Hardware decoded video may not be displayed with software WebRender when creating a D3D11 compositor fails
Categories
(Core :: Graphics: WebRender, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox161 | --- | fixed |
People
(Reporter: aosmond, Assigned: aosmond)
References
Details
Attachments
(1 external file)
With software WebRender on Windows, RenderCompositor::Create first tries RenderCompositorD3D11SWGL, which composites with D3D11 (CompositorD3D11). If CompositorD3D11::Initialize fails, e.g. because the swap chain or the device attachments cannot be created, the window silently falls back to plain SWGL (RenderCompositorSWGL).
Nothing records that fallback, so gfxVars::AllowSoftwareWebRenderD3D11 remains true, and everything else keeps assuming D3D11 compositing is used. In particular, video decoders decide whether to output D3D11 textures based on it (KnowsCompositor::SupportsD3D11). Plain SWGL cannot draw D3D11 textures: RenderDXGITextureHost::MapPlane and RenderDXGIYCbCrTextureHost::MapPlane read them back through the device of a RenderCompositorD3D11SWGL, and fail otherwise, so the video is not displayed.
The failure also leaks the SWGL context created by RenderCompositorD3D11SWGL::Create.
Proposed fix:
- If
CompositorD3D11::Initializefails because the device was removed (DeviceManagerDx::HasDeviceReset), handle it as a device reset, since the device will be recreated. - Otherwise, report a new
WebRenderError, which the parent handles by clearinggfxVars::AllowSoftwareWebRenderD3D11, similar to how the overlay errors clear their vars. This is the same stepgfxPlatform::FallbackFromAccelerationtakes when falling back from software WebRender with D3D11 to plain software WebRender. - Free the SWGL context on failure.
| Assignee | ||
Comment 1•24 days ago
|
||
When creating a D3D11 compositor for SWGL failed, the window silently
fell back to plain SWGL, while gfxVars::AllowSoftwareWebRenderD3D11 kept
claiming otherwise. Producers such as video decoders would then share
D3D11 textures that the window cannot draw. Clear the var instead,
unless the failure is due to a device reset, which is recoverable. Also
free the SWGL context, which was leaked on failure.
Comment 3•23 days ago
|
||
| bugherder | ||
Updated•7 days ago
|
Description
•