---
title: "makeSpatialScaler(device:compiler:)"
framework: MetalFX
role: symbol
role_heading: Instance Method
platforms: [iOS 26.0+, iPadOS 26.0+, Mac Catalyst 26.0+, macOS 26.0+, tvOS 27.1+, visionOS 26.0+]
path: "metalfx/mtlfxspatialscalerdescriptor/makespatialscaler(device:compiler:)"
---

# makeSpatialScaler(device:compiler:)

Creates a spatial scaler instance for a Metal device.

## Declaration

```swift
func makeSpatialScaler(device: any MTLDevice, compiler: any MTL4Compiler) -> (any MTL4FXSpatialScaler)?
```

## Parameters

- `device`: The Metal device that creates the spatial scaler.
- `compiler`: A compiler instance this method can use to build pipeline state objects.

## Return Value

Return Value  A new spatial scaler instance upon success, or nil otherwise.
