diff options
| author | 2018-07-19 20:32:40 -0400 | |
|---|---|---|
| committer | 2018-07-19 20:32:49 -0400 | |
| commit | f26866ff6abffbdb447f9ff5467bff242bcec56d (patch) | |
| tree | 37258e62291277853a961e2891f6d19a346d3195 /src | |
| parent | Merge pull request #726 from lioncash/overload (diff) | |
| download | yuzu-f26866ff6abffbdb447f9ff5467bff242bcec56d.tar.gz yuzu-f26866ff6abffbdb447f9ff5467bff242bcec56d.tar.xz yuzu-f26866ff6abffbdb447f9ff5467bff242bcec56d.zip | |
gl_shader_decompiler: Eliminate variable and declaration shadowing
Ensures that no identifiers are being hidden, which also reduces
compiler warnings.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 5fae95788..8fdae49ef 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -1405,7 +1405,7 @@ private: | |||
| 1405 | 1405 | ||
| 1406 | // TEXS has two destination registers. RG goes into gpr0+0 and gpr0+1, and BA | 1406 | // TEXS has two destination registers. RG goes into gpr0+0 and gpr0+1, and BA |
| 1407 | // goes into gpr28+0 and gpr28+1 | 1407 | // goes into gpr28+0 and gpr28+1 |
| 1408 | size_t offset{}; | 1408 | size_t texs_offset{}; |
| 1409 | 1409 | ||
| 1410 | for (const auto& dest : {instr.gpr0.Value(), instr.gpr28.Value()}) { | 1410 | for (const auto& dest : {instr.gpr0.Value(), instr.gpr28.Value()}) { |
| 1411 | for (unsigned elem = 0; elem < 2; ++elem) { | 1411 | for (unsigned elem = 0; elem < 2; ++elem) { |
| @@ -1413,7 +1413,8 @@ private: | |||
| 1413 | // Skip disabled components | 1413 | // Skip disabled components |
| 1414 | continue; | 1414 | continue; |
| 1415 | } | 1415 | } |
| 1416 | regs.SetRegisterToFloat(dest, elem + offset, texture, 1, 4, false, elem); | 1416 | regs.SetRegisterToFloat(dest, elem + texs_offset, texture, 1, 4, false, |
| 1417 | elem); | ||
| 1417 | } | 1418 | } |
| 1418 | 1419 | ||
| 1419 | if (!instr.texs.HasTwoDestinations()) { | 1420 | if (!instr.texs.HasTwoDestinations()) { |
| @@ -1421,7 +1422,7 @@ private: | |||
| 1421 | break; | 1422 | break; |
| 1422 | } | 1423 | } |
| 1423 | 1424 | ||
| 1424 | offset += 2; | 1425 | texs_offset += 2; |
| 1425 | } | 1426 | } |
| 1426 | --shader.scope; | 1427 | --shader.scope; |
| 1427 | shader.AddLine("}"); | 1428 | shader.AddLine("}"); |
| @@ -1463,7 +1464,6 @@ private: | |||
| 1463 | op_b = "abs(" + op_b + ')'; | 1464 | op_b = "abs(" + op_b + ')'; |
| 1464 | } | 1465 | } |
| 1465 | 1466 | ||
| 1466 | using Tegra::Shader::Pred; | ||
| 1467 | // We can't use the constant predicate as destination. | 1467 | // We can't use the constant predicate as destination. |
| 1468 | ASSERT(instr.fsetp.pred3 != static_cast<u64>(Pred::UnusedIndex)); | 1468 | ASSERT(instr.fsetp.pred3 != static_cast<u64>(Pred::UnusedIndex)); |
| 1469 | 1469 | ||
| @@ -1500,7 +1500,6 @@ private: | |||
| 1500 | } | 1500 | } |
| 1501 | } | 1501 | } |
| 1502 | 1502 | ||
| 1503 | using Tegra::Shader::Pred; | ||
| 1504 | // We can't use the constant predicate as destination. | 1503 | // We can't use the constant predicate as destination. |
| 1505 | ASSERT(instr.isetp.pred3 != static_cast<u64>(Pred::UnusedIndex)); | 1504 | ASSERT(instr.isetp.pred3 != static_cast<u64>(Pred::UnusedIndex)); |
| 1506 | 1505 | ||
| @@ -1528,7 +1527,6 @@ private: | |||
| 1528 | std::string op_b = | 1527 | std::string op_b = |
| 1529 | GetPredicateCondition(instr.psetp.pred29, instr.psetp.neg_pred29 != 0); | 1528 | GetPredicateCondition(instr.psetp.pred29, instr.psetp.neg_pred29 != 0); |
| 1530 | 1529 | ||
| 1531 | using Tegra::Shader::Pred; | ||
| 1532 | // We can't use the constant predicate as destination. | 1530 | // We can't use the constant predicate as destination. |
| 1533 | ASSERT(instr.psetp.pred3 != static_cast<u64>(Pred::UnusedIndex)); | 1531 | ASSERT(instr.psetp.pred3 != static_cast<u64>(Pred::UnusedIndex)); |
| 1534 | 1532 | ||