webgpu_traits/messages/
to_script.rs1use serde::{Deserialize, Serialize};
8use servo_base::id::PipelineId;
9use wgpu_core::id::{
10 AdapterId, BindGroupId, BindGroupLayoutId, BufferId, CommandBufferId, CommandEncoderId,
11 ComputePassEncoderId, ComputePipelineId, DeviceId, ExternalTextureId, PipelineLayoutId,
12 QuerySetId, RenderBundleId, RenderPassEncoderId, RenderPipelineId, SamplerId, ShaderModuleId,
13 StagingBufferId, SurfaceId, TextureId, TextureViewId,
14};
15
16use crate::{DeviceLostReason, Error, WebGPUDevice};
17
18#[derive(Clone, Debug, Deserialize, Serialize)]
19pub enum WebGPUMsg {
20 FreeAdapter(AdapterId),
21 FreeDevice {
22 device_id: DeviceId,
23 pipeline_id: PipelineId,
24 },
25 FreeBuffer(BufferId),
26 FreePipelineLayout(PipelineLayoutId),
27 FreeComputePipeline(ComputePipelineId),
28 FreeRenderPipeline(RenderPipelineId),
29 FreeBindGroup(BindGroupId),
30 FreeBindGroupLayout(BindGroupLayoutId),
31 FreeCommandEncoder(CommandEncoderId),
32 FreeCommandBuffer(CommandBufferId),
33 FreeTexture(TextureId),
34 FreeTextureView(TextureViewId),
35 FreeSampler(SamplerId),
36 FreeSurface(SurfaceId),
37 FreeShaderModule(ShaderModuleId),
38 FreeRenderBundle(RenderBundleId),
39 FreeStagingBuffer(StagingBufferId),
40 FreeQuerySet(QuerySetId),
41 FreeComputePass(ComputePassEncoderId),
42 FreeRenderPass(RenderPassEncoderId),
43 FreeExternalTexture(ExternalTextureId),
44 UncapturedError {
45 device: WebGPUDevice,
46 pipeline_id: PipelineId,
47 error: Error,
48 },
49 DeviceLost {
50 device: WebGPUDevice,
51 pipeline_id: PipelineId,
52 reason: DeviceLostReason,
53 msg: String,
54 },
55 Exit,
56}