mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 08:00: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
|
|
@ -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