diff options
Diffstat (limited to 'reference/shaders-msl/comp/ray-query.spv14.vk.ios.msl24..invalid.comp')
-rw-r--r-- | reference/shaders-msl/comp/ray-query.spv14.vk.ios.msl24..invalid.comp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/reference/shaders-msl/comp/ray-query.spv14.vk.ios.msl24..invalid.comp b/reference/shaders-msl/comp/ray-query.spv14.vk.ios.msl24..invalid.comp index dde7f47b..6e777935 100644 --- a/reference/shaders-msl/comp/ray-query.spv14.vk.ios.msl24..invalid.comp +++ b/reference/shaders-msl/comp/ray-query.spv14.vk.ios.msl24..invalid.comp @@ -1,3 +1,5 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + #include <metal_stdlib> #include <simd/simd.h> #if __METAL_VERSION__ >= 230 @@ -7,6 +9,30 @@ using namespace metal::raytracing; using namespace metal; +intersection_params spvMakeIntersectionParams(uint flags) +{ + intersection_params ip; + if ((flags & 1) != 0) + ip.force_opacity(forced_opacity::opaque); + if ((flags & 2) != 0) + ip.force_opacity(forced_opacity::non_opaque); + if ((flags & 4) != 0) + ip.accept_any_intersection(true); + if ((flags & 16) != 0) + ip.set_triangle_cull_mode(triangle_cull_mode::back); + if ((flags & 32) != 0) + ip.set_triangle_cull_mode(triangle_cull_mode::front); + if ((flags & 64) != 0) + ip.set_opacity_cull_mode(opacity_cull_mode::opaque); + if ((flags & 128) != 0) + ip.set_opacity_cull_mode(opacity_cull_mode::non_opaque); + if ((flags & 256) != 0) + ip.set_geometry_cull_mode(geometry_cull_mode::triangle); + if ((flags & 512) != 0) + ip.set_geometry_cull_mode(geometry_cull_mode::bounding_box); + return ip; +} + struct Params { uint ray_flags; @@ -22,9 +48,9 @@ struct Params kernel void main0(constant Params& _18 [[buffer(1)]], raytracing::acceleration_structure<raytracing::instancing> AS0 [[buffer(0)]], raytracing::acceleration_structure<raytracing::instancing> AS1 [[buffer(2)]]) { raytracing::intersection_query<raytracing::instancing, raytracing::triangle_data> q; - q.reset(ray(_18.origin, _18.dir, _18.tmin, _18.tmax), AS0, intersection_params()); + q.reset(ray(_18.origin, _18.dir, _18.tmin, _18.tmax), AS0, spvMakeIntersectionParams(_18.ray_flags)); raytracing::intersection_query<raytracing::instancing, raytracing::triangle_data> q2[2]; - q2[1].reset(ray(_18.origin, _18.dir, _18.tmin, _18.tmax), AS1, intersection_params()); + q2[1].reset(ray(_18.origin, _18.dir, _18.tmin, _18.tmax), AS1, spvMakeIntersectionParams(_18.ray_flags)); bool _63 = q.next(); bool res = _63; q2[0].abort(); |