diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-12-18 02:38:50 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-12-18 03:38:10 +0100 |
commit | 15a753b9a5b5cd08520c7ee78ea2a93d06f6b316 (patch) | |
tree | ced1451fd72c34aa1f3f8d1690b4dc03d4438208 /src/video_core | |
parent | Merge pull request #3173 from yuzu-emu/bunnei-spscqueue (diff) | |
download | yuzu-15a753b9a5b5cd08520c7ee78ea2a93d06f6b316.tar yuzu-15a753b9a5b5cd08520c7ee78ea2a93d06f6b316.tar.gz yuzu-15a753b9a5b5cd08520c7ee78ea2a93d06f6b316.tar.bz2 yuzu-15a753b9a5b5cd08520c7ee78ea2a93d06f6b316.tar.lz yuzu-15a753b9a5b5cd08520c7ee78ea2a93d06f6b316.tar.xz yuzu-15a753b9a5b5cd08520c7ee78ea2a93d06f6b316.tar.zst yuzu-15a753b9a5b5cd08520c7ee78ea2a93d06f6b316.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/shader/decode/texture.cpp | 13 |
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 // When lod is used always is in gpr20 const Node lod = lod_enabled ? GetRegister(instr.gpr20) : Immediate(0); - // Fill empty entries from the guest 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)); + + // When the size is higher we insert zeroes + for (std::size_t i = type_coord_count; i < entry_coord_count; ++i) { + coords.push_back(GetRegister(Register::ZeroIndex)); + } + + // Then we ensure the size matches the number of entries (dropping unused values) + coords.resize(entry_coord_count); } Node4 values; |