summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-06-05 16:08:42 +0200
committerGitHub <noreply@github.com>2018-06-05 16:08:42 +0200
commitb54a72afc0a445727de6eab7b70d0d3b3c67f865 (patch)
tree95fd33df9876ead932871d4ab66ac792df19444c /src/video_core/renderer_opengl
parentMerge pull request #518 from Subv/incomplete_shaders (diff)
parentgl_shader_decompiler: Fix typo with ISCADD instruction. (diff)
downloadyuzu-b54a72afc0a445727de6eab7b70d0d3b3c67f865.tar
yuzu-b54a72afc0a445727de6eab7b70d0d3b3c67f865.tar.gz
yuzu-b54a72afc0a445727de6eab7b70d0d3b3c67f865.tar.bz2
yuzu-b54a72afc0a445727de6eab7b70d0d3b3c67f865.tar.lz
yuzu-b54a72afc0a445727de6eab7b70d0d3b3c67f865.tar.xz
yuzu-b54a72afc0a445727de6eab7b70d0d3b3c67f865.tar.zst
yuzu-b54a72afc0a445727de6eab7b70d0d3b3c67f865.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index eb8d37c9b..f886e49ca 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -893,6 +893,35 @@ private:
}
break;
}
+
+ case OpCode::Type::Shift: {
+ std::string op_a = regs.GetRegisterAsInteger(instr.gpr8, 0, false);
+ std::string op_b;
+
+ if (instr.is_b_imm) {
+ op_b += '(' + std::to_string(instr.alu.GetSignedImm20_20()) + ')';
+ } else {
+ if (instr.is_b_gpr) {
+ op_b += regs.GetRegisterAsInteger(instr.gpr20);
+ } else {
+ op_b += regs.GetUniform(instr.uniform, GLSLRegister::Type::Integer);
+ }
+ }
+
+ switch (opcode->GetId()) {
+ case OpCode::Id::SHL_C:
+ case OpCode::Id::SHL_R:
+ case OpCode::Id::SHL_IMM:
+ regs.SetRegisterToInteger(instr.gpr0, true, 0, op_a + " << " + op_b, 1, 1);
+ break;
+ default: {
+ NGLOG_CRITICAL(HW_GPU, "Unhandled shift instruction: {}", opcode->GetName());
+ UNREACHABLE();
+ }
+ }
+ break;
+ }
+
case OpCode::Type::ScaledAdd: {
std::string op_a = regs.GetRegisterAsInteger(instr.gpr8);
@@ -902,12 +931,12 @@ private:
std::string op_b = instr.iscadd.negate_b ? "-" : "";
if (instr.is_b_imm) {
- op_b += '(' + std::to_string(instr.iscadd.GetImmediate()) + ')';
+ op_b += '(' + std::to_string(instr.alu.GetSignedImm20_20()) + ')';
} else {
if (instr.is_b_gpr) {
op_b += regs.GetRegisterAsInteger(instr.gpr20);
} else {
- op_b += regs.GetUniform(instr.uniform, instr.gpr0);
+ op_b += regs.GetUniform(instr.uniform, GLSLRegister::Type::Integer);
}
}