godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.46k stars 21.26k forks source link

Metal: Add MetalFX upscaling support #99603

Open stuartcarnie opened 5 days ago

stuartcarnie commented 5 days ago

🚧 Draft

This PR is not complete, as it needs to compile on other platforms. The enums will remain, but the effects will be excluded.

Summary

Introduces support for MetalFX upscaling for macOS and iOS platforms.

🚧 Overview

I'll add some numbers of the improvements.

On a MacBook Pro M1 Max, the Bistro Demo gains about a 10% improvement in performance over FSR2

stuartcarnie commented 4 days ago

MetalFX spatial also consistently was a few % faster than fsr1 and imo looks better.

I thought the same when comparing MetalFX spatial to FSR1

DarioSamo commented 3 days ago

Device and Graph changes look good to me for the most part, I left a comment about a particular quirk we might need to sort out though.

stuartcarnie commented 3 days ago

On my m2 MBA I setup a simple 30s benchmark scene moving a camera around bistro for various scaling factors and saw a roughly 19% improvement going from fsr2 to MetalFX temporal.

How did you set up the 30s benchmark? Presumably it follows the same path every time, so it is repeatable?

a-johnston commented 3 days ago

How did you set up the 30s benchmark? Presumably it follows the same path every time, so it is repeatable?

Yeah super simple, just a camera on a set position/rotation path to get a somewhat representative sample of the bistro scene with a process step that moves the camera and counts frames until 30s of benchmark have passed at which point it reports the average for that period and quits. Definitely a lot of possible improvements to make but I just wanted a rough idea of the performance difference. If it would be helpful I can make some changes to it and share it here but it took maybe a minute or two to set up.