From cd12d416271e9e9fd0f00303525021f75688ff9f Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Sun, 5 May 2024 07:22:18 -0700 Subject: chore: update wgpu (#23684) --- ext/webgpu/binding.rs | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'ext/webgpu/binding.rs') 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) { - 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) { - 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,27 +112,11 @@ impl From 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 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 { @@ -171,7 +153,7 @@ impl From 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) } -- cgit v1.2.3