From 59df7e7104473c5fc745b3e2845fab5af61369d6 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Mon, 11 Jul 2016 04:05:13 +0300 Subject: [PATCH] glsl: not all shaders write to col0 (#1884) fix typo --- rpcs3/Emu/RSX/GL/rsx_gl_cache.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/rpcs3/Emu/RSX/GL/rsx_gl_cache.cpp b/rpcs3/Emu/RSX/GL/rsx_gl_cache.cpp index 2b237d7188..72e88e6b8e 100644 --- a/rpcs3/Emu/RSX/GL/rsx_gl_cache.cpp +++ b/rpcs3/Emu/RSX/GL/rsx_gl_cache.cpp @@ -272,15 +272,11 @@ rsx::complete_shader glsl_complete_shader(const rsx::decompiled_shader &shader, if (state.ctrl & CELL_GCM_SHADER_CONTROL_32_BITS_EXPORTS) { - if (0) - { - finalize += "\tocol = vec4(1.0, 0.0, 1.0, 1.0);\n"; - } - else + if (shader.temporary_registers.find({ "r0" }) != shader.temporary_registers.end()) { + //Some shaders only write to gl_FragDepth and ignore color output finalize += "\tocol = r0;\n"; } - if (shader.temporary_registers.find({ "r2" }) != shader.temporary_registers.end()) { result.code += "layout(location = 1) out vec4 ocol1;\n";