Closed Bug 1820066 Opened 2 years ago Closed 2 years ago

Fix some DXGI-related D3D11 debug-layer warnings when using swapchains

Categories

(Core :: Graphics: WebRender, defect)

Desktop
Windows
defect

Tracking

()

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: rkraesig, Assigned: rkraesig)

References

Details

Attachments

(3 files)

When enabling the D3D11 debug layer and running without DirectComposition, an easily-fixed DXGI warning and error appear in the debug output:

[18532] DXGI WARNING: IDXGIFactory::CreateSwapChain: Blt-model swap effects (DXGI_SWAP_EFFECT_DISCARD and DXGI_SWAP_EFFECT_SEQUENTIAL) are legacy swap effects that are predominantly superceded by their flip-model counterparts (DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL and DXGI_SWAP_EFFECT_FLIP_DISCARD). Please consider updating your application to leverage flip-model swap effects to benefit from modern presentation enhancements. More information is available at http://aka.ms/dxgiflipmodel. [ MISCELLANEOUS WARNING #294: ]

[18532] DXGI ERROR: IDXGIFactory::CreateSwapChain: Blt model swapchains (DXGI_SWAP_EFFECT_SEQUENTIAL and DXGI_SWAP_EFFECT_DISCARD) do not support DXGI_SCALING_NONE. [function arguments omitted] [ MISCELLANEOUS ERROR #141: ]

These are relatively easy to address, and doing so has other salutary effects -- in particular, suppressing bug 1763981.

Per Microsoft documentation, DXGI_SCALING_NONE is only supported by
swap chains using DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; for any other swap
effect, including DXGI_SWAP_EFFECT_SEQUENTIAL, another value must be
supplied. Prior to Windows 10 the only such available entry was
DXGI_SCALING_STRETCH, so use that.

This causes the CreateSwapChainForHwnd call to succeed, rather than
causing us to fall back to CreateSwapChain. There is no known user-
facing effect here, as DXGI_SCALING_STRETCH is documented to be the
semantics applied by CreateSwapChain -- but it does eliminate an error
message from the D3D11 debug layer's output.

This silences a warning emitted by the D3D11 debug layer.

Conveniently, it also suppresses bug 1763981.

Depends on D171521

N.B.: Bug 1435995 was previously filed concerning swapchains with DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL causing the fallback in-process compositor not to work. I can no longer reproduce this on my local build (with WebRender DirectComposition disabled).

This appears to be dealt with by bug 1567347: when gfx.webrender.flip-sequential is set to true, a separate compositor window (like that used with DirectComposition) is created. The DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL swapchain is associated with the compositor HWND instead of the parent-process HWND, so there's no issue when falling back to the parent process.

Attachment #9320909 - Attachment description: Bug 1820066 [1/2] - Fix `CreateSwapChainForHwnd` call r?sotaro → Bug 1820066 [1/3] - Fix `CreateSwapChainForHwnd` call r?sotaro

The in-process compositor assumes that no compositor window was present.
This is not guaranteed to be true if, for example, the preference
gfx.webrender.flip-sequential is set.

Make the in-process compositor more closely mirror the out-of-process
compositor. (At present this effectively just means calling ::SetParent
on the compositor window.)

Depends on D171521

Attachment #9320910 - Attachment description: Bug 1820066 [2/2] - Default to DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL on Win10+ r?sotaro → Bug 1820066 [3/3] - Default to DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL on Win10+ r?sotaro

The severity field is not set for this bug.
:gw, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(gwatson)
Pushed by rkraesig@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c34dfd018abb [1/3] - Fix `CreateSwapChainForHwnd` call r=sotaro https://hg.mozilla.org/integration/autoland/rev/ec623d25b138 [2/3] - Allow in-process use of the compositor window r=sotaro https://hg.mozilla.org/integration/autoland/rev/501d93d8c9eb [3/3] - Default to DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL on Win10+ r=sotaro
Severity: -- → S3
Flags: needinfo?(gwatson)

It's a relatively simple fix to handle headless mode properly; but it's still worth requesting rereview before landing, I think.

Flags: needinfo?(rkraesig)
Pushed by rkraesig@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c8742f6c466f [1/3] - Fix `CreateSwapChainForHwnd` call r=sotaro https://hg.mozilla.org/integration/autoland/rev/062f325dfd28 [2/3] - Allow in-process use of the compositor window r=sotaro https://hg.mozilla.org/integration/autoland/rev/ec948153333a [3/3] - Default to DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL on Win10+ r=sotaro

Partially reverted in bug 1830792.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: