summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/ir_opt/texture_pass.cpp
diff options
context:
space:
mode:
authorGravatar Ameer J2021-10-16 21:41:54 -0400
committerGravatar GitHub2021-10-16 21:41:54 -0400
commit3791c7ca82aafa8e007074dcc2059ff4ba4de22d (patch)
treeb70ed6e2d0f75589532a0e6c197b970bf328e20a /src/shader_recompiler/ir_opt/texture_pass.cpp
parentMerge pull request #7127 from FernandoS27/i-saw-a-wabbit (diff)
parentShader Compiler: avoid overflowed indices on indixed samplers. (diff)
downloadyuzu-3791c7ca82aafa8e007074dcc2059ff4ba4de22d.tar.gz
yuzu-3791c7ca82aafa8e007074dcc2059ff4ba4de22d.tar.xz
yuzu-3791c7ca82aafa8e007074dcc2059ff4ba4de22d.zip
Merge pull request #7077 from FernandoS27/face-down
A series of fixes to queries and indexed samplers.
Diffstat (limited to 'src/shader_recompiler/ir_opt/texture_pass.cpp')
-rw-r--r--src/shader_recompiler/ir_opt/texture_pass.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shader_recompiler/ir_opt/texture_pass.cpp b/src/shader_recompiler/ir_opt/texture_pass.cpp
index 44ad10d43..225c238fb 100644
--- a/src/shader_recompiler/ir_opt/texture_pass.cpp
+++ b/src/shader_recompiler/ir_opt/texture_pass.cpp
@@ -492,7 +492,8 @@ void TexturePass(Environment& env, IR::Program& program) {
492 const auto insert_point{IR::Block::InstructionList::s_iterator_to(*inst)}; 492 const auto insert_point{IR::Block::InstructionList::s_iterator_to(*inst)};
493 IR::IREmitter ir{*texture_inst.block, insert_point}; 493 IR::IREmitter ir{*texture_inst.block, insert_point};
494 const IR::U32 shift{ir.Imm32(std::countr_zero(DESCRIPTOR_SIZE))}; 494 const IR::U32 shift{ir.Imm32(std::countr_zero(DESCRIPTOR_SIZE))};
495 inst->SetArg(0, ir.ShiftRightArithmetic(cbuf.dynamic_offset, shift)); 495 inst->SetArg(0, ir.SMin(ir.ShiftRightArithmetic(cbuf.dynamic_offset, shift),
496 ir.Imm32(DESCRIPTOR_SIZE - 1)));
496 } else { 497 } else {
497 inst->SetArg(0, IR::Value{}); 498 inst->SetArg(0, IR::Value{});
498 } 499 }