GL_EXT_ray_query glslang updates, and test cases added.

This commit is contained in:
Neslisah Torosdagli
2020-03-20 18:23:27 -04:00
parent 34e874228e
commit 50a722818b
18 changed files with 1724 additions and 38 deletions

35
Test/rayQuery-no-cse.rgen Normal file
View 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);
}