Instance Property

vertexBuffers

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

Declaration

var vertexBuffers: 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 vertex function.

Listing 1

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

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

See Also

Specifying Buffer Mutability

var fragmentBuffers: MTLPipelineBufferDescriptorArray

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

class MTLPipelineBufferDescriptor

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