godot-proposals icon indicating copy to clipboard operation
godot-proposals copied to clipboard

Add support for AMD Anti-Lag 2

Open frabert opened this issue 1 year ago • 5 comments

Describe the project you are working on

N/A

Describe the problem or limitation you are having in your project

This is not meant to solve a specific problem -- the idea is to integrate AMD Anti-Lag 2 features in the engine to reduce click to image-on-screen latency when using DirectX 12 on RDNA1/2 AMD cards.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

AMD Anti-Lag 2 introduces wait times before input polling in order to reduce the time between when an input is received and when a frame is displayed.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

When the feature is enabled and proper runtime support is detected, the AMD Radeon driver is invoked before input polling to activate the lag-reduction measures.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No -- this requires interacting with the AMD Radeon drivers to function.

Is there a reason why this should be core and not an add-on in the asset library?

This requires integration with the core rendering and input polling loop.

I've opened a PR for this: https://github.com/godotengine/godot/pull/96991

frabert avatar Sep 14 '24 11:09 frabert

it looks that is only for amd hardware, i think latency-flex is better alternative

https://github.com/ishitatsuyuki/LatencyFleX

octanejohn avatar Sep 15 '24 00:09 octanejohn

This seems like it may be Linux only on the other hand - https://github.com/ishitatsuyuki/LatencyFleX/issues/3

Also Calinou already asked about this issue with no reply a couple of years ago - https://github.com/ishitatsuyuki/LatencyFleX/issues/22

so this would end up benefiting even less people likely, as a ton of people on linux tend to go with AMD anyway due to Nvidia's Linux drivers being historically trash.

Though Great catch non the less, and a hardware agnostic solution would be amazing if they perform similarly.

mrjustaguy avatar Sep 15 '24 11:09 mrjustaguy

Please note that Anti-Lag would only work with DirectX 12 and requires AMD drivers, no Linux support in this case.

frabert avatar Sep 15 '24 11:09 frabert

Please note that Anti-Lag would only work with DirectX 12 and requires AMD drivers, no Linux support in this case.

There's a Vulkan extension for anti-lag: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_AMD_anti_lag.html

There's also a Nvidia Reflex extension: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_low_latency2.html

sakrel avatar Sep 15 '24 11:09 sakrel

LatencyFleX looks to be outdated / no longer in active development, and is Linux only. For this reason alone I think Radeon anti-lag would be a better fit

it looks that is only for amd hardware, i think latency-flex is better alternative

https://github.com/ishitatsuyuki/LatencyFleX

btarg avatar Sep 15 '24 13:09 btarg