-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Once there's actually something interesting to do for the GPU, experiment with implementing barriers like this:
There's two sets of MTLFences for each stage. Once for all signaled passes and one that all passes need to wait for.
Each set has a list of MTLFences for each stage thats relevant to Metal (compute, blit, fragment, mesh, vertex). Every pass adds a fence to the relevant list of the signaled set. When there's a pipeline barrier the signaled fences get moved over to the wait set (depending on the src & dst stages).
There's also a per-queue set of MTLFences. At the beginning of every command buffer those get added to the wait set and at the end there's an empty compute pass that just waits for all fences in the wait set and signals the per-queue ones.