<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ShaderGraph/validate()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:11ShaderGraphAAC8validateSbyF"
  },
  "title" : "validate()"
}
-->

# validate()

Checks whether the graph is well-formed without producing a Metal library.

```
final func validate() -> Bool
```

## Return Value

`true` if the graph passes front-end validation, `false` otherwise.

## Discussion

Runs the ShaderGraph compiler front end — parsing, graph construction, and the
transform pipeline — but stops short of stitching the graph into a Metal
library. Use this to catch structural problems before paying the cost of a
full compile.

Validation is cheaper than [`ShaderGraphMaterial`](/documentation/RealityKit/ShaderGraphMaterial) compilation, but the exact
amount of work skipped is not guaranteed and may change over time. A graph
that passes [`validate()`](/documentation/RealityKit/ShaderGraph/validate()) may still fail later during Metal library
generation.

---

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)