azhirnov / FrameGraph

vulkan abstraction layer that represent frame as a task graph
BSD 2-Clause "Simplified" License
405 stars 38 forks source link

validation failed when running Tests.FrameGraph, Debug x64 #19

Open raptoravis opened 3 years ago

raptoravis commented 3 years ago

image

azhirnov commented 3 years ago

It looks like a bug in new validation layers. If I use vkCmdDispath instead of vkCmdDispatchBase then the error disappears.

azhirnov commented 3 years ago

I don't read error message, my previous answer is for another error. Current validation message is Descriptor in binding #0 index 8 is being used in draw but has never been updated via vkUpdateDescriptorSets() or a similar call. This error occurs when used descriptor indexing. To fix it I need to create VkDescriptorSetLayout with actual size of runtime sized array, but in FG pipeline creation is hidden inside and I don't know a convenient way to pass array size into pipeline creation code. In this test index 8 is not used in shader, but runtime sized array initialized with size 64 and validation error trigger error that indices 8..64 are not initialized. As said in docs it is UB and driver may crash even if uninitialized descriptors are not used in shader. Current vulkan drivers works fine, but you should not use descriptor indexing in production code to avoid any UB.

The solution of this problem may be using rebustness2 extension, but robustness extensions has performance impact.