mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
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:
parent
bb5926b329
commit
7fce24f9d5
12 changed files with 690 additions and 1163 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue