From fd715e54a1e6ecf0d6bbe0e75fc9605d09c9f371 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 5 Aug 2018 01:46:11 -0400 Subject: gl_shader_decompiler: Fix TEXS mask and dest. --- src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 68db3c22a..e3217db81 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -766,13 +766,16 @@ private: // goes into gpr28+0 and gpr28+1 size_t texs_offset{}; + size_t src_elem{}; for (const auto& dest : {instr.gpr0.Value(), instr.gpr28.Value()}) { + size_t dest_elem{}; for (unsigned elem = 0; elem < 2; ++elem) { - if (!instr.texs.IsComponentEnabled(elem)) { + if (!instr.texs.IsComponentEnabled(src_elem++)) { // Skip disabled components continue; } - regs.SetRegisterToFloat(dest, elem + texs_offset, texture, 1, 4, false, elem); + regs.SetRegisterToFloat(dest, elem + texs_offset, texture, 1, 4, false, + dest_elem++); } if (!instr.texs.HasTwoDestinations()) { -- cgit v1.2.3