From b5469b57bacdba11d13c9052fda9e2128abef5ba Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Mon, 7 Dec 2015 22:57:28 -0800 Subject: [PATCH] Moving temporary registers to exec blocks. ps may still need to be shared. --- src/xenia/gpu/glsl_shader_translator.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/xenia/gpu/glsl_shader_translator.cc b/src/xenia/gpu/glsl_shader_translator.cc index a09e7685c..23a68f423 100644 --- a/src/xenia/gpu/glsl_shader_translator.cc +++ b/src/xenia/gpu/glsl_shader_translator.cc @@ -277,10 +277,6 @@ void main() { EmitSource("void processFragment(const in StateData state) {\n"); } - // Previous Vector result (used as a scratch). - EmitSource(" vec4 pv;\n"); - // Previous Scalar result (used for RETAIN_PREV). - EmitSource(" float ps;\n"); // Predicate temp, clause-local. EmitSource(" bool p0 = false;\n"); // Address register when using absolute addressing. @@ -290,10 +286,6 @@ void main() { // Loop counter stack, .x is the active loop. // Represents number of times remaining to loop. EmitSource(" ivec4 loop_count = ivec4(0);\n"); - // Temps for source register values. - EmitSource(" vec4 src0;\n"); - EmitSource(" vec4 src1;\n"); - EmitSource(" vec4 src2;\n"); // Temporary registers. if (is_vertex_shader()) { @@ -382,6 +374,15 @@ void GlslShaderTranslator::ProcessExecInstructionBegin( break; } Indent(); + + // Previous Vector result (used as a scratch). + EmitSourceDepth("vec4 pv;\n"); + // Previous Scalar result (used for RETAIN_PREV). + EmitSourceDepth("float ps;\n"); + // Temps for source register values. + EmitSourceDepth("vec4 src0;\n"); + EmitSourceDepth("vec4 src1;\n"); + EmitSourceDepth("vec4 src2;\n"); } void GlslShaderTranslator::ProcessExecInstructionEnd(