Merge pull request #731 from lioncash/shadow

gl_shader_decompiler: Eliminate variable and declaration shadowing
This commit is contained in:
bunnei 2018-07-20 09:13:36 -07:00 committed by GitHub
commit 204d707ce7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1405,7 +1405,7 @@ private:
// TEXS has two destination registers. RG goes into gpr0+0 and gpr0+1, and BA // TEXS has two destination registers. RG goes into gpr0+0 and gpr0+1, and BA
// goes into gpr28+0 and gpr28+1 // goes into gpr28+0 and gpr28+1
size_t offset{}; size_t texs_offset{};
for (const auto& dest : {instr.gpr0.Value(), instr.gpr28.Value()}) { for (const auto& dest : {instr.gpr0.Value(), instr.gpr28.Value()}) {
for (unsigned elem = 0; elem < 2; ++elem) { for (unsigned elem = 0; elem < 2; ++elem) {
@ -1413,7 +1413,8 @@ private:
// Skip disabled components // Skip disabled components
continue; continue;
} }
regs.SetRegisterToFloat(dest, elem + offset, texture, 1, 4, false, elem); regs.SetRegisterToFloat(dest, elem + texs_offset, texture, 1, 4, false,
elem);
} }
if (!instr.texs.HasTwoDestinations()) { if (!instr.texs.HasTwoDestinations()) {
@ -1421,7 +1422,7 @@ private:
break; break;
} }
offset += 2; texs_offset += 2;
} }
--shader.scope; --shader.scope;
shader.AddLine("}"); shader.AddLine("}");
@ -1463,7 +1464,6 @@ private:
op_b = "abs(" + op_b + ')'; op_b = "abs(" + op_b + ')';
} }
using Tegra::Shader::Pred;
// We can't use the constant predicate as destination. // We can't use the constant predicate as destination.
ASSERT(instr.fsetp.pred3 != static_cast<u64>(Pred::UnusedIndex)); ASSERT(instr.fsetp.pred3 != static_cast<u64>(Pred::UnusedIndex));
@ -1500,7 +1500,6 @@ private:
} }
} }
using Tegra::Shader::Pred;
// We can't use the constant predicate as destination. // We can't use the constant predicate as destination.
ASSERT(instr.isetp.pred3 != static_cast<u64>(Pred::UnusedIndex)); ASSERT(instr.isetp.pred3 != static_cast<u64>(Pred::UnusedIndex));
@ -1528,7 +1527,6 @@ private:
std::string op_b = std::string op_b =
GetPredicateCondition(instr.psetp.pred29, instr.psetp.neg_pred29 != 0); GetPredicateCondition(instr.psetp.pred29, instr.psetp.neg_pred29 != 0);
using Tegra::Shader::Pred;
// We can't use the constant predicate as destination. // We can't use the constant predicate as destination.
ASSERT(instr.psetp.pred3 != static_cast<u64>(Pred::UnusedIndex)); ASSERT(instr.psetp.pred3 != static_cast<u64>(Pred::UnusedIndex));