This patch makes several changes:
1) It modifies WebGPUParent::RecvAdapterRequestDevice to additionally
send a device lost callback to wgpu. The user data for this callback is
stored within WebGPUParent as a hash of unique_ptr memory, which allows
for the possibility that wgpu will not call the callback (though it
should). When the callback is received, this memory is cleared. When the
WebGPUParent is destroyed, it asserts that there is no remaining held
memory for pending callbacks. These callbacks also check a WeakPtr to
the parent as additional safety.
2) It corrects some behavior in Device::ResolveLost where checking the
existence of the underlying JS object is moved earlier, since later
operations on the promise require the JS object to exist.
Differential Revision: https://phabricator.services.mozilla.com/D194310
This patch makes several changes:
1) It modifies WebGPUParent::RecvAdapterRequestDevice to additionally
send a device lost callback to wgpu. The user data for this callback is
stored within WebGPUParent as a hash of unique_ptr memory, which allows
for the possibility that wgpu will not call the callback (though it
should). When the callback is received, this memory is cleared. When the
WebGPUParent is destroyed, it asserts that there is no remaining held
memory for pending callbacks. These callbacks also check a WeakPtr to
the parent as additional safety.
2) It corrects some behavior in Device::ResolveLost where checking the
existence of the underlying JS object is moved earlier, since later
operations on the promise require the JS object to exist.
Differential Revision: https://phabricator.services.mozilla.com/D194310
This patch makes several changes:
1) It modifies WebGPUParent::RecvAdapterRequestDevice to additionally
send a device lost callback to wgpu. The user data for this callback is
stored within WebGPUParent as a hash of unique_ptr memory, which allows
for the possibility that wgpu will not call the callback (though it
should). When the callback is received, this memory is cleared. When the
WebGPUParent is destroyed, it asserts that there is no remaining held
memory for pending callbacks. These callbacks also check a WeakPtr to
the parent as additional safety.
2) It corrects some behavior in Device::ResolveLost where checking the
existence of the underlying JS object is moved earlier, since later
operations on the promise require the JS object to exist.
Differential Revision: https://phabricator.services.mozilla.com/D194310
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
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.
Differential Revision: https://phabricator.services.mozilla.com/D197799
If creation of the `CompilationInfo` promise fails in
`mozilla::webgpu::Device::CreateShaderModule`, propagate the error
properly, rather than leaving a local `ErrorResult` unhandled.
Differential Revision: https://phabricator.services.mozilla.com/D197600
If creation of the `CompilationInfo` promise fails in
`mozilla::webgpu::Device::CreateShaderModule`, propagate the error
properly, rather than leaving a local `ErrorResult` unhandled.
Differential Revision: https://phabricator.services.mozilla.com/D197600
The `mozilla::webgpu::Device::CreateShaderModule` and
`mozilla::webgpu::WebGPUChild::DeviceCreateShaderModule` definitions
do not need `MOZ_CAN_RUN_SCRIPT_FOR_DEFINITION` attributes, because
their declarations in the class bodies already have
`MOZ_CAN_RUN_SCRIPT` attributes.
Differential Revision: https://phabricator.services.mozilla.com/D197605
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
In addition to moving the valid check earlier in Buffer::Drop, this
patch also ensures that Device clears the tracked buffers set after they
have been unmapped, and cleans up the error handling in Device::GetLost.
Differential Revision: https://phabricator.services.mozilla.com/D191565
This ensures that both internal and external triggers of "lose the
device" resolve the lost promise using the same code path.
Differential Revision: https://phabricator.services.mozilla.com/D190129
This creates a WebGPUParent::LoseDevice entry point, which informs the
WebGPUChild that the device has been lost. The child side is largely a
stub, as a later part will rationalize the handling of the device.lost
promise in the child.
This also expands ErrorBufferType with a DeviceLost value. The
LoseDevice function is triggered for any error where webgpu_bindings
HasErrorBufferType error_type returns ErrorBufferType::DeviceLost.
Differential Revision: https://phabricator.services.mozilla.com/D188388
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
* Add validation for requested features and devices for
adapter.requestDevice().
* Promote webgl's AutoAssertCast to mfbt/Casting.h/LazyAssertedCast.
Differential Revision: https://phabricator.services.mozilla.com/D177110