summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2018-09-30 21:53:38 -0400
committerGravatar GitHub2018-09-30 21:53:38 -0400
commitbc679c9b8c05d3db46da8cef77e729b31c6dbff5 (patch)
treea96752a0ddefec9a857fa3423fd91b88ef19967d
parentMerge pull request #1420 from MerryMage/dynarmic (diff)
parentFix trailing whitespace (diff)
downloadyuzu-bc679c9b8c05d3db46da8cef77e729b31c6dbff5.tar.gz
yuzu-bc679c9b8c05d3db46da8cef77e729b31c6dbff5.tar.xz
yuzu-bc679c9b8c05d3db46da8cef77e729b31c6dbff5.zip
Merge pull request #1330 from raven02/tlds
TLDS: Add 1D sampler
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp22
1 files changed, 15 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 320babdb1..579a78702 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -2026,9 +2026,12 @@ private:
2026 break; 2026 break;
2027 } 2027 }
2028 case OpCode::Id::TLDS: { 2028 case OpCode::Id::TLDS: {
2029 ASSERT(instr.tlds.GetTextureType() == Tegra::Shader::TextureType::Texture2D);
2030 ASSERT(instr.tlds.IsArrayTexture() == false);
2031 std::string coord; 2029 std::string coord;
2030 const Tegra::Shader::TextureType texture_type{instr.tlds.GetTextureType()};
2031 const bool is_array{instr.tlds.IsArrayTexture()};
2032
2033 ASSERT(texture_type == Tegra::Shader::TextureType::Texture2D);
2034 ASSERT(is_array == false);
2032 2035
2033 ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::NODEP), 2036 ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::NODEP),
2034 "NODEP is not implemented"); 2037 "NODEP is not implemented");
@@ -2037,9 +2040,14 @@ private:
2037 ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::MZ), 2040 ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::MZ),
2038 "MZ is not implemented"); 2041 "MZ is not implemented");
2039 2042
2040 switch (instr.tlds.GetTextureType()) { 2043 switch (texture_type) {
2044 case Tegra::Shader::TextureType::Texture1D: {
2045 const std::string x = regs.GetRegisterAsInteger(instr.gpr8);
2046 coord = "int coords = " + x + ';';
2047 break;
2048 }
2041 case Tegra::Shader::TextureType::Texture2D: { 2049 case Tegra::Shader::TextureType::Texture2D: {
2042 if (instr.tlds.IsArrayTexture()) { 2050 if (is_array) {
2043 LOG_CRITICAL(HW_GPU, "Unhandled 2d array texture"); 2051 LOG_CRITICAL(HW_GPU, "Unhandled 2d array texture");
2044 UNREACHABLE(); 2052 UNREACHABLE();
2045 } else { 2053 } else {
@@ -2051,11 +2059,11 @@ private:
2051 } 2059 }
2052 default: 2060 default:
2053 LOG_CRITICAL(HW_GPU, "Unhandled texture type {}", 2061 LOG_CRITICAL(HW_GPU, "Unhandled texture type {}",
2054 static_cast<u32>(instr.tlds.GetTextureType())); 2062 static_cast<u32>(texture_type));
2055 UNREACHABLE(); 2063 UNREACHABLE();
2056 } 2064 }
2057 const std::string sampler = GetSampler(instr.sampler, instr.tlds.GetTextureType(), 2065
2058 instr.tlds.IsArrayTexture()); 2066 const std::string sampler = GetSampler(instr.sampler, texture_type, is_array);
2059 const std::string texture = "texelFetch(" + sampler + ", coords, 0)"; 2067 const std::string texture = "texelFetch(" + sampler + ", coords, 0)";
2060 WriteTexsInstruction(instr, coord, texture); 2068 WriteTexsInstruction(instr, coord, texture);
2061 break; 2069 break;