Skip to content

Commit

Permalink
resource_tracking_pass: Fix type handling of sample offsets.
Browse files Browse the repository at this point in the history
  • Loading branch information
squidbus committed Oct 10, 2024
1 parent 21eb175 commit 87360de
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/shader_recompiler/ir/passes/resource_tracking_pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 87360de

Please sign in to comment.