diff --git a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp index 0cb6bff291..21f2115d5f 100644 --- a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp +++ b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp @@ -507,7 +507,11 @@ void PatchImageSampleInstruction(IR::Block& block, IR::Inst& inst, Info& info, } // The offsets are six-bit signed integers: X=[5:0], Y=[13:8], and Z=[21:16]. - const IR::Value arg = get_addr_reg(addr_reg++); + IR::Value arg = get_addr_reg(addr_reg++); + if (const IR::Inst* offset_inst = arg.TryInstRecursive()) { + ASSERT(offset_inst->GetOpcode() == IR::Opcode::BitCastF32U32); + arg = offset_inst->Arg(0); + } const auto read = [&](u32 off) -> IR::U32 { if (arg.IsImmediate()) {