<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/LowLevelRenderContext",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:19RealityCoreRenderer21LowLevelRenderContextP"
  },
  "title" : "LowLevelRenderContext"
}
-->

# LowLevelRenderContext

An entry point for creating rendering resources and compiling materials.

```
protocol LowLevelRenderContext : AnyObject
```

## Overview

Use a `LowLevelRenderContext` to construct meshes, textures, buffers, argument tables,
materials, and pipeline states. These objects are assembled into a
[`LowLevelMeshInstanceArray`](/documentation/RealityKit/LowLevelMeshInstanceArray) consumed each frame by [`LowLevelRenderer`](/documentation/RealityKit/LowLevelRenderer).

## Topics

### Accessing the render context

[`var device: any MTLDevice`](/documentation/RealityKit/LowLevelRenderContext/device)

The Metal device that backs this render context.

[`var shaderGraph: any LowLevelRenderContextShaderGraph`](/documentation/RealityKit/LowLevelRenderContext/shaderGraph)

The ShaderGraph function creation interface for this render context.

### Creating resources

[`func makeBufferResource(descriptor: LowLevelBufferResource.Descriptor) throws -> LowLevelBufferResource`](/documentation/RealityKit/LowLevelRenderContext/makeBufferResource(descriptor:))

Creates a GPU-managed buffer resource from the given descriptor.

[`func makeTextureResource(descriptor: LowLevelTextureResource.Descriptor) throws -> LowLevelTextureResource`](/documentation/RealityKit/LowLevelRenderContext/makeTextureResource(descriptor:))

Creates a texture resource from the given descriptor.

[`func makeMaterialResource(descriptor: LowLevelMaterialResource.Descriptor) throws -> sending LowLevelMaterialResource`](/documentation/RealityKit/LowLevelRenderContext/makeMaterialResource(descriptor:)-8hizx)

Synchronous variant of [`makeMaterialResource(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeMaterialResource(descriptor:)-8hizx). Blocks the current thread until compilation completes.

[`func makeMaterialResource(descriptor: LowLevelMaterialResource.Descriptor) async throws -> sending LowLevelMaterialResource`](/documentation/RealityKit/LowLevelRenderContext/makeMaterialResource(descriptor:)-9nufj)

Asynchronously compiles a material resource from a geometry modifier, surface shader,
and lighting function.

### Creating meshes

[`func makeMeshResource(descriptor: LowLevelMeshResource.Descriptor) throws -> LowLevelMeshResource`](/documentation/RealityKit/LowLevelRenderContext/makeMeshResource(descriptor:))

Creates a mesh resource from the given descriptor.

[`func makeMeshPart(resource: LowLevelMeshResource, indexOffset: Int, indexCount: Int, primitive: MTLPrimitiveType, windingOrder: MTLWinding, bounds: BoundingSphereBox) throws -> LowLevelMeshPart`](/documentation/RealityKit/LowLevelRenderContext/makeMeshPart(resource:indexOffset:indexCount:primitive:windingOrder:bounds:))

Creates a mesh part that selects a contiguous range of indices from a mesh resource.

[`func makeMeshInstance(meshPart: LowLevelMeshPart, pipeline: LowLevelRenderPipelineState, geometryArguments: LowLevelArgumentTable?, surfaceArguments: LowLevelArgumentTable?, lightingArguments: LowLevelArgumentTable?, transform: simd_float4x4, sortCategory: LowLevelMeshInstance.SortCategory) throws -> LowLevelMeshInstance`](/documentation/RealityKit/LowLevelRenderContext/makeMeshInstance(meshPart:pipeline:geometryArguments:surfaceArguments:lightingArguments:transform:sortCategory:))

Creates a drawable mesh instance pairing a mesh part with a compiled pipeline state
and optional per-draw argument tables.

[`func makeMeshInstanceArray(renderTargets: LowLevelRenderTarget.DescriptorSet, count: Int) throws -> LowLevelMeshInstanceArray`](/documentation/RealityKit/LowLevelRenderContext/makeMeshInstanceArray(renderTargets:count:))

Creates a fixed-capacity ordered collection of mesh instances for the given render targets.

[`func makeInstanceTransformResource(instanceCapacity: Int) throws -> LowLevelInstanceTransformResource`](/documentation/RealityKit/LowLevelRenderContext/makeInstanceTransformResource(instanceCapacity:))

Creates a transform buffer resource for GPU instancing.

### Creating pipeline state

[`func makeRenderPipelineState(descriptor: LowLevelRenderPipelineState.Descriptor) throws -> sending LowLevelRenderPipelineState`](/documentation/RealityKit/LowLevelRenderContext/makeRenderPipelineState(descriptor:)-7j32p)

Synchronous variant of [`makeRenderPipelineState(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeRenderPipelineState(descriptor:)-7j32p). Blocks the current thread until compilation completes.

[`func makeRenderPipelineState(descriptor: LowLevelRenderPipelineState.Descriptor) async throws -> sending LowLevelRenderPipelineState`](/documentation/RealityKit/LowLevelRenderContext/makeRenderPipelineState(descriptor:)-55ty6)

Asynchronously compiles a Metal render pipeline state from the given descriptor.

[`func makeArgumentTable(descriptor: LowLevelArgumentTable.Descriptor, buffers: [LowLevelBufferSlice], textures: [LowLevelTextureResource]) throws -> LowLevelArgumentTable`](/documentation/RealityKit/LowLevelRenderContext/makeArgumentTable(descriptor:buffers:textures:))

Creates an argument table that binds the provided buffer slices and textures.

### Creating surface shaders

[`func makeSurfaceShader(descriptor: LowLevelMaterialResource.SurfaceShader.Descriptor) throws -> sending LowLevelMaterialResource.SurfaceShader`](/documentation/RealityKit/LowLevelRenderContext/makeSurfaceShader(descriptor:)-66tq8)

Synchronous variant of [`makeSurfaceShader(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeSurfaceShader(descriptor:)-66tq8). Blocks the current thread until compilation completes.

[`func makeSurfaceShader(descriptor: LowLevelMaterialResource.SurfaceShader.Descriptor) async throws -> sending LowLevelMaterialResource.SurfaceShader`](/documentation/RealityKit/LowLevelRenderContext/makeSurfaceShader(descriptor:)-9kdy6)

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

[`func makeSimpleSurfaceShader(descriptor: LowLevelMaterialResource.SimpleSurfaceDescriptor) throws -> sending LowLevelMaterialResource.SurfaceShader`](/documentation/RealityKit/LowLevelRenderContext/makeSimpleSurfaceShader(descriptor:)-74vhb)

Synchronous variant of [`makeSimpleSurfaceShader(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeSimpleSurfaceShader(descriptor:)-74vhb). Blocks the current thread until compilation completes.

[`func makeSimpleSurfaceShader(descriptor: LowLevelMaterialResource.SimpleSurfaceDescriptor) async throws -> sending LowLevelMaterialResource.SurfaceShader`](/documentation/RealityKit/LowLevelRenderContext/makeSimpleSurfaceShader(descriptor:)-14ppx)

Asynchronously creates a simple surface shader using a built-in tint color or
texture implementation, as described by the given descriptor.

### Creating geometry modifiers

[`func makeGeometryModifier(descriptor: LowLevelMaterialResource.GeometryModifier.Descriptor) throws -> sending LowLevelMaterialResource.GeometryModifier`](/documentation/RealityKit/LowLevelRenderContext/makeGeometryModifier(descriptor:)-307ec)

Synchronous variant of [`makeGeometryModifier(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeGeometryModifier(descriptor:)-307ec). Blocks the current thread until compilation completes.

[`func makeGeometryModifier(descriptor: LowLevelMaterialResource.GeometryModifier.Descriptor) async throws -> sending LowLevelMaterialResource.GeometryModifier`](/documentation/RealityKit/LowLevelRenderContext/makeGeometryModifier(descriptor:)-9tq7q)

Asynchronously creates a geometry modifier from a user-authored Metal function described
by the given descriptor.

[`func makeDefaultGeometryModifier() -> sending LowLevelMaterialResource.GeometryModifier`](/documentation/RealityKit/LowLevelRenderContext/makeDefaultGeometryModifier())

Returns a pass-through geometry modifier that performs no vertex transformation.

### Synchronizing command buffers

[`func waitForCommandBuffer(any MTLCommandBuffer)`](/documentation/RealityKit/LowLevelRenderContext/waitForCommandBuffer(_:))

Adds a command buffer that the renderer should wait on before using resources for rendering.

### Instance Properties

[`var lighting: any LowLevelRenderContextLighting`](/documentation/RealityKit/LowLevelRenderContext/lighting)

The lighting function creation interface for this context.

### Instance Methods

[`func makeGeometryModifier(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeGeometryModifier(descriptor:))

Synchronous variant of [`makeGeometryModifier(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeGeometryModifier(descriptor:)). Blocks the current thread until compilation completes.

[`func makeMaterialResource(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeMaterialResource(descriptor:))

Synchronous variant of [`makeMaterialResource(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeMaterialResource(descriptor:)). Blocks the current thread until compilation completes.

[`func makeRenderPipelineState(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeRenderPipelineState(descriptor:))

Synchronous variant of [`makeRenderPipelineState(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeRenderPipelineState(descriptor:)). Blocks the current thread until compilation completes.

[`func makeSimpleSurfaceShader(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeSimpleSurfaceShader(descriptor:))

Synchronous variant of [`makeSimpleSurfaceShader(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeSimpleSurfaceShader(descriptor:)). Blocks the current thread until compilation completes.

[`func makeSurfaceShader(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeSurfaceShader(descriptor:))

Synchronous variant of [`makeSurfaceShader(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeSurfaceShader(descriptor:)). Blocks the current thread until compilation completes.

## Relationships

### Conforming Types

[`LowLevelRenderContextStandalone`](/documentation/RealityKit/LowLevelRenderContextStandalone)

---

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)