Skip to content

Commit

Permalink
[naga] Adjust RayQuery statements in override processing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblandy committed Mar 26, 2024
1 parent 86b056d commit 8033980
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
20 changes: 18 additions & 2 deletions naga/src/back/pipeline_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ fn adjust_stmt(new_pos: &[Handle<Expression>], stmt: &mut Statement) {
Statement::Call {
ref mut arguments,
ref mut result,
..
function: _,
} => {
for argument in arguments.iter_mut() {
adjust(argument);
Expand All @@ -642,8 +642,24 @@ fn adjust_stmt(new_pos: &[Handle<Expression>], stmt: &mut Statement) {
adjust(e);
}
}
Statement::RayQuery { ref mut query, .. } => {
Statement::RayQuery {
ref mut query,
ref mut fun,
} => {
adjust(query);
match *fun {
crate::RayQueryFunction::Initialize {
ref mut acceleration_structure,
ref mut descriptor,
} => {
adjust(acceleration_structure);
adjust(descriptor);
}
crate::RayQueryFunction::Proceed { ref mut result } => {
adjust(result);
}
crate::RayQueryFunction::Terminate => {}
}
}
Statement::Break | Statement::Continue | Statement::Kill | Statement::Barrier(_) => {}
}
Expand Down
5 changes: 5 additions & 0 deletions naga/tests/snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ fn write_output_spv(
);
}
} else {
assert!(pipeline_constants.is_empty());
write_output_spv_inner(input, module, info, &options, None, "spvasm");
}
}
Expand Down Expand Up @@ -857,6 +858,10 @@ fn convert_wgsl() {
"overrides-atomicCompareExchangeWeak",
Targets::IR | Targets::SPIRV,
),
(
"overrides-ray-query",
Targets::IR | Targets::SPIRV | Targets::METAL,
),
];

for &(name, targets) in inputs.iter() {
Expand Down

0 comments on commit 8033980

Please sign in to comment.