mirror of
https://github.com/servo/servo.git
synced 2025-07-29 10:10:34 +01:00
webgpu: Implement device lost (#32354)
* device lost promise should be init at creation of device object * device lost impl * lock for device poll workaround for wgpu deadlocks * expect * Less lost reason reasoning in script
This commit is contained in:
parent
3381f2a704
commit
cbc9304c20
9 changed files with 224 additions and 5628 deletions
|
@ -15,6 +15,13 @@ use crate::wgc::id::{
|
|||
ShaderModuleId, StagingBufferId, SurfaceId, TextureId, TextureViewId,
|
||||
};
|
||||
|
||||
/// <https://gpuweb.github.io/gpuweb/#enumdef-gpudevicelostreason>
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||
pub enum DeviceLostReason {
|
||||
Unknown,
|
||||
Destroyed,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub enum WebGPUMsg {
|
||||
FreeAdapter(AdapterId),
|
||||
|
@ -34,14 +41,16 @@ pub enum WebGPUMsg {
|
|||
FreeRenderBundle(RenderBundleId),
|
||||
FreeStagingBuffer(StagingBufferId),
|
||||
FreeQuerySet(QuerySetId),
|
||||
CleanDevice {
|
||||
device: WebGPUDevice,
|
||||
pipeline_id: PipelineId,
|
||||
},
|
||||
UncapturedError {
|
||||
device: WebGPUDevice,
|
||||
pipeline_id: PipelineId,
|
||||
error: Error,
|
||||
},
|
||||
DeviceLost {
|
||||
device: WebGPUDevice,
|
||||
pipeline_id: PipelineId,
|
||||
reason: DeviceLostReason,
|
||||
msg: String,
|
||||
},
|
||||
Exit,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue