---
title: "makeSurfaceShader(descriptor:)"
framework: RealityKit
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: "realitykit/lowlevelrendercontextstandalone/makesurfaceshader(descriptor:)-9hqo9"
---

# makeSurfaceShader(descriptor:)

Asynchronously creates a custom surface shader from a user-authored Metal function descriptor.

## Declaration

```swift
nonisolated(nonsending) final func makeSurfaceShader(descriptor: LowLevelMaterialResource.SurfaceShader.Descriptor) async throws -> sending LowLevelMaterialResource.SurfaceShader
```

## Parameters

- `descriptor`: The Metal function name, library, and optional constant values.

## Return Value

Return Value A compiled LowLevelMaterialResource.SurfaceShader.

## Discussion

Discussion note: An error if the specified Metal function cannot be found or compiled.
