Instance Method

setFragmentBufferOffset:atIndex:

Sets where the data begins in a buffer already bound to the fragment shader.

Required.

Declaration

- (void)setFragmentBufferOffset:(NSUInteger)offset atIndex:(NSUInteger)index;

Parameters

offset

Where the data begins, in bytes, from the start of the buffer.

index

The index in the buffer argument table.

Discussion

Call this method to change the offset you specified when binding a single buffer with the setFragmentBuffer:offset:atIndex: method or multiple buffers with the setFragmentBuffers:offsets:withRange: method. You can also use this method to specify a data offset after binding data directly to the fragment shader with the setFragmentBytes:length:atIndex: method. Don’t rebind a buffer or block of data if you’re only updating its offset.

For buffers in the device address space, align the offset to the data type consumed by the fragment shader (which is always less than or equal to 16 bytes).

For buffers in the constant address space, align the offset to 256 bytes in macOS. In iOS, align the offset to the maximum of either the data type consumed by the fragment shader, or 4 bytes. A 16-byte alignment is safe in iOS if you don’t need to consider the data type.

See Also

Specifying Arguments for a Fragment Function

- setFragmentBuffer:offset:atIndex:

Sets a buffer for the fragment function.

Required.

- setFragmentBuffers:offsets:withRange:

Sets an array of buffers for the fragment function in a range of indices in the buffer argument table.

Required.

- setFragmentBytes:length:atIndex:

Sets a block of data for the fragment shader.

Required.

- setFragmentSamplerState:atIndex:

Sets a sampler state for the fragment function at an index in the sampler state argument table.

Required.

- setFragmentSamplerStates:withRange:

Sets an array of sampler states for the fragment function in a range of indices in the sampler state argument table.

Required.

- setFragmentSamplerState:lodMinClamp:lodMaxClamp:atIndex:

Sets a sampler state for the fragment function at an index in the sampler state argument table, specifying clamp values for the minimum and maximum level of detail.

Required.

- setFragmentSamplerStates:lodMinClamps:lodMaxClamps:withRange:

Sets sampler states for the fragment function in a range of indices in the sampler state argument table, specifying clamp values for levels of detail.

Required.

- setFragmentTexture:atIndex:

Sets a texture for the fragment function at an index in the texture argument table.

Required.

- setFragmentTextures:withRange:

Sets an array of textures for the fragment function in a range of indices in the texture argument table.

Required.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software