moving pointsets to the GPU via Uniform buffer

This commit is contained in:
CDaut 2024-07-09 20:18:28 +02:00
parent 74457d1a9c
commit 1114f4c8ff
Signed by: clara
GPG key ID: 223391B52FAD4463
6 changed files with 61 additions and 51 deletions

View file

@ -33,16 +33,14 @@ layout(set = 0, binding = 0) uniform accelerationStructureEXT topLevelAS;
layout(set = 0, binding = 1, rgba32f) uniform image2D image;
layout(set = 1, binding = 0) uniform _GlobalUniforms { GlobalUniforms uni; };
layout(set = 1, binding = ePointset) buffer PointsetBuffer { vec2[WINDOWSIZE * WINDOWSIZE] pointset; };
layout(push_constant) uniform _PushConstantRay { PushConstantRay pcRay; };
layout(set = 1, binding = ePointsetTexture) uniform sampler2D pointset;// bluenoise pointset
// clang-format on
void main()
{
vec2 uv = vec2(float(gl_LaunchIDEXT.x) / float(gl_LaunchSizeEXT.x), float(gl_LaunchIDEXT.y) / float(gl_LaunchSizeEXT.y));
const vec2 rayOriginInPix = vec2(gl_LaunchIDEXT.xy) + texture(pointset, uv).xy;
/*
const vec2 rayOriginInPix = vec2(gl_LaunchIDEXT.xy) + pointset[255].xy;
const vec2 inUV = rayOriginInPix / vec2(gl_LaunchSizeEXT.xy);
vec2 d = inUV * 2.0 - 1.0;
@ -66,6 +64,6 @@ void main()
tMax, // ray max range
0// payload (location = 0)
);
imageStore(image, ivec2(gl_LaunchIDEXT.xy), vec4(prd.hitValue, 1.0));
*/
imageStore(image, ivec2(gl_LaunchIDEXT.xy), vec4(pointset[gl_LaunchIDEXT.x + WINDOWSIZE * gl_LaunchIDEXT.y].xy, 0.f, 1.0));
}