<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalFX",
  "identifier" : "/documentation/MetalFX/MTLFXSpatialScaler",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "MetalFX"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLFXSpatialScaler"
  },
  "title" : "MTLFXSpatialScaler"
}
-->

# MTLFXSpatialScaler

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

```
protocol MTLFXSpatialScaler : MTLFXSpatialScalerBase
```

## 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`](/documentation/MetalFX/MTLFXSpatialScaler) instance following these steps:

1. Create and configure an [`MTLFXSpatialScalerDescriptor`](/documentation/MetalFX/MTLFXSpatialScalerDescriptor) instance.
2. Call the descriptor’s [`makeSpatialScaler(device:)`](/documentation/MetalFX/MTLFXSpatialScalerDescriptor/makeSpatialScaler(device:)) method.

Upscale a rendering by following these steps for every render pass:

1. Set the spatial scaler’s `MTLFXSpatialScaler/colorTexture` property to the input texture.
2. Set the scaler’s `MTLFXSpatialScaler/inputContentWidth` and `MTLFXSpatialScaler/inputContentHeight` properties.
3. Set the scaler’s `MTLFXSpatialScaler/outputTexture` property to your destination texture.
4. Encode the upscale commands to an <doc://com.apple.documentation/documentation/Metal/MTLCommandBuffer> by calling the spatial scaler’s [`encode(commandBuffer:)`](/documentation/MetalFX/MTLFXSpatialScaler/encode(commandBuffer:)) method.

## Topics

### Configuring the image input

### Configuring the image output

### Synchronizing untracked resources

### Encoding a spatial scaler

[`-  encodeToCommandBuffer:`](/documentation/MetalFX/MTLFXSpatialScaler/encode(commandBuffer:))

Adds the spatial scaler to a render pass’s command buffer.

### Inspecting the fixed settings

## Relationships

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`MTLFXSpatialScalerBase`](/documentation/MetalFX/MTLFXSpatialScalerBase)

---

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)