Contents

memoryBarrier(resources:)

Creates a memory barrier that enforces the order of write and read operations for specific resources.

Declaration

func memoryBarrier(resources: [any MTLResource])

Parameters

  • resources:

    An array of Mtlresource instances the barrier applies to.

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).

See Also

Preventing resource access conflicts