Contents

MTLLogState

A container for shader log messages.

Declaration

protocol MTLLogState : NSObjectProtocol, Sendable

Mentioned in

Overview

Create an MTLCommandQueue or MTLCommandBuffer with a log state to hold messages logged from shaders. Attach a log state to a command buffer by assigning it to the command buffer descriptor’s logState. Similarly, to attach a log state to a command queue, use the command queue descriptor’s logState.

When you attach a log state to a command queue, the command queue shares the log state with all the command buffers it creates. If you attach different log states to a command buffer and command queue, then the system uses the state attached to the command buffer.

Because logging incurs an overhead, regardless of whether the system prints messages, you need to explicitly enable logging with enableLogging.

Topics

Instance Methods

See Also

Shader logging