mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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
|
@ -267,9 +267,8 @@ pub enum WebGPURequest {
|
|||
},
|
||||
UnmapBuffer {
|
||||
buffer_id: id::BufferId,
|
||||
device_id: id::DeviceId,
|
||||
array_buffer: IpcSharedMemory,
|
||||
is_map_read: bool,
|
||||
write_back: bool,
|
||||
offset: u64,
|
||||
size: u64,
|
||||
},
|
||||
|
|
|
@ -4,10 +4,13 @@
|
|||
|
||||
//! IPC messages that are send to WebGPU DOM objects.
|
||||
|
||||
use std::ops::Range;
|
||||
|
||||
use ipc_channel::ipc::IpcSharedMemory;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use wgc::id;
|
||||
use wgc::pipeline::CreateShaderModuleError;
|
||||
use wgpu_core::device::HostMap;
|
||||
use wgpu_core::instance::{RequestAdapterError, RequestDeviceError};
|
||||
use wgpu_core::resource::BufferAccessError;
|
||||
pub use {wgpu_core as wgc, wgpu_types as wgt};
|
||||
|
@ -72,6 +75,13 @@ pub struct Pipeline<T: std::fmt::Debug + Serialize> {
|
|||
pub label: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct Mapping {
|
||||
pub data: IpcSharedMemory,
|
||||
pub mode: HostMap,
|
||||
pub range: Range<u64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
pub enum WebGPUResponse {
|
||||
|
@ -85,7 +95,7 @@ pub enum WebGPUResponse {
|
|||
Result<wgt::DeviceDescriptor<Option<String>>, RequestDeviceError>,
|
||||
),
|
||||
),
|
||||
BufferMapAsync(Result<IpcSharedMemory, BufferAccessError>),
|
||||
BufferMapAsync(Result<Mapping, BufferAccessError>),
|
||||
SubmittedWorkDone,
|
||||
PoppedErrorScope(Result<Option<Error>, PopError>),
|
||||
CompilationInfo(Option<ShaderCompilationInfo>),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue