diff options
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 252ff18fc..60d0ec81f 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -954,8 +954,6 @@ private: | |||
| 954 | // TEXS has two destination registers and a swizzle. The first two elements in the swizzle | 954 | // TEXS has two destination registers and a swizzle. The first two elements in the swizzle |
| 955 | // go into gpr0+0 and gpr0+1, and the rest goes into gpr28+0 and gpr28+1 | 955 | // go into gpr0+0 and gpr0+1, and the rest goes into gpr28+0 and gpr28+1 |
| 956 | 956 | ||
| 957 | ASSERT_MSG(instr.texs.nodep == 0, "TEXS nodep not implemented"); | ||
| 958 | |||
| 959 | std::size_t written_components = 0; | 957 | std::size_t written_components = 0; |
| 960 | for (u32 component = 0; component < 4; ++component) { | 958 | for (u32 component = 0; component < 4; ++component) { |
| 961 | if (!instr.texs.IsComponentEnabled(component)) { | 959 | if (!instr.texs.IsComponentEnabled(component)) { |
| @@ -1871,6 +1869,13 @@ private: | |||
| 1871 | Tegra::Shader::TextureType texture_type{instr.tex.texture_type}; | 1869 | Tegra::Shader::TextureType texture_type{instr.tex.texture_type}; |
| 1872 | std::string coord; | 1870 | std::string coord; |
| 1873 | 1871 | ||
| 1872 | ASSERT_MSG(!instr.tex.UsesMiscMode(Tegra::Shader::TextureMiscMode::NODEP), | ||
| 1873 | "NODEP is not implemented"); | ||
| 1874 | ASSERT_MSG(!instr.tex.UsesMiscMode(Tegra::Shader::TextureMiscMode::AOFFI), | ||
| 1875 | "AOFFI is not implemented"); | ||
| 1876 | ASSERT_MSG(!instr.tex.UsesMiscMode(Tegra::Shader::TextureMiscMode::DC), | ||
| 1877 | "DC is not implemented"); | ||
| 1878 | |||
| 1874 | switch (texture_type) { | 1879 | switch (texture_type) { |
| 1875 | case Tegra::Shader::TextureType::Texture1D: { | 1880 | case Tegra::Shader::TextureType::Texture1D: { |
| 1876 | const std::string x = regs.GetRegisterAsFloat(instr.gpr8); | 1881 | const std::string x = regs.GetRegisterAsFloat(instr.gpr8); |
| @@ -1953,6 +1958,11 @@ private: | |||
| 1953 | Tegra::Shader::TextureType texture_type{instr.texs.GetTextureType()}; | 1958 | Tegra::Shader::TextureType texture_type{instr.texs.GetTextureType()}; |
| 1954 | bool is_array{instr.texs.IsArrayTexture()}; | 1959 | bool is_array{instr.texs.IsArrayTexture()}; |
| 1955 | 1960 | ||
| 1961 | ASSERT_MSG(!instr.texs.UsesMiscMode(Tegra::Shader::TextureMiscMode::NODEP), | ||
| 1962 | "NODEP is not implemented"); | ||
| 1963 | ASSERT_MSG(!instr.texs.UsesMiscMode(Tegra::Shader::TextureMiscMode::DC), | ||
| 1964 | "DC is not implemented"); | ||
| 1965 | |||
| 1956 | switch (texture_type) { | 1966 | switch (texture_type) { |
| 1957 | case Tegra::Shader::TextureType::Texture2D: { | 1967 | case Tegra::Shader::TextureType::Texture2D: { |
| 1958 | if (is_array) { | 1968 | if (is_array) { |
| @@ -1989,6 +1999,13 @@ private: | |||
| 1989 | ASSERT(instr.tlds.IsArrayTexture() == false); | 1999 | ASSERT(instr.tlds.IsArrayTexture() == false); |
| 1990 | std::string coord; | 2000 | std::string coord; |
| 1991 | 2001 | ||
| 2002 | ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::NODEP), | ||
| 2003 | "NODEP is not implemented"); | ||
| 2004 | ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::AOFFI), | ||
| 2005 | "AOFFI is not implemented"); | ||
| 2006 | ASSERT_MSG(!instr.tlds.UsesMiscMode(Tegra::Shader::TextureMiscMode::MZ), | ||
| 2007 | "MZ is not implemented"); | ||
| 2008 | |||
| 1992 | switch (instr.tlds.GetTextureType()) { | 2009 | switch (instr.tlds.GetTextureType()) { |
| 1993 | case Tegra::Shader::TextureType::Texture2D: { | 2010 | case Tegra::Shader::TextureType::Texture2D: { |
| 1994 | if (instr.tlds.IsArrayTexture()) { | 2011 | if (instr.tlds.IsArrayTexture()) { |
| @@ -2017,6 +2034,17 @@ private: | |||
| 2017 | ASSERT(instr.tld4.array == 0); | 2034 | ASSERT(instr.tld4.array == 0); |
| 2018 | std::string coord; | 2035 | std::string coord; |
| 2019 | 2036 | ||
| 2037 | ASSERT_MSG(!instr.tld4.UsesMiscMode(Tegra::Shader::TextureMiscMode::NODEP), | ||
| 2038 | "NODEP is not implemented"); | ||
| 2039 | ASSERT_MSG(!instr.tld4.UsesMiscMode(Tegra::Shader::TextureMiscMode::AOFFI), | ||
| 2040 | "AOFFI is not implemented"); | ||
| 2041 | ASSERT_MSG(!instr.tld4.UsesMiscMode(Tegra::Shader::TextureMiscMode::DC), | ||
| 2042 | "DC is not implemented"); | ||
| 2043 | ASSERT_MSG(!instr.tld4.UsesMiscMode(Tegra::Shader::TextureMiscMode::NDV), | ||
| 2044 | "NDV is not implemented"); | ||
| 2045 | ASSERT_MSG(!instr.tld4.UsesMiscMode(Tegra::Shader::TextureMiscMode::PTP), | ||
| 2046 | "PTP is not implemented"); | ||
| 2047 | |||
| 2020 | switch (instr.tld4.texture_type) { | 2048 | switch (instr.tld4.texture_type) { |
| 2021 | case Tegra::Shader::TextureType::Texture2D: { | 2049 | case Tegra::Shader::TextureType::Texture2D: { |
| 2022 | const std::string x = regs.GetRegisterAsFloat(instr.gpr8); | 2050 | const std::string x = regs.GetRegisterAsFloat(instr.gpr8); |
| @@ -2054,6 +2082,13 @@ private: | |||
| 2054 | break; | 2082 | break; |
| 2055 | } | 2083 | } |
| 2056 | case OpCode::Id::TLD4S: { | 2084 | case OpCode::Id::TLD4S: { |
| 2085 | ASSERT_MSG(!instr.tld4s.UsesMiscMode(Tegra::Shader::TextureMiscMode::NODEP), | ||
| 2086 | "NODEP is not implemented"); | ||
| 2087 | ASSERT_MSG(!instr.tld4s.UsesMiscMode(Tegra::Shader::TextureMiscMode::AOFFI), | ||
| 2088 | "AOFFI is not implemented"); | ||
| 2089 | ASSERT_MSG(!instr.tld4s.UsesMiscMode(Tegra::Shader::TextureMiscMode::DC), | ||
| 2090 | "DC is not implemented"); | ||
| 2091 | |||
| 2057 | const std::string op_a = regs.GetRegisterAsFloat(instr.gpr8); | 2092 | const std::string op_a = regs.GetRegisterAsFloat(instr.gpr8); |
| 2058 | const std::string op_b = regs.GetRegisterAsFloat(instr.gpr20); | 2093 | const std::string op_b = regs.GetRegisterAsFloat(instr.gpr20); |
| 2059 | // TODO(Subv): Figure out how the sampler type is encoded in the TLD4S instruction. | 2094 | // TODO(Subv): Figure out how the sampler type is encoded in the TLD4S instruction. |
| @@ -2066,6 +2101,9 @@ private: | |||
| 2066 | break; | 2101 | break; |
| 2067 | } | 2102 | } |
| 2068 | case OpCode::Id::TXQ: { | 2103 | case OpCode::Id::TXQ: { |
| 2104 | ASSERT_MSG(!instr.txq.UsesMiscMode(Tegra::Shader::TextureMiscMode::NODEP), | ||
| 2105 | "NODEP is not implemented"); | ||
| 2106 | |||
| 2069 | // TODO: the new commits on the texture refactor, change the way samplers work. | 2107 | // TODO: the new commits on the texture refactor, change the way samplers work. |
| 2070 | // Sadly, not all texture instructions specify the type of texture their sampler | 2108 | // Sadly, not all texture instructions specify the type of texture their sampler |
| 2071 | // uses. This must be fixed at a later instance. | 2109 | // uses. This must be fixed at a later instance. |
| @@ -2086,6 +2124,11 @@ private: | |||
| 2086 | break; | 2124 | break; |
| 2087 | } | 2125 | } |
| 2088 | case OpCode::Id::TMML: { | 2126 | case OpCode::Id::TMML: { |
| 2127 | ASSERT_MSG(!instr.tmml.UsesMiscMode(Tegra::Shader::TextureMiscMode::NODEP), | ||
| 2128 | "NODEP is not implemented"); | ||
| 2129 | ASSERT_MSG(!instr.tmml.UsesMiscMode(Tegra::Shader::TextureMiscMode::NDV), | ||
| 2130 | "NDV is not implemented"); | ||
| 2131 | |||
| 2089 | const std::string op_a = regs.GetRegisterAsFloat(instr.gpr8); | 2132 | const std::string op_a = regs.GetRegisterAsFloat(instr.gpr8); |
| 2090 | const std::string op_b = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1); | 2133 | const std::string op_b = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1); |
| 2091 | const bool is_array = instr.tmml.array != 0; | 2134 | const bool is_array = instr.tmml.array != 0; |