Skip to content

Don't treat 0x0 swapchains as overlay calls - #1183

Open
kebas3 wants to merge 1 commit into
optiscaler:masterfrom
kebas3:fix-zero-size-swapchain
Open

kebas3 wants to merge 1 commit into
optiscaler:masterfrom
kebas3:fix-zero-size-swapchain

Conversation

@kebas3

@kebas3 kebas3 commented Sep 27, 2026

Copy link
Copy Markdown

Some games pass Width/Height = 0 when creating their swapchain, which tells DXGI to use the window size. The < 100 overlay check treats that as an overlay, so the game's main swapchain never gets wrapped and the menu and OptiFG don't work.

Hit this in Soulframe (DX12). The log only shows CreateSwapChainForHwnd Overlay call! for the game's swapchain. With this change it logs Width: 0, Height: 0, gets wrapped, and the menu and FSR FG work. #1141 (Helldivers 2) looks like the same issue, same lone "Overlay call!" in DX12.

Width/Height 0 in the swapchain desc means DXGI uses the window size,
so these are real game swapchains and should be wrapped.
gabrielmaialva33 added a commit to gabrielmaialva33/OptiScaler_DLSSNR that referenced this pull request Sep 30, 2026
Width/Height 0 in a swapchain desc tells DXGI to take the window's size,
so these are real game swapchains. The `< 100` overlay check sent them
down the unwrapped path: no menu, no OptiFG, and for a D3D11 title no
bridge, even though every bridge creation path already resolves a zero
extent against the game window (Dx11wDx12::ResolveZeroExtent) right
after this check.

Upstream PR optiscaler#1183 (kebas3, 8abf6d7) fixes the
four checks in DxgiFactory_Hooks.cpp; its text is used verbatim there so
the conflict is empty when it merges. The same check exists five more
times and the PR misses them: the two CoreWindow variants in
DxgiFactory_Hooks.cpp and CreateSwapChain / CreateSwapChainForHwnd /
CreateSwapChainForCoreWindow in DxgiFactory_WrappedCalls.cpp, the path a
wrapped factory takes. All nine now read the same.

Ported from optiscaler#1183 (kebas3/OptiScaler@8abf6d7f).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant