Contents

Tracking the resource residency of argument buffers

Optimize resource performance within an argument buffer.

Overview

The Metal driver can’t automatically track the residency of argument buffer resources, but you can track it manually.

Track argument buffer resource residency manually

Call an MTLRenderCommandEncoder or MTLComputeCommandEncoder method:

These methods perform two important functions:

  • They add argument buffer resources to the set of resources that the render or compute pass needs resident.

  • They ensure that argument buffer resources are in a format that’s compatible with the required function operation, as an MTLResourceUsage value specifies.

The methods with a stages parameter also insert dependency hazards, similar to MTLFence instances for that stage.

Call these methods before issuing any draw or dispatch calls that may access the specified resources.

See Also

Argument buffers