diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-03-27 00:13:53 +0100 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-04-08 17:29:49 +0200 |
commit | 189bd1980cc405d512eb8b19307df76976344e6e (patch) | |
tree | 3d20913dd18315c099852bbf16efbe18f04641ff /src/video_core/shader | |
parent | Corrections to TEX_B (diff) | |
download | yuzu-189bd1980cc405d512eb8b19307df76976344e6e.tar yuzu-189bd1980cc405d512eb8b19307df76976344e6e.tar.gz yuzu-189bd1980cc405d512eb8b19307df76976344e6e.tar.bz2 yuzu-189bd1980cc405d512eb8b19307df76976344e6e.tar.lz yuzu-189bd1980cc405d512eb8b19307df76976344e6e.tar.xz yuzu-189bd1980cc405d512eb8b19307df76976344e6e.tar.zst yuzu-189bd1980cc405d512eb8b19307df76976344e6e.zip |
Diffstat (limited to 'src/video_core/shader')
-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) { u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { const Instruction instr = {program_code[pc]}; const auto opcode = OpCode::Decode(instr); - + bool is_bindless = false; switch (opcode->get().GetId()) { case OpCode::Id::TEX: { if (instr.tex.UsesMiscMode(TextureMiscMode::NODEP)) { @@ -185,6 +185,8 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { } break; } + case OpCode::Id::TMML_B: + is_bindless = true; case OpCode::Id::TMML: { UNIMPLEMENTED_IF_MSG(instr.tmml.UsesMiscMode(Tegra::Shader::TextureMiscMode::NDV), "NDV is not implemented"); @@ -195,7 +197,9 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { auto texture_type = instr.tmml.texture_type.Value(); const bool is_array = instr.tmml.array != 0; - const auto& sampler = GetSampler(instr.sampler, texture_type, is_array, false); + const auto& sampler = !is_bindless + ? GetSampler(instr.sampler, texture_type, is_array, false) + : GetBindlessSampler(instr.gpr20, texture_type, is_array, false); std::vector<Node> coords; @@ -271,11 +275,12 @@ const Sampler& ShaderIR::GetSampler(const Tegra::Shader::Sampler& sampler, Textu return *used_samplers.emplace(entry).first; } -const Sampler& ShaderIR::GetBindlessSampler(const Tegra::Shader::Register& reg, - TextureType type, bool is_array, bool is_shadow) { +const Sampler& ShaderIR::GetBindlessSampler(const Tegra::Shader::Register& reg, TextureType type, + bool is_array, bool is_shadow) { const Node sampler_register = GetRegister(reg); - const Node base_sampler = TrackCbuf(sampler_register, global_code, static_cast<s64>(global_code.size())); + const Node base_sampler = + TrackCbuf(sampler_register, global_code, static_cast<s64>(global_code.size())); const auto cbuf = std::get_if<CbufNode>(base_sampler); const auto cbuf_offset_imm = std::get_if<ImmediateNode>(cbuf->GetOffset()); ASSERT(cbuf_offset_imm != nullptr); |