From 299ef6d813ac46d5c3642c5dda7215b1b25b8edf Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Mon, 16 Oct 2023 18:36:06 -0700 Subject: [PATCH] fixup! 206d355d --- src/back/msl/writer.rs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/back/msl/writer.rs b/src/back/msl/writer.rs index 72bef641c5..21ef9afaa6 100644 --- a/src/back/msl/writer.rs +++ b/src/back/msl/writer.rs @@ -3112,20 +3112,24 @@ impl Writer { // 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() { @@ -3134,6 +3138,10 @@ impl Writer { } } + if uses_ray_query { + self.put_ray_query_type()?; + } + if options .bounds_check_policies .contains(index::BoundsCheckPolicy::ReadZeroSkipWrite)