summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorraven02 <jacky.kktsui@yahoo.com.hk>2018-09-16 09:19:08 +0200
committerraven02 <jacky.kktsui@yahoo.com.hk>2018-09-17 17:25:18 +0200
commitb91f7d5d67a67115926ad03526f71a7cc3dfb326 (patch)
tree0363ec1f789d4d2e084c78de331513baf65aeb84 /src
parentMerge pull request #1273 from Subv/ld_sizes (diff)
downloadyuzu-b91f7d5d67a67115926ad03526f71a7cc3dfb326.tar
yuzu-b91f7d5d67a67115926ad03526f71a7cc3dfb326.tar.gz
yuzu-b91f7d5d67a67115926ad03526f71a7cc3dfb326.tar.bz2
yuzu-b91f7d5d67a67115926ad03526f71a7cc3dfb326.tar.lz
yuzu-b91f7d5d67a67115926ad03526f71a7cc3dfb326.tar.xz
yuzu-b91f7d5d67a67115926ad03526f71a7cc3dfb326.tar.zst
yuzu-b91f7d5d67a67115926ad03526f71a7cc3dfb326.zip
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:
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;