diff options
Diffstat (limited to 'shaders-msl-no-opt/frag/ray-query-mutability.spv14.vk.msl24.frag')
-rw-r--r-- | shaders-msl-no-opt/frag/ray-query-mutability.spv14.vk.msl24.frag | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/shaders-msl-no-opt/frag/ray-query-mutability.spv14.vk.msl24.frag b/shaders-msl-no-opt/frag/ray-query-mutability.spv14.vk.msl24.frag new file mode 100644 index 00000000..d3594225 --- /dev/null +++ b/shaders-msl-no-opt/frag/ray-query-mutability.spv14.vk.msl24.frag @@ -0,0 +1,26 @@ +#version 460 + +#extension GL_ARB_separate_shader_objects : enable +#extension GL_EXT_ray_query : enable + +layout(binding = 0) uniform accelerationStructureEXT topLevelAS; + +void initFn(rayQueryEXT rayQuery) { + vec3 rayOrigin = vec3(0, 0, 1); + vec3 rayDirection = vec3(0, 0,-1); + float rayDistance = 2.0; + rayQueryInitializeEXT(rayQuery, topLevelAS, gl_RayFlagsTerminateOnFirstHitEXT, 0xFF, rayOrigin, 0.001, rayDirection, rayDistance); +} + +uint proceeFn(rayQueryEXT rayQuery) { + while(rayQueryProceedEXT(rayQuery)) + ; + return rayQueryGetIntersectionTypeEXT(rayQuery, true); +} + +void main() { + rayQueryEXT rayQuery; + + initFn(rayQuery); + proceeFn(rayQuery); +} |