summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2019-12-19 20:40:27 -0500
committerGravatar GitHub2019-12-19 20:40:27 -0500
commit6d55b14cc01e174c574e33379ab35d07fbc2b2ed (patch)
treed211a8bfdf01845705187bfefc505705a74817eb /src
parentMerge pull request #3232 from ReinUsesLisp/gl-decompiler-images (diff)
parentshader/texture: Properly shrink unused entries in size mismatches (diff)
downloadyuzu-6d55b14cc01e174c574e33379ab35d07fbc2b2ed.tar.gz
yuzu-6d55b14cc01e174c574e33379ab35d07fbc2b2ed.tar.xz
yuzu-6d55b14cc01e174c574e33379ab35d07fbc2b2ed.zip
Merge pull request #3233 from ReinUsesLisp/mismatch-sizes
shader/texture: Properly shrink unused entries in size mismatches
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/decode/texture.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/video_core/shader/decode/texture.cpp b/src/video_core/shader/decode/texture.cpp
index 994c05611..dff01a541 100644
--- a/src/video_core/shader/decode/texture.cpp
+++ b/src/video_core/shader/decode/texture.cpp
@@ -743,13 +743,18 @@ Node4 ShaderIR::GetTldsCode(Instruction instr, TextureType texture_type, bool is
743 // When lod is used always is in gpr20 743 // When lod is used always is in gpr20
744 const Node lod = lod_enabled ? GetRegister(instr.gpr20) : Immediate(0); 744 const Node lod = lod_enabled ? GetRegister(instr.gpr20) : Immediate(0);
745 745
746 // Fill empty entries from the guest sampler. 746 // Fill empty entries from the guest sampler
747 const std::size_t entry_coord_count = GetCoordCount(sampler.GetType()); 747 const std::size_t entry_coord_count = GetCoordCount(sampler.GetType());
748 if (type_coord_count != entry_coord_count) { 748 if (type_coord_count != entry_coord_count) {
749 LOG_WARNING(HW_GPU, "Bound and built texture types mismatch"); 749 LOG_WARNING(HW_GPU, "Bound and built texture types mismatch");
750 } 750
751 for (std::size_t i = type_coord_count; i < entry_coord_count; ++i) { 751 // When the size is higher we insert zeroes
752 coords.push_back(GetRegister(Register::ZeroIndex)); 752 for (std::size_t i = type_coord_count; i < entry_coord_count; ++i) {
753 coords.push_back(GetRegister(Register::ZeroIndex));
754 }
755
756 // Then we ensure the size matches the number of entries (dropping unused values)
757 coords.resize(entry_coord_count);
753 } 758 }
754 759
755 Node4 values; 760 Node4 values;