Merge pull request #927 from bunnei/fix-texs

gl_shader_decompiler: Fix TEXS mask and dest.
This commit is contained in:
bunnei 2018-08-05 16:42:21 -04:00 committed by GitHub
commit c8e5c74092
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -766,13 +766,16 @@ private:
// goes into gpr28+0 and gpr28+1 // goes into gpr28+0 and gpr28+1
size_t texs_offset{}; size_t texs_offset{};
size_t src_elem{};
for (const auto& dest : {instr.gpr0.Value(), instr.gpr28.Value()}) { for (const auto& dest : {instr.gpr0.Value(), instr.gpr28.Value()}) {
size_t dest_elem{};
for (unsigned elem = 0; elem < 2; ++elem) { for (unsigned elem = 0; elem < 2; ++elem) {
if (!instr.texs.IsComponentEnabled(elem)) { if (!instr.texs.IsComponentEnabled(src_elem++)) {
// Skip disabled components // Skip disabled components
continue; continue;
} }
regs.SetRegisterToFloat(dest, elem + texs_offset, texture, 1, 4, false, elem); regs.SetRegisterToFloat(dest, elem + texs_offset, texture, 1, 4, false,
dest_elem++);
} }
if (!instr.texs.HasTwoDestinations()) { if (!instr.texs.HasTwoDestinations()) {