---
title: MTLFXSpatialScaler
framework: MetalFX
role: symbol
role_heading: Protocol
platforms: [iOS 16.0+, iPadOS 16.0+, Mac Catalyst 16.0+, macOS 13.0+, tvOS 27.1+, visionOS 1.0+]
path: metalfx/mtlfxspatialscaler
---

# MTLFXSpatialScaler

An upscaling effect that generates a higher resolution texture in a render pass by spatially analyzing an input texture.

## Declaration

```swift
protocol MTLFXSpatialScaler : MTLFXSpatialScalerBase
```

## Overview

Overview The MetalFX spatial scaler increases the size of your input texture to a larger output texture. You can use the scaler to upscale every frame of your app’s scene or rendering in real time. With a scaler, you can draw more complicated scenes in less time by intentionally rendering to a lower resolution to save time before upscaling. Create an MTLFXSpatialScaler instance following these steps: Create and configure an MTLFXSpatialScalerDescriptor instance. Call the descriptor’s makeSpatialScaler(device:) method. Upscale a rendering by following these steps for every render pass: Set the spatial scaler’s MTLFXSpatialScaler/colorTexture property to the input texture. Set the scaler’s MTLFXSpatialScaler/inputContentWidth and MTLFXSpatialScaler/inputContentHeight properties. Set the scaler’s MTLFXSpatialScaler/outputTexture property to your destination texture. Encode the upscale commands to an MTLCommandBuffer by calling the spatial scaler’s encode(commandBuffer:) method.

## Topics

### Encoding a spatial scaler

- [encode(commandBuffer:)](metalfx/mtlfxspatialscaler/encode(commandbuffer:).md)

## Relationships

### Inherits From

- [MTLFXSpatialScalerBase](metalfx/mtlfxspatialscalerbase.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Spatial scaling

- [MTLFXSpatialScalerDescriptor](metalfx/mtlfxspatialscalerdescriptor.md)
- [MTLFXSpatialScalerColorProcessingMode](metalfx/mtlfxspatialscalercolorprocessingmode.md)
