[naga] Handle comparison operands in pipeline constant evaluation.

Properly adjust `AtomicFunction::Exchange::compare` after pipeline
constant evaluation.
This commit is contained in:
Jim Blandy authored and Teodor Tanasoaia committed 2024-04-05 18:07:41 +02:00
1 parent a7d8ee999d
commit 8a2bc07f11
7 files changed
+344 -1

No files matched your search

+16 -1
View File
@@ -571,11 +571,26 @@ fn adjust_stmt(new_pos: &[Handle<Expression>], stmt: &mut Statement) {
ref mut pointer,
ref mut value,
ref mut result,
..
ref mut fun,
} => {
adjust(pointer);
adjust(value);
adjust(result);
match *fun {
crate::AtomicFunction::Exchange {
compare: Some(ref mut compare),
} => {
adjust(compare);
}
crate::AtomicFunction::Add
| crate::AtomicFunction::Subtract
| crate::AtomicFunction::And
| crate::AtomicFunction::ExclusiveOr
| crate::AtomicFunction::InclusiveOr
| crate::AtomicFunction::Min
| crate::AtomicFunction::Max
| crate::AtomicFunction::Exchange { compare: None } => {}
}
}
Statement::WorkGroupUniformLoad {
ref mut pointer,