<!--
{
  "documentType" : "article",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/checking-the-pixel-format-of-a-postprocess-effect-s-output-texture",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Checking the pixel format of a postprocess effect’s output texture"
}
-->

# Checking the pixel format of a postprocess effect’s output texture

Make sure your postprocess effect works on all devices.

## Overview

Some device GPUs require that the output texture for postprocess effects be in a
specific format. If the current device doesn’t support <doc://com.apple.documentation/documentation/Metal/MTLGPUFamily/apple2>,
convert the output texture to <doc://com.apple.documentation/documentation/Metal/MTLPixelFormat/bgra8Unorm>
before encoding the processed framebuffer to it. An easy way to do that, is to add
a derived property to [`ARView.PostProcessContext`](/documentation/RealityKit/ARView/PostProcessContext) using an extension:

```swift
extension RealityKit.ARView.PostProcessContext {
    // Returns the output texture, ensuring that the pixel format is 
    // appropriate for the current device's GPU.
    var compatibleTargetTexture: MTLTexture! {
        if self.device.supportsFamily(.apple2) {
            return targetColorTexture
        } else {
            return targetColorTexture.makeTextureView(pixelFormat: .bgra8Unorm)!
        }
    }
}
```

If you use this derived property instead of [`targetColorTexture`](/documentation/RealityKit/ARView/PostProcessContext/targetColorTexture)
when encoding the results of a postprocess effect, it ensures the effect works on
all devices.

---

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)