Shaders: lower v_xnor_b32 and v_swap_b32

Add lowering for v_xnor_b32 and v_swap_b32 (seen in GTA VI world compute shaders), and record v.dst as a read in ir.rs for v_swap_b32 / v_swaprel_b32 since both operands are read before being swapped.
This commit is contained in:
Yaekai committed 2026-11-24 00:59:52 +01:00
1 parent 97c78d1087
commit 0c560918b3
2 files changed
+34 -2

No files matched your search

+12 -2
View File
@@ -806,8 +806,18 @@ fn effects(
regs(c, &mut w)?;
}
match name {
"v_swap_b32" => regs(&v.src[0], &mut w)?,
"v_swaprel_b32" => indexed(&v.src[0], &mut w)?,
"v_swap_b32" => {
regs(&v.src[0], &mut w)?;
if let Some(d) = &v.dst {
regs(d, &mut r)?;
}
}
"v_swaprel_b32" => {
indexed(&v.src[0], &mut w)?;
if let Some(d) = &v.dst {
indexed(d, &mut r)?;
}
}
_ => {}
}
if name.starts_with("v_interp_") || src_indexed || dst_indexed {