diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-11-07 02:43:02 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-11-23 01:28:47 +0100 |
commit | dc9961f341be64dcbc13097d4eb7b95db45f9fb9 (patch) | |
tree | 623997e27be185a8b6f415ef1e749b823d98565a /src | |
parent | shader/texture: Deduce texture buffers from locker (diff) | |
download | yuzu-dc9961f341be64dcbc13097d4eb7b95db45f9fb9.tar yuzu-dc9961f341be64dcbc13097d4eb7b95db45f9fb9.tar.gz yuzu-dc9961f341be64dcbc13097d4eb7b95db45f9fb9.tar.bz2 yuzu-dc9961f341be64dcbc13097d4eb7b95db45f9fb9.tar.lz yuzu-dc9961f341be64dcbc13097d4eb7b95db45f9fb9.tar.xz yuzu-dc9961f341be64dcbc13097d4eb7b95db45f9fb9.tar.zst yuzu-dc9961f341be64dcbc13097d4eb7b95db45f9fb9.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/shader/decode/texture.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/video_core/shader/decode/texture.cpp b/src/video_core/shader/decode/texture.cpp index 695fdbd24..b094e5a06 100644 --- a/src/video_core/shader/decode/texture.cpp +++ b/src/video_core/shader/decode/texture.cpp @@ -616,6 +616,8 @@ Node4 ShaderIR::GetTldCode(Tegra::Shader::Instruction instr) { } Node4 ShaderIR::GetTldsCode(Instruction instr, TextureType texture_type, bool is_array) { + const auto& sampler = GetSampler(instr.sampler); + const std::size_t type_coord_count = GetCoordCount(texture_type); const bool lod_enabled = instr.tlds.GetTextureProcessMode() == TextureProcessMode::LL; @@ -639,7 +641,14 @@ Node4 ShaderIR::GetTldsCode(Instruction instr, TextureType texture_type, bool is // When lod is used always is in gpr20 const Node lod = lod_enabled ? GetRegister(instr.gpr20) : Immediate(0); - const auto& sampler = GetSampler(instr.sampler); + // Fill empty entries from the guest sampler. + const std::size_t entry_coord_count = GetCoordCount(sampler.GetType()); + if (type_coord_count != entry_coord_count) { + LOG_WARNING(HW_GPU, "Bound and built texture types mismatch"); + } + for (std::size_t i = type_coord_count; i < entry_coord_count; ++i) { + coords.push_back(GetRegister(Register::ZeroIndex)); + } Node4 values; for (u32 element = 0; element < values.size(); ++element) { |