summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 81c0662d0..7a5321b9c 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1987,13 +1987,18 @@ private:
1987 break; 1987 break;
1988 } 1988 }
1989 case OpCode::Id::TLDS: { 1989 case OpCode::Id::TLDS: {
1990 ASSERT(instr.tlds.GetTextureType() == Tegra::Shader::TextureType::Texture2D);
1991 ASSERT(instr.tlds.IsArrayTexture() == false);
1992 std::string coord; 1990 std::string coord;
1991 const Tegra::Shader::TextureType texture_type{instr.tlds.GetTextureType()};
1992 const bool is_array{instr.tlds.IsArrayTexture()};
1993 1993
1994 switch (instr.tlds.GetTextureType()) { 1994 switch (texture_type) {
1995 case Tegra::Shader::TextureType::Texture1D: {
1996 const std::string x = regs.GetRegisterAsInteger(instr.gpr8);
1997 coord = "int coords = " + x + ';';
1998 break;
1999 }
1995 case Tegra::Shader::TextureType::Texture2D: { 2000 case Tegra::Shader::TextureType::Texture2D: {
1996 if (instr.tlds.IsArrayTexture()) { 2001 if (is_array) {
1997 LOG_CRITICAL(HW_GPU, "Unhandled 2d array texture"); 2002 LOG_CRITICAL(HW_GPU, "Unhandled 2d array texture");
1998 UNREACHABLE(); 2003 UNREACHABLE();
1999 } else { 2004 } else {
@@ -2005,11 +2010,11 @@ private:
2005 } 2010 }
2006 default: 2011 default:
2007 LOG_CRITICAL(HW_GPU, "Unhandled texture type {}", 2012 LOG_CRITICAL(HW_GPU, "Unhandled texture type {}",
2008 static_cast<u32>(instr.tlds.GetTextureType())); 2013 static_cast<u32>(texture_type));
2009 UNREACHABLE(); 2014 UNREACHABLE();
2010 } 2015 }
2011 const std::string sampler = GetSampler(instr.sampler, instr.tlds.GetTextureType(), 2016
2012 instr.tlds.IsArrayTexture()); 2017 const std::string sampler = GetSampler(instr.sampler, texture_type, is_array);
2013 const std::string texture = "texelFetch(" + sampler + ", coords, 0)"; 2018 const std::string texture = "texelFetch(" + sampler + ", coords, 0)";
2014 WriteTexsInstruction(instr, coord, texture); 2019 WriteTexsInstruction(instr, coord, texture);
2015 break; 2020 break;