Article

Tracking the Resource Residency of Argument Buffers

Optimize resource performance within an argument buffer.

Overview

The Metal driver cannot automatically track the residency of argument buffer resources. You must track it manually.

Track Argument Buffer Resource Residency Manually

Call a MTLRenderCommandEncoder or MTLComputeCommandEncoder method:

These methods perform two important functions:

  • Add argument buffer resources to the set of resources that must be resident for the duration of the render or compute pass.

  • Ensure that argument buffer resources are in a format compatible with the required function operation, as specified by a MTLResourceUsage value.

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

See Also

Argument Buffers

About Argument Buffers

Improve your app’s performance by grouping your resources into an argument buffer.

Basic Argument Buffers

Demonstrates how to manage groups of resources with an argument buffer.

Argument Buffers with Arrays and Resource Heaps

Demonstrates how to define an argument buffer with arrays and reduce CPU overhead by combining argument buffers with resource heaps.

Argument Buffers with GPU Encoding

Demonstrates how to encode an argument buffer with a compute pass and then access its arguments in a subsequent render pass.

Dynamic Terrain with Argument Buffers

Demonstrates how to use argument buffers to render a dynamic terrain in real time with a GPU-driven pipeline.

Indexing Argument Buffers

Assign resource indices within an argument buffer.

class MTLArgumentDescriptor

A representation of an argument within an argument buffer.

protocol MTLArgumentEncoder

An object used to encode data into an argument buffer.