summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2018-10-09 15:44:34 -0400
committerGravatar Lioncash2018-10-09 15:44:37 -0400
commit6e27c5d4d18ba08ce8130837b8cb4026e5989afc (patch)
tree70d898d6d29c8b8a2e10cc634032772f8c389309 /src
parentMerge pull request #1423 from DarkLordZach/romfs-file-exts (diff)
downloadyuzu-6e27c5d4d18ba08ce8130837b8cb4026e5989afc.tar.gz
yuzu-6e27c5d4d18ba08ce8130837b8cb4026e5989afc.tar.xz
yuzu-6e27c5d4d18ba08ce8130837b8cb4026e5989afc.zip
gl_shader_decompiler: Remove unused variables in TMML's implementation
Given "y" isn't always used, but "x" is, we can rearrange this to avoid unused variable warnings by changing the names of op_a and op_b
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp10
1 files changed, 3 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 7e57de78a..85c668ca1 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -2299,8 +2299,7 @@ private:
2299 ASSERT_MSG(!instr.tmml.UsesMiscMode(Tegra::Shader::TextureMiscMode::NDV), 2299 ASSERT_MSG(!instr.tmml.UsesMiscMode(Tegra::Shader::TextureMiscMode::NDV),
2300 "NDV is not implemented"); 2300 "NDV is not implemented");
2301 2301
2302 const std::string op_a = regs.GetRegisterAsFloat(instr.gpr8); 2302 const std::string x = regs.GetRegisterAsFloat(instr.gpr8);
2303 const std::string op_b = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1);
2304 const bool is_array = instr.tmml.array != 0; 2303 const bool is_array = instr.tmml.array != 0;
2305 auto texture_type = instr.tmml.texture_type.Value(); 2304 auto texture_type = instr.tmml.texture_type.Value();
2306 const std::string sampler = 2305 const std::string sampler =
@@ -2311,13 +2310,11 @@ private:
2311 std::string coord; 2310 std::string coord;
2312 switch (texture_type) { 2311 switch (texture_type) {
2313 case Tegra::Shader::TextureType::Texture1D: { 2312 case Tegra::Shader::TextureType::Texture1D: {
2314 std::string x = regs.GetRegisterAsFloat(instr.gpr8);
2315 coord = "float coords = " + x + ';'; 2313 coord = "float coords = " + x + ';';
2316 break; 2314 break;
2317 } 2315 }
2318 case Tegra::Shader::TextureType::Texture2D: { 2316 case Tegra::Shader::TextureType::Texture2D: {
2319 std::string x = regs.GetRegisterAsFloat(instr.gpr8); 2317 const std::string y = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1);
2320 std::string y = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1);
2321 coord = "vec2 coords = vec2(" + x + ", " + y + ");"; 2318 coord = "vec2 coords = vec2(" + x + ", " + y + ");";
2322 break; 2319 break;
2323 } 2320 }
@@ -2327,8 +2324,7 @@ private:
2327 UNREACHABLE(); 2324 UNREACHABLE();
2328 2325
2329 // Fallback to interpreting as a 2D texture for now 2326 // Fallback to interpreting as a 2D texture for now
2330 std::string x = regs.GetRegisterAsFloat(instr.gpr8); 2327 const std::string y = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1);
2331 std::string y = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1);
2332 coord = "vec2 coords = vec2(" + x + ", " + y + ");"; 2328 coord = "vec2 coords = vec2(" + x + ", " + y + ");";
2333 texture_type = Tegra::Shader::TextureType::Texture2D; 2329 texture_type = Tegra::Shader::TextureType::Texture2D;
2334 } 2330 }