From 1d4458738a0a9fe0e2e441d04a42eb5d68edf944 Mon Sep 17 00:00:00 2001 From: cdozdil Date: Tue, 16 Jul 2024 10:51:24 +0300 Subject: [PATCH 1/9] Added Vulkan 1.1 fallback for vkGetBufferMemoryRequirements2KHR if extension is not found Added ifdef _DEBUG for beginMarkerVK and endMarkerVK calls --- sdk/src/backends/vk/ffx_vk.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sdk/src/backends/vk/ffx_vk.cpp b/sdk/src/backends/vk/ffx_vk.cpp index e22446a9..28e41a20 100644 --- a/sdk/src/backends/vk/ffx_vk.cpp +++ b/sdk/src/backends/vk/ffx_vk.cpp @@ -1363,7 +1363,13 @@ FfxErrorCode CreateBackendContextVK(FfxInterface* backendInterface, FfxEffectBin backendContext->vkFunctionTable.vkDestroySampler = (PFN_vkDestroySampler)vkDeviceContext->vkDeviceProcAddr(backendContext->device, "vkDestroySampler"); backendContext->vkFunctionTable.vkDestroyShaderModule = (PFN_vkDestroyShaderModule)vkDeviceContext->vkDeviceProcAddr(backendContext->device, "vkDestroyShaderModule"); backendContext->vkFunctionTable.vkGetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements)vkDeviceContext->vkDeviceProcAddr(backendContext->device, "vkGetBufferMemoryRequirements"); + backendContext->vkFunctionTable.vkGetBufferMemoryRequirements2KHR = (PFN_vkGetBufferMemoryRequirements2KHR)vkDeviceContext->vkDeviceProcAddr(backendContext->device, "vkGetBufferMemoryRequirements2KHR"); + + // If extension not found try loading it from Core 1.1 + if (!backendContext->vkFunctionTable.vkGetBufferMemoryRequirements2KHR) + backendContext->vkFunctionTable.vkGetBufferMemoryRequirements2KHR = (PFN_vkGetBufferMemoryRequirements2KHR)vkDeviceContext->vkDeviceProcAddr(backendContext->device, "vkGetBufferMemoryRequirements2"); + backendContext->vkFunctionTable.vkGetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements)vkDeviceContext->vkDeviceProcAddr(backendContext->device, "vkGetImageMemoryRequirements"); backendContext->vkFunctionTable.vkAllocateDescriptorSets = (PFN_vkAllocateDescriptorSets)vkDeviceContext->vkDeviceProcAddr(backendContext->device, "vkAllocateDescriptorSets"); backendContext->vkFunctionTable.vkFreeDescriptorSets = (PFN_vkFreeDescriptorSets)vkDeviceContext->vkDeviceProcAddr(backendContext->device, "vkFreeDescriptorSets"); @@ -4031,11 +4037,12 @@ FfxErrorCode ExecuteGpuJobsVK(FfxInterface* backendInterface, FfxCommandList com { FfxGpuJobDescription* gpuJob = &backendContext->pGpuJobs[i]; +#ifdef _DEBUG // If we have a label for the job, drop a marker for it if (gpuJob->jobLabel[0]) { beginMarkerVK(backendContext, vkCommandBuffer, gpuJob->jobLabel); } - +#endif switch (gpuJob->jobType) { @@ -4062,9 +4069,11 @@ FfxErrorCode ExecuteGpuJobsVK(FfxInterface* backendInterface, FfxCommandList com default:; } +#ifdef _DEBUG if (gpuJob->jobLabel[0]) { endMarkerVK(backendContext, vkCommandBuffer); } +#endif } // check the execute function returned cleanly. From c3aa1827bacbdd8f2cc78b3f9403d9eb616181ab Mon Sep 17 00:00:00 2001 From: cdozdil Date: Fri, 1 Nov 2024 16:22:09 +0300 Subject: [PATCH 2/9] build batch files --- ffx-api/BuildFfxApiDllDx12.bat | 43 ++++++++++++++++++++++++++++++++++ ffx-api/BuildFfxApiDllVk.bat | 43 ++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 ffx-api/BuildFfxApiDllDx12.bat create mode 100644 ffx-api/BuildFfxApiDllVk.bat diff --git a/ffx-api/BuildFfxApiDllDx12.bat b/ffx-api/BuildFfxApiDllDx12.bat new file mode 100644 index 00000000..d92d2b81 --- /dev/null +++ b/ffx-api/BuildFfxApiDllDx12.bat @@ -0,0 +1,43 @@ +:: This file is part of the FidelityFX SDK. +:: +:: Copyright (C) 2024 Advanced Micro Devices, Inc. +:: +:: Permission is hereby granted, free of charge, to any person obtaining a copy +:: of this software and associated documentation files(the "Software"), to deal +:: in the Software without restriction, including without limitation the rights +:: to use, copy, modify, merge, publish, distribute, sublicense, and /or sell +:: copies of the Software, and to permit persons to whom the Software is +:: furnished to do so, subject to the following conditions : +:: +:: The above copyright notice and this permission notice shall be included in +:: all copies or substantial portions of the Software. +:: +:: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +:: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +:: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +:: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +:: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +:: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +:: THE SOFTWARE. + +@echo off + +if not exist build\ ( + mkdir build +) + +cd build +:: Clear out CMakeCache +if exist CMakeFiles\ ( + rmdir /S /Q CMakeFiles +) +if exist CMakeCache.txt ( + del /S /Q CMakeCache.txt +) +cmake -DFFX_API_BACKEND=DX12_X64 -A x64 .. %*% +cmake --build ./ --config Debug --parallel 4 -- /p:CL_MPcount=16 +cmake --build ./ --config Release --parallel 4 -- /p:CL_MPcount=16 +cmake --build ./ --config RelWithDebInfo --parallel 4 -- /p:CL_MPcount=16 + +:: Come back to root level +cd .. diff --git a/ffx-api/BuildFfxApiDllVk.bat b/ffx-api/BuildFfxApiDllVk.bat new file mode 100644 index 00000000..830465f8 --- /dev/null +++ b/ffx-api/BuildFfxApiDllVk.bat @@ -0,0 +1,43 @@ +:: This file is part of the FidelityFX SDK. +:: +:: Copyright (C) 2024 Advanced Micro Devices, Inc. +:: +:: Permission is hereby granted, free of charge, to any person obtaining a copy +:: of this software and associated documentation files(the "Software"), to deal +:: in the Software without restriction, including without limitation the rights +:: to use, copy, modify, merge, publish, distribute, sublicense, and /or sell +:: copies of the Software, and to permit persons to whom the Software is +:: furnished to do so, subject to the following conditions : +:: +:: The above copyright notice and this permission notice shall be included in +:: all copies or substantial portions of the Software. +:: +:: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +:: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +:: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +:: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +:: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +:: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +:: THE SOFTWARE. + +@echo off + +if not exist build\ ( + mkdir build +) + +cd build +:: Clear out CMakeCache +if exist CMakeFiles\ ( + rmdir /S /Q CMakeFiles +) +if exist CMakeCache.txt ( + del /S /Q CMakeCache.txt +) +cmake -DFFX_API_BACKEND=VK_X64 -A x64 .. %*% +cmake --build ./ --config Debug --parallel 4 -- /p:CL_MPcount=16 +cmake --build ./ --config Release --parallel 4 -- /p:CL_MPcount=16 +cmake --build ./ --config RelWithDebInfo --parallel 4 -- /p:CL_MPcount=16 + +:: Come back to root level +cd .. From ae0d9832563e5e60b38b61bed970fe51b9cbbd23 Mon Sep 17 00:00:00 2001 From: cdozdil Date: Mon, 4 Nov 2024 00:12:13 +0300 Subject: [PATCH 3/9] fix for RDR crash --- .../FrameInterpolationSwapchainDX12.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/src/backends/dx12/FrameInterpolationSwapchain/FrameInterpolationSwapchainDX12.cpp b/sdk/src/backends/dx12/FrameInterpolationSwapchain/FrameInterpolationSwapchainDX12.cpp index 1d3d394d..e2e483b1 100644 --- a/sdk/src/backends/dx12/FrameInterpolationSwapchain/FrameInterpolationSwapchainDX12.cpp +++ b/sdk/src/backends/dx12/FrameInterpolationSwapchain/FrameInterpolationSwapchainDX12.cpp @@ -1638,6 +1638,8 @@ HRESULT STDMETHODCALLTYPE FrameInterpolationSwapChainDX12::ResizeBuffers(UINT Bu LeaveCriticalSection(&criticalSection); + verifyBackbufferDuplicateResources(); + return hr; } From 26b9581d5de67529bc9362da84dd40d6342c8af5 Mon Sep 17 00:00:00 2001 From: cdozdil Date: Mon, 4 Nov 2024 00:12:36 +0300 Subject: [PATCH 4/9] batch files --- ffx-api/BuildFfxApiDllDx12.bat | 43 ++++++++++++++++++++++++++++++++++ ffx-api/BuildFfxApiDllVk.bat | 43 ++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 ffx-api/BuildFfxApiDllDx12.bat create mode 100644 ffx-api/BuildFfxApiDllVk.bat diff --git a/ffx-api/BuildFfxApiDllDx12.bat b/ffx-api/BuildFfxApiDllDx12.bat new file mode 100644 index 00000000..e7b94e59 --- /dev/null +++ b/ffx-api/BuildFfxApiDllDx12.bat @@ -0,0 +1,43 @@ +:: This file is part of the FidelityFX SDK. +:: +:: Copyright (C) 2024 Advanced Micro Devices, Inc. +:: +:: Permission is hereby granted, free of charge, to any person obtaining a copy +:: of this software and associated documentation files(the "Software"), to deal +:: in the Software without restriction, including without limitation the rights +:: to use, copy, modify, merge, publish, distribute, sublicense, and /or sell +:: copies of the Software, and to permit persons to whom the Software is +:: furnished to do so, subject to the following conditions : +:: +:: The above copyright notice and this permission notice shall be included in +:: all copies or substantial portions of the Software. +:: +:: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +:: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +:: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +:: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +:: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +:: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +:: THE SOFTWARE. + +@echo off + +if not exist build\ ( + mkdir build +) + +cd build +:: Clear out CMakeCache +if exist CMakeFiles\ ( + rmdir /S /Q CMakeFiles +) +if exist CMakeCache.txt ( + del /S /Q CMakeCache.txt +) +cmake .. %*% -DFFX_API_BACKEND=DX12_X64 +::cmake --build ./ --config Debug --parallel 4 -- /p:CL_MPcount=16 +::cmake --build ./ --config Release --parallel 4 -- /p:CL_MPcount=16 +cmake --build ./ --config RelWithDebInfo --parallel 4 -- /p:CL_MPcount=16 + +:: Come back to root level +cd .. diff --git a/ffx-api/BuildFfxApiDllVk.bat b/ffx-api/BuildFfxApiDllVk.bat new file mode 100644 index 00000000..6c90d774 --- /dev/null +++ b/ffx-api/BuildFfxApiDllVk.bat @@ -0,0 +1,43 @@ +:: This file is part of the FidelityFX SDK. +:: +:: Copyright (C) 2024 Advanced Micro Devices, Inc. +:: +:: Permission is hereby granted, free of charge, to any person obtaining a copy +:: of this software and associated documentation files(the "Software"), to deal +:: in the Software without restriction, including without limitation the rights +:: to use, copy, modify, merge, publish, distribute, sublicense, and /or sell +:: copies of the Software, and to permit persons to whom the Software is +:: furnished to do so, subject to the following conditions : +:: +:: The above copyright notice and this permission notice shall be included in +:: all copies or substantial portions of the Software. +:: +:: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +:: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +:: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +:: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +:: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +:: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +:: THE SOFTWARE. + +@echo off + +if not exist build\ ( + mkdir build +) + +cd build +:: Clear out CMakeCache +if exist CMakeFiles\ ( + rmdir /S /Q CMakeFiles +) +if exist CMakeCache.txt ( + del /S /Q CMakeCache.txt +) +cmake .. %*% +cmake --build ./ --config Debug --parallel 4 -- /p:CL_MPcount=16 +cmake --build ./ --config Release --parallel 4 -- /p:CL_MPcount=16 +cmake --build ./ --config RelWithDebInfo --parallel 4 -- /p:CL_MPcount=16 + +:: Come back to root level +cd .. From 7ee2ba54063f158eab87cb8275fca6c7eb688417 Mon Sep 17 00:00:00 2001 From: cdozdil Date: Tue, 14 Jan 2025 11:23:16 +0300 Subject: [PATCH 5/9] rename enum FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK to FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK_VK on vulkan --- ffx-api/include/ffx_api/vk/ffx_api_vk.h | 2 +- samples/fsrapi/fsrapirendermodule.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ffx-api/include/ffx_api/vk/ffx_api_vk.h b/ffx-api/include/ffx_api/vk/ffx_api_vk.h index dd670fad..a9fd1d89 100644 --- a/ffx-api/include/ffx_api/vk/ffx_api_vk.h +++ b/ffx-api/include/ffx_api/vk/ffx_api_vk.h @@ -101,7 +101,7 @@ struct ffxConfigureDescFrameGenerationSwapChainKeyValueVK enum FfxApiConfigureFrameGenerationSwapChainKeyVK { - FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK = 0 ///< Sets FfxWaitCallbackFunc + FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK_VK = 0 ///< Sets FfxWaitCallbackFunc }; /// Function to get the number of presents. This is useful when using frame interpolation diff --git a/samples/fsrapi/fsrapirendermodule.cpp b/samples/fsrapi/fsrapirendermodule.cpp index 6a26fb49..39463976 100644 --- a/samples/fsrapi/fsrapirendermodule.cpp +++ b/samples/fsrapi/fsrapirendermodule.cpp @@ -529,10 +529,11 @@ void FSRRenderModule::InitUI(UISection* pUISection) { #if defined(FFX_API_DX12) ffx::ConfigureDescFrameGenerationSwapChainKeyValueDX12 m_swapchainKeyValueConfig{}; + m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK; #elif defined(FFX_API_VK) ffx::ConfigureDescFrameGenerationSwapChainKeyValueVK m_swapchainKeyValueConfig{}; + m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK_VK; #endif - m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK; if (m_waitCallbackMode == 0) { m_swapchainKeyValueConfig.ptr = nullptr; From fa6303bc434cbe24a05c981035e35a9e2367a69f Mon Sep 17 00:00:00 2001 From: cdozdil Date: Tue, 14 Jan 2025 11:25:46 +0300 Subject: [PATCH 6/9] update duplicate enums --- ffx-api/include/ffx_api/vk/ffx_api_vk.h | 4 ++-- samples/fsrapi/fsrapirendermodule.cpp | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ffx-api/include/ffx_api/vk/ffx_api_vk.h b/ffx-api/include/ffx_api/vk/ffx_api_vk.h index 1f56ea6d..208ef2e8 100644 --- a/ffx-api/include/ffx_api/vk/ffx_api_vk.h +++ b/ffx-api/include/ffx_api/vk/ffx_api_vk.h @@ -102,8 +102,8 @@ struct ffxConfigureDescFrameGenerationSwapChainKeyValueVK //enum value matches enum FfxFrameInterpolationSwapchainConfigureKey enum FfxApiConfigureFrameGenerationSwapChainKeyVK { - FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK = 0, ///< Sets FfxWaitCallbackFunc - FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING = 2, ///< Sets FfxApiSwapchainFramePacingTuning casted from ptr + FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK_VK = 0, ///< Sets FfxWaitCallbackFunc + FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING_VK = 2, ///< Sets FfxApiSwapchainFramePacingTuning casted from ptr }; #define FFX_API_QUERY_DESC_TYPE_FRAMEGENERATIONSWAPCHAIN_GPU_MEMORY_USAGE_VK 0x00040009u diff --git a/samples/fsrapi/fsrapirendermodule.cpp b/samples/fsrapi/fsrapirendermodule.cpp index 2115549a..0e969ab8 100644 --- a/samples/fsrapi/fsrapirendermodule.cpp +++ b/samples/fsrapi/fsrapirendermodule.cpp @@ -600,10 +600,11 @@ void FSRRenderModule::InitUI(UISection* pUISection) [this](float, float) { #if defined(FFX_API_DX12) ffx::ConfigureDescFrameGenerationSwapChainKeyValueDX12 m_swapchainKeyValueConfig{}; + m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING; #elif defined(FFX_API_VK) ffx::ConfigureDescFrameGenerationSwapChainKeyValueVK m_swapchainKeyValueConfig{}; + m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING_VK; #endif - m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING; m_swapchainKeyValueConfig.ptr = &framePacingTuning; framePacingTuning.safetyMarginInMs = m_SafetyMarginInMs; @@ -619,10 +620,11 @@ void FSRRenderModule::InitUI(UISection* pUISection) [this](float, float) { #if defined(FFX_API_DX12) ffx::ConfigureDescFrameGenerationSwapChainKeyValueDX12 m_swapchainKeyValueConfig{}; + m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING; #elif defined(FFX_API_VK) ffx::ConfigureDescFrameGenerationSwapChainKeyValueVK m_swapchainKeyValueConfig{}; + m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING_VK; #endif - m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING; m_swapchainKeyValueConfig.ptr = &framePacingTuning; framePacingTuning.varianceFactor = m_VarianceFactor; @@ -637,10 +639,11 @@ void FSRRenderModule::InitUI(UISection* pUISection) [this](bool, bool) { #if defined(FFX_API_DX12) ffx::ConfigureDescFrameGenerationSwapChainKeyValueDX12 m_swapchainKeyValueConfig{}; + m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING; #elif defined(FFX_API_VK) ffx::ConfigureDescFrameGenerationSwapChainKeyValueVK m_swapchainKeyValueConfig{}; + m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING_VK; #endif - m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING; m_swapchainKeyValueConfig.ptr = &framePacingTuning; framePacingTuning.allowHybridSpin = m_AllowHybridSpin; @@ -655,10 +658,11 @@ void FSRRenderModule::InitUI(UISection* pUISection) [this](int32_t, int32_t) { #if defined(FFX_API_DX12) ffx::ConfigureDescFrameGenerationSwapChainKeyValueDX12 m_swapchainKeyValueConfig{}; + m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING; #elif defined(FFX_API_VK) ffx::ConfigureDescFrameGenerationSwapChainKeyValueVK m_swapchainKeyValueConfig{}; + m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING_VK; #endif - m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING; m_swapchainKeyValueConfig.ptr = &framePacingTuning; framePacingTuning.hybridSpinTime = m_HybridSpinTime; @@ -673,10 +677,11 @@ void FSRRenderModule::InitUI(UISection* pUISection) [this](bool, bool) { #if defined(FFX_API_DX12) ffx::ConfigureDescFrameGenerationSwapChainKeyValueDX12 m_swapchainKeyValueConfig{}; + m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING; #elif defined(FFX_API_VK) ffx::ConfigureDescFrameGenerationSwapChainKeyValueVK m_swapchainKeyValueConfig{}; + m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING_VK; #endif - m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING; m_swapchainKeyValueConfig.ptr = &framePacingTuning; framePacingTuning.allowWaitForSingleObjectOnFence = m_AllowWaitForSingleObjectOnFence; From e5d336a999bf2856412e7dbf6bd0fab86a4201ce Mon Sep 17 00:00:00 2001 From: cdozdil Date: Sat, 18 Jan 2025 22:48:15 +0300 Subject: [PATCH 7/9] revert back to 1.1.2 --- ffx-api/include/ffx_api/vk/ffx_api_vk.h | 10 +--------- samples/fsrapi/fsrapirendermodule.cpp | 3 +-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/ffx-api/include/ffx_api/vk/ffx_api_vk.h b/ffx-api/include/ffx_api/vk/ffx_api_vk.h index 208ef2e8..10b644b7 100644 --- a/ffx-api/include/ffx_api/vk/ffx_api_vk.h +++ b/ffx-api/include/ffx_api/vk/ffx_api_vk.h @@ -102,15 +102,7 @@ struct ffxConfigureDescFrameGenerationSwapChainKeyValueVK //enum value matches enum FfxFrameInterpolationSwapchainConfigureKey enum FfxApiConfigureFrameGenerationSwapChainKeyVK { - FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK_VK = 0, ///< Sets FfxWaitCallbackFunc - FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING_VK = 2, ///< Sets FfxApiSwapchainFramePacingTuning casted from ptr -}; - -#define FFX_API_QUERY_DESC_TYPE_FRAMEGENERATIONSWAPCHAIN_GPU_MEMORY_USAGE_VK 0x00040009u -struct ffxQueryFrameGenerationSwapChainGetGPUMemoryUsageVK -{ - ffxQueryDescHeader header; - struct FfxApiEffectMemoryUsage* gpuMemoryUsageFrameGenerationSwapchain; + FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK = 0 ///< Sets FfxWaitCallbackFunc }; /// Function to get the number of presents. This is useful when using frame interpolation diff --git a/samples/fsrapi/fsrapirendermodule.cpp b/samples/fsrapi/fsrapirendermodule.cpp index 0e969ab8..de0da49f 100644 --- a/samples/fsrapi/fsrapirendermodule.cpp +++ b/samples/fsrapi/fsrapirendermodule.cpp @@ -573,11 +573,10 @@ void FSRRenderModule::InitUI(UISection* pUISection) { #if defined(FFX_API_DX12) ffx::ConfigureDescFrameGenerationSwapChainKeyValueDX12 m_swapchainKeyValueConfig{}; - m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK; #elif defined(FFX_API_VK) ffx::ConfigureDescFrameGenerationSwapChainKeyValueVK m_swapchainKeyValueConfig{}; - m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK_VK; #endif + m_swapchainKeyValueConfig.key = FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK; if (m_waitCallbackMode == 0) { m_swapchainKeyValueConfig.ptr = nullptr; From 3ca5cad5f46988dca365923ddbb5919b2168a79d Mon Sep 17 00:00:00 2001 From: cdozdil Date: Sat, 18 Jan 2025 22:53:53 +0300 Subject: [PATCH 8/9] rename VK enum --- ffx-api/include/ffx_api/vk/ffx_api_vk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffx-api/include/ffx_api/vk/ffx_api_vk.h b/ffx-api/include/ffx_api/vk/ffx_api_vk.h index 10b644b7..0b17cffc 100644 --- a/ffx-api/include/ffx_api/vk/ffx_api_vk.h +++ b/ffx-api/include/ffx_api/vk/ffx_api_vk.h @@ -102,7 +102,7 @@ struct ffxConfigureDescFrameGenerationSwapChainKeyValueVK //enum value matches enum FfxFrameInterpolationSwapchainConfigureKey enum FfxApiConfigureFrameGenerationSwapChainKeyVK { - FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK = 0 ///< Sets FfxWaitCallbackFunc + FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK_VK = 0 ///< Sets FfxWaitCallbackFunc }; /// Function to get the number of presents. This is useful when using frame interpolation From b5c29d14a2862eda010a069a3e50b74528a6ac69 Mon Sep 17 00:00:00 2001 From: cdozdil Date: Sat, 18 Jan 2025 22:54:01 +0300 Subject: [PATCH 9/9] update build batch files --- ffx-api/BuildFfxApiDllDx12.bat | 4 ++-- ffx-api/BuildFfxApiDllVk.bat | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ffx-api/BuildFfxApiDllDx12.bat b/ffx-api/BuildFfxApiDllDx12.bat index 263025b5..e4974736 100644 --- a/ffx-api/BuildFfxApiDllDx12.bat +++ b/ffx-api/BuildFfxApiDllDx12.bat @@ -36,8 +36,8 @@ if exist CMakeCache.txt ( ) cmake .. %*% -DFFX_API_BACKEND=DX12_X64 ::cmake --build ./ --config Debug --parallel 4 -- /p:CL_MPcount=16 -::cmake --build ./ --config Release --parallel 4 -- /p:CL_MPcount=16 -cmake --build ./ --config RelWithDebInfo --parallel 4 -- /p:CL_MPcount=16 +cmake --build ./ --config Release --parallel 4 -- /p:CL_MPcount=16 +::cmake --build ./ --config RelWithDebInfo --parallel 4 -- /p:CL_MPcount=16 :: Come back to root level cd .. diff --git a/ffx-api/BuildFfxApiDllVk.bat b/ffx-api/BuildFfxApiDllVk.bat index 830465f8..3a8524ec 100644 --- a/ffx-api/BuildFfxApiDllVk.bat +++ b/ffx-api/BuildFfxApiDllVk.bat @@ -35,9 +35,9 @@ if exist CMakeCache.txt ( del /S /Q CMakeCache.txt ) cmake -DFFX_API_BACKEND=VK_X64 -A x64 .. %*% -cmake --build ./ --config Debug --parallel 4 -- /p:CL_MPcount=16 +::cmake --build ./ --config Debug --parallel 4 -- /p:CL_MPcount=16 cmake --build ./ --config Release --parallel 4 -- /p:CL_MPcount=16 -cmake --build ./ --config RelWithDebInfo --parallel 4 -- /p:CL_MPcount=16 +::cmake --build ./ --config RelWithDebInfo --parallel 4 -- /p:CL_MPcount=16 :: Come back to root level cd ..