resource_tracking_pass: Fix type handling of sample offsets. (#1337)

This commit is contained in:
squidbus 2024-10-10 13:30:09 -07:00 committed by GitHub
parent 21eb175aa1
commit 2f80d7565d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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()) {