summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-06-01 04:57:32 +0200
committerbunnei <bunneidev@gmail.com>2018-06-01 04:57:32 +0200
commit4c727d0ba82012436dfd4eb1572db5e0882b2766 (patch)
tree16eda7a1a5c5b6a2d39d6d089d33489a2eaaf18f /src/video_core/renderer_opengl
parentMerge pull request #488 from Subv/thread_masks (diff)
downloadyuzu-4c727d0ba82012436dfd4eb1572db5e0882b2766.tar
yuzu-4c727d0ba82012436dfd4eb1572db5e0882b2766.tar.gz
yuzu-4c727d0ba82012436dfd4eb1572db5e0882b2766.tar.bz2
yuzu-4c727d0ba82012436dfd4eb1572db5e0882b2766.tar.lz
yuzu-4c727d0ba82012436dfd4eb1572db5e0882b2766.tar.xz
yuzu-4c727d0ba82012436dfd4eb1572db5e0882b2766.tar.zst
yuzu-4c727d0ba82012436dfd4eb1572db5e0882b2766.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp20
1 files changed, 18 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 68efe74b8..f6a60c920 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -903,9 +903,25 @@ private:
++shader.scope;
shader.AddLine(coord);
const std::string texture = "texture(" + sampler + ", coords)";
- for (unsigned elem = 0; elem < instr.attribute.fmt20.size; ++elem) {
- regs.SetRegisterToFloat(instr.gpr0, elem, texture, 1, 4, false, elem);
+
+ // 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;
+ }
+ regs.SetRegisterToFloat(dest, elem + offset, texture, 1, 4, false, elem);
+ if (!instr.texs.enable_g_component) {
+ // Skip the second component
+ break;
+ }
+ }
+ offset += 2;
}
+
--shader.scope;
shader.AddLine("}");
break;