Commit Graph

342 Commits

Author SHA1 Message Date
Nicolas Silva
e411bce9ed Bug 1889873 - Remove IsOpen in favor of CanSend. r=webgpu-reviewers,teoxoy
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
2024-04-05 15:59:38 +00:00
sotaro
11955a763b Bug 1888341 - Remove MOZ_ASSERT_UNREACHABLE in WebGPUParent::CreateExternalTexture() r=gfx-reviewers,lsalzman
ExternalTexture allocation failure could happen when allocating size is too large or system does not have enough gpu memory. Then it seems better to remove the assert. ExternalTextureD3D11.cpp already has enough error logs.

Differential Revision: https://phabricator.services.mozilla.com/D205978
2024-03-28 10:54:06 +00:00
Erich Gubler
b04dc39bbe Bug 1885238 - fix(webgpu): add missing ser/de for CompilationMessage offset and length over IPC r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D205171
2024-03-20 15:24:19 +00:00
Erich Gubler
e6445c8a1c Bug 1879692: chore(webgpu): remove PresentationData::mBuffersLock r=webgpu-reviewers,jimb
This logic is in an IPDL actor, and doesn't spin up its own threads.
Therefore, all methods in `WebGPUParent` are called on the same thread,
all the time. There's no need for a synchronization mechanism here; it
only serves to confuse the mental model of newcomers to this code.

Differential Revision: https://phabricator.services.mozilla.com/D203709
2024-03-07 22:07:31 +00:00
Erich Gubler
dfd3817b71 Bug 1879692: refactor(webgpu): s/PresentationData*/RefPtr<PresentationData> r=webgpu-reviewers,nical
If we were in Rust, and I could extract a reference using only safe
code, I'd totally trust this, and be happy to avoid an atomic addition
on the strong ref-count. However, I think in our case for C++, it's
better to simply avoid the safety hazard altogether, and accept the
trivial performance hit.

Differential Revision: https://phabricator.services.mozilla.com/D203708
2024-03-07 22:07:31 +00:00
Erich Gubler
b62d49eca9 Bug 1879692: refactor(webgpu): clarify internal-ness of WGPU error logs in readback presentation r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D203713
2024-03-06 21:17:35 +00:00
Erich Gubler
4e35c1f913 Bug 1879692: fix(webgpu): bail readback presentation if get_mapped_range fails r=webgpu-reviewers,nical
Failing to `return` here yields a crash in the case where the device is
lost, which is the root cause of bug 1879692. Crashing seems like
a pretty severe consequence for something that users may invoke
themselves (i.e., via `device.destroy`), so let's bail out instead.

Differential Revision: https://phabricator.services.mozilla.com/D203710
2024-03-06 21:17:35 +00:00
Erich Gubler
f35a5a1e04 Bug 1879692: refactor(webgpu): always print WGPU errors in readback presentation r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D203712
2024-03-06 21:17:34 +00:00
Erich Gubler
6914f3de10 Bug 1879692: fix(webgpu): coerce valid. errors to internal in readback presentation r=webgpu-reviewers,nical
Validation errors are supposed to be errors that a WebGPU user are
solely responsible for. In cases where we encounter an error for
implementation internals, we should use
[`GPUInternalError`](https://gpuweb.github.io/gpuweb/#gpuinternalerror)
instead. If we encounter a validation error in our usage of `wgpu-core`
to implement presentation readback, coerce them to an internal error
before forwarding them to the applicable `GPUDevice`.

Differential Revision: https://phabricator.services.mozilla.com/D203711
2024-03-06 21:17:34 +00:00
Erich Gubler
20396799f0 Bug 1883478: chore(webgpu): prepend Uncaptured WebGPU error: to uncaptured errs. r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D203503
2024-03-06 21:01:47 +00:00
Peter Van der Beken
9e9199880e Bug 1640839 - Stop generating a sentinel value at the end of WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201344
2024-03-02 07:50:25 +00:00
Peter Van der Beken
29ebd94e8a Bug 1640839 - Add IPC serializer for WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,dom-storage-reviewers,janv,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201339
2024-03-02 07:50:22 +00:00
Natalia Csoregi
10b9ceb789 Backed out 13 changesets (bug 1640839) for causing bustage on Element.cpp CLOSED TREE
Backed out changeset 179ceb82c9e5 (bug 1640839)
Backed out changeset 73f498a821f0 (bug 1640839)
Backed out changeset dc2d3d0e0365 (bug 1640839)
Backed out changeset ddc989ac0509 (bug 1640839)
Backed out changeset e595bb3feea8 (bug 1640839)
Backed out changeset c85aca04e27f (bug 1640839)
Backed out changeset 98e8e3a4047a (bug 1640839)
Backed out changeset 59ef180517db (bug 1640839)
Backed out changeset af2f5e293662 (bug 1640839)
Backed out changeset 89aa6d9dc598 (bug 1640839)
Backed out changeset 67b722a722f9 (bug 1640839)
Backed out changeset 24a9665c6ced (bug 1640839)
Backed out changeset d93f199385e9 (bug 1640839)
2024-03-01 18:23:08 +02:00
Peter Van der Beken
e0fa109cb0 Bug 1640839 - Stop generating a sentinel value at the end of WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201344
2024-03-01 14:31:15 +00:00
Peter Van der Beken
29b6d7ad30 Bug 1640839 - Add IPC serializer for WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,dom-storage-reviewers,janv,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201339
2024-03-01 14:31:12 +00:00
Nicolas Silva
10f2d9133a Bug 1878308 - Move the compute pass remoting logic into wgpu bindings. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D200460
2024-02-26 08:31:37 +00:00
Nicolas Silva
8fe46ddc7b Bug 1878308 - Move the render pass remoting logic into wgpu's bindings. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D200444
2024-02-26 08:31:37 +00:00
sotaro
3f63809b74 Bug 1880005 - Fix FenceHandle handling in WebGPUParent r=lsalzman
FenceHandle handling in WebGPUParent was wrong. The FenceHandle exists for each device.

Differential Revision: https://phabricator.services.mozilla.com/D202385
2024-02-22 09:29:23 +00:00
sotaro
cad8205f3c Bug 1879928 - Fix ErrorBuffer::GetError() handling in ReadbackPresentCallback() r=webgpu-reviewers,nical
Add ErrorBuffer::GetError() handling to wgpu_server_buffer_get_mapped_range() in ReadbackPresentCallback()
and call ForwardError(), if possible.

Differential Revision: https://phabricator.services.mozilla.com/D201790
2024-02-15 01:43:01 +00:00
Nicolas Silva
defb99c51e Bug 1880034 - Prevent a Debug assertion when not checking an error buffer. r=webgpu-reviewers,ErichDonGubler
Not calling GetError or ForwardError on an ErrorBuffer leads to an assertion in ErrorBuffer's destructor.

Differential Revision: https://phabricator.services.mozilla.com/D201694
2024-02-14 07:53:59 +00:00
Nicolas Silva
f48166d78b Bug 1880081 - Don't crash the content process if the GPU process goes down. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D201715
2024-02-13 16:57:08 +00:00
Sandor Molnar
04383665ae Backed out 3 changesets (bug 1878308) for causing webgpu failures. CLOSED TREE
Backed out changeset 2887e360adb9 (bug 1878308)
Backed out changeset c5f276e2774d (bug 1878308)
Backed out changeset b3fb55591aa7 (bug 1878308)
2024-02-13 09:00:38 +02:00
Nicolas Silva
00db3ed84a Bug 1878308 - Move the compute pass remoting logic into wgpu bindings. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D200460
2024-02-13 04:59:05 +00:00
Nicolas Silva
29b0e724c2 Bug 1878308 - Move the render pass remoting logic into wgpu's bindings. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D200444
2024-02-13 04:59:04 +00:00
sotaro
8796d8a23f Bug 1878316 - Defer SwapChain drop until readback complete r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D201192
2024-02-09 22:37:37 +00:00
Nicolas Silva
62b064944e Bug 1877985 - Forward validation errors in buffer map and getMappedRange. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D200306
2024-02-08 14:38:43 +00:00
Noemi Erli
4848bd032d Backed out 3 changesets (bug 1878308) for causing wgpu_bindings related build bustages CLOSED TREE
Backed out changeset 330e9b1f94c2 (bug 1878308)
Backed out changeset c4a9d3751619 (bug 1878308)
Backed out changeset 36b086dfbd13 (bug 1878308)
2024-02-07 18:19:30 +02:00
Nicolas Silva
9d1e33142f Bug 1878308 - Move the compute pass remoting logic into wgpu bindings. r=webgpu-reviewers,ErichDonGubler
Depends on D200444

Differential Revision: https://phabricator.services.mozilla.com/D200460
2024-02-07 15:53:26 +00:00
Nicolas Silva
0330f8afca Bug 1878308 - Move the render pass remoting logic into wgpu's bindings. r=webgpu-reviewers,ErichDonGubler
Depends on D200359

Differential Revision: https://phabricator.services.mozilla.com/D200444
2024-02-07 15:53:25 +00:00
Nicolas Silva
ef27040105 Bug 1878851 - Push createShaderModule errors to the error scope. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D200775
2024-02-06 15:29:24 +00:00
Jim Blandy
698b98439a Bug 1876389: Update wgpu to revision 32e70bc1635905c508d408eb1cf22b2aa062ffe1. r=webgpu-reviewers,supply-chain-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D200359
2024-02-05 18:32:00 +00:00
Iulian Moraru
92ba802eeb Backed out changeset 4fd09aad97af (bug 1876389) for causing webgpu failures on test_command_buffer_creation.html. CLOSED TREE 2024-02-02 22:49:04 +02:00
Jim Blandy
c132a60aa9 Bug 1876389 - Update wgpu to revision 87b6513df32e8a9c588962ba8509019c277438e2. r=webgpu-reviewers,supply-chain-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D200359
2024-02-02 17:14:47 +00:00
Cristina Horotan
41b3346b40 Backed out 2 changesets (bug 1876389) for causing build bustages on windows. CLOSED TREE
Backed out changeset 6181ee1cdb28 (bug 1876389)
Backed out changeset 9dd0cf97b35d (bug 1876389)
2024-02-02 00:11:30 +02:00
Jim Blandy
11ef27ef0a Bug 1876389 - Update wgpu to revision 87b6513df32e8a9c588962ba8509019c277438e2. r=webgpu-reviewers,supply-chain-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D200359
2024-02-01 21:16:46 +00:00
Lee Salzman
25a04a247d Bug 1877010 - Track forwarder transaction ids for RemoteTextureMap with WebGL and WebGPU. r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D199876
2024-01-30 15:44:04 +00:00
Brad Werth
567429f7fb Bug 1865921 Part 1: Make WebGPUParent supply a device lost callback. r=ErichDonGubler,webgpu-reviewers,nical
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
2024-01-26 20:03:17 +00:00
Iulian Moraru
07bd3c9704 Backed out 2 changesets (bug 1865921) for causing Bug 1876663. CLOSED TREE
Backed out changeset 46b5a7e46018 (bug 1865921)
Backed out changeset dbb08bccb5e3 (bug 1865921)
2024-01-26 13:25:40 +02:00
Brad Werth
491fd1da4f Bug 1865921 Part 1: Make WebGPUParent supply a device lost callback. r=ErichDonGubler,webgpu-reviewers,nical
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
2024-01-25 23:52:24 +00:00
Natalia Csoregi
2335d7e1fe Backed out 2 changesets (bug 1865921) for causing failures on test_device_lost.html. CLOSED TREE
Backed out changeset 39cf0feca383 (bug 1865921)
Backed out changeset b0f89dfa3291 (bug 1865921)
2024-01-24 03:18:18 +02:00
Brad Werth
065868ade6 Bug 1865921 Part 1: Make WebGPUParent supply a device lost callback. r=ErichDonGubler,webgpu-reviewers,nical
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
2024-01-24 00:39:30 +00:00
sotaro
e9996baad0 Bug 1863474 - Add a capability of handling ID3D11Fence and ID3D12Fence handling to WebGPU r=webgpu-reviewers,nical
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
2024-01-23 02:41:49 +00:00
Nicolas Silva
7563a27051 Bug 1873047 - Move CommandEncoder and RenderBundleEncoder ::Finish to their respective file. r=webgpu-reviewers,ErichDonGubler
Depends on D198401

Differential Revision: https://phabricator.services.mozilla.com/D198402
2024-01-20 01:18:59 +00:00
Nicolas Silva
c0784f2e7e Bug 1873047 - Generate a valid RenderPipeline object on the JS side even if IPC is down. r=webgpu-reviewers,ErichDonGubler
Depends on D198400

Differential Revision: https://phabricator.services.mozilla.com/D198401
2024-01-20 01:18:59 +00:00
Nicolas Silva
4e0f601dd5 Bug 1873047 - Generate a valid ComputePipeline object on the JS side even if IPC is down. r=webgpu-reviewers,ErichDonGubler
Depends on D198387

Differential Revision: https://phabricator.services.mozilla.com/D198400
2024-01-20 01:18:58 +00:00
Nicolas Silva
2026d799c5 Bug 1873047 - Generate a valid PipelineLayout object on the JS side even if IPC is down. r=webgpu-reviewers,ErichDonGubler
Depends on D198386

Differential Revision: https://phabricator.services.mozilla.com/D198387
2024-01-20 01:18:58 +00:00
Nicolas Silva
5984b6a544 Bug 1873047 - Generate a valid CommandEncoder object on the JS side even if IPC is down. r=webgpu-reviewers,ErichDonGubler
Depends on D198385

Differential Revision: https://phabricator.services.mozilla.com/D198386
2024-01-20 01:18:57 +00:00
Nicolas Silva
07d56a1414 Bug 1873047 - Generate a valid ShaderModule object on the JS side even if IPC is down. r=webgpu-reviewers,ErichDonGubler
Depends on D198384

Differential Revision: https://phabricator.services.mozilla.com/D198385
2024-01-20 01:18:57 +00:00
Nicolas Silva
479581f823 Bug 1873047 - Generate a valid BindGroup object on the JS side even if IPC is down. r=webgpu-reviewers,ErichDonGubler
Depends on D198383

Differential Revision: https://phabricator.services.mozilla.com/D198384
2024-01-20 01:18:57 +00:00
Nicolas Silva
1480aa203d Bug 1873047 - Generate a valid BindGroupLayout object on the JS side even if IPC is down. r=webgpu-reviewers,ErichDonGubler
Depends on D197801

Differential Revision: https://phabricator.services.mozilla.com/D198383
2024-01-20 01:18:56 +00:00