diff options
Diffstat (limited to 'src')
| -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) { | |||
| 616 | } | 616 | } |
| 617 | 617 | ||
| 618 | Node4 ShaderIR::GetTldsCode(Instruction instr, TextureType texture_type, bool is_array) { | 618 | Node4 ShaderIR::GetTldsCode(Instruction instr, TextureType texture_type, bool is_array) { |
| 619 | const auto& sampler = GetSampler(instr.sampler); | ||
| 620 | |||
| 619 | const std::size_t type_coord_count = GetCoordCount(texture_type); | 621 | const std::size_t type_coord_count = GetCoordCount(texture_type); |
| 620 | const bool lod_enabled = instr.tlds.GetTextureProcessMode() == TextureProcessMode::LL; | 622 | const bool lod_enabled = instr.tlds.GetTextureProcessMode() == TextureProcessMode::LL; |
| 621 | 623 | ||
| @@ -639,7 +641,14 @@ Node4 ShaderIR::GetTldsCode(Instruction instr, TextureType texture_type, bool is | |||
| 639 | // When lod is used always is in gpr20 | 641 | // When lod is used always is in gpr20 |
| 640 | const Node lod = lod_enabled ? GetRegister(instr.gpr20) : Immediate(0); | 642 | const Node lod = lod_enabled ? GetRegister(instr.gpr20) : Immediate(0); |
| 641 | 643 | ||
| 642 | const auto& sampler = GetSampler(instr.sampler); | 644 | // Fill empty entries from the guest sampler. |
| 645 | const std::size_t entry_coord_count = GetCoordCount(sampler.GetType()); | ||
| 646 | if (type_coord_count != entry_coord_count) { | ||
| 647 | LOG_WARNING(HW_GPU, "Bound and built texture types mismatch"); | ||
| 648 | } | ||
| 649 | for (std::size_t i = type_coord_count; i < entry_coord_count; ++i) { | ||
| 650 | coords.push_back(GetRegister(Register::ZeroIndex)); | ||
| 651 | } | ||
| 643 | 652 | ||
| 644 | Node4 values; | 653 | Node4 values; |
| 645 | for (u32 element = 0; element < values.size(); ++element) { | 654 | for (u32 element = 0; element < values.size(); ++element) { |