2 #extension GL_NV_ray_tracing : enable
3 #extension GL_EXT_ray_query : enable
13 layout(binding = 0, set = 0) uniform accelerationStructureEXT rtas;
14 layout(std430, set = 0, binding = 2) buffer Rays { Ray rays[]; };
18 return gl_LaunchIDNV.z*gl_LaunchSizeNV.x*gl_LaunchSizeNV.y + gl_LaunchIDNV.y*gl_LaunchSizeNV.x + gl_LaunchIDNV.x;
21 void doInitialize(rayQueryEXT rayQuery, Ray ray)
23 rayQueryInitializeEXT(rayQuery, rtas, gl_RayFlagsNoneEXT, gl_RayFlagsCullBackFacingTrianglesEXT, ray.pos, ray.tmin, ray.dir, ray.tmax);
28 uint index = launchIndex();
29 Ray ray = rays[index];
30 rayQueryEXT rayQuery1;
31 rayQueryEXT rayQuery2;
32 doInitialize(rayQuery1, ray);
33 rayQueryInitializeEXT(rayQuery1, rtas, gl_RayFlagsOpaqueEXT, gl_RayFlagsCullFrontFacingTrianglesEXT, ray.pos, ray.tmin, ray.dir, ray.tmax);
34 doInitialize(rayQuery2, ray);