descriptor heap rewrite

This commit is contained in:
Jorijn van der Graaf 2026-04-05 22:53:59 +02:00
commit f8e142fb06
31 changed files with 429 additions and 1017 deletions

View file

@ -1,14 +1,17 @@
#version 460
#extension GL_EXT_ray_tracing : enable
#extension GL_EXT_shader_image_load_formatted : enable
#extension GL_EXT_shader_explicit_arithmetic_types_int16 : enable
#extension GL_EXT_descriptor_heap : enable
#extension GL_EXT_nonuniform_qualifier : enable
layout(binding = 0, set = 0) uniform accelerationStructureEXT topLevelAS;
layout(binding = 1, set = 0, rgba8) uniform writeonly image2D image;
layout(constant_id = 0) const uint16_t bufferStart = 0us;
layout(descriptor_heap) uniform accelerationStructureEXT topLevelAS[];
layout(descriptor_heap) uniform writeonly image2D image[];
layout(location = 0) rayPayloadEXT vec3 hitValue;
void main()
{
void main() {
// Pixel coordinates
uvec2 pixel = gl_LaunchIDEXT.xy;
uvec2 resolution = gl_LaunchSizeEXT.xy;
@ -32,7 +35,7 @@ void main()
));
traceRayEXT(
topLevelAS,
topLevelAS[bufferStart],
gl_RayFlagsNoneEXT,
0xff,
0, 0, 0,
@ -43,5 +46,5 @@ void main()
0
);
imageStore(image, ivec2(pixel), vec4(hitValue, 1.0));
imageStore(image[0], ivec2(pixel), vec4(hitValue, 1));
}