Function

MTKModelIOVertexDescriptorFromMetalWithError

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

Declaration

MDLVertexDescriptor * MTKModelIOVertexDescriptorFromMetalWithError(MTLVertexDescriptor *metalDescriptor, NSError * _Nullable *error);

Parameters

metalDescriptor

A Metal vertex descriptor to convert from.

error

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

Return Value

A Model I/O vertex descriptor object.

Discussion

This function can only set vertex format, offset, buffer index, and stride information in the resulting MDLMutableVertexDescriptor object. It does not add any semantic information such as attribute names. Names must be set in the returned MDLMutableVertexDescriptor object before it can be applied to a Model I/O mesh.

See Also

Converting Between Model I/O and Metal Vertex Descriptors

MTKMetalVertexDescriptorFromModelIO

Returns a partially converted Metal vertex descriptor.

MTKMetalVertexDescriptorFromModelIOWithError

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

MTKModelIOVertexDescriptorFromMetal

Returns a partially converted Model I/O vertex descriptor.