summaryrefslogtreecommitdiffstats
path: root/src/video_core/engines/maxwell_3d.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-07-28 00:40:10 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-02-14 21:27:17 +0100
commit2b58652f0897053d4da04deb586490220ab5a774 (patch)
treecb49e0b4da2297e25da1aa196bbb38d6e996d399 /src/video_core/engines/maxwell_3d.cpp
parentgl_resource_manager: Add managed query class (diff)
downloadyuzu-2b58652f0897053d4da04deb586490220ab5a774.tar
yuzu-2b58652f0897053d4da04deb586490220ab5a774.tar.gz
yuzu-2b58652f0897053d4da04deb586490220ab5a774.tar.bz2
yuzu-2b58652f0897053d4da04deb586490220ab5a774.tar.lz
yuzu-2b58652f0897053d4da04deb586490220ab5a774.tar.xz
yuzu-2b58652f0897053d4da04deb586490220ab5a774.tar.zst
yuzu-2b58652f0897053d4da04deb586490220ab5a774.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp39
1 files changed, 26 insertions, 13 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index 0b3e8749b..fe91ff6a0 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -400,6 +400,10 @@ void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) {
ProcessQueryCondition();
break;
}
+ case MAXWELL3D_REG_INDEX(counter_reset): {
+ ProcessCounterReset();
+ break;
+ }
case MAXWELL3D_REG_INDEX(sync_info): {
ProcessSyncPoint();
break;
@@ -544,23 +548,23 @@ void Maxwell3D::ProcessQueryGet() {
"Units other than CROP are unimplemented");
switch (regs.query.query_get.operation) {
- case Regs::QueryOperation::Release: {
- const u64 result = regs.query.query_sequence;
- StampQueryResult(result, regs.query.query_get.short_query == 0);
+ case Regs::QueryOperation::Release:
+ StampQueryResult(regs.query.query_sequence, regs.query.query_get.short_query == 0);
break;
- }
- case Regs::QueryOperation::Acquire: {
- // Todo(Blinkhawk): Under this operation, the GPU waits for the CPU
- // to write a value that matches the current payload.
+ case Regs::QueryOperation::Acquire:
+ // TODO(Blinkhawk): Under this operation, the GPU waits for the CPU to write a value that
+ // matches the current payload.
UNIMPLEMENTED_MSG("Unimplemented query operation ACQUIRE");
break;
- }
case Regs::QueryOperation::Counter: {
- u64 result{};
+ u64 result;
switch (regs.query.query_get.select) {
case Regs::QuerySelect::Zero:
result = 0;
break;
+ case Regs::QuerySelect::SamplesPassed:
+ result = rasterizer.Query(VideoCore::QueryType::SamplesPassed);
+ break;
default:
result = 1;
UNIMPLEMENTED_MSG("Unimplemented query select type {}",
@@ -569,15 +573,13 @@ void Maxwell3D::ProcessQueryGet() {
StampQueryResult(result, regs.query.query_get.short_query == 0);
break;
}
- case Regs::QueryOperation::Trap: {
+ case Regs::QueryOperation::Trap:
UNIMPLEMENTED_MSG("Unimplemented query operation TRAP");
break;
- }
- default: {
+ default:
UNIMPLEMENTED_MSG("Unknown query operation");
break;
}
- }
}
void Maxwell3D::ProcessQueryCondition() {
@@ -619,6 +621,17 @@ void Maxwell3D::ProcessQueryCondition() {
}
}
+void Maxwell3D::ProcessCounterReset() {
+ switch (regs.counter_reset) {
+ case Regs::CounterReset::SampleCnt:
+ rasterizer.ResetCounter(VideoCore::QueryType::SamplesPassed);
+ break;
+ default:
+ UNIMPLEMENTED_MSG("counter_reset={}", static_cast<u32>(regs.counter_reset));
+ break;
+ }
+}
+
void Maxwell3D::ProcessSyncPoint() {
const u32 sync_point = regs.sync_info.sync_point.Value();
const u32 increment = regs.sync_info.increment.Value();