They are the same and the latter is more self explanatory.
The patch also addresses a couple of Cleanup methods where I forgot to check the bridge pointer.
Differential Revision: https://phabricator.services.mozilla.com/D206785
On Windows, external texture in swap chain requests compositor device. But when gpu process is disabled as fallback and webrender does not use hardware accceleration, parent process does not have the compositor device. Then it seems better to disable external texture in swap chain when WebRender does not use hardware acceleration.
Differential Revision: https://phabricator.services.mozilla.com/D204869
WebGPU rendering needs to be synchronized to dom like WebGL and canvas 2D. But the current rendering is not synchronized to dom.
Differential Revision: https://phabricator.services.mozilla.com/D197326
This is preparation for Bug 1843891.
ID3D11Fence and ID3D12Fence handling is necessary to interoperate between D3D11 and D3D12. Necessary fence value can be obtained from wgpu_server_queue_submit().
Differential Revision: https://phabricator.services.mozilla.com/D193619
These JS proxies are always safe to create. The ids are validated on the other side so if the GPU process comes back up and we try to use the object (on a new device), it will generate an error as expected.
Depends on D197799
Differential Revision: https://phabricator.services.mozilla.com/D197800
OffscreenCanvas WebGPU could deliver descriptor of remote texture like other canvases since it uses async ImageContainer(via ImageBridge). Then when CanvasContext::SwapChainPresent() returns valid descritptor of remote texture, the descriptor is delivered correctly to WebRenderImageHost like other canvases with offscreen canvas.
Async wait and callback happen at WebRenderImageHost::UseRemoteTexture() since it uses async ImageContainer(via ImageBridge).
Differential Revision: https://phabricator.services.mozilla.com/D196249
By Bug 1858361 fix, first WebGPU rendering becomes not rendered. It happens because CanvasContext::MaybeQueueSwapChainPresent() is called before CanvasContext::InitializeCanvasRenderer().
The change handles it.
Differential Revision: https://phabricator.services.mozilla.com/D196253
Call CanvasContext::SwapChainPresent() from ShareableCanvasRenderer::UpdateCompositableClient() like other canvas implementations.
Current WebGPU implementation does not handle presenting swap chain of offscreen canvas. It is going to be handled by another bug.
Differential Revision: https://phabricator.services.mozilla.com/D196141
This is a short term fix. Long term fix needs to be done by Bug 1860958.
Presenting WebGPU without readback needs a way to destroy Texture. Then Texture::ForceDestroy() is added for it.
Differential Revision: https://phabricator.services.mozilla.com/D191829
For presenting WebGPU without readback, wgpu does rendering to ExternalTexture. Then the ExternalTexture is pushed to RemoteTextureMap for present.
With DX12, ExternalTextureD3D11 is implemented for gecko side implementation. ExternalTextureWgpu holds necessary resource that is necessary by wgpu. ExternalTextureWgpu is created and destroyed by gecko side's ExternalTexture.
Presenting current texture starts at CanvasContext::SwapChainPresent(). CanvasContext::SwapChainPresent() posts current texture for present. And the current texture is set invalid, since the texture is going to be posted to WebRender. Next CanvasContext::GetCurrentTexture() call creates a new texture of swap chain.
WebGPUParent::RecvSwapChainPresent() receives present request. It pushes to RemoteTextureMap for presenting.
TextureRaw is recycled with ExternalTexture recycling.
Differential Revision: https://phabricator.services.mozilla.com/D190249
The change is preparation for Bug 1843891.
Current gecko uses a internal texture for SwapChain's texture. This bug changes as to use external dx11 texture for WebGPU dx12 backend on Windows.
WebGPUParent allocates dx11 texture for SwapChain's texture of dx12 backend WebGPU. wgpu uses the dx11 texture as ID3D12Resource. The readback for presenting to WebRender still exists.
The change handles only RBGA format.
Differential Revision: https://phabricator.services.mozilla.com/D187870
The change is preparation for Bug 1843891.
Current gecko uses a internal texture for SwapChain's texture. This bug changes as to use external dx11 texture for WebGPU dx12 backend on Windows.
WebGPUParent allocates dx11 texture for SwapChain's texture of dx12 backend WebGPU. wgpu uses the dx11 texture as ID3D12Resource. The readback for presenting to WebRender still exists.
The change handles only RBGA format.
Differential Revision: https://phabricator.services.mozilla.com/D187870
This patch introduces random noises to data extraction functions of
canvas element and offscreen canvas. The random noise is based on the
random key of the cookieJarSettings and the image data itself.
The random noises would interfere the ability of fingerprinters that
use canvas data to fingerprint users. The random noise will make unique
canvas finerprint to for every browsing session. Therefore, fingerprinter
cannot use canvas fingerprint to tracker individuals across browsing
sessions.
Differential Revision: https://phabricator.services.mozilla.com/D175499
WebGPU uses CompositableInProcessManager to push TextureHost directly from WebGPUParent to WebRender. But CompositableInProcessManager plumbing has a problem and caused Bug 1805209.
gecko already has a similar mechanism, called RemoteTextureMap. It is used in oop WebGL. If WebGPU uses RemoteTextureMap instead of CompositableInProcessManager, both WebGPU and oop WebGL use same mechanism.
WebGPUParent pushes a new texture to RemoteTextureMap. The RemoteTextureMap notifies the pushed texture to WebRenderImageHost.
Before the change, only one TextureHost is used for one swap chain. With the change, multiple TextureHosts are used for one swap chain with recycling.
The changes are followings.
- Use RemoteTextureMap instead of CompositableInProcessManager.
- Use RemoteTextureOwnerId instead of CompositableHandle.
- Use WebRenderCanvasData instead of WebRenderInProcessImageData.
- Add remote texture pushed callback functionality to RemoteTextureMap. With it, RemoteTextureMap notifies a new pushed remote texture to WebRenderImageHost.
- Remove CompositableInProcessManager.
Differential Revision: https://phabricator.services.mozilla.com/D164890
This patch hooks up the improved CanvasManagerChild::GetSnapshot method
to the WebGPU canvas context object in order to do readbacks for various
DOM facing methods such as ConvertToBlob and for Firefox Screenshots.
Differential Revision: https://phabricator.services.mozilla.com/D144309
This reworks the CanvasManagerChild::GetSnapshot method to work with
WebGPU. This will allow it to be called for a WebGPU context from any
thread, which is useful for screenshots.
Differential Revision: https://phabricator.services.mozilla.com/D144308
This patch hooks up the improved CanvasManagerChild::GetSnapshot method
to the WebGPU canvas context object in order to do readbacks for various
DOM facing methods such as ConvertToBlob and for Firefox Screenshots.
Differential Revision: https://phabricator.services.mozilla.com/D144309
This reworks the CanvasManagerChild::GetSnapshot method to work with
WebGPU. This will allow it to be called for a WebGPU context from any
thread, which is useful for screenshots.
Differential Revision: https://phabricator.services.mozilla.com/D144308
This patch hooks up the improved CanvasManagerChild::GetSnapshot method
to the WebGPU canvas context object in order to do readbacks for various
DOM facing methods such as ConvertToBlob and for Firefox Screenshots.
Differential Revision: https://phabricator.services.mozilla.com/D144309
This reworks the CanvasManagerChild::GetSnapshot method to work with
WebGPU. This will allow it to be called for a WebGPU context from any
thread, which is useful for screenshots.
Differential Revision: https://phabricator.services.mozilla.com/D144308
This patch removes more main thread dependencies from the content side
of WebGPU. Instead of issuing a resource update for an external image,
we now use an async image pipeline in conjunction with
CompositableInProcessManager from part 1. This allows us to update the
HTMLCanvasElement bound to the WebGPU device without having to go
through the main thread, or even the content process after the swap
chain update / readback has been requested.
Differential Revision: https://phabricator.services.mozilla.com/D138887