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, RenderBundleEncoderId, RenderBundleId, RenderPassEncoderId, RenderPipelineId,
13 SamplerId, ShaderModuleId, 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 FreeRenderBundleEncoder(RenderBundleEncoderId),
45 UncapturedError {
46 device: WebGPUDevice,
47 pipeline_id: PipelineId,
48 error: Error,
49 },
50 DeviceLost {
51 device: WebGPUDevice,
52 pipeline_id: PipelineId,
53 reason: DeviceLostReason,
54 msg: String,
55 },
56 Exit,
57}