glslang/Test/spv.ext.RayGenShader.rgen
2022-09-29 10:21:01 -07:00

24 lines
825 B
Plaintext

#version 460
#extension GL_EXT_ray_tracing : enable
#extension GL_EXT_ray_flags_primitive_culling : enable
#extension GL_EXT_opacity_micromap : enable
layout(binding = 0) uniform accelerationStructureEXT accEXT0;
layout(binding = 1, set = 0) uniform accelerationStructureEXT accEXT1; // Unused
layout(binding = 2, r32ui) shadercallcoherent uniform uimage2D imageu;
layout(location = 1) rayPayloadEXT vec4 payload;
layout(shaderRecordEXT) buffer block
{
vec3 dir;
vec3 origin;
};
layout(primitive_culling);
void main()
{
uint lx = gl_LaunchIDEXT.x;
uint ly = gl_LaunchIDEXT.y;
uint sx = gl_LaunchSizeEXT.x;
uint sy = gl_LaunchSizeEXT.y;
traceRayEXT(accEXT0, lx, ly, sx, sy, gl_RayFlagsSkipTrianglesEXT | gl_RayFlagsSkipAABBEXT | gl_RayFlagsForceOpacityMicromap2StateEXT, origin, 0.5f, dir, 0.75f, 1);
}