summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-08-09 14:36:52 -0400
committerGravatar GitHub2018-08-09 14:36:52 -0400
commit0bfe974281de2944d08d2856908142298b78c86b (patch)
tree11db1a4ac56e53b71e8a676796c60b8c57915d8b /src
parentMerge pull request #994 from lioncash/const (diff)
parentgl_shader_decompiler: Declare predicates on use. (diff)
downloadyuzu-0bfe974281de2944d08d2856908142298b78c86b.tar.gz
yuzu-0bfe974281de2944d08d2856908142298b78c86b.tar.xz
yuzu-0bfe974281de2944d08d2856908142298b78c86b.zip
Merge pull request #992 from bunnei/declr-pred
gl_shader_decompiler: Declare predicates on use.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index dd240a4ce..ea7779429 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -657,16 +657,17 @@ private:
657 * @param instr Instruction to generate the if condition for. 657 * @param instr Instruction to generate the if condition for.
658 * @returns string containing the predicate condition. 658 * @returns string containing the predicate condition.
659 */ 659 */
660 std::string GetPredicateCondition(u64 index, bool negate) const { 660 std::string GetPredicateCondition(u64 index, bool negate) {
661 using Tegra::Shader::Pred; 661 using Tegra::Shader::Pred;
662 std::string variable; 662 std::string variable;
663 663
664 // Index 7 is used as an 'Always True' condition. 664 // Index 7 is used as an 'Always True' condition.
665 if (index == static_cast<u64>(Pred::UnusedIndex)) 665 if (index == static_cast<u64>(Pred::UnusedIndex)) {
666 variable = "true"; 666 variable = "true";
667 else 667 } else {
668 variable = 'p' + std::to_string(index) + '_' + suffix; 668 variable = 'p' + std::to_string(index) + '_' + suffix;
669 669 declr_predicates.insert(variable);
670 }
670 if (negate) { 671 if (negate) {
671 return "!(" + variable + ')'; 672 return "!(" + variable + ')';
672 } 673 }