Closed lukelmy closed 1 year ago
Also "imgMemBarrier.srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT" should be added before L829. https://github.com/nvpro-samples/vk_raytracing_tutorial_KHR/blob/003bab42a58fd028a20f7c307ca991a1b5a6f48c/ray_tracing_ao/hello_vulkan.cpp#L829-L830
Thanks for spotting this @lukelmy , the change was committed in 525becc66ca5c27309560192ecc0db435959532d
In ray_tracing_ao, g-buffer is drawn in fragment shader and sampled in compute shader. Between both shaders there is a pipeline barrier. According to vulkan specs, the srcStageMask should be VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT instead of VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT which may cause corruption sometimes.
https://github.com/nvpro-samples/vk_raytracing_tutorial_KHR/blob/003bab42a58fd028a20f7c307ca991a1b5a6f48c/ray_tracing_ao/hello_vulkan.cpp#L810