summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-06-06 05:46:23 +0200
committerbunnei <bunneidev@gmail.com>2018-06-07 00:09:06 +0200
commit4669f15f8be26ddf3c1cc02d8aac78656c41d361 (patch)
tree3e6968e43a2377a0bfd8bb45f3ea8141f9bd0568 /src/video_core/renderer_opengl
parentgl_shader_gen: Add uniform handling for indirect const buffer access. (diff)
downloadyuzu-4669f15f8be26ddf3c1cc02d8aac78656c41d361.tar
yuzu-4669f15f8be26ddf3c1cc02d8aac78656c41d361.tar.gz
yuzu-4669f15f8be26ddf3c1cc02d8aac78656c41d361.tar.bz2
yuzu-4669f15f8be26ddf3c1cc02d8aac78656c41d361.tar.lz
yuzu-4669f15f8be26ddf3c1cc02d8aac78656c41d361.tar.xz
yuzu-4669f15f8be26ddf3c1cc02d8aac78656c41d361.tar.zst
yuzu-4669f15f8be26ddf3c1cc02d8aac78656c41d361.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 44c8bf4d4..a703b9151 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1090,6 +1090,33 @@ private:
attribute);
break;
}
+ case OpCode::Id::LD_C: {
+ ASSERT_MSG(instr.ld_c.unknown == 0, "Unimplemented");
+
+ std::string op_a =
+ regs.GetUniformIndirect(instr.cbuf36.index, instr.cbuf36.offset + 0, instr.gpr8,
+ GLSLRegister::Type::Float);
+ std::string op_b =
+ regs.GetUniformIndirect(instr.cbuf36.index, instr.cbuf36.offset + 4, instr.gpr8,
+ GLSLRegister::Type::Float);
+
+ switch (instr.ld_c.type.Value()) {
+ case Tegra::Shader::UniformType::Single:
+ regs.SetRegisterToFloat(instr.gpr0, 0, op_a, 1, 1);
+ break;
+
+ case Tegra::Shader::UniformType::Double:
+ regs.SetRegisterToFloat(instr.gpr0, 0, op_a, 1, 1);
+ regs.SetRegisterToFloat(instr.gpr0.Value() + 1, 0, op_b, 1, 1);
+ break;
+
+ default:
+ NGLOG_CRITICAL(HW_GPU, "Unhandled type: {}",
+ static_cast<unsigned>(instr.ld_c.type.Value()));
+ UNREACHABLE();
+ }
+ break;
+ }
case OpCode::Id::ST_A: {
ASSERT_MSG(instr.attribute.fmt20.size == 0, "untested");
regs.SetOutputAttributeToRegister(attribute, instr.attribute.fmt20.element,