mirror of
https://github.com/xenia-project/xenia.git
synced 2025-12-06 07:12:03 +01:00
Fix broken check against bool constants
Fix always terminating execution in cexece branches (these are sometimes followed by exece branches)
This commit is contained in:
parent
15816327b4
commit
cf41a84fe3
|
|
@ -361,10 +361,10 @@ void GlslShaderTranslator::ProcessExecInstructionBegin(
|
||||||
EmitSourceDepth("{\n");
|
EmitSourceDepth("{\n");
|
||||||
break;
|
break;
|
||||||
case ParsedExecInstruction::Type::kConditional:
|
case ParsedExecInstruction::Type::kConditional:
|
||||||
EmitSourceDepth("if ((state.bool_consts[%d] & (1 << %d)) == %c) {\n",
|
EmitSourceDepth("if ((state.bool_consts[%d] & (1 << %d)) %c= 0) {\n",
|
||||||
instr.bool_constant_index / 32,
|
instr.bool_constant_index / 32,
|
||||||
instr.bool_constant_index % 32,
|
instr.bool_constant_index % 32,
|
||||||
instr.condition ? '1' : '0');
|
instr.condition ? '!' : '=');
|
||||||
break;
|
break;
|
||||||
case ParsedExecInstruction::Type::kPredicated:
|
case ParsedExecInstruction::Type::kPredicated:
|
||||||
EmitSourceDepth("if (%cp0) {\n", instr.condition ? ' ' : '!');
|
EmitSourceDepth("if (%cp0) {\n", instr.condition ? ' ' : '!');
|
||||||
|
|
@ -384,13 +384,13 @@ void GlslShaderTranslator::ProcessExecInstructionBegin(
|
||||||
|
|
||||||
void GlslShaderTranslator::ProcessExecInstructionEnd(
|
void GlslShaderTranslator::ProcessExecInstructionEnd(
|
||||||
const ParsedExecInstruction& instr) {
|
const ParsedExecInstruction& instr) {
|
||||||
Unindent();
|
|
||||||
EmitSourceDepth("}\n");
|
|
||||||
if (instr.is_end) {
|
if (instr.is_end) {
|
||||||
EmitSourceDepth("pc = 0xFFFF;\n");
|
EmitSourceDepth("pc = 0xFFFF;\n");
|
||||||
EmitSourceDepth("break;\n");
|
EmitSourceDepth("break;\n");
|
||||||
cf_wrote_pc_ = true;
|
cf_wrote_pc_ = true;
|
||||||
}
|
}
|
||||||
|
Unindent();
|
||||||
|
EmitSourceDepth("}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void GlslShaderTranslator::ProcessLoopStartInstruction(
|
void GlslShaderTranslator::ProcessLoopStartInstruction(
|
||||||
|
|
@ -494,10 +494,10 @@ void GlslShaderTranslator::ProcessJumpInstruction(
|
||||||
EmitSourceDepth("{\n");
|
EmitSourceDepth("{\n");
|
||||||
break;
|
break;
|
||||||
case ParsedJumpInstruction::Type::kConditional:
|
case ParsedJumpInstruction::Type::kConditional:
|
||||||
EmitSourceDepth("if ((state.bool_consts[%d] & (1 << %d)) == %c) {\n",
|
EmitSourceDepth("if ((state.bool_consts[%d] & (1 << %d)) %c= 0) {\n",
|
||||||
instr.bool_constant_index / 32,
|
instr.bool_constant_index / 32,
|
||||||
instr.bool_constant_index % 32,
|
instr.bool_constant_index % 32,
|
||||||
instr.condition ? '1' : '0');
|
instr.condition ? '!' : '=');
|
||||||
needs_fallthrough = true;
|
needs_fallthrough = true;
|
||||||
break;
|
break;
|
||||||
case ParsedJumpInstruction::Type::kPredicated:
|
case ParsedJumpInstruction::Type::kPredicated:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue