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:
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()};
+
ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::NODEP),
"NODEP is not implemented");
ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::AOFFI),
@@ -2029,9 +2029,14 @@ private:
ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::MZ),
"MZ is not implemented");
- 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 {
@@ -2043,11 +2048,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;