diff options
| author | 2018-11-11 08:18:27 -0800 | |
|---|---|---|
| committer | 2018-11-11 08:18:27 -0800 | |
| commit | 1916213311f2b762f37edb1f4a4be0b4bba9ebc1 (patch) | |
| tree | 26aa55f6307d6fdd3b1b4e3f831cd2c41a865dcc /src | |
| parent | Merge pull request #1654 from degasus/dirty_flags (diff) | |
| parent | Correct issue where texturelod could not be applied to 2darrayshadow (diff) | |
| download | yuzu-1916213311f2b762f37edb1f4a4be0b4bba9ebc1.tar.gz yuzu-1916213311f2b762f37edb1f4a4be0b4bba9ebc1.tar.xz yuzu-1916213311f2b762f37edb1f4a4be0b4bba9ebc1.zip | |
Merge pull request #1648 from FernandoS27/texs-3-array
Implement 3 coordinate array in TEXS instruction
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 18 |
1 files changed, 11 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 09b003c59..f6a879a7b 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -2742,12 +2742,12 @@ private: | |||
| 2742 | } | 2742 | } |
| 2743 | case 3: { | 2743 | case 3: { |
| 2744 | if (is_array) { | 2744 | if (is_array) { |
| 2745 | UNIMPLEMENTED_MSG("3-coordinate arrays not fully implemented"); | 2745 | const std::string index = regs.GetRegisterAsInteger(instr.gpr8); |
| 2746 | const std::string x = regs.GetRegisterAsFloat(instr.gpr8); | 2746 | const std::string x = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1); |
| 2747 | const std::string y = regs.GetRegisterAsFloat(instr.gpr20); | 2747 | const std::string y = regs.GetRegisterAsFloat(instr.gpr8.Value() + 2); |
| 2748 | coord = "vec2 coords = vec2(" + x + ", " + y + ");"; | 2748 | const std::string z = regs.GetRegisterAsFloat(instr.gpr20); |
| 2749 | texture_type = Tegra::Shader::TextureType::Texture2D; | 2749 | coord = |
| 2750 | is_array = false; | 2750 | "vec4 coords = vec4(" + x + ", " + y + ", " + z + ", " + index + ");"; |
| 2751 | } else { | 2751 | } else { |
| 2752 | const std::string x = regs.GetRegisterAsFloat(instr.gpr8); | 2752 | const std::string x = regs.GetRegisterAsFloat(instr.gpr8); |
| 2753 | const std::string y = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1); | 2753 | const std::string y = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1); |
| @@ -2777,7 +2777,11 @@ private: | |||
| 2777 | break; | 2777 | break; |
| 2778 | } | 2778 | } |
| 2779 | case Tegra::Shader::TextureProcessMode::LZ: { | 2779 | case Tegra::Shader::TextureProcessMode::LZ: { |
| 2780 | texture = "textureLod(" + sampler + ", coords, 0.0)"; | 2780 | if (depth_compare && is_array) { |
| 2781 | texture = "texture(" + sampler + ", coords)"; | ||
| 2782 | } else { | ||
| 2783 | texture = "textureLod(" + sampler + ", coords, 0.0)"; | ||
| 2784 | } | ||
| 2781 | break; | 2785 | break; |
| 2782 | } | 2786 | } |
| 2783 | case Tegra::Shader::TextureProcessMode::LL: { | 2787 | case Tegra::Shader::TextureProcessMode::LL: { |