From 5ba71369acca9c0d58e9cea4c915a921029ddab4 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 10 Apr 2018 00:04:49 -0400 Subject: gl_shader_decompiler: Use fragment output color for GPR 0-3. --- src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/video_core') diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index a439da470..ba3aa7dd1 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -187,6 +187,11 @@ private: /// Generates code representing a temporary (GPR) register. std::string GetRegister(const Register& reg) { + if (stage == Maxwell3D::Regs::ShaderStage::Fragment && reg.GetIndex() < 4) { + // GPRs 0-3 are output color for the fragment shader + return std::string{"color."} + "rgba"[reg.GetIndex()]; + } + return *declr_register.insert("register_" + std::to_string(reg)).first; } -- cgit v1.2.3