diff options
| author | 2019-03-26 19:13:53 -0400 | |
|---|---|---|
| committer | 2019-04-08 11:29:49 -0400 | |
| commit | 189bd1980cc405d512eb8b19307df76976344e6e (patch) | |
| tree | 3d20913dd18315c099852bbf16efbe18f04641ff /src | |
| parent | Corrections to TEX_B (diff) | |
| download | yuzu-189bd1980cc405d512eb8b19307df76976344e6e.tar.gz yuzu-189bd1980cc405d512eb8b19307df76976344e6e.tar.xz yuzu-189bd1980cc405d512eb8b19307df76976344e6e.zip | |
Implement TMML_B
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/decode/texture.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/video_core/shader/decode/texture.cpp b/src/video_core/shader/decode/texture.cpp index 300f1abad..ddb7755b8 100644 --- a/src/video_core/shader/decode/texture.cpp +++ b/src/video_core/shader/decode/texture.cpp | |||
| @@ -40,7 +40,7 @@ static std::size_t GetCoordCount(TextureType texture_type) { | |||
| 40 | u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | 40 | u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { |
| 41 | const Instruction instr = {program_code[pc]}; | 41 | const Instruction instr = {program_code[pc]}; |
| 42 | const auto opcode = OpCode::Decode(instr); | 42 | const auto opcode = OpCode::Decode(instr); |
| 43 | 43 | bool is_bindless = false; | |
| 44 | switch (opcode->get().GetId()) { | 44 | switch (opcode->get().GetId()) { |
| 45 | case OpCode::Id::TEX: { | 45 | case OpCode::Id::TEX: { |
| 46 | if (instr.tex.UsesMiscMode(TextureMiscMode::NODEP)) { | 46 | if (instr.tex.UsesMiscMode(TextureMiscMode::NODEP)) { |
| @@ -185,6 +185,8 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 185 | } | 185 | } |
| 186 | break; | 186 | break; |
| 187 | } | 187 | } |
| 188 | case OpCode::Id::TMML_B: | ||
| 189 | is_bindless = true; | ||
| 188 | case OpCode::Id::TMML: { | 190 | case OpCode::Id::TMML: { |
| 189 | UNIMPLEMENTED_IF_MSG(instr.tmml.UsesMiscMode(Tegra::Shader::TextureMiscMode::NDV), | 191 | UNIMPLEMENTED_IF_MSG(instr.tmml.UsesMiscMode(Tegra::Shader::TextureMiscMode::NDV), |
| 190 | "NDV is not implemented"); | 192 | "NDV is not implemented"); |
| @@ -195,7 +197,9 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 195 | 197 | ||
| 196 | auto texture_type = instr.tmml.texture_type.Value(); | 198 | auto texture_type = instr.tmml.texture_type.Value(); |
| 197 | const bool is_array = instr.tmml.array != 0; | 199 | const bool is_array = instr.tmml.array != 0; |
| 198 | const auto& sampler = GetSampler(instr.sampler, texture_type, is_array, false); | 200 | const auto& sampler = !is_bindless |
| 201 | ? GetSampler(instr.sampler, texture_type, is_array, false) | ||
| 202 | : GetBindlessSampler(instr.gpr20, texture_type, is_array, false); | ||
| 199 | 203 | ||
| 200 | std::vector<Node> coords; | 204 | std::vector<Node> coords; |
| 201 | 205 | ||
| @@ -271,11 +275,12 @@ const Sampler& ShaderIR::GetSampler(const Tegra::Shader::Sampler& sampler, Textu | |||
| 271 | return *used_samplers.emplace(entry).first; | 275 | return *used_samplers.emplace(entry).first; |
| 272 | } | 276 | } |
| 273 | 277 | ||
| 274 | const Sampler& ShaderIR::GetBindlessSampler(const Tegra::Shader::Register& reg, | 278 | const Sampler& ShaderIR::GetBindlessSampler(const Tegra::Shader::Register& reg, TextureType type, |
| 275 | TextureType type, bool is_array, bool is_shadow) { | 279 | bool is_array, bool is_shadow) { |
| 276 | 280 | ||
| 277 | const Node sampler_register = GetRegister(reg); | 281 | const Node sampler_register = GetRegister(reg); |
| 278 | const Node base_sampler = TrackCbuf(sampler_register, global_code, static_cast<s64>(global_code.size())); | 282 | const Node base_sampler = |
| 283 | TrackCbuf(sampler_register, global_code, static_cast<s64>(global_code.size())); | ||
| 279 | const auto cbuf = std::get_if<CbufNode>(base_sampler); | 284 | const auto cbuf = std::get_if<CbufNode>(base_sampler); |
| 280 | const auto cbuf_offset_imm = std::get_if<ImmediateNode>(cbuf->GetOffset()); | 285 | const auto cbuf_offset_imm = std::get_if<ImmediateNode>(cbuf->GetOffset()); |
| 281 | ASSERT(cbuf_offset_imm != nullptr); | 286 | ASSERT(cbuf_offset_imm != nullptr); |