Просмотр исходного кода

Merge pull request #7222 from FernandoS27/fix-indixed-textures-again

TexturePass: Fix clamping  of images as this allowed negative indices.
Ameer J 4 лет назад
Родитель
Сommit
aed5878dd3
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/shader_recompiler/ir_opt/texture_pass.cpp

+ 1 - 1
src/shader_recompiler/ir_opt/texture_pass.cpp

@@ -492,7 +492,7 @@ void TexturePass(Environment& env, IR::Program& program) {
             const auto insert_point{IR::Block::InstructionList::s_iterator_to(*inst)};
             IR::IREmitter ir{*texture_inst.block, insert_point};
             const IR::U32 shift{ir.Imm32(std::countr_zero(DESCRIPTOR_SIZE))};
-            inst->SetArg(0, ir.SMin(ir.ShiftRightArithmetic(cbuf.dynamic_offset, shift),
+            inst->SetArg(0, ir.UMin(ir.ShiftRightArithmetic(cbuf.dynamic_offset, shift),
                                     ir.Imm32(DESCRIPTOR_SIZE - 1)));
         } else {
             inst->SetArg(0, IR::Value{});