---
title: "makeCompiler(descriptor:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtldevice/makecompiler(descriptor:)"
---

# makeCompiler(descriptor:)

Creates a new compiler from a compiler descriptor.

## Declaration

```swift
func makeCompiler(descriptor: MTL4CompilerDescriptor) throws -> any MTL4Compiler
```

## Parameters

- `descriptor`: A doc://com.apple.metal/documentation/Metal/MTL4CompilerDescriptor instance that configures the doc://com.apple.metal/documentation/Metal/MTL4Compiler instance.

## Return Value

Return Value A MTL4Compiler instance, or nil if the function failed.
