Add support for primitive culling layout qualifier. (#2220)

* Add support for primitive culling layout qualifier.

* Add error checks for primitive flags and negative test.
This commit is contained in:
alelenv
2020-05-21 04:38:41 -07:00
committed by GitHub
parent eba1389a01
commit 59216d5cd8
9 changed files with 50 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
spv.ext.RayPrimCull_Errors.rgen
ERROR: 0:3: 'primitive culling' : required extension not requested: GL_EXT_ray_flags_primitive_culling
ERROR: 0:5: 'primitive_culling' : layout qualifier can not have storage qualifiers
ERROR: 0:6: 'primitive_culling' : can only be applied as standalone
ERROR: 0:7: 'primitive_culling' : can only be applied as standalone
ERROR: 4 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link

View File

@@ -2,6 +2,7 @@
#extension GL_EXT_ray_query : enable
#extension GL_EXT_ray_flags_primitive_culling : enable
layout(primitive_culling);
struct Ray
{
vec3 pos;

View File

@@ -11,6 +11,7 @@ layout(shaderRecordEXT) buffer block
vec3 origin;
};
layout(primitive_culling);
void main()
{
uint lx = gl_LaunchIDEXT.x;

View File

@@ -0,0 +1,10 @@
#version 460
#extension GL_EXT_ray_tracing : enable
layout(primitive_culling);
#extension GL_EXT_ray_flags_primitive_culling : enable
layout(primitive_culling) uniform;
layout(primitive_culling, binding = 2) uniform accelerationStructureEXT as;
layout(std140, binding = 2, primitive_culling) buffer block { int x; };
void main()
{
}