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>
This commit is contained in:
Samson 2024-08-27 09:54:55 +02:00 committed by GitHub
parent bb5926b329
commit 7fce24f9d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 690 additions and 1163 deletions

View file

@ -8,7 +8,7 @@ use std::hash::{Hash, Hasher};
use dom_struct::dom_struct;
use webgpu::{WebGPU, WebGPUCommandBuffer, WebGPURequest};
use crate::dom::bindings::cell::{DomRefCell, Ref};
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::GPUCommandBufferMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot};
@ -89,10 +89,6 @@ impl GPUCommandBuffer {
pub fn id(&self) -> WebGPUCommandBuffer {
self.command_buffer
}
pub fn buffers(&self) -> Ref<HashSet<Dom<GPUBuffer>>> {
self.buffers.borrow()
}
}
impl GPUCommandBufferMethods for GPUCommandBuffer {