MTKMetalVertexDescriptorFromModelIOWithError
Returns a partially converted Metal vertex descriptor, reporting any error that occurs.
Declaration
extern MTLVertexDescriptor *MTKMetalVertexDescriptorFromModelIOWithError(MDLVertexDescriptor *modelIODescriptor, NSError **error);Parameters
- modelIODescriptor:
A Model I/O vertex descriptor to convert from.
- error:
A pointer to an Nserror object if an error occurred, or
nilif 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.