summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2018-10-13 16:35:45 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2018-10-14 04:14:25 +0200
commitd880b776982b77d1be819c5765804eea1fc6a31d (patch)
tree3ff092fcaa005dc85502c39eee87193b835713d8
parentMerge pull request #1409 from DarkLordZach/key-derivation (diff)
downloadyuzu-d880b776982b77d1be819c5765804eea1fc6a31d.tar
yuzu-d880b776982b77d1be819c5765804eea1fc6a31d.tar.gz
yuzu-d880b776982b77d1be819c5765804eea1fc6a31d.tar.bz2
yuzu-d880b776982b77d1be819c5765804eea1fc6a31d.tar.lz
yuzu-d880b776982b77d1be819c5765804eea1fc6a31d.tar.xz
yuzu-d880b776982b77d1be819c5765804eea1fc6a31d.tar.zst
yuzu-d880b776982b77d1be819c5765804eea1fc6a31d.zip
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 8dfb49507..6220323a0 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -2254,6 +2254,8 @@ private:
ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::MZ),
"MZ is not implemented");
+ u32 op_c_offset = 0;
+
switch (texture_type) {
case Tegra::Shader::TextureType::Texture1D: {
const std::string x = regs.GetRegisterAsInteger(instr.gpr8);
@@ -2268,6 +2270,7 @@ private:
const std::string x = regs.GetRegisterAsInteger(instr.gpr8);
const std::string y = regs.GetRegisterAsInteger(instr.gpr20);
coord = "ivec2 coords = ivec2(" + x + ", " + y + ");";
+ op_c_offset = 1;
}
break;
}
@@ -2279,13 +2282,14 @@ private:
const std::string sampler =
GetSampler(instr.sampler, texture_type, is_array, false);
std::string texture = "texelFetch(" + sampler + ", coords, 0)";
- const std::string op_c = regs.GetRegisterAsInteger(instr.gpr20.Value() + 1);
switch (instr.tlds.GetTextureProcessMode()) {
case Tegra::Shader::TextureProcessMode::LZ: {
texture = "texelFetch(" + sampler + ", coords, 0)";
break;
}
case Tegra::Shader::TextureProcessMode::LL: {
+ const std::string op_c =
+ regs.GetRegisterAsInteger(instr.gpr20.Value() + op_c_offset);
texture = "texelFetch(" + sampler + ", coords, " + op_c + ')';
break;
}