aboutsummaryrefslogtreecommitdiffstats
path: root/components/webgpu
Commit message (Collapse)AuthorAgeFilesLines
* webgpu: destroy GPUTexture without erroring (#33534)Samson2024-09-252-10/+3
| | | | | | | | | | | | | * destroy GPUTexture without erroring (errors can be safely ignored) Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* reuse ImageKey for gpucanvascontext (#33517)Samson2024-09-223-18/+13
| | | Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* chore: Update wgpu (#33506)Samson2024-09-214-89/+72
| | | | | | | | | | | | | | | | | | | | | | | | | * Update wgpu Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * use all backends at runtime Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * clean up some adapter stuff Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * flakes Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Add `rust-version` to all `Cargo.toml` files (#33483)Martin Robinson2024-09-171-0/+1
| | | | | | | This is another step preparing for building Servo without `mach`. Fixes #33430. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* webgpu: Use `PresentationBufferState` instead of bucketing buffer_ids per ↵Samson2024-09-161-39/+93
| | | | | | | | | | | | | | | state (#33457) * `PresentationBufferState` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixups Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* webgpu: Do one allocation less on presentation by keeping GPUBuffer mapped ↵Samson2024-09-131-31/+74
| | | | | | | | | | | | | | | | | | | (#33387) * `GPUPresentationBuffer` in `WGPUExternalImages` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * mv presentation_buffer in if let Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * docs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* webgpu: Factor out swapchain to separate file (#33367)Samson2024-09-094-290/+385
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move some stuff to swapchain.rs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Use typed WebGPUContextId instead of u64 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Extract create_swapchain function and move more stuff in it Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * extract destroy_swapchain Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * extract swapchain_present Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * extract update_wr_image callback Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixup Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* tidy: Fix rustdoc warnings and add a tidy check for a common URL issue (#33366)Martin Robinson2024-09-081-1/+1
| | | | | | | | This change fixes all rustdoc errors and also adds a tidy check for a very common rustdoc URL issue. Eventually rustdoc warnings should likely cause the build to fail, but this catches those issues sooner in order to not waste so much developer time. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* webgpu: Clean up `GPUCommandEncoders` and add some validation (#33223)Samson2024-08-302-28/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * TextureUsages::from_bits_retain Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fixup CreateBindGroupLayout Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * GPUExtent3D checking and converting Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Cleanup GPUCommandEncoders and some TODOs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * validate gpuorigin3d Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * validate GPUColor Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * set good expect Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Update wgpu (#33209)Samson2024-08-272-186/+195
| | | | | no gfx_select macro and some minor changes to passes Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* webgpu: Sync `GPUBuffer` (#33154)Samson2024-08-273-30/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * More helpers on `Promise` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Sync `GPUBuffer` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Set some good expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Some bad expect also on firefox Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Extract DataBlock, DataView impl from GPUBuffer Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix size check to work on 32bit platforms Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* webgpu: Align `writeBuffer` with spec (#33147)Samson2024-08-211-1/+0
| | | | | | | | | | | | | | | | | * Sync `WriteBuffer` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Set good expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Change assert to debug_assert Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Update wgpu (#32981)Samson2024-08-081-5/+5
| | | | | | | | | | | | | * Update wgpu to https://github.com/gfx-rs/wgpu/commit/781b54a8b9cee1a2cb22bda565662edec52eb70e Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* webgpu: Implement proper async pipeline creation and GPUPipelineError (#32636)Samson2024-08-083-12/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add GPUPipelineError Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Proper GetBindGroupLayout Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Proper Create*PipelineAsync Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixups Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * more good expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* separate Queue&Device Id (#32966)Samson2024-08-083-27/+24
| | | Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* webgpu: Use wgpu's instead of string errors and update limits handling (#32925)Samson2024-08-042-40/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use wgpu specific errors Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixup expect Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * WIP Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix records erasing enforcerange Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * page can already be destroyed Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Support more limits Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Set good results Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Set OK (not PASS) expect CRASH Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixup expectation Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * bad expectations https://github.com/gfx-rs/wgpu/issues/6075 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * set bad expectation render bundleencoder needs to be rewritten Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* webgpu: Update wgpu to 22.0 (#32827)Samson2024-07-252-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update wgpu to https://github.com/gfx-rs/wgpu/commit/c0e7c1ef945a7dd61c81fb951ea554213811aee0 This is few commits ahead of wgpu 22.0 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Make it compile Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Move usage checking to device timeline as per spec Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Add logging (trace) of WEBGPU messages This is very useful when debugging Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * update wgpu again Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * set good Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * skip `webgpu:api,operation,memory_sync,texture,same_subresource` for flakyness Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * rm r.json Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Remove failure breaks from webgpu thread (#32814)Samson2024-07-201-5/+1
| | | | | | | | | | | | | | | | | * Remove breaks from webgpu requests Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * expect Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * limit,out_of_range TIMEOUT->FAIL Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* fix a couple of simple clipy warnings (#32813)Rodion Borovyk2024-07-191-5/+5
| | | Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
* Less nesting in webgpu response (#32799)Samson2024-07-173-113/+115
| | | | | | | | | | | | | * Remove Option wrap of WebGPUResponse Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Replace WebGPUResponseResult with WebGPUResponse Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* webgpu: Divide message code into separate files (#32700)Samson2024-07-125-73/+93
| | | | | | | * Spilt webgpu ipc messages even more * Add license to mod.rs * file docs
* webgpu: Update wgpu and revamp RenderPass (#32665)Samson2024-07-046-31/+332
| | | | | | | | | | | | | | | | | | | | | * Update wgpu and revamp RenderPass * Set good expectations * Set one bad expectation * send_render_command * small fixups * docs * doc * Put RenderPass inside PassState * Use Pass enum for ComputePass too * fix docs
* webgpu: Implement ShaderCompilationInfo (#32642)Samson2024-07-022-3/+56
| | | | | | | | | * ShaderCompilationInfo * expectations * Handle CompilationInfo promise in GPUShaderModule * Fix my english
* webgpu: Update wgpu and revamp computepass (#32575)Samson2024-06-284-46/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Do not wait on drop, but rather wake poller thread * Update wgpu and render stuff * Set some good expectations * Update wgpu again * handle IPC error as warning * More good expectations * Some more expectations CTS does not match the spec: https://github.com/gpuweb/cts/issues/3806 * This expectations are due to other changes in servo also happening on main * Explain error_command_encoders and remove RefCell around it * fixup * store validness of passes * More good expectations * More docs * this assert is wrong * This is even more right per CTS/spec Only Command encoder state errors are allowed here, but wgpu does not exposes them. * More good expectations * One bad expectation * Fix my english
* Proper GPUDevice cleanup (#32520)Samson2024-06-202-27/+54
| | | | | | | | | | | * Make device cleanup right * Use weakref for GPUDevice in globalscope * No need to destroy device on drop * DeviceReason early return * make remove_gpu_device to be the only way to remove device
* Use workspace definitions for all crates and update to the 2021 edition (#32544)Martin Robinson2024-06-181-5/+5
|
* webgpu: Implement device lost (#32354)Samson2024-06-173-27/+88
| | | | | | | | | | | | | * device lost promise should be init at creation of device object * device lost impl * lock for device poll workaround for wgpu deadlocks * expect * Less lost reason reasoning in script
* webgpu: Enable gles support (#32452)Hieu Do2024-06-091-1/+1
|
* webgpu: Parse and forward backend prefs to wgpu (#32410)Hieu Do2024-05-311-2/+14
| | | Signed-off-by: Hieu Do <hieudn.uh@gmail.com>
* clippy: Fix warnings in `components/webgpu/wgpu_thread.rs` (#32392)Farid2024-05-311-30/+25
| | | | | | | | | | | | | * clippy: Fix warnings in `components/webgpu/wgpu_thread.rs` Signed-off-by: Jujumba <far77578@gmail.com> * clippy: `test-tidy` failure in `components/webgpu/wgpu_thread.rs` Signed-off-by: Jujumba <far77578@gmail.com> --------- Signed-off-by: Jujumba <far77578@gmail.com>
* webgpu: Move errorscopes to WGPU thread (#32304)Samson2024-05-225-118/+297
| | | | | | | | | | | | | | | | | | | | | * Prepare errorscopes logic in wgpu_thread * remove scope_id from ipc * new GPUErrors per spec * remove cotent timeline error_scope * fixup poperrorscope types * device_scope -> gpu_error and nice errors * Handle errors detection more elegantly * good expectations * new expectations * Make error_scope.errors Vec as per spec
* Move non-gfx things out of `gfx_traits` and create a `base` crate (#32296)Martin Robinson2024-05-174-4/+4
| | | | | | | | | | | | | | | | | | | | | | | For a long time, `gfx_traits` has held a lot of things unrelated to graphics and also unrelated to the `gfx` crate (which is mostly about fonts). This is a cleanup which does a few things: 1. Move non `gfx` crate things out of `gfx_traits`. This is important in order to prevent dependency cycles with a different integration between layout, script, and fonts. 2. Rename the `msg` crate to `base`. It didn't really contain anything to do with messages and instead mostly holds ids, which are used across many different crates in Servo. This new crate will hold the *rare* data types that are widely used. Details: - All BackgroundHangMonitor-related things from base to a new `background_hang_monitor_api` crate. - Moved `TraversalDirection` to `script_traits` - Moved `Epoch`-related things from `gfx_traits` to `base`. - Moved `PrintTree` to base. This should be widely useful in Servo. - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it to `WebRenderFontApi`.
* webgpu: Use WGPU poller thread for poll_all_devices (#32266)Samson2024-05-153-22/+149
| | | | | | | | | | | * Use special WGPU poller thread for poll_all_devices * Switch to latest wgpu This is required to fix some deadlocks. * non-blocking poll unconditionally * small fixes
* webgpu: Refactor webgpu crate (#32255)Samson2024-05-085-1383/+1448
| | | | | | | * wgpu(_core) -> wgc * Refactor webgpu crate split lib.rs into multiple modules
* webgpu: Update to wgpu 0.20 (#32173)Samson2024-05-081-7/+33
| | | | | | | | | | | * Update wgpu to 0.20 * good expectations * Throw TypeError in configure on unsupported format instead of panic * Expect * `into_command_buffer_id`,`into_command_encoder_id`
* webgpu: Use safe callbacks & try_recv_timeout (#32008)Samson2024-04-301-164/+95
| | | | | | | | | | | | | * Use safe callback in SwapChainPresent and remove present_buffer_maps * Use rust closure in BufferMapAsync * Remove buffer_maps and dead code elimination * scope id passthrough * Inline callbacks * try_recv timeout and halve DEVICE_POLL_INTERVAL
* webgpu: Update wgpu to 0.19 (#31995)Samson2024-04-263-197/+206
| | | | | | | | | | | * Update wgpu to https://github.com/gfx-rs/wgpu/commit/32e70bc1635905c508d408eb1cf22b2aa062ffe1 (0.19) * Update expect only good * reexpect * remove dbg stuff * Remove all occurrences of dx11_hub
* webgpu: Implement onSubmittedWorkDone (#31772)Samson2024-04-041-0/+18
| | | | | | | | | | | | | | | | | | | | | | | * Implement onSubmittedWorkDone * Use rust closures for callback & actually remove entries from hashmap. * Remove hashmap * Fix warnings * Update expectations * clean flaky crashes * re * Update components/script/dom/gpuqueue.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Fix assorted warnings in `components/` (#31628)eri2024-03-131-3/+9
| | | | | | | * clippy: fix assorted warnings in `components/` * fix: new and default * fix: review comments
* clippy: fix warnings in various modules in components (#31568)eri2024-03-081-11/+3
| | | | | | | | | * clippy: fix warnings in various modules in components * fix: unit tests * fix: build on android * fix: all samplers use new_boxed
* Move Stylo to its own repo (#31350)Delan Azabani2024-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove packages that were moved to external repo * Add workspace dependencies pointing to 2023-06-14 branch * Fix servo-tidy.toml errors * Update commit to include #31346 * Update commit to include servo/stylo#2 * Move css-properties.json lookup to target/doc/stylo * Remove dependency on vendored mako in favour of pypi dependency This also removes etc/ci/generate_workflow.py, which has been unused since at least 9e71bd6a7010d6e5723831696ae0ebe26b47682f. * Add temporary code to debug Windows test failures * Fix failures on Windows due to custom target dir * Update commit to include servo/stylo#3 * Fix license in tests/unit/style/build.rs * Document how to build with local Stylo in Cargo.toml
* Fix failed request for adapter when not available (#31002)Taym Haddadi2024-01-091-13/+13
| | | Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* WebGPU: always send exit message to script before exiting (#30989)Gregory Terzian2024-01-031-6/+6
| | | | | | | | | * webgpu: always send exit message to script before exiting * Update expectations --------- Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Update wgpu to 0.18.1 (#30926)Samson2023-12-253-6/+11
| | | | | | | * Update wgpu to 0.18.1 * Fix webgpu code * tidy
* Move `*_traits` and other shared types to `shared`Martin Robinson2023-11-031-2/+2
| | | | | | | | | | | | This is the start of the organization of types that are in their own crates in order to break dependency cycles between other crates. The idea here is that putting these packages into their own directory is the first step toward cleaning them up. They have grown organically and it is difficult to explain to new folks where to put new shared types. Many of these crates contain more than traits or don't contain traits at all. Notably, `script_traits` isn't touched because it is vendored from Gecko. Eventually this will move to `third_party`.
* Add GPUSupportedFeatures and update GPUSupportedLimits (#30359)Samson2023-09-141-0/+5
| | | | | | | * GPUSupportedFeatures * New supported limits * Update expectations
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-112-37/+35
| | | | | * strict imports formatting * Reformat all imports
* Upgrade WebRender to e491e1ae637b2eed1e7195855d88357e5eb3ddf9 (#30323)Martin Robinson2023-09-102-4/+3
| | | | | | | | | | | | | | | | | | * Upgrade vendored version of WebRender * Patch WebRender: upgrade version of gleam * Restore hit testing implementation * Fix WebRender warnings * Adapt Servo to new WebRender * Update results * Add a workaround for #30313 This slightly expands text boundaries in order to take into account the fact that layout isn't measuring glyph boundaries.
* remove `extern crate` (#30311)Samson2023-09-082-11/+10
| | | | | | | | | | | * remove extern crate * Update components/script_plugins/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Update wgpu to 0.17 (#30147)Samson2023-08-213-9/+9
|