Skip to content

Memory Barrier Issue for Indirect Buffers / Dispatches #2655

@tr-nc

Description

@tr-nc

I've encountered a potential issue with memory barriers in vulkano when using dispatch_indirect.

In my use case, I'm modifying an indirect buffer inside a compute shader, and then using AutoCommandBufferBuilder::dispatch_indirect with that same buffer in a subsequent compute shader. Through RenderDoc profiling, I noticed that vulkano doesn't seem to insert a memory barrier for the indirect buffer between these operations.

Details:

  • RenderDoc shows at EID44 the indirect buffer is edited to <1, 10, 1>
  • Between EID48 - EID76, vkCmdDispatchIndirect is called using this buffer
  • The buffer isn't ready at EID48, causing incorrect behavior

I understood that AutoCommandBufferBuilder should handle memory barriers automatically, so I'm wondering if:

  1. This is a known limitation that requires manual barrier insertion
  2. This could be handled by the new task-graph system
  3. There are any recommended best practices to handle this scenario

I found a related discussion in PR #1516, but the synchronization issue seems to persist.

Any guidance would be appreciated!

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: wontfix / old syncThis issue relates to the old synchronization using GpuFuture and co.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions