From 27916764b1f6b153884d73c063b6ff3521402dbd Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Mon, 15 Oct 2018 15:16:55 -0300 Subject: [PATCH 1/3] gl_rasterizer: Silence implicit cast warning in glBindBufferRange --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 84582c777..8d5f277e2 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -286,7 +286,8 @@ void RasterizerOpenGL::SetupShaders(GLenum primitive_mode) { &ubo, sizeof(ubo), static_cast(uniform_buffer_alignment)); // Bind the buffer - glBindBufferRange(GL_UNIFORM_BUFFER, stage, buffer_cache.GetHandle(), offset, sizeof(ubo)); + glBindBufferRange(GL_UNIFORM_BUFFER, static_cast(stage), buffer_cache.GetHandle(), + offset, static_cast(sizeof(ubo))); Shader shader{shader_cache.GetStageProgram(program)}; From b461342a841f58de2410608e1329db8b518a3656 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Mon, 15 Oct 2018 15:27:47 -0300 Subject: [PATCH 2/3] gl_shader_decompiler: Fixup style inconsistencies --- src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 8dfb49507..ca063d90d 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -1436,7 +1436,6 @@ private: break; } - case OpCode::Type::Shift: { std::string op_a = regs.GetRegisterAsInteger(instr.gpr8, 0, true); std::string op_b; @@ -1478,7 +1477,6 @@ private: } break; } - case OpCode::Type::ArithmeticIntegerImmediate: { std::string op_a = regs.GetRegisterAsInteger(instr.gpr8); std::string op_b = std::to_string(instr.alu.imm20_32.Value()); @@ -2626,14 +2624,14 @@ private: const std::string pred = GetPredicateCondition(instr.csetp.pred39, instr.csetp.neg_pred39 != 0); const std::string combiner = GetPredicateCombiner(instr.csetp.op); - const std::string controlCode = regs.GetControlCode(instr.csetp.cc); + const std::string control_code = regs.GetControlCode(instr.csetp.cc); if (instr.csetp.pred3 != static_cast(Pred::UnusedIndex)) { SetPredicate(instr.csetp.pred3, - '(' + controlCode + ") " + combiner + " (" + pred + ')'); + '(' + control_code + ") " + combiner + " (" + pred + ')'); } if (instr.csetp.pred0 != static_cast(Pred::UnusedIndex)) { SetPredicate(instr.csetp.pred0, - "!(" + controlCode + ") " + combiner + " (" + pred + ')'); + "!(" + control_code + ") " + combiner + " (" + pred + ')'); } break; } From 936c36a5144df183a4cbb8d41b72179f8b94547e Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Mon, 15 Oct 2018 15:32:31 -0300 Subject: [PATCH 3/3] shader_bytecode: Add Control Code enum 0xf Control Code 0xf means to unconditionally execute the instruction. This value is passed to most BRA, EXIT and SYNC instructions (among others) but this may not always be the case. --- src/video_core/engines/shader_bytecode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index 9a59b65b3..f356f9a03 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h @@ -267,7 +267,7 @@ enum class ControlCode : u64 { GTU = 12, NEU = 13, GEU = 14, - // + T = 15, OFF = 16, LO = 17, SFF = 18,