Instance Property

fragmentBuffers

An array that contains the buffer mutability options for a render pipeline's fragment function.

Declaration

var fragmentBuffers: MTLPipelineBufferDescriptorArray { get }

Discussion

This property returns an array of MTLPipelineBufferDescriptor objects, with each array index corresponding to the same index in the buffer argument table for the render pipeline's fragment function.

Listing 1

Setting the mutability for a buffer at a specific index of a fragment function

// Render setup
// Set mutability for buffer at index 8
MTLRenderPipelineDescriptor *renderDescriptor = [MTLRenderPipelineDescriptor new];
renderDescriptor.fragmentBuffers[8].mutability = MTLMutabilityImmutable;
// Render pass
// Set immutable buffer at index 8
id <MTLRenderCommandEncoder> renderEncoder = [_commandBuffer renderCommandEncoderWithDescriptor:_renderPassDescriptor];
[renderEncoder setFragmentBuffer:_buffer offset:0 atIndex:8];

See Also

Specifying Buffer Mutability

var vertexBuffers: MTLPipelineBufferDescriptorArray

An array that contains the buffer mutability options for a render pipeline's vertex function.

class MTLPipelineBufferDescriptor

An object that contains the mutability options for buffers used in a render or compute pass.