diff options
author | 丛越 <congyue@ztgame.com> | 2021-10-21 12:46:45 +0300 |
---|---|---|
committer | 丛越 <congyue@ztgame.com> | 2021-10-21 12:46:45 +0300 |
commit | d52ec1e196fc1db4d0399414dcff3c069e2f3772 (patch) | |
tree | 977bf3de9d5cc19230549d4210245793f3eafd9a /reference | |
parent | 597f29d09d3d49fca9f3654c43210ca0cb3b5371 (diff) |
Fix all requested changes, test_shaders.py supports compiling MSL 2.4 shaders, and the Intersection Query currently only supports MSL 2.4 on the iOS platform.
Diffstat (limited to 'reference')
-rw-r--r-- | reference/shaders-msl/comp/ray-query.spv14.vk.ios.msl24.comp (renamed from reference/shaders-msl/comp/ray-query.nocompat.spv14.vk.comp) | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/reference/shaders-msl/comp/ray-query.nocompat.spv14.vk.comp b/reference/shaders-msl/comp/ray-query.spv14.vk.ios.msl24.comp index 442a2589..f73d4911 100644 --- a/reference/shaders-msl/comp/ray-query.nocompat.spv14.vk.comp +++ b/reference/shaders-msl/comp/ray-query.spv14.vk.ios.msl24.comp @@ -3,7 +3,10 @@ #include <metal_stdlib> #include <simd/simd.h> +#if __METAL_VERSION__ >= 230 +#include <metal_raytracing> using namespace metal::raytracing; +#endif using namespace metal; @@ -60,11 +63,9 @@ struct Params kernel void main0(constant Params& _18 [[buffer(1)]], acceleration_structure<instancing> AS0 [[buffer(0)]], acceleration_structure<instancing> AS1 [[buffer(2)]]) { intersection_query<instancing, triangle_data> q; - intersection_params _intersection_params_; - 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, intersection_params()); spvUnsafeArray<intersection_query<instancing, triangle_data>, 2> q2; - intersection_params _intersection_params_; - 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, intersection_params()); bool _63 = q.next(); bool res = _63; q2[0].abort(); @@ -76,33 +77,33 @@ kernel void main0(constant Params& _18 [[buffer(1)]], acceleration_structure<ins float3 fvals = _74; float3 _75 = q.get_world_space_ray_direction(); fvals = _75; - uint _80 = (uint)q2[1].get_committed_intersection_type(); + uint _80 = uint(q2[1].get_committed_intersection_type()); uint type = _80; - uint _83 = (uint)q2[0].get_committed_intersection_type(); + uint _83 = uint(q2[0].get_candidate_intersection_type()) - 1; type = _83; bool _85 = q2[1].is_candidate_non_opaque_bounding_box(); res = _85; float _87 = q2[1].get_committed_distance(); fval = _87; - float _89 = q2[1].get_committed_distance(); + float _89 = q2[1].get_candidate_triangle_distance(); fval = _89; int _92 = q.get_committed_user_instance_id(); int ival = _92; - int _94 = q2[0].get_committed_instance_id(); + int _94 = q2[0].get_candidate_instance_id(); ival = _94; - int _96 = q2[1].get_committed_geometry_id(); + int _96 = q2[1].get_candidate_geometry_id(); ival = _96; int _97 = q.get_committed_primitive_id(); ival = _97; - float2 _100 = q2[0].get_committed_triangle_barycentric_coord(); + float2 _100 = q2[0].get_candidate_triangle_barycentric_coord(); fvals = float3(_100.x, _100.y, fvals.z); bool _103 = q.is_committed_triangle_front_facing(); res = _103; - float3 _104 = q.get_committed_ray_direction(); + float3 _104 = q.get_candidate_ray_direction(); fvals = _104; float3 _106 = q2[0].get_committed_ray_origin(); fvals = _106; - float4x3 _110 = q.get_committed_object_to_world_transform(); + float4x3 _110 = q.get_candidate_object_to_world_transform(); float4x3 matrices = _110; float4x3 _112 = q2[1].get_committed_world_to_object_transform(); matrices = _112; |