diff options
author | Samson <16504129+sagudev@users.noreply.github.com> | 2024-08-27 09:54:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-27 07:54:55 +0000 |
commit | 7fce24f9d54a015db7ee813fc16c74d2feacbb12 (patch) | |
tree | e344ef00f1f1b99b59158b789c064fda52b495b6 /components/script/dom/gpuqueue.rs | |
parent | bb5926b3291877fb47d44ea376881c2d52701bbf (diff) | |
download | servo-7fce24f9d54a015db7ee813fc16c74d2feacbb12.tar.gz servo-7fce24f9d54a015db7ee813fc16c74d2feacbb12.zip |
webgpu: Sync `GPUBuffer` (#33154)
* 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>
Diffstat (limited to 'components/script/dom/gpuqueue.rs')
-rw-r--r-- | components/script/dom/gpuqueue.rs | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/components/script/dom/gpuqueue.rs b/components/script/dom/gpuqueue.rs index aa0daa5ae0f..e4a4102141d 100644 --- a/components/script/dom/gpuqueue.rs +++ b/components/script/dom/gpuqueue.rs @@ -20,7 +20,7 @@ use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::{Dom, DomRoot}; use crate::dom::bindings::str::USVString; use crate::dom::globalscope::GlobalScope; -use crate::dom::gpubuffer::{GPUBuffer, GPUBufferState}; +use crate::dom::gpubuffer::GPUBuffer; use crate::dom::gpucommandbuffer::GPUCommandBuffer; use crate::dom::gpuconvert::{ convert_ic_texture, convert_image_data_layout, convert_texture_size_to_dict, @@ -80,21 +80,6 @@ impl GPUQueueMethods for GPUQueue { /// <https://gpuweb.github.io/gpuweb/#dom-gpuqueue-submit> fn Submit(&self, command_buffers: Vec<DomRoot<GPUCommandBuffer>>) { - let valid = command_buffers.iter().all(|cb| { - cb.buffers() - .iter() - .all(|b| matches!(b.state(), GPUBufferState::Unmapped)) - }); - if !valid { - self.device - .borrow() - .as_ref() - .unwrap() - .dispatch_error(webgpu::Error::Validation(String::from( - "Referenced GPUBuffer(s) are not Unmapped", - ))); - return; - } let command_buffers = command_buffers.iter().map(|cb| cb.id().0).collect(); self.channel .0 |