VERY experimental Nintendo Switch 2 emulator
C++
Add 1D sampler for TLDS - TexelFetch (Mario Rabbids)
raven02da0fb4d371b0
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cppindex 81c0662d0c..7a5321b9ce 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:break;}case OpCode::Id::TLDS: {- ASSERT(instr.tlds.GetTextureType() == Tegra::Shader::TextureType::Texture2D);- ASSERT(instr.tlds.IsArrayTexture() == false);std::string coord;+ const Tegra::Shader::TextureType texture_type{instr.tlds.GetTextureType()};+ const bool is_array{instr.tlds.IsArrayTexture()};- switch (instr.tlds.GetTextureType()) {+ switch (texture_type) {+ case Tegra::Shader::TextureType::Texture1D: {+ const std::string x = regs.GetRegisterAsInteger(instr.gpr8);+ coord = "int coords = " + x + ';';+ break;+ }case Tegra::Shader::TextureType::Texture2D: {- if (instr.tlds.IsArrayTexture()) {+ if (is_array) {LOG_CRITICAL(HW_GPU, "Unhandled 2d array texture");UNREACHABLE();} else {@@ -2005,11 +2010,11 @@ private:}default:LOG_CRITICAL(HW_GPU, "Unhandled texture type {}",- static_cast<u32>(instr.tlds.GetTextureType()));+ static_cast<u32>(texture_type));UNREACHABLE();}- const std::string sampler = GetSampler(instr.sampler, instr.tlds.GetTextureType(),- instr.tlds.IsArrayTexture());++ const std::string sampler = GetSampler(instr.sampler, texture_type, is_array);const std::string texture = "texelFetch(" + sampler + ", coords, 0)";WriteTexsInstruction(instr, coord, texture);break;