From f89d35cf48b184b37c019f4dcd9ef28fa1a36d3a Mon Sep 17 00:00:00 2001 From: FakeMichau <49685661+FakeMichau@users.noreply.github.com> Date: Fri, 26 Jun 2026 01:02:10 +0200 Subject: [PATCH] Don't link FSRFG camera struct if it's just all zeros Should fix an issue where driver upgrade FG would fallback to FSR 3 FG when using OptiFG --- OptiScaler/framegen/ffx/FSRFG_Dx12.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/OptiScaler/framegen/ffx/FSRFG_Dx12.cpp b/OptiScaler/framegen/ffx/FSRFG_Dx12.cpp index 9df4a540..c35a4a7c 100644 --- a/OptiScaler/framegen/ffx/FSRFG_Dx12.cpp +++ b/OptiScaler/framegen/ffx/FSRFG_Dx12.cpp @@ -490,7 +490,17 @@ bool FSRFG_Dx12::Dispatch() ffxDispatchDescFrameGenerationPrepare dfgPrepare {}; dfgPrepare.header.type = FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION_PREPARE; - dfgPrepare.header.pNext = &dfgCameraData.header; + + // Hacky way but should do + const float* cameraDataRaw = dfgCameraData.cameraPosition; + bool cameraDataIsZeroed = std::all_of(cameraDataRaw, cameraDataRaw + 12, [](float v) { return v == 0.0f; }); + + // Don't link the camera struct if it's just all zeros + // Specifically the driver upgrade dll is looking at this and falling back to FSR 3 FG + if (cameraDataIsZeroed) + dfgPrepare.header.pNext = &backendDesc.header; + else + dfgPrepare.header.pNext = &dfgCameraData.header; // Prepare command list auto allocator = _fgCommandAllocator[fIndex];