diff options
author | Samson <16504129+sagudev@users.noreply.github.com> | 2024-06-28 06:49:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-28 04:49:35 +0000 |
commit | e9cf4d4971c0ce8ec64da7f09d6e97ae10be5b05 (patch) | |
tree | fb9f0179cfe93744118835c3a34edc8c19672a3e /components/webgpu/dom_messages.rs | |
parent | fced0b49404c02bb5aafa9ddd468f9077ce26c19 (diff) | |
download | servo-e9cf4d4971c0ce8ec64da7f09d6e97ae10be5b05.tar.gz servo-e9cf4d4971c0ce8ec64da7f09d6e97ae10be5b05.zip |
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
Diffstat (limited to 'components/webgpu/dom_messages.rs')
-rw-r--r-- | components/webgpu/dom_messages.rs | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/components/webgpu/dom_messages.rs b/components/webgpu/dom_messages.rs index f9f0fc0ffe5..78bde1c91b2 100644 --- a/components/webgpu/dom_messages.rs +++ b/components/webgpu/dom_messages.rs @@ -16,8 +16,7 @@ use wgc::binding_model::{ BindGroupDescriptor, BindGroupLayoutDescriptor, PipelineLayoutDescriptor, }; use wgc::command::{ - ComputePass, ImageCopyBuffer, ImageCopyTexture, RenderBundleDescriptor, RenderBundleEncoder, - RenderPass, + ImageCopyBuffer, ImageCopyTexture, RenderBundleDescriptor, RenderBundleEncoder, RenderPass, }; use wgc::device::HostMap; use wgc::id; @@ -191,6 +190,7 @@ pub enum WebGPURequest { DropShaderModule(id::ShaderModuleId), DropRenderBundle(id::RenderBundleId), DropQuerySet(id::QuerySetId), + DropComputePass(id::ComputePassEncoderId), Exit(IpcSender<()>), RenderBundleEncoderFinish { render_bundle_encoder: RenderBundleEncoder, @@ -210,13 +210,45 @@ pub enum WebGPURequest { device_id: id::DeviceId, pipeline_id: PipelineId, }, - RunComputePass { + BeginComputePass { command_encoder_id: id::CommandEncoderId, - compute_pass: Option<ComputePass>, + compute_pass_id: ComputePassId, + label: Option<Cow<'static, str>>, + device_id: id::DeviceId, + }, + ComputePassSetPipeline { + compute_pass_id: ComputePassId, + pipeline_id: id::ComputePipelineId, + device_id: id::DeviceId, + }, + ComputePassSetBindGroup { + compute_pass_id: ComputePassId, + index: u32, + bind_group_id: id::BindGroupId, + offsets: Vec<u32>, + device_id: id::DeviceId, + }, + ComputePassDispatchWorkgroups { + compute_pass_id: ComputePassId, + x: u32, + y: u32, + z: u32, + device_id: id::DeviceId, + }, + ComputePassDispatchWorkgroupsIndirect { + compute_pass_id: ComputePassId, + buffer_id: id::BufferId, + offset: u64, + device_id: id::DeviceId, }, - RunRenderPass { + EndComputePass { + compute_pass_id: ComputePassId, + device_id: id::DeviceId, command_encoder_id: id::CommandEncoderId, + }, + EndRenderPass { render_pass: Option<RenderPass>, + device_id: id::DeviceId, }, Submit { queue_id: id::QueueId, |