GL_EXT_ray_query glslang updates, and test cases added.
This commit is contained in:
35
Test/rayQuery-no-cse.rgen
Normal file
35
Test/rayQuery-no-cse.rgen
Normal file
@@ -0,0 +1,35 @@
|
||||
#version 460
|
||||
#extension GL_NV_ray_tracing : enable
|
||||
#extension GL_EXT_ray_query : enable
|
||||
|
||||
struct Ray
|
||||
{
|
||||
vec3 pos;
|
||||
float tmin;
|
||||
vec3 dir;
|
||||
float tmax;
|
||||
};
|
||||
|
||||
layout(binding = 0, set = 0) uniform accelerationStructureNV rtas;
|
||||
layout(std430, set = 0, binding = 2) buffer Rays { Ray rays[]; };
|
||||
|
||||
uint launchIndex()
|
||||
{
|
||||
return gl_LaunchIDNV.z*gl_LaunchSizeNV.x*gl_LaunchSizeNV.y + gl_LaunchIDNV.y*gl_LaunchSizeNV.x + gl_LaunchIDNV.x;
|
||||
}
|
||||
|
||||
void doInitialize(rayQueryEXT rayQuery, Ray ray)
|
||||
{
|
||||
rayQueryInitializeEXT(rayQuery, rtas, 0, 1, ray.pos, ray.tmin, ray.dir, ray.tmax);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
uint index = launchIndex();
|
||||
Ray ray = rays[index];
|
||||
rayQueryEXT rayQuery1;
|
||||
rayQueryEXT rayQuery2;
|
||||
doInitialize(rayQuery1, ray);
|
||||
rayQueryInitializeEXT(rayQuery1, rtas, 1, 2, ray.pos, ray.tmin, ray.dir, ray.tmax);
|
||||
doInitialize(rayQuery2, ray);
|
||||
}
|
||||
Reference in New Issue
Block a user