godotengine / godot

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

TAA is very slow on macOS #92254

Open passivestar opened 6 months ago

passivestar commented 6 months ago

Tested versions

v4.3.dev6.official [89850d553]

System information

Godot v4.3.dev6 - macOS 14.4.1 - Vulkan (Forward+) - integrated Apple M1 Max - Apple M1 Max (10 Threads)

Issue description

This is an empty project

TAA off: ~220fps TAA on: ~53fps

https://github.com/godotengine/godot/assets/60579014/fb9d21af-8e24-4af3-9a6d-6b016a2e8069

Steps to reproduce

N/A

Minimal reproduction project (MRP)

New empty project

Calinou commented 6 months ago

This seems much more extreme though, as a decrease from 220 FPS to 53 FPS means an increase in rendering time of 14.3 mspf.

Could you check if this happens with https://github.com/godotengine/godot/pull/88199 when the Metal driver is chosen in the project settings?

Also, what does performance with FSR2 at native resolution look like (in the Scaling 3D project settings)? You can leave TAA disabled in this case, as FSR2 comes with its own TAA algorithm.

shakesoda commented 6 months ago

I've been having problems with this too (& thought it was already known/reported), enabling TAA in my game on M1 brings it from about 13mspf to 43mspf @ 1280x800. FSR2 also breaks the rendering severely (and runs badly, but the frame is broken - so no surprise), so I haven't been able to test it.

Waiting on #88199 to build right now, will update about it shortly.

update: using Metal backend fixes TAA performance for me, ~11ms/f TAA off -> ~14ms/f TAA on. editor looks a little funny, but my game looks correct other than some general issues in 4.3. FSR2 is also fixed (camera motion's a little weird, but that's for some other issue)

passivestar commented 6 months ago

Could you check if this happens with https://github.com/godotengine/godot/pull/88199 when the Metal driver is chosen in the project settings?

That does fix the issue for me too. Can you edit a "closes" keyword in there so that this gets closed when its merged? (also https://github.com/godotengine/godot/issues/88064)

Also, what does performance with FSR2 at native resolution look like (in the Scaling 3D project settings)? You can leave TAA disabled in this case, as FSR2 comes with its own TAA algorithm.

What's interesting about FSR2 on mac (both Vulkan and Metal) is that it's faster to run native resolution than 0.5 scale + FSR2, which I believe defeats the purpose of turning it on

https://github.com/godotengine/godot/assets/60579014/03173ddf-b8df-4412-bbc3-094c64396225

shakesoda commented 6 months ago

What's interesting about FSR2 on mac (both Vulkan and Metal) is that it's faster to run native resolution than 0.5 scale + FSR2, which I believe defeats the purpose of turning it on

an empty scene is probably just not enough fragment shading work for fsr2's overhead to cost less than just rendering it does

Calinou commented 6 months ago

That does fix the issue for me too. Can you edit a "closes" keyword in there so that this gets closed when its merged? (also https://github.com/godotengine/godot/issues/88064)

I don't know if Metal will be made the default when it's merged, so I don't think that PR should close this issue just yet.

stuartcarnie commented 1 month ago

I'd like to explore supporting MetalFX on Apple platforms too – as that has been highly optimised by Apple for upscaling and temporal anti-aliasing on their hardware.