mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Make FSR3 SDK integration Kits-only and align CI/docs
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
This commit is contained in:
parent
e916ef9bda
commit
ae48e4d7a6
6 changed files with 26 additions and 118 deletions
27
.github/workflows/build.yml
vendored
27
.github/workflows/build.yml
vendored
|
|
@ -82,30 +82,15 @@ jobs:
|
|||
echo "WoWee CMake will bootstrap vendored headers."
|
||||
fi
|
||||
|
||||
- name: Check FidelityFX-SDK Vulkan framegen files
|
||||
- name: Check FidelityFX-SDK Kits framegen headers
|
||||
run: |
|
||||
set -euo pipefail
|
||||
SDK_DIR="$PWD/extern/FidelityFX-SDK/sdk"
|
||||
KITS_DIR="$PWD/extern/FidelityFX-SDK/Kits/FidelityFX"
|
||||
LEGACY_OK=0
|
||||
KITS_OK=0
|
||||
if [ -f "$SDK_DIR/include/FidelityFX/host/ffx_frameinterpolation.h" ]; then
|
||||
LEGACY_OK=1
|
||||
fi
|
||||
if [ -f "$KITS_DIR/framegeneration/include/ffx_framegeneration.h" ]; then
|
||||
KITS_OK=1
|
||||
fi
|
||||
|
||||
if [ "$LEGACY_OK" -eq 1 ] && [ -f "$SDK_DIR/include/FidelityFX/gpu/frameinterpolation/ffx_frameinterpolation_callbacks_glsl.h" ] \
|
||||
&& [ -f "$SDK_DIR/include/FidelityFX/gpu/opticalflow/ffx_opticalflow_callbacks_glsl.h" ] \
|
||||
&& [ -f "$SDK_DIR/src/backends/vk/CMakeShadersFrameinterpolation.txt" ] \
|
||||
&& [ -f "$SDK_DIR/src/backends/vk/CMakeShadersOpticalflow.txt" ]; then
|
||||
echo "FidelityFX-SDK legacy Vulkan framegen files detected."
|
||||
elif [ "$KITS_OK" -eq 1 ]; then
|
||||
echo "FidelityFX-SDK Kits layout detected (DX12-focused framegeneration APIs available)."
|
||||
else
|
||||
echo "FidelityFX-SDK Vulkan framegen files are missing in this checkout; build continues."
|
||||
fi
|
||||
test -f "$KITS_DIR/upscalers/fsr3/include/ffx_fsr3upscaler.h"
|
||||
test -f "$KITS_DIR/framegeneration/fsr3/include/ffx_frameinterpolation.h"
|
||||
test -f "$KITS_DIR/framegeneration/fsr3/include/ffx_opticalflow.h"
|
||||
test -f "$KITS_DIR/backend/vk/ffx_vk.h"
|
||||
echo "FidelityFX-SDK Kits framegen headers detected."
|
||||
|
||||
- name: Configure (AMD ON)
|
||||
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DWOWEE_ENABLE_AMD_FSR2=ON
|
||||
|
|
|
|||
|
|
@ -95,22 +95,9 @@ else()
|
|||
endif()
|
||||
|
||||
# AMD FidelityFX SDK (FSR3 frame generation interfaces) detection under extern/FidelityFX-SDK
|
||||
set(WOWEE_AMD_FFX_SDK_DIR ${CMAKE_SOURCE_DIR}/extern/FidelityFX-SDK/sdk)
|
||||
set(WOWEE_AMD_FFX_SDK_KITS_DIR ${CMAKE_SOURCE_DIR}/extern/FidelityFX-SDK/Kits/FidelityFX)
|
||||
set(WOWEE_AMD_FFX_SDK_FI_HEADER ${WOWEE_AMD_FFX_SDK_DIR}/include/FidelityFX/host/ffx_frameinterpolation.h)
|
||||
set(WOWEE_AMD_FFX_SDK_OF_HEADER ${WOWEE_AMD_FFX_SDK_DIR}/include/FidelityFX/host/ffx_opticalflow.h)
|
||||
set(WOWEE_AMD_FFX_SDK_FSR3_HEADER ${WOWEE_AMD_FFX_SDK_DIR}/include/FidelityFX/host/ffx_fsr3upscaler.h)
|
||||
set(WOWEE_AMD_FFX_SDK_VK_HEADER ${WOWEE_AMD_FFX_SDK_DIR}/include/FidelityFX/host/backends/vk/ffx_vk.h)
|
||||
set(WOWEE_AMD_FFX_SDK_KITS_FG_HEADER ${WOWEE_AMD_FFX_SDK_KITS_DIR}/framegeneration/include/ffx_framegeneration.h)
|
||||
|
||||
set(WOWEE_AMD_FFX_SDK_LEGACY_READY FALSE)
|
||||
if(EXISTS ${WOWEE_AMD_FFX_SDK_FI_HEADER}
|
||||
AND EXISTS ${WOWEE_AMD_FFX_SDK_OF_HEADER}
|
||||
AND EXISTS ${WOWEE_AMD_FFX_SDK_FSR3_HEADER}
|
||||
AND EXISTS ${WOWEE_AMD_FFX_SDK_VK_HEADER})
|
||||
set(WOWEE_AMD_FFX_SDK_LEGACY_READY TRUE)
|
||||
endif()
|
||||
|
||||
set(WOWEE_AMD_FFX_SDK_KITS_READY FALSE)
|
||||
if(EXISTS ${WOWEE_AMD_FFX_SDK_KITS_DIR}/upscalers/fsr3/include/ffx_fsr3upscaler.h
|
||||
AND EXISTS ${WOWEE_AMD_FFX_SDK_KITS_DIR}/framegeneration/fsr3/include/ffx_frameinterpolation.h
|
||||
|
|
@ -119,14 +106,9 @@ if(EXISTS ${WOWEE_AMD_FFX_SDK_KITS_DIR}/upscalers/fsr3/include/ffx_fsr3upscaler.
|
|||
set(WOWEE_AMD_FFX_SDK_KITS_READY TRUE)
|
||||
endif()
|
||||
|
||||
if(WOWEE_ENABLE_AMD_FSR3_FRAMEGEN AND (WOWEE_AMD_FFX_SDK_LEGACY_READY OR WOWEE_AMD_FFX_SDK_KITS_READY))
|
||||
if(WOWEE_AMD_FFX_SDK_LEGACY_READY)
|
||||
message(STATUS "AMD FidelityFX-SDK framegen headers detected at ${WOWEE_AMD_FFX_SDK_DIR} (legacy layout)")
|
||||
add_compile_definitions(WOWEE_AMD_FFX_SDK_KITS=0)
|
||||
else()
|
||||
message(STATUS "AMD FidelityFX-SDK framegen headers detected at ${WOWEE_AMD_FFX_SDK_KITS_DIR} (Kits layout)")
|
||||
add_compile_definitions(WOWEE_AMD_FFX_SDK_KITS=1)
|
||||
endif()
|
||||
if(WOWEE_ENABLE_AMD_FSR3_FRAMEGEN AND WOWEE_AMD_FFX_SDK_KITS_READY)
|
||||
message(STATUS "AMD FidelityFX-SDK framegen headers detected at ${WOWEE_AMD_FFX_SDK_KITS_DIR} (Kits layout)")
|
||||
add_compile_definitions(WOWEE_AMD_FFX_SDK_KITS=1)
|
||||
add_compile_definitions(WOWEE_HAS_AMD_FSR3_FRAMEGEN=1)
|
||||
add_library(wowee_fsr3_framegen_amd_vk_probe STATIC
|
||||
src/rendering/amd_fsr3_framegen_probe.cpp
|
||||
|
|
@ -135,23 +117,17 @@ if(WOWEE_ENABLE_AMD_FSR3_FRAMEGEN AND (WOWEE_AMD_FFX_SDK_LEGACY_READY OR WOWEE_A
|
|||
CXX_STANDARD 17
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
)
|
||||
if(WOWEE_AMD_FFX_SDK_LEGACY_READY)
|
||||
target_include_directories(wowee_fsr3_framegen_amd_vk_probe PUBLIC
|
||||
${WOWEE_AMD_FFX_SDK_DIR}/include
|
||||
)
|
||||
else()
|
||||
target_include_directories(wowee_fsr3_framegen_amd_vk_probe PUBLIC
|
||||
${WOWEE_AMD_FFX_SDK_KITS_DIR}/upscalers/fsr3/include
|
||||
${WOWEE_AMD_FFX_SDK_KITS_DIR}/framegeneration/fsr3/include
|
||||
${WOWEE_AMD_FFX_SDK_KITS_DIR}/framegeneration/include
|
||||
${WOWEE_AMD_FFX_SDK_KITS_DIR}/backend/vk
|
||||
${WOWEE_AMD_FFX_SDK_KITS_DIR}/api/internal
|
||||
${WOWEE_AMD_FFX_SDK_KITS_DIR}/api/include
|
||||
)
|
||||
endif()
|
||||
target_include_directories(wowee_fsr3_framegen_amd_vk_probe PUBLIC
|
||||
${WOWEE_AMD_FFX_SDK_KITS_DIR}/upscalers/fsr3/include
|
||||
${WOWEE_AMD_FFX_SDK_KITS_DIR}/framegeneration/fsr3/include
|
||||
${WOWEE_AMD_FFX_SDK_KITS_DIR}/framegeneration/include
|
||||
${WOWEE_AMD_FFX_SDK_KITS_DIR}/backend/vk
|
||||
${WOWEE_AMD_FFX_SDK_KITS_DIR}/api/internal
|
||||
${WOWEE_AMD_FFX_SDK_KITS_DIR}/api/include
|
||||
)
|
||||
target_link_libraries(wowee_fsr3_framegen_amd_vk_probe PUBLIC Vulkan::Vulkan)
|
||||
|
||||
if(WOWEE_BUILD_AMD_FSR3_RUNTIME AND WOWEE_AMD_FFX_SDK_KITS_READY)
|
||||
if(WOWEE_BUILD_AMD_FSR3_RUNTIME)
|
||||
message(STATUS "AMD FSR3 Path A runtime target enabled: build with target 'wowee_fsr3_official_runtime_copy'")
|
||||
set(WOWEE_AMD_FSR3_RUNTIME_BUILD_DIR ${CMAKE_BINARY_DIR}/ffx_sdk_runtime_build)
|
||||
if(WIN32)
|
||||
|
|
@ -211,12 +187,9 @@ else()
|
|||
add_compile_definitions(WOWEE_AMD_FFX_SDK_KITS=0)
|
||||
if(WOWEE_ENABLE_AMD_FSR3_FRAMEGEN)
|
||||
if(EXISTS ${WOWEE_AMD_FFX_SDK_KITS_FG_HEADER})
|
||||
message(STATUS "FidelityFX-SDK Kits layout detected at ${WOWEE_AMD_FFX_SDK_KITS_DIR}, "
|
||||
"but legacy sdk/include headers required by WoWee FSR3 probe/runtime are not present. "
|
||||
"FSR3 framegen interface probe disabled.")
|
||||
message(STATUS "FidelityFX-SDK Kits layout detected at ${WOWEE_AMD_FFX_SDK_KITS_DIR}, but required FSR3 headers are incomplete. FSR3 framegen interface probe disabled.")
|
||||
else()
|
||||
message(WARNING "AMD FidelityFX-SDK framegen headers not found at ${WOWEE_AMD_FFX_SDK_DIR}; "
|
||||
"FSR3 framegen interface probe disabled.")
|
||||
message(WARNING "AMD FidelityFX-SDK Kits headers not found at ${WOWEE_AMD_FFX_SDK_KITS_DIR}; FSR3 framegen interface probe disabled.")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ make -j$(nproc)
|
|||
- GitHub Actions builds on every push: Linux (x86-64, ARM64), Windows (x86-64, ARM64 via MSYS2), macOS (ARM64)
|
||||
- All build jobs are AMD-FSR2-only (`WOWEE_ENABLE_AMD_FSR2=ON`) and explicitly build `wowee_fsr2_amd_vk`
|
||||
- Each job clones AMD's FSR2 SDK and FidelityFX-SDK (`Kelsidavis/FidelityFX-SDK`, `main` by default)
|
||||
- Linux CI checks FidelityFX-SDK framegen files and supports both legacy (`sdk/...`) and Kits layouts
|
||||
- Linux CI validates FidelityFX-SDK Kits framegen headers
|
||||
- CI builds `wowee_fsr3_framegen_amd_vk_probe` when that target is generated for the detected SDK layout
|
||||
- If FSR2 generated Vulkan permutation headers are absent upstream, WoWee bootstraps them from `third_party/fsr2_vk_permutations`
|
||||
- Container build via `container/build-in-container.sh` (Podman)
|
||||
|
|
|
|||
|
|
@ -71,11 +71,11 @@ Runtime note:
|
|||
- All build jobs clone:
|
||||
- `GPUOpen-Effects/FidelityFX-FSR2` (`master`)
|
||||
- `Kelsidavis/FidelityFX-SDK` (`main`) by default
|
||||
- Linux CI additionally checks FidelityFX-SDK framegen files (legacy `sdk/...` and Kits layouts):
|
||||
- `ffx_frameinterpolation_callbacks_glsl.h`
|
||||
- `ffx_opticalflow_callbacks_glsl.h`
|
||||
- `CMakeShadersFrameinterpolation.txt`
|
||||
- `CMakeShadersOpticalflow.txt`
|
||||
- Linux CI validates FidelityFX-SDK Kits framegen headers:
|
||||
- `upscalers/fsr3/include/ffx_fsr3upscaler.h`
|
||||
- `framegeneration/fsr3/include/ffx_frameinterpolation.h`
|
||||
- `framegeneration/fsr3/include/ffx_opticalflow.h`
|
||||
- `backend/vk/ffx_vk.h`
|
||||
- CI builds `wowee_fsr3_framegen_amd_vk_probe` when that target is generated by CMake for the detected SDK layout.
|
||||
- Some upstream SDK checkouts do not include generated Vulkan permutation headers.
|
||||
- WoWee bootstraps those headers from the vendored snapshot so AMD backend builds remain cross-platform and deterministic.
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
#include <cstddef>
|
||||
#if WOWEE_AMD_FFX_SDK_KITS
|
||||
#include <ffx_fsr3upscaler.h>
|
||||
#include <ffx_frameinterpolation.h>
|
||||
#include <ffx_opticalflow.h>
|
||||
#include <ffx_vk.h>
|
||||
#else
|
||||
#include <FidelityFX/host/ffx_fsr3upscaler.h>
|
||||
#include <FidelityFX/host/ffx_frameinterpolation.h>
|
||||
#include <FidelityFX/host/ffx_opticalflow.h>
|
||||
#include <FidelityFX/host/backends/vk/ffx_vk.h>
|
||||
#endif
|
||||
|
||||
namespace wowee::rendering {
|
||||
|
||||
|
|
@ -21,11 +14,7 @@ bool amdFsr3FramegenCompileProbe() {
|
|||
FfxFrameInterpolationContext fiContext{};
|
||||
FfxOpticalflowContext ofContext{};
|
||||
FfxInterface backend{};
|
||||
#if WOWEE_AMD_FFX_SDK_KITS
|
||||
FfxApiDimensions2D renderSize{};
|
||||
#else
|
||||
FfxDimensions2D renderSize{};
|
||||
#endif
|
||||
|
||||
static_assert(FFX_FSR3UPSCALER_VERSION_MAJOR >= 3, "Expected FSR3 upscaler v3+");
|
||||
static_assert(FFX_FRAMEINTERPOLATION_VERSION_MAJOR >= 1, "Expected frame interpolation v1+");
|
||||
|
|
|
|||
|
|
@ -16,13 +16,8 @@
|
|||
#endif
|
||||
|
||||
#if WOWEE_HAS_AMD_FSR3_FRAMEGEN
|
||||
#if WOWEE_AMD_FFX_SDK_KITS
|
||||
#include "third_party/ffx_fsr3_legacy_compat.h"
|
||||
#include <ffx_vk.h>
|
||||
#else
|
||||
#include <FidelityFX/host/ffx_fsr3.h>
|
||||
#include <FidelityFX/host/backends/vk/ffx_vk.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace wowee::rendering {
|
||||
|
|
@ -238,11 +233,7 @@ bool AmdFsr3Runtime::initialize(const AmdFsr3RuntimeInitDesc& desc) {
|
|||
return false;
|
||||
}
|
||||
|
||||
#if WOWEE_AMD_FFX_SDK_KITS
|
||||
scratchBufferSize_ = fns_->getScratchMemorySizeVK(FFX_FSR3_CONTEXT_COUNT);
|
||||
#else
|
||||
scratchBufferSize_ = fns_->getScratchMemorySizeVK(desc.physicalDevice, FFX_FSR3_CONTEXT_COUNT);
|
||||
#endif
|
||||
if (scratchBufferSize_ == 0) {
|
||||
LOG_WARNING("FSR3 runtime: scratch buffer size query returned 0.");
|
||||
lastError_ = "scratch buffer size query returned 0";
|
||||
|
|
@ -258,24 +249,11 @@ bool AmdFsr3Runtime::initialize(const AmdFsr3RuntimeInitDesc& desc) {
|
|||
return false;
|
||||
}
|
||||
|
||||
#if WOWEE_AMD_FFX_SDK_KITS
|
||||
FfxDevice ffxDevice = fns_->getDeviceVK(desc.device);
|
||||
#else
|
||||
VkDeviceContext vkDevCtx{};
|
||||
vkDevCtx.vkDevice = desc.device;
|
||||
vkDevCtx.vkPhysicalDevice = desc.physicalDevice;
|
||||
vkDevCtx.vkDeviceProcAddr = desc.getDeviceProcAddr;
|
||||
FfxDevice ffxDevice = fns_->getDeviceVK(&vkDevCtx);
|
||||
#endif
|
||||
|
||||
FfxInterface backendShared{};
|
||||
#if WOWEE_AMD_FFX_SDK_KITS
|
||||
FfxErrorCode ifaceErr = fns_->getInterfaceVK(
|
||||
&backendShared, ffxDevice, desc.physicalDevice, scratchBuffer_, scratchBufferSize_, FFX_FSR3_CONTEXT_COUNT);
|
||||
#else
|
||||
FfxErrorCode ifaceErr = fns_->getInterfaceVK(
|
||||
&backendShared, ffxDevice, scratchBuffer_, scratchBufferSize_, FFX_FSR3_CONTEXT_COUNT);
|
||||
#endif
|
||||
if (ifaceErr != FFX_OK) {
|
||||
LOG_WARNING("FSR3 runtime: ffxGetInterfaceVK failed (", static_cast<int>(ifaceErr), ").");
|
||||
lastError_ = "ffxGetInterfaceVK failed";
|
||||
|
|
@ -386,23 +364,13 @@ bool AmdFsr3Runtime::dispatchUpscale(const AmdFsr3RuntimeDispatchDesc& desc) {
|
|||
static wchar_t kDepthName[] = L"FSR3_Depth";
|
||||
static wchar_t kMotionName[] = L"FSR3_MotionVectors";
|
||||
static wchar_t kOutputName[] = L"FSR3_Output";
|
||||
#if WOWEE_AMD_FFX_SDK_KITS
|
||||
dispatch.color = fns_->getResourceVK(desc.colorImage, colorDesc, kColorName, FFX_RESOURCE_STATE_COMPUTE_READ);
|
||||
dispatch.depth = fns_->getResourceVK(desc.depthImage, depthDesc, kDepthName, FFX_RESOURCE_STATE_COMPUTE_READ);
|
||||
dispatch.motionVectors = fns_->getResourceVK(desc.motionVectorImage, mvDesc, kMotionName, FFX_RESOURCE_STATE_COMPUTE_READ);
|
||||
#else
|
||||
dispatch.color = fns_->getResourceVK(reinterpret_cast<void*>(desc.colorImage), colorDesc, kColorName, FFX_RESOURCE_STATE_COMPUTE_READ);
|
||||
dispatch.depth = fns_->getResourceVK(reinterpret_cast<void*>(desc.depthImage), depthDesc, kDepthName, FFX_RESOURCE_STATE_COMPUTE_READ);
|
||||
dispatch.motionVectors = fns_->getResourceVK(reinterpret_cast<void*>(desc.motionVectorImage), mvDesc, kMotionName, FFX_RESOURCE_STATE_COMPUTE_READ);
|
||||
#endif
|
||||
dispatch.exposure = FfxResource{};
|
||||
dispatch.reactive = FfxResource{};
|
||||
dispatch.transparencyAndComposition = FfxResource{};
|
||||
#if WOWEE_AMD_FFX_SDK_KITS
|
||||
dispatch.upscaleOutput = fns_->getResourceVK(desc.outputImage, outDesc, kOutputName, FFX_RESOURCE_STATE_UNORDERED_ACCESS);
|
||||
#else
|
||||
dispatch.upscaleOutput = fns_->getResourceVK(reinterpret_cast<void*>(desc.outputImage), outDesc, kOutputName, FFX_RESOURCE_STATE_UNORDERED_ACCESS);
|
||||
#endif
|
||||
dispatch.jitterOffset.x = desc.jitterX;
|
||||
dispatch.jitterOffset.y = desc.jitterY;
|
||||
dispatch.motionVectorScale.x = desc.motionScaleX;
|
||||
|
|
@ -459,17 +427,10 @@ bool AmdFsr3Runtime::dispatchFrameGeneration(const AmdFsr3RuntimeDispatchDesc& d
|
|||
static wchar_t kInterpolatedName[] = L"FSR3_InterpolatedOutput";
|
||||
FfxFrameGenerationDispatchDescription fgDispatch{};
|
||||
fgDispatch.commandList = fns_->getCommandListVK(desc.commandBuffer);
|
||||
#if WOWEE_AMD_FFX_SDK_KITS
|
||||
fgDispatch.presentColor = fns_->getResourceVK(
|
||||
desc.outputImage, presentDesc, kPresentName, FFX_RESOURCE_STATE_COMPUTE_READ);
|
||||
fgDispatch.outputs[0] = fns_->getResourceVK(
|
||||
desc.frameGenOutputImage, fgOutDesc, kInterpolatedName, FFX_RESOURCE_STATE_UNORDERED_ACCESS);
|
||||
#else
|
||||
fgDispatch.presentColor = fns_->getResourceVK(
|
||||
reinterpret_cast<void*>(desc.outputImage), presentDesc, kPresentName, FFX_RESOURCE_STATE_COMPUTE_READ);
|
||||
fgDispatch.outputs[0] = fns_->getResourceVK(
|
||||
reinterpret_cast<void*>(desc.frameGenOutputImage), fgOutDesc, kInterpolatedName, FFX_RESOURCE_STATE_UNORDERED_ACCESS);
|
||||
#endif
|
||||
fgDispatch.numInterpolatedFrames = 1;
|
||||
fgDispatch.reset = desc.reset;
|
||||
fgDispatch.backBufferTransferFunction = FFX_BACKBUFFER_TRANSFER_FUNCTION_SRGB;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue