summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2018-09-19 06:16:00 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2018-10-03 14:41:12 +0200
commitf664437ae876bb47978e3fabeaa96d627658bbfd (patch)
tree1099eb7898055f045a75db7d68c2b0e2043f4c4e
parentMerge pull request #1407 from DarkLordZach/dlc (diff)
downloadyuzu-f664437ae876bb47978e3fabeaa96d627658bbfd.tar
yuzu-f664437ae876bb47978e3fabeaa96d627658bbfd.tar.gz
yuzu-f664437ae876bb47978e3fabeaa96d627658bbfd.tar.bz2
yuzu-f664437ae876bb47978e3fabeaa96d627658bbfd.tar.lz
yuzu-f664437ae876bb47978e3fabeaa96d627658bbfd.tar.xz
yuzu-f664437ae876bb47978e3fabeaa96d627658bbfd.tar.zst
yuzu-f664437ae876bb47978e3fabeaa96d627658bbfd.zip
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp47
1 files changed, 42 insertions, 5 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 579a78702..d73234ec3 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1935,7 +1935,7 @@ private:
shader.AddLine(coord);
std::string texture;
- switch (instr.tex.process_mode) {
+ switch (instr.tex.GetTextureProcessMode()) {
case Tegra::Shader::TextureProcessMode::None: {
texture = "texture(" + sampler + ", coords)";
break;
@@ -1959,7 +1959,7 @@ private:
default: {
texture = "texture(" + sampler + ", coords)";
LOG_CRITICAL(HW_GPU, "Unhandled texture process mode {}",
- static_cast<u32>(instr.tex.process_mode.Value()));
+ static_cast<u32>(instr.tex.GetTextureProcessMode()));
UNREACHABLE();
}
}
@@ -2021,7 +2021,28 @@ private:
is_array = false;
}
const std::string sampler = GetSampler(instr.sampler, texture_type, is_array);
- const std::string texture = "texture(" + sampler + ", coords)";
+ std::string texture;
+ const std::string op_c = regs.GetRegisterAsFloat(instr.gpr20.Value() + 1);
+ switch (instr.texs.GetTextureProcessMode()) {
+ case Tegra::Shader::TextureProcessMode::None: {
+ texture = "texture(" + sampler + ", coords)";
+ break;
+ }
+ case Tegra::Shader::TextureProcessMode::LZ: {
+ texture = "textureLod(" + sampler + ", coords, 0.0)";
+ break;
+ }
+ case Tegra::Shader::TextureProcessMode::LL: {
+ texture = "textureLod(" + sampler + ", coords, " + op_c + ')';
+ break;
+ }
+ default: {
+ texture = "texture(" + sampler + ", coords)";
+ LOG_CRITICAL(HW_GPU, "Unhandled texture process mode {}",
+ static_cast<u32>(instr.texs.GetTextureProcessMode()));
+ UNREACHABLE();
+ }
+ }
WriteTexsInstruction(instr, coord, texture);
break;
}
@@ -2062,9 +2083,25 @@ private:
static_cast<u32>(texture_type));
UNREACHABLE();
}
-
const std::string sampler = GetSampler(instr.sampler, texture_type, is_array);
- const std::string texture = "texelFetch(" + sampler + ", coords, 0)";
+ std::string texture = "texelFetch(" + sampler + ", coords, 0)";
+ const std::string op_c = regs.GetRegisterAsInteger(instr.gpr20.Value() + 1);
+ switch (instr.tlds.GetTextureProcessMode()) {
+ case Tegra::Shader::TextureProcessMode::LZ: {
+ texture = "texelFetch(" + sampler + ", coords, 0)";
+ break;
+ }
+ case Tegra::Shader::TextureProcessMode::LL: {
+ texture = "texelFetch(" + sampler + ", coords, " + op_c + ')';
+ break;
+ }
+ default: {
+ texture = "texelFetch(" + sampler + ", coords, 0)";
+ LOG_CRITICAL(HW_GPU, "Unhandled texture process mode {}",
+ static_cast<u32>(instr.tlds.GetTextureProcessMode()));
+ UNREACHABLE();
+ }
+ }
WriteTexsInstruction(instr, coord, texture);
break;
}