memoryBarrier(scope:)
Creates a memory barrier that enforces the order of write and read operations for specific resource types.
Declaration
func memoryBarrier(scope: MTLBarrierScope)Parameters
- scope:
An Mtlbarrierscope instance that represents the resource types the barrier synchronizes operations on.
Discussion
Memory barriers ensure the relevant passes finish updating resources before starting the stages of subsequent commands that depend on those resources.
To determine whether a GPU supports memory barriers, see the Metal feature set tables (PDF).