Commit Graph

231 Commits

Author SHA1 Message Date
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
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
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
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
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
sotaro
c66558645d Bug 1868927 - Remove RemoteTextureHostWrapper's async mode r=gfx-reviewers,lsalzman
By removing the async mode, remote texture implementation becomes simpler.

Differential Revision: https://phabricator.services.mozilla.com/D197323
2024-01-07 22:47:05 +00:00
Lee Salzman
ab390835ca Bug 1872087 - Share recycled texture data across remote texture owners on a single client. r=sotaro,gfx-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D197324
2023-12-27 14:56:24 +00:00
sotaro
5e4ff4aeae Bug 1861605 - Use IDXGIResource1::CreateSharedHandle() instead of IDXGIResource::GetSharedHandle() r=gfx-reviewers,lsalzman
gecko uses IDXGIResource::GetSharedHandle(). But it is recommend not to use anymore to retrieve the handle to a shared resource.
IDXGIResource1::CreateSharedHandle() with D3D11_RESOURCE_MISC_SHARED_NTHANDLE flag should be used instead of the GetSharedHandle().

The CreateSharedHandle() could be called only once for a shared resource. Later calls fail.

HANDLEs of ID3D11Texture2D are replaced by gfx::FileHandleWrappers.

Differential Revision: https://phabricator.services.mozilla.com/D192173
2023-12-19 09:23:21 +00:00
Narcis Beleuzu
b9ada835f3 Backed out 2 changesets (bug 1865921) for causing webgpu leaks. CLOSED TREE
Backed out changeset e378a6744fb2 (bug 1865921)
Backed out changeset 95b9cef93a5c (bug 1865921)
2023-12-05 22:36:48 +02:00
Brad Werth
645a47034d Bug 1865921 Part 1: Make WebGPUParent supply a device lost callback. r=ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D194310
2023-12-05 17:55:40 +00:00
Nicolas Silva
798bd0c194 Bug 1865364 - Ensure a buffer's ID can't be zero. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D193920
2023-11-22 14:15:36 +00:00
Nicolas Silva
d6c5420983 Bug 1861985 - Handle CommandBuffer/CommandBuffer lifecycle correctly. r=webgpu-reviewers,ErichDonGubler
In wgpu, command encoders and command buffers actually share the same identity and resource, so dropping one drops the other. This commit makes it so that our gecko wrappers take that into account. The lifetime is now tied to the encoder which may be held alive by a command buffer if there is one.

Differential Revision: https://phabricator.services.mozilla.com/D193313
2023-11-22 14:15:35 +00:00
Nicolas Silva
5a963c5173 Bug 1860958 - Implement Texture::Destroy. r=webgpu-reviewers,jimb
Differential Revision: https://phabricator.services.mozilla.com/D192080
2023-11-22 14:15:34 +00:00
Natalia Csoregi
5ea22ebe90 Backed out 4 changesets (bug 1861985, bug 1860958, bug 1865364) for causing bustage due to CommandEncoder. CLOSED TREE
Backed out changeset 3d6b04449863 (bug 1865364)
Backed out changeset 1e35eb31a789 (bug 1861985)
Backed out changeset e3f53b794c1d (bug 1861985)
Backed out changeset d676e8a3a515 (bug 1860958)
2023-11-22 13:52:44 +02:00
Nicolas Silva
d369f1e328 Bug 1865364 - Ensure a buffer's ID can't be zero. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D193920
2023-11-22 10:57:58 +00:00
Nicolas Silva
4ea5b3990a Bug 1861985 - Handle CommandBuffer/CommandBuffer lifecycle correctly. r=webgpu-reviewers,ErichDonGubler
In wgpu, command encoders and command buffers actually share the same identity and resource, so dropping one drops the other. This commit makes it so that our gecko wrappers take that into account. The lifetime is now tied to the encoder which may be held alive by a command buffer if there is one.

Differential Revision: https://phabricator.services.mozilla.com/D193313
2023-11-22 10:57:58 +00:00
Nicolas Silva
1a7390629a Bug 1860958 - Implement Texture::Destroy. r=webgpu-reviewers,jimb
Differential Revision: https://phabricator.services.mozilla.com/D192080
2023-11-22 10:57:57 +00:00
Cristian Tuns
7ecd49983c Backed out 3 changesets (bug 1861985, bug 1860958) for causing build bustages in RefPtr.h CLOSED TREE
Backed out changeset 13f07117425f (bug 1861985)
Backed out changeset 0bdc4c60018e (bug 1861985)
Backed out changeset 5e6f2b2e19c6 (bug 1860958)
2023-11-21 14:07:35 -05:00
Nicolas Silva
6a1a1cb542 Bug 1861985 - Handle CommandBuffer/CommandBuffer lifecycle correctly. r=webgpu-reviewers,ErichDonGubler
In wgpu, command encoders and command buffers actually share the same identity and resource, so dropping one drops the other. This commit makes it so that our gecko wrappers take that into account. The lifetime is now tied to the encoder which may be held alive by a command buffer if there is one.

Differential Revision: https://phabricator.services.mozilla.com/D193313
2023-11-21 18:16:25 +00:00
Nicolas Silva
ff6fa22c05 Bug 1860958 - Implement Texture::Destroy. r=webgpu-reviewers,jimb
Differential Revision: https://phabricator.services.mozilla.com/D192080
2023-11-21 18:16:24 +00:00
Nicolas Silva
d71febc53e Bug 1865311 - Fix inconsistent destroy/drop naming in webgpu IPC. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D193894
2023-11-17 20:11:22 +00:00
Brad Werth
ad675e8c0a Bug 1816731 Part 1: Prevent configuration of a WebGPU context for a too-big canvas. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D193567
2023-11-17 16:11:40 +00:00
sotaro
a81fc25c0a Bug 1863106 - Set D3D11_BIND_UNORDERED_ACCESS if texture usage has STORAGE_BINDING r=lsalzman
wgpu dx12 requests to Texture that if its usage has STORAGE_BINDING, D3D12 resource needs to have D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS.

The equivalent of D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS in D3D11 is D3D11_BIND_UNORDERED_ACCESS. Therefore, D3D11 textures in ExternalTextureD3D11 also require D3D11_BIND_UNORDERED_ACCESS if STORAGE_BINDING is used.

Differential Revision: https://phabricator.services.mozilla.com/D192976
2023-11-09 00:42:41 +00:00