summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index b3e95187e..00cd05e62 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -2018,10 +2018,10 @@ private:
2018 break; 2018 break;
2019 } 2019 }
2020 case OpCode::Id::TLDS: { 2020 case OpCode::Id::TLDS: {
2021 ASSERT(instr.tlds.GetTextureType() == Tegra::Shader::TextureType::Texture2D);
2022 ASSERT(instr.tlds.IsArrayTexture() == false);
2023 std::string coord; 2021 std::string coord;
2024 2022 const Tegra::Shader::TextureType texture_type{instr.tlds.GetTextureType()};
2023 const bool is_array{instr.tlds.IsArrayTexture()};
2024
2025 ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::NODEP), 2025 ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::NODEP),
2026 "NODEP is not implemented"); 2026 "NODEP is not implemented");
2027 ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::AOFFI), 2027 ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::AOFFI),
@@ -2029,9 +2029,14 @@ private:
2029 ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::MZ), 2029 ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::MZ),
2030 "MZ is not implemented"); 2030 "MZ is not implemented");
2031 2031
2032 switch (instr.tlds.GetTextureType()) { 2032 switch (texture_type) {
2033 case Tegra::Shader::TextureType::Texture1D: {
2034 const std::string x = regs.GetRegisterAsInteger(instr.gpr8);
2035 coord = "int coords = " + x + ';';
2036 break;
2037 }
2033 case Tegra::Shader::TextureType::Texture2D: { 2038 case Tegra::Shader::TextureType::Texture2D: {
2034 if (instr.tlds.IsArrayTexture()) { 2039 if (is_array) {
2035 LOG_CRITICAL(HW_GPU, "Unhandled 2d array texture"); 2040 LOG_CRITICAL(HW_GPU, "Unhandled 2d array texture");
2036 UNREACHABLE(); 2041 UNREACHABLE();
2037 } else { 2042 } else {
@@ -2043,11 +2048,11 @@ private:
2043 } 2048 }
2044 default: 2049 default:
2045 LOG_CRITICAL(HW_GPU, "Unhandled texture type {}", 2050 LOG_CRITICAL(HW_GPU, "Unhandled texture type {}",
2046 static_cast<u32>(instr.tlds.GetTextureType())); 2051 static_cast<u32>(texture_type));
2047 UNREACHABLE(); 2052 UNREACHABLE();
2048 } 2053 }
2049 const std::string sampler = GetSampler(instr.sampler, instr.tlds.GetTextureType(), 2054
2050 instr.tlds.IsArrayTexture()); 2055 const std::string sampler = GetSampler(instr.sampler, texture_type, is_array);
2051 const std::string texture = "texelFetch(" + sampler + ", coords, 0)"; 2056 const std::string texture = "texelFetch(" + sampler + ", coords, 0)";
2052 WriteTexsInstruction(instr, coord, texture); 2057 WriteTexsInstruction(instr, coord, texture);
2053 break; 2058 break;