mirror of
https://github.com/servo/servo.git
synced 2025-08-13 01:15:34 +01:00
webgpu: Use wgpu's instead of string errors and update limits handling (#32925)
* Use wgpu specific errors Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixup expect Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * WIP Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix records erasing enforcerange Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * page can already be destroyed Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Support more limits Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Set good results Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Set OK (not PASS) expect CRASH Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixup expectation Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * bad expectations https://github.com/gfx-rs/wgpu/issues/6075 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * set bad expectation render bundleencoder needs to be rewritten 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
b366a02318
commit
5e59988c87
8 changed files with 496 additions and 871 deletions
|
@ -7,6 +7,8 @@
|
|||
use ipc_channel::ipc::IpcSharedMemory;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use wgc::pipeline::CreateShaderModuleError;
|
||||
use wgpu_core::instance::{RequestAdapterError, RequestDeviceError};
|
||||
use wgpu_core::resource::BufferAccessError;
|
||||
pub use {wgpu_core as wgc, wgpu_types as wgt};
|
||||
|
||||
use crate::identity::*;
|
||||
|
@ -63,22 +65,20 @@ pub struct Adapter {
|
|||
pub channel: WebGPU,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct Device {
|
||||
pub device_id: WebGPUDevice,
|
||||
pub queue_id: WebGPUQueue,
|
||||
pub descriptor: wgt::DeviceDescriptor<Option<String>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
pub enum WebGPUResponse {
|
||||
/// WebGPU is disabled
|
||||
None,
|
||||
// TODO: use wgpu errors
|
||||
Adapter(Result<Adapter, String>),
|
||||
Device(Result<Device, String>),
|
||||
BufferMapAsync(Result<IpcSharedMemory, String>),
|
||||
Adapter(Result<Adapter, RequestAdapterError>),
|
||||
Device(
|
||||
(
|
||||
WebGPUDevice,
|
||||
WebGPUQueue,
|
||||
Result<wgt::DeviceDescriptor<Option<String>>, RequestDeviceError>,
|
||||
),
|
||||
),
|
||||
BufferMapAsync(Result<IpcSharedMemory, BufferAccessError>),
|
||||
SubmittedWorkDone,
|
||||
PoppedErrorScope(Result<Option<Error>, PopError>),
|
||||
CompilationInfo(Option<ShaderCompilationInfo>),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue