summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Laku2018-08-22 21:33:32 +0300
committerGravatar Laku2018-08-22 21:33:32 +0300
commite70a3c5a5d6f117ec915aab4635e79e346da24d9 (patch)
tree30769f22c450996809bd84dbb779b782b40854e9
parentremove debug logging (diff)
downloadyuzu-e70a3c5a5d6f117ec915aab4635e79e346da24d9.tar.gz
yuzu-e70a3c5a5d6f117ec915aab4635e79e346da24d9.tar.xz
yuzu-e70a3c5a5d6f117ec915aab4635e79e346da24d9.zip
fixes
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp18
1 files changed, 12 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 07bd0d21b..15194d5a6 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -851,22 +851,28 @@ private:
851 851
852 void WriteLop3Instruction(Register dest, const std::string& op_a, const std::string& op_b, 852 void WriteLop3Instruction(Register dest, const std::string& op_a, const std::string& op_b,
853 const std::string& op_c, const std::string& imm_lut) { 853 const std::string& op_c, const std::string& imm_lut) {
854 if (dest == Tegra::Shader::Register::ZeroIndex)
855 return;
856
857 static constexpr std::array<const char*, 32> ix = {
858 "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
859 "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21",
860 "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"};
861
854 std::string result; 862 std::string result;
855 result += '('; 863 result += '(';
856 864
857 for (u32 i = 0; i < 32; ++i) { 865 for (u32 i = 0; i < 32; ++i) {
858 std::string ix = std::to_string(i);
859 if (i) 866 if (i)
860 result += '|'; 867 result += '|';
861 result += "(((" + imm_lut + ">>(((" + op_c + ">>" + ix + ")&1)|((" + op_b + ">>" + ix + 868 result += "(((" + imm_lut + " >> (((" + op_c + " >> " + ix[i] + ") & 1) | ((" + op_b +
862 ")&1)<<1|((" + op_a + ">>" + ix + ")&1)<<2))&1)<<" + ix + ")"; 869 " >> " + ix[i] + ") & 1) << 1 | ((" + op_a + " >> " + ix[i] +
870 ") & 1) << 2)) & 1) << " + ix[i] + ")";
863 } 871 }
864 872
865 result += ')'; 873 result += ')';
866 874
867 if (dest != Tegra::Shader::Register::ZeroIndex) { 875 regs.SetRegisterToInteger(dest, true, 0, result, 1, 1);
868 regs.SetRegisterToInteger(dest, true, 0, result, 1, 1);
869 }
870 } 876 }
871 877
872 void WriteTexsInstruction(const Instruction& instr, const std::string& coord, 878 void WriteTexsInstruction(const Instruction& instr, const std::string& coord,