<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalKit",
  "identifier" : "/documentation/MetalKit/MTKModelIOVertexDescriptorFromMetalWithError",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "MetalKit"
    ],
    "preciseIdentifier" : "c:@F@MTKModelIOVertexDescriptorFromMetalWithError"
  },
  "title" : "MTKModelIOVertexDescriptorFromMetalWithError"
}
-->

# MTKModelIOVertexDescriptorFromMetalWithError

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

```
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

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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)