<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLCommandBufferError-swift.struct/invalidResource",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:SC21MTLCommandBufferErrorLeV15invalidResourceSoAAVvpZ"
  },
  "title" : "invalidResource"
}
-->

# invalidResource

An error code that indicates the command buffer has an invalid reference to resource.

```
static var invalidResource: MTLCommandBufferError.Code { get }
```

## Discussion

Typically, apps trigger this error by deleting a resource and then running a command buffer that refers to it.

---

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)