From eb7987a63489f6f399688931f1a8dc194d38a525 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Tue, 8 Jul 2014 16:01:57 -0700 Subject: [PATCH] Setting default output values for pixel shaders. --- src/xenia/gpu/d3d11/d3d11_shader_translator.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/xenia/gpu/d3d11/d3d11_shader_translator.cc b/src/xenia/gpu/d3d11/d3d11_shader_translator.cc index 5bb28c6e6..b23c0d5a5 100644 --- a/src/xenia/gpu/d3d11/d3d11_shader_translator.cc +++ b/src/xenia/gpu/d3d11/d3d11_shader_translator.cc @@ -274,8 +274,11 @@ int D3D11ShaderTranslator::TranslatePixelShader( // Pixel shader main() header. append( "PS_OUTPUT main(VS_OUTPUT i) {\n" - " PS_OUTPUT o;\n" - " o.oC0 = float4(1.0, 0.0, 0.0, 1.0);\n"); + " PS_OUTPUT o;\n"); + for (uint32_t n = 0; n < alloc_counts.params; n++) { + append( + " o.oC%d = float4(1.0, 0.0, 0.0, 1.0);\n", n); + } // Add temporary registers. uint32_t temp_regs = program_cntl.vs_regs + program_cntl.ps_regs;