<!--
{
  "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/MTKMetalVertexDescriptorFromModelIOWithError",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "MetalKit"
    ],
    "preciseIdentifier" : "c:@F@MTKMetalVertexDescriptorFromModelIOWithError"
  },
  "title" : "MTKMetalVertexDescriptorFromModelIOWithError"
}
-->

# MTKMetalVertexDescriptorFromModelIOWithError

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

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

A Metal vertex descriptor object.

## Discussion

This function can only set vertex format, offset, buffer index, and stride information in the resulting <doc://com.apple.documentation/documentation/Metal/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 <doc://com.apple.documentation/documentation/Metal/MTLVertexDescriptor> object can properly map mesh data to vertex shader inputs. Layout <doc://com.apple.documentation/documentation/Metal/MTLVertexBufferLayoutDescriptor/stepFunction> and <doc://com.apple.documentation/documentation/Metal/MTLVertexBufferLayoutDescriptor/stepRate> values for the resulting <doc://com.apple.documentation/documentation/Metal/MTLVertexDescriptor> object must also be set by your application.

---

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)