From a0749df85eb1d152c6da1b00ada46bcf492baa23 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 9 Mar 2026 02:10:55 -0700 Subject: [PATCH] Make wrapper framegen transfer function HDR-aware --- src/rendering/amd_fsr3_wrapper_impl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rendering/amd_fsr3_wrapper_impl.cpp b/src/rendering/amd_fsr3_wrapper_impl.cpp index 6872e28f..fc6d23b0 100644 --- a/src/rendering/amd_fsr3_wrapper_impl.cpp +++ b/src/rendering/amd_fsr3_wrapper_impl.cpp @@ -239,6 +239,7 @@ struct WrapperContext { size_t scratchBufferSize = 0; void* fsr3ContextStorage = nullptr; bool frameGenerationReady = false; + bool hdrInput = false; std::string lastError{}; #if defined(_WIN32) ID3D12Device* dx12Device = nullptr; @@ -747,6 +748,7 @@ WOWEE_FSR3_WRAPPER_EXPORT int32_t wowee_fsr3_wrapper_initialize(const WoweeFsr3W } const bool enableFrameGeneration = (initDesc->enableFlags & WOWEE_FSR3_WRAPPER_ENABLE_FRAME_GENERATION) != 0u; + ctx->hdrInput = (initDesc->enableFlags & WOWEE_FSR3_WRAPPER_ENABLE_HDR_INPUT) != 0u; if (enableFrameGeneration && (!ctx->fns.fsr3ConfigureFrameGeneration || !ctx->fns.fsr3DispatchFrameGeneration)) { destroyContext(ctx); writeError(outErrorText, outErrorTextCapacity, "backend missing frame generation symbols"); @@ -1127,7 +1129,9 @@ WOWEE_FSR3_WRAPPER_EXPORT int32_t wowee_fsr3_wrapper_dispatch_framegen(WoweeFsr3 } fgDispatch.numInterpolatedFrames = 1; fgDispatch.reset = (dispatchDesc->reset != 0u); - fgDispatch.backBufferTransferFunction = FFX_BACKBUFFER_TRANSFER_FUNCTION_SRGB; + fgDispatch.backBufferTransferFunction = ctx->hdrInput + ? FFX_BACKBUFFER_TRANSFER_FUNCTION_SCRGB + : FFX_BACKBUFFER_TRANSFER_FUNCTION_SRGB; fgDispatch.minMaxLuminance[0] = 0.0f; fgDispatch.minMaxLuminance[1] = 1.0f;