SPIRV-Cross/reference/opt/shaders/vulkan/rgen/ray_tracing.khr.spv14.nocompat.vk.rgen.vk
Hans-Kristian Arntzen 2097c30985 GLSL: Support both SPV_KHR_ray_tracing and NV_ray_tracing.
Fairly minor differences, so can keep them side by side without too much
effort. NV support is effectively deprecated now however.

- Add OpConvertUToAccelerationStructureKHR
- Ignore/Terminate ray is now a terminator in KHR, but a call in NV.
- Fix some bugs with reportIntersection.
2021-01-08 14:59:04 +01:00

16 lines
571 B
Plaintext

#version 460
#extension GL_EXT_ray_tracing : require
layout(set = 0, binding = 1) uniform accelerationStructureEXT as;
layout(location = 0) rayPayloadEXT float payload;
layout(set = 0, binding = 0, rgba8) uniform writeonly image2D image;
void main()
{
traceRayEXT(as, 0u, 255u, 0u, 1u, 0u, vec3(float(gl_LaunchIDEXT.x) / float(gl_LaunchSizeEXT.x), float(gl_LaunchIDEXT.y) / float(gl_LaunchSizeEXT.y), 1.0), 0.0, vec3(0.0, 0.0, -1.0), 1000.0, 0);
vec4 _68 = vec4(0.0, 0.0, 0.0, 1.0);
_68.y = payload;
imageStore(image, ivec2(gl_LaunchIDEXT.xy), _68);
}