nvpro-samples / vk_raytracing_tutorial_KHR

Ray tracing examples and tutorials using VK_KHR_ray_tracing
Apache License 2.0
1.36k stars 143 forks source link

Missing nonuniform qualifier? #3

Closed Novum closed 4 years ago

Novum commented 4 years ago

https://github.com/nvpro-samples/vk_raytracing_tutorial_KHR/blob/21fc6552372d40927b29904eabb25061874668ba/ray_tracing__advance/shaders/raytrace.rchit#L115

It seems like this should be using GLSL "nonuniform" because the threads can diverge and sample different textures?

mklefrancois commented 4 years ago

This is safe to use. The txtId is unique when executing the closest hit shader and will not change or be affected by other threads.