Encodes a command to optimize a range in the indirect command buffer to improve performance.
- iOS 12.0+
- macOS 10.14+
- Mac Catalyst 13.0+Beta
- tvOS 12.0+
- Xcode 10.0+
The indirect command buffer to optimize.
The range of commands to optimize.
Often, indirect command buffers are filled by compute functions executing on the GPU. Because compute functions are encoding commands in parallel, they must sometime reset commands or set the same parameter state in multiple commands. Optimizing an indirect command buffer removes some empty commands and redundant parameter state from the indirect command buffer, improving performance when commands in the indirect command buffer are executed.
Any range within a buffer that is optimized must be treated as opaque data. It is illegal to execute commands within the buffer with a start index that is inside the optimized range. Executing commands with any start index other than the start of the optimized region results in undefined behavior. It is legal to cross optimized ranges or to execute a range of commands that ends within an optimized range. You must reset the optimized range before new commands can be encoded into the buffer.