---
title: MTKModelIOVertexDescriptorFromMetalWithError
framework: metalkit
role: symbol
role_heading: Function
path: metalkit/mtkmodeliovertexdescriptorfrommetalwitherror
---

# MTKModelIOVertexDescriptorFromMetalWithError

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

## Declaration

```occ
extern MDLVertexDescriptor *MTKModelIOVertexDescriptorFromMetalWithError(MTLVertexDescriptor *metalDescriptor, NSError **error);
```

## Parameters

- `metalDescriptor`: A Metal 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 Model I/O vertex descriptor object.

## Discussion

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