Skip to content

Repository files navigation

MSPR 2x: Metal Spatial Upscaling from Pre-Resolve MSAA

English | 简体中文

MSPR (Multisample Phase Reconstruction) is an open-source 2x spatial upscaler for Apple's Metal graphics API. In plain language, it turns the four color samples already produced by 4x MSAA into a 2x2 output block before a normal resolve averages those samples into one pixel.

MSPR is deterministic, single-frame, and model-free: no neural network, model weights, motion vectors, or temporal history are required. The included Swift and Metal demo runs on iOS, iPadOS, and macOS.

Project website · English technical report · 中文技术报告

Low-resolution 4x MSAA render → pre-resolve samples → MSPR tile kernel → 2x output

Why MSPR

  • Combines the strongest measured reconstruction with small full-path overhead. In the same archived nine-scene iPhone 13 matrix, MSPR-Quality gains 1.021 dB over Bilinear for 1.067 ms of additional full-path GPU time, while MSPR-Lite gains 0.785 dB for 0.629 ms.
  • Reuses subpixel information that normal spatial upscalers never receive. MSPR starts before MSAA resolve, not from one already-resolved image.
  • Fits Apple tile-based GPUs. The main path reconstructs inside the render pass, keeps working data tile-local, and stores only the final 2x image.
  • Offers two operating points. MSPR-Quality uses a 3x3 resolved neighborhood for stronger reconstruction; MSPR-Lite uses a fixed six-tap, barrier-free path for very low cost.
  • Is easy to inspect and integrate. The runtime is self-contained Swift and Metal shader code with locked constants and no package-manager dependencies or external runtime assets.

Results at a glance

Main result: in the same archived nine-scene iPhone 13 matrix, MSPR-Quality delivers the highest mean RGB PSNR and MSPR-Lite ranks second while adding far less full-path GPU time over Bilinear than the tested MetalFX Spatial and FSR1 paths.

Method Mean RGB PSNR ↑ 9-scene full-path GPU mean ↓ Added full-path GPU time vs Bilinear ↓
MSPR-Quality 30.301 dB 3.656 ms +1.067 ms
MSPR-Lite 30.065 dB 3.218 ms +0.629 ms
MetalFX Spatial 29.410 dB 7.606 ms +5.017 ms
Bilinear 2x 29.280 dB 2.589 ms 0 ms (reference)
In-project FSR1 EASU + RCAS 27.367 dB 8.575 ms +5.986 ms

Quality and performance come from the same archived nine-scene matrix on one physical iPhone 13. GPU time is the arithmetic scene mean of full command-buffer duration after 20 warm-up frames and 120 measured frames per mode. The final column subtracts Bilinear's 2.589 ms full-path mean; it is a same-workload path comparison, not isolated kernel timing. The Temple and full-screen-image rows are historical because their Apple demo assets are not distributed.

Archived iPhone 13 nine-scene PSNR comparison for MSPR-Quality, MSPR-Lite, MetalFX Spatial, Bilinear 2x, and FSR1

Rendered-scene example

The following fixed frame from the project-built real-time rendering set shows the same scene and output size across LR resolve, one MSAA sample, Bicubic, FSR1, MSPR-Quality, and the Direct 2x reference:

Rendered scene compared across LR resolve, MSAA sample 0, Bicubic, FSR1, MSPR-Quality, and Direct 2x reference

On the project-built 100-frame rendering set, MSPR-Quality reached 32.934 dB, 0.815 dB above Bicubic. Together with the same-matrix device table above, the evidence shows MSPR's intended advantage: stronger reconstruction than the tested spatial baselines with a comparatively small increase in full-path GPU time over Bilinear.

These measurements describe the documented devices, scenes, and comparison contracts; they are not a universal ranking across games or GPUs. MSPR is spatial and stateless, while temporal upscalers solve a different problem with motion and history inputs.

Run the demo

Requirements:

  • A Mac with Xcode 16 or newer
  • iOS/iPadOS 15 or newer, or macOS 12 or newer
  • A supported physical Apple GPU to exercise the imageblock and memoryless-MSAA path and to evaluate performance

Clone and open the self-contained Xcode project:

git clone https://github.com/long-0228/mspr2x.git
cd mspr2x
open Demo/NeuralUpsampling.xcodeproj

Then select one of the four shared schemes and press Run:

  • MSPR-Quality-iOS or MSPR-Lite-iOS
  • MSPR-Quality-macOS or MSPR-Lite-macOS

The macOS schemes and iOS Simulator are the quickest smoke-test paths and require no project dependencies. Simulator and unsupported GPUs use the texture-backed fallback. To run on a physical iPhone or iPad, select your own Development Team and replace com.example.FormulaUpsamplingDemo with a bundle identifier you control; this is Apple signing setup, not a missing project dependency.

The physical-device path is required for the documented imageblock, memoryless-MSAA, MetalFX, and performance conclusions. MetalFX is used only where the framework and device report support; otherwise the interactive metalfx mode falls back to Direct 2x.

Select a profile or comparison path

The shared schemes already select the corresponding MSPR profile. To compare paths, change NSS_RENDER_MODE in the scheme's Run environment variables:

Value Path
formula MSPR-Quality
formula_v2 MSPR-Lite
linear Bilinear 2x
fsr FSR1 EASU + RCAS
metalfx MetalFX Spatial on supported physical iOS devices
direct2x Native Direct 2x reference

The runtime includes seven project-authored procedural scenes: transparent, flat, checker, fine_lines, alpha_cutout, specular, and gradient. Select one with NSS_SCENE_FAMILY.

Reports, evidence, and reproduction scope

The archived matrix also contains temple and fullscreen_image. Their assets came from the downloadable demo accompanying Apple's Implementing order-independent transparency with image blocks documentation and were used only for testing. Because this project does not grant rights to redistribute Apple's sample assets, neither scene nor its assets are included. Obtain the demo directly from Apple and use it under Apple's applicable terms if you need to examine the original content.

The historical rows remain in the reports for disclosure, but current source reproduction covers the seven distributed procedural scenes.

Validation and project policies

Run the dependency-free release validator with the Python already available on your system:

python Demo/Tools/validate_project.py

See CONTRIBUTING.md, SECURITY.md, CODE_OF_CONDUCT.md, and THIRD_PARTY_NOTICES.md before contributing or redistributing the project.

License

Project-authored source and documentation are released under the MIT License, copyright 2026 Long Li lilong0228@gmail.com. Third-party components retain their own terms.

About

Open-source 2x Metal spatial upscaler using pre-resolve 4x MSAA samples on Apple GPUs; deterministic, tile-local, and model-free.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages