Skip to content

Commit

Permalink
fixup! 206d355
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblandy committed Oct 17, 2023
1 parent 348d82a commit 299ef6d
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/back/msl/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3112,20 +3112,24 @@ impl<W: Write> Writer<W> {
// Work around Metal bug where `uint` is not available by default
writeln!(self.out, "using {NAMESPACE}::uint;")?;

let mut uses_ray_query = false;
for (_, ty) in module.types.iter() {
match ty.inner {
crate::TypeInner::AccelerationStructure | crate::TypeInner::RayQuery
if options.lang_version < (2, 4) =>
{
return Err(Error::UnsupportedRayTracing);
crate::TypeInner::AccelerationStructure => {
if options.lang_version < (2, 4) {
return Err(Error::UnsupportedRayTracing);
}
}
crate::TypeInner::RayQuery => {
self.put_ray_query_type()?;
break;
if options.lang_version < (2, 4) {
return Err(Error::UnsupportedRayTracing);
}
uses_ray_query = true;
}
_ => {}
_ => (),
}
}

if module.special_types.ray_desc.is_some()
|| module.special_types.ray_intersection.is_some()
{
Expand All @@ -3134,6 +3138,10 @@ impl<W: Write> Writer<W> {
}
}

if uses_ray_query {
self.put_ray_query_type()?;
}

if options
.bounds_check_policies
.contains(index::BoundsCheckPolicy::ReadZeroSkipWrite)
Expand Down

0 comments on commit 299ef6d

Please sign in to comment.