diff options
author | bunnei <bunneidev@gmail.com> | 2018-06-03 18:08:17 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-06-03 18:08:17 +0200 |
commit | 1efcba346af097f816decdac12280f41ffd759e0 (patch) | |
tree | 8b3918b9183f2cdb06474ecb97019e31064d555d /src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |
parent | Merge pull request #494 from bunnei/shader-tex (diff) | |
download | yuzu-1efcba346af097f816decdac12280f41ffd759e0.tar yuzu-1efcba346af097f816decdac12280f41ffd759e0.tar.gz yuzu-1efcba346af097f816decdac12280f41ffd759e0.tar.bz2 yuzu-1efcba346af097f816decdac12280f41ffd759e0.tar.lz yuzu-1efcba346af097f816decdac12280f41ffd759e0.tar.xz yuzu-1efcba346af097f816decdac12280f41ffd759e0.tar.zst yuzu-1efcba346af097f816decdac12280f41ffd759e0.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 86d880dfc..bb5209a7e 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -938,18 +938,21 @@ private: // TEXS has two destination registers. RG goes into gpr0+0 and gpr0+1, and BA goes // into gpr28+0 and gpr28+1 size_t offset{}; + for (const auto& dest : {instr.gpr0.Value(), instr.gpr28.Value()}) { for (unsigned elem = 0; elem < 2; ++elem) { - if (dest + elem >= Register::ZeroIndex) { - // Skip invalid register values - break; + if (!instr.texs.IsComponentEnabled(elem)) { + // Skip disabled components + continue; } regs.SetRegisterToFloat(dest, elem + offset, texture, 1, 4, false, elem); - if (!instr.texs.enable_g_component) { - // Skip the second component - break; - } } + + if (!instr.texs.HasTwoDestinations()) { + // Skip the second destination + break; + } + offset += 2; } --shader.scope; |