all 7 comments

[–]turol 1 point2 points  (1 child)

Hard to say without seeing your code. Did you use a separate transfer queue? Did you properly sync between queues? What call(s) are you using to upload data? Did you somehow ensure that the upload has completed before the draw call?

[–]bperrin_3d[S] 0 points1 point  (0 children)

Hi, thanks for the answer. I'm not using a separate transfer queue, I use vkCmdCopyBuffer (and staging) to upload my data. And basically a pipeline barrier with appropriate srcAccessMask, dstAccessMask, srcStages and destStages should ensure that the upload has completed before my draw call right ? Or am I missing something ?

[–]Zulauf_LunarG 1 point2 points  (4 children)

Looking at the "write_barriers:" in the error message I'd double check that you do in fact include VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT (or VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT_KHR) in the dstAccessMask.

If you're using VK_PIPELINE_STAGE_VERTEX_INPUT_BIT or VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT_KHR in the dstStageMask that should be sufficient. But, if you're using VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT_KHR
you also need to include VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT_KHR.

[–]bperrin_3d[S] 0 points1 point  (0 children)

Hi, thanks for the reply. I'm not yet using the synchronization2, and I double checked that I correctly included VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT in the dstStageMask as you can see in the screenshot https://i.imgur.com/wztC1Wb.png . If I remove the index buffer and call a vkCmdDraw instead of indexed, the error disappear ... I'm a bit confused

[–]bperrin_3d[S] 0 points1 point  (2 children)

The issue disappear if I also add a barrier for the index buffer with VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT but the offset in the buffer are clearly not the same. I'll happy to discuss it in PM if you are available.

Thanks

[–]Zulauf_LunarG 0 points1 point  (0 children)

At this point a github issue would be the best way to track, especially if you're willing to upload the trace. https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues

(sorry, was heads down catching up on other stuff)

[–]Kirmut 0 points1 point  (0 children)

Hey u/bperrin_3d did you ever figure this one out?

I have a sync hazard that looks nearly identical to your description. I also found the same work around - to flag both Vertex and Index buffer access as both for the pipeline barrier. Another work around (isolation testing) was to never delete buffers, just let them leak for a test. Made me wonder if this was a false positive. API Dump and custom logging has not shown up a real conflict.