diff options
Diffstat (limited to 'ext/webgpu/binding.rs')
-rw-r--r-- | ext/webgpu/binding.rs | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/ext/webgpu/binding.rs b/ext/webgpu/binding.rs index bdc71a9ef..41708acc7 100644 --- a/ext/webgpu/binding.rs +++ b/ext/webgpu/binding.rs @@ -21,8 +21,7 @@ impl Resource for WebGpuBindGroupLayout { } fn close(self: Rc<Self>) { - let instance = &self.0; - gfx_select!(self.1 => instance.bind_group_layout_drop(self.1)); + gfx_select!(self.1 => self.0.bind_group_layout_drop(self.1)); } } @@ -36,8 +35,7 @@ impl Resource for WebGpuBindGroup { } fn close(self: Rc<Self>) { - let instance = &self.0; - gfx_select!(self.1 => instance.bind_group_drop(self.1)); + gfx_select!(self.1 => self.0.bind_group_drop(self.1)); } } @@ -114,28 +112,12 @@ impl From<GpuTextureSampleType> for wgpu_types::TextureSampleType { #[derive(Deserialize)] #[serde(rename_all = "camelCase")] struct GpuStorageTextureBindingLayout { - access: GpuStorageTextureAccess, + access: wgpu_types::StorageTextureAccess, format: wgpu_types::TextureFormat, view_dimension: wgpu_types::TextureViewDimension, } #[derive(Deserialize)] -#[serde(rename_all = "kebab-case")] -enum GpuStorageTextureAccess { - WriteOnly, -} - -impl From<GpuStorageTextureAccess> for wgpu_types::StorageTextureAccess { - fn from(access: GpuStorageTextureAccess) -> Self { - match access { - GpuStorageTextureAccess::WriteOnly => { - wgpu_types::StorageTextureAccess::WriteOnly - } - } - } -} - -#[derive(Deserialize)] #[serde(rename_all = "camelCase")] pub struct GpuBindGroupLayoutEntry { binding: u32, @@ -171,7 +153,7 @@ impl From<GpuBindingType> for wgpu_types::BindingType { }, GpuBindingType::StorageTexture(storage_texture) => { wgpu_types::BindingType::StorageTexture { - access: storage_texture.access.into(), + access: storage_texture.access, format: storage_texture.format, view_dimension: storage_texture.view_dimension, } @@ -215,7 +197,7 @@ pub fn op_webgpu_create_bind_group_layout( gfx_put!(device => instance.device_create_bind_group_layout( device, &descriptor, - () + None ) => state, WebGpuBindGroupLayout) } @@ -251,7 +233,7 @@ pub fn op_webgpu_create_pipeline_layout( gfx_put!(device => instance.device_create_pipeline_layout( device, &descriptor, - () + None ) => state, super::pipeline::WebGpuPipelineLayout) } @@ -335,6 +317,6 @@ pub fn op_webgpu_create_bind_group( gfx_put!(device => instance.device_create_bind_group( device, &descriptor, - () + None ) => state, WebGpuBindGroup) } |