summaryrefslogtreecommitdiff
path: root/ext/webgpu/binding.rs
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2024-05-05 07:22:18 -0700
committerGitHub <noreply@github.com>2024-05-05 07:22:18 -0700
commitcd12d416271e9e9fd0f00303525021f75688ff9f (patch)
treeaf1fd7a88590e37b09e61ae5a1aaeec4c325b907 /ext/webgpu/binding.rs
parentb2628e4a069ed9fc13f34f6e4fd75f29c657e5a9 (diff)
chore: update wgpu (#23684)
Diffstat (limited to 'ext/webgpu/binding.rs')
-rw-r--r--ext/webgpu/binding.rs32
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)
}