From 390aa4a8c8655d0ae6e90079db2c85e103a96da3 Mon Sep 17 00:00:00 2001 From: Rys Sommefeldt Date: Tue, 1 Oct 2024 10:44:04 +0100 Subject: [PATCH] Anti-Lag 2 SDK v2.0.0a --- README.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9050126..abf3622 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,27 @@ In order to achieve this improved latency reduction, the game developer needs to ## FSR 3 Frame Generation Support Anti-Lag 2 requires some special attention when FSR 3 frame generation is enabled. There are a couple of extra Anti-Lag 2 functions required to be called to let Anti-Lag 2 know whether the presented frames are interpolated or not. -Until Anti-Lag 2 is supported in the public open-source release of FSR 3 (which is coming soon), developers are advised to reach out to their Developer Technology contacts at AMD. +`AMD::AntiLag2DX12::MarkEndOfFrameRendering(&context)` should be called once the game's main rendering workload has been submitted, before the FSR 3 Present call is made. + +`AMD::AntiLag2DX12::SetFrameGenFrameType(&context,bInterpolatedFrame)` also needs to be called, but FSR 3.1.1 onwards calls this for you. However, for this to work, you will need to poke some data into the DXGI swapchain's private data each frame using a specific struct format using a specific GUID. + +An example of this would look something as follows: + +```C++ +// {5083ae5b-8070-4fca-8ee5-3582dd367d13} +static const GUID IID_IFfxAntiLag2Data = + {0x5083ae5b, 0x8070, 0x4fca, {0x8e, 0xe5, 0x35, 0x82, 0xdd, 0x36, 0x7d, 0x13}}; + +struct AntiLag2Data +{ + AMD::AntiLag2DX12::Context* context; + bool enabled; +} data; + +data.context = &m_AntiLag2Context; +data.enabled = m_AntiLag2Enabled; +pSwapChain->SetPrivateData( IID_IFfxAntiLag2Data, sizeof( data ), &data ); +``` # Testing @@ -69,7 +89,7 @@ OS: # Strings -Recommended UI text can be found here: https://gpuopen.com/fidelityfx-naming-guidelines/ +Recommended UI text can be found here: https://gpuopen.com/fidelityfx-naming-guidelines/#antilag2

Open source