---
title: MTKMetalVertexDescriptorFromModelIOWithError
framework: metalkit
role: symbol
role_heading: Function
path: metalkit/mtkmetalvertexdescriptorfrommodeliowitherror
---

# MTKMetalVertexDescriptorFromModelIOWithError

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

## Declaration

```occ
extern MTLVertexDescriptor *MTKMetalVertexDescriptorFromModelIOWithError(MDLVertexDescriptor *modelIODescriptor, NSError **error);
```

## Parameters

- `modelIODescriptor`: A Model I/O vertex descriptor to convert from.
- `error`: A pointer to an doc://com.apple.documentation/documentation/Foundation/NSError object if an error occurred, or nil if conversion succeeded.

## Return Value

Return Value A Metal vertex descriptor object.

## Discussion

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(_:)](metalkit/mtkmetalvertexdescriptorfrommodelio(_:).md)
- [MTKModelIOVertexDescriptorFromMetal(_:)](metalkit/mtkmodeliovertexdescriptorfrommetal(_:).md)
- [MTKModelIOVertexDescriptorFromMetalWithError](metalkit/mtkmodeliovertexdescriptorfrommetalwitherror.md)
