Commit graph

44 commits

Author SHA1 Message Date
Samson
24ad2a0526
chore: Update wgpu (#33506)
* 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>
2024-09-21 04:20:18 +00:00
Taym Haddadi
152e62022a
Move convert_label to Into implementation (#33348)
Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-09-06 21:58:13 +00:00
Samson
ebed9218f2
webgpu: Move actual Create* implementations from GPUDevice to Self (#33320)
* Move actual Create* implementations from `GPUDevice` to Self

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* move Create*Pipeline to Self::create

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* `parse_render_pipeline` outside`GPURenderPipeline::create`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-09-05 19:48:16 +00:00
Taym Haddadi
00389cf007
Transform convert_* functions in gpuconvert.rs to From/TryFrom implementations (#33302)
Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-09-04 16:03:59 +00:00
Samson
817a91f2ac
webgpu: Clean up GPUCommandEncoders and add some validation (#33223)
* 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>
2024-08-30 11:23:17 +00:00
Samson
94ff89a5e4
webgpu: Sync various parts of spec (#33009)
* Sync `GPUObjectDescriptorBase` (label is not option anymore)

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Sync `GPUFeatureName`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* shader_f16 feature is not usable in wgpu so disable it

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* sync `GPUTextureFormat`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* `validate_texture_format_required_features`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Sync `GPUTexture` attributes

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Make `entryPoint` in `GPUProgrammableStage` optional

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Set good expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Bad expectations because naga does not support cons declarations

Also fail on firefox, where skipped before due to missing device features

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Bad expectation, also fails on firefox

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Bad expectations, because naga does not support `let pos = positions[vertex_index];`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Set expectation

external texture does not work in firefox too (again naga)

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* set bad expectations, because naga does not support `enable`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Set bad expectations for, `Texture with '' label has been destroyed`

also fails in firefox with same reason

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* one bad expectation

also on firefox

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* expect that also matches firefox

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* more expect

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Use only 1 proc for _webgpu

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* better doc comment

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-19 14:06:30 +00:00
Samson
99c1f886b8
webgpu: Update wgpu and revamp RenderPass (#32665)
* 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
2024-07-04 12:16:42 +00:00
派卡 (pi-cla)
650af7db92
webgpu: Remove mutex around Identities (#32682) 2024-07-03 18:39:45 +00:00
Samson
e9cf4d4971
webgpu: Update wgpu and revamp computepass (#32575)
* 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
2024-06-28 04:49:35 +00:00
Samson
794110ebe5
webgpu: Move errorscopes to WGPU thread (#32304)
* 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
2024-05-22 16:47:35 +00:00
Samson
168d43f24a
webgpu: Refactor webgpu crate (#32255)
* wgpu(_core) -> wgc

* Refactor webgpu crate

split lib.rs into multiple modules
2024-05-08 13:53:39 +00:00
Samson
c4f8599404
webgpu: Update to wgpu 0.20 (#32173)
* 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`
2024-05-08 05:38:11 +00:00
Samson
4af413cd04
webgpu: Update wgpu to 0.19 (#31995)
* Update wgpu to 32e70bc163 (0.19)

* Update expect only good

* reexpect

* remove dbg stuff

* Remove all occurrences of dx11_hub
2024-04-26 07:04:15 +00:00
Oluwatobi Sofela
3e63f8d6ee
clippy: Fix needless borrow warnings (#31813) 2024-03-21 17:48:54 +00:00
eri
a8170966ec
Move convert_* functions into gpuconvert.rs (#31521)
* feat: unify convert_* functions across gpu*.rs files #31104

* chore: reorder and format
2024-03-06 16:48:34 +00:00
Martin Robinson
5c1723c983
rustdoc: Fix many rustdoc errors (#31147)
This fixes many rustdoc errors that occur due to raw URLs in rustdoc
comments as well as unescaped Rust code that should be in backticks.
2024-01-22 13:13:48 +00:00
Samson
7973cb6458
Update wgpu to 0.18.1 (#30926)
* Update wgpu to 0.18.1

* Fix webgpu code

* tidy
2023-12-25 07:11:37 +00:00
Samson
ddc47aa56b
Codegen support multiple interfaces in single webidl file & WebGPU single webidl (#30448)
* Codegen support multiple interfaces in single webidl file

* Merge GPU*.webidl into WebGPU.webidl

* Update gpu files to use WebGPUBinding module file
2023-09-30 12:30:12 +00:00
Samson
aad2dccc9c
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting

* Reformat all imports
2023-09-11 19:16:54 +00:00
Samson
71e0372ac1
Upgrade whole webgpu stack (#29795)
* Allow noidl files in script/dom/webidls

* Upgrade wgpu to 0.16 and refresh whole webgpu implementation

* Update WebGPU test expectations

* misc

* MutNullableDom -> DomRefCell<Option<Dom for GPUTexture

* Direct use of GPUTextureDescriptor

* Remove config from GPUCanvasContext

* misc

* finally blue color

* gpubuffer "handle" error

* GPU object have non-null label

* gpu limits and info

* use buffer_size

* fix warnings

* Cleanup

* device destroy

* fallback adapter

* mach update-webgpu write webgpu commit hash in file

* Mising deps in CI for webgpu tests

* Updated expectations

* Fixups

* early reject

* DomRefCell<Option<Dom -> MutNullableDom for GPUTexture
2023-08-20 23:16:46 +00:00
Samson
9514f670d1
No tracing of nop traceable fields (#29926)
* Add `no_trace` option to JSTraceable derive

* NoTrace wrapper

* Port some types to no_trace schematics

* Fixing my unsafe mistakes (not tracing traceables)

* Add docs & safety guards for no_trace

Safety guards (trait shenanigans) guarantees safety usage of `no_trace`

* Port canvas_traits to no_trace

* Port servo_media to no_trace

* Port net_traits to no_trace

* Port style to no_trace

* Port webgpu to no_trace

* Port script_traits to no_trace

* Port canvas_traits, devtools_traits, embedder_traits, profile_traits to no_trace

* unrooted_must_root lint in seperate file

* Add trace_in_no_trace_lint as script_plugin

* Composable types in must_not_have_traceable

* Introduced HashMapTracedValues wrapper

* `HashMap<NoTrace<K>,V>`->`HashMapTracedValues<K,V>`

* Port rest of servo's types to no_trace

* Port html5ever, euclid, mime and http to no_trace

* Port remaining externals to no_trace

* Port webxr and Arc<Mutex<_>>

* Fix spelling in notrace doc
2023-08-04 10:17:43 +00:00
Kunal Mohan
9c3967158a defer encoding errors to finish() 2020-08-22 17:43:10 +05:30
Kunal Mohan
e1bfc7aa0d upgrade wgpu to v0.6 2020-08-22 17:42:40 +05:30
Kunal Mohan
1d80f57aab Record errors in GPUCommandEncoder.BeginPass() and EncoderPass.endPass() 2020-08-07 22:36:05 +05:30
Kunal Mohan
ce6e09a3aa Change ErrorScopeId type to NonZeroU64
And extract it from WebGPURequest
2020-08-03 01:45:29 +05:30
Kunal Mohan
8cb5fad828 Report errors from void returning operations 2020-08-01 16:32:37 +05:30
Kunal Mohan
4e38633009 Refactor and improve GPUErrorScopes
Remove use of equivalent BGLs
2020-07-30 23:36:58 +05:30
Kunal Mohan
aff22db33f Implement GPURenderBundleEncoder and GPURenderBundle 2020-07-24 12:45:23 +05:30
Kunal Mohan
75abccb16b update wgpu, use serializable descriptors 2020-07-22 23:22:13 +05:30
Kunal Mohan
5285c07f1f Implement GPUCommandEncoder.copy commands 2020-07-21 21:00:23 +05:30
Kunal Mohan
cdc0a75fe4 Update GPUObjectBase webidl and cleanup valid flags 2020-07-20 23:03:53 +05:30
Kunal Mohan
0dc1514d57 Implement Async Error reporting for WebGPU and update wgpu-core 2020-07-16 23:21:09 +05:30
Kunal Mohan
b74cea3a46 Implement GPUBuffer.mapAsync and update wgpu-core 2020-06-27 20:27:17 +05:30
Kunal Mohan
00b3f785c4 Add GPUSampler and GPUTextureView to BindingResource
Add validation for BindGroups
2020-06-17 12:45:40 +05:30
Kunal Mohan
3b5ede153d Update wgpu-core and wgpu-types 2020-06-04 01:19:13 +05:30
Kunal Mohan
1d4efb48ba Implement GPURenderPassEncoder
Add webidls for GPURenderPassEncoder and  GPURenderEncoderBase and
implement relevant methods.
2020-06-04 00:27:58 +05:30
Kunal Mohan
f4d0183568 Make WebGPU resource creation fully async
Remove some garbage code in adapter id checks
Prevent panic during shutdown if using WebGPU
2020-05-26 19:16:46 +05:30
Kunal Mohan
a4f911699a Upgrade wgpu-core version to 0.5.0 and implement server-side logic for wgpu id recycling
Remove current implementation of MapReadAsync
2020-05-21 18:28:49 +05:30
Kunal Mohan
1aeae47299 Validate copybuffertobuffer() + some spec update
The spec update includes renaming bindings to entries and
adding CommandEncoderState.
2020-05-15 22:55:08 +05:30
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
Istvan Miklos
000a5d543d Fixing some style related issues in WebGPU.
Changed the Requests/Response from tuples to named struct variants and also sorted in alphabetical order.
Replaced the ID generator functions from `globalscope` with a single function,
which returns a `RefMut` and can call the appropriate method to generate resource IDs.
2020-02-27 15:10:24 +01:00
Istvan Miklos
170e9971ac Implement GPUComputePassEncoder functions
Implement the `dispatch`, `endPass`, `setBindGroup`, `setPipeline` functions of `GPUComputePassEncoder`.
2020-02-19 11:19:59 +01:00
Zakor
a3c6810b18 Initial implementation of GPUQueue
Added WebIDL bindings for `GPUQueue`.
Implemented the `submit` function of `GPUQueue` and `defaultQueue` function of `GPUDevice`.
2020-02-13 14:37:25 +01:00
Zakor Gyula
4facd3d4d2 Initial implementation of GPUCommandEncoder
Added WebIDL bindings for `GPUCommandEncoder`, `GPUCommandBuffer`, `GPUComputePassEncoder`, `GPUProgrammablePassEncoder`.
Implemented the `beginComputePass`, `copyBufferToBuffer` and `finish` functions of `GPUCommandEncoder`.
Implemented the `createCommandEncoder` function of `GPUDevice`.
2020-02-11 10:20:34 +01:00