summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend
diff options
context:
space:
mode:
authorZephyron <zephyron@citron-emu.org>2025-01-17 19:28:11 +1000
committerZephyron <zephyron@citron-emu.org>2025-01-17 19:28:11 +1000
commit382999025af8a95aa791fd00c24f24ecd54596d4 (patch)
treed4ff9562f46bad570e2fc814e4be727a5ab04ca3 /src/shader_recompiler/frontend
parentee0beea82a999f6a46f7f980c700867f860905f1 (diff)
shader_recompiler: Add stubs for CSM/FCSM flow test conditions
Add stub implementations for previously unhandled flow test conditions in the shader recompiler's IR emitter. These conditions were previously throwing "Not Implemented" exceptions when encountered. The following flow test cases are now stubbed: - FCSM_TR (Fragment Shader Coarse/Fine Mode Test and Reject) - CSM_TA (Coarse/Fine Mode Test Accept) - CSM_TR (Coarse/Fine Mode Test and Reject) - CSM_MX (Coarse/Fine Mode Maximum) - FCSM_TA (Fragment Shader Coarse/Fine Mode Test Accept) - FCSM_MX (Fragment Shader Coarse/Fine Mode Maximum) Currently these stubs: 1. Return false (ir.Imm1(false)) as a placeholder value 2. Log a warning message indicating the stub 3. Allow shaders using these conditions to compile rather than fail This is a step toward proper implementation of coarse/fine mode shader operations. The stubs prevent crashes while making it clear which code paths need full implementation. Technical notes: - Removed the previous FCSM_TR implementation that used flag operations - Added consistent warning messages for tracking stub usage - Kept within the existing GetFlowTest switch statement structure
Diffstat (limited to 'src/shader_recompiler/frontend')
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
index b8bc5ea95..4a811178a 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
@@ -261,12 +261,23 @@ static U1 GetFlowTest(IREmitter& ir, FlowTest flow_test) {
case FlowTest::RGT:
return ir.LogicalAnd(ir.LogicalNot(ir.GetSFlag()), ir.LogicalNot(ir.GetZFlag()));
case FlowTest::FCSM_TR:
- return ir.LogicalAnd(ir.GetSFlag(), ir.LogicalNot(ir.GetZFlag()));
+ LOG_WARNING(Shader, "(STUBBED) FCSM_TR");
+ return ir.Imm1(false);
case FlowTest::CSM_TA:
+ LOG_WARNING(Shader, "(STUBBED) CSM_TA");
+ return ir.Imm1(false);
case FlowTest::CSM_TR:
+ LOG_WARNING(Shader, "(STUBBED) CSM_TR");
+ return ir.Imm1(false);
case FlowTest::CSM_MX:
+ LOG_WARNING(Shader, "(STUBBED) CSM_MX");
+ return ir.Imm1(false);
case FlowTest::FCSM_TA:
+ LOG_WARNING(Shader, "(STUBBED) FCSM_TA");
+ return ir.Imm1(false);
case FlowTest::FCSM_MX:
+ LOG_WARNING(Shader, "(STUBBED) FCSM_MX");
+ return ir.Imm1(false);
default:
throw NotImplementedException("Flow test {}", flow_test);
}