Function

MTKMetalVertexDescriptorFromModelIOWithError

Returns a partially converted Metal vertex descriptor, reporting any error that occurs.

Declaration

MTLVertexDescriptor * MTKMetalVertexDescriptorFromModelIOWithError(MDLVertexDescriptor *modelIODescriptor, NSError * _Nullable *error);

Parameters

modelIODescriptor

A Model I/O vertex descriptor to convert from.

error

A pointer to an NSError object if an error occurred, or nil if conversion succeeded.

Return Value

A Metal vertex descriptor object.

Discussion

This function can only set vertex format, offset, buffer index, and stride information in the resulting MTLVertexDescriptor object. The function copies attributes one-for-one, so it is up to you to properly arrange the MDLMutableVertexDescriptor attributes in the correct order so that the resulting MTLVertexDescriptor object can properly map mesh data to vertex shader inputs. Layout stepFunction and stepRate values for the resulting MTLVertexDescriptor object must also be set by your application.

See Also

Converting Between Model I/O and Metal Vertex Descriptors

MTKMetalVertexDescriptorFromModelIO

Returns a partially converted Metal vertex descriptor.

MTKModelIOVertexDescriptorFromMetal

Returns a partially converted Model I/O vertex descriptor.

MTKModelIOVertexDescriptorFromMetalWithError

Returns a partially converted Model I/O vertex descriptor, reporting any error that occurs.