diff options
author | Leo K <crowlkats@toaxl.com> | 2021-08-24 13:29:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-24 13:29:42 +0200 |
commit | f4a9db350fbf00a6cb13a2c030b925cfd5218ed2 (patch) | |
tree | 3ab5cc4f4db7e4855df04fc792ee1e66e05a5d13 /ext/webgpu/command_encoder.rs | |
parent | 50f69a6996ae4dcdfe53f15fc49949d3756c9787 (diff) |
chore(ext/webgpu): update wgpu to 0.10.0 (#11781)
Co-authored-by: Luca Casonato <hello@lcas.dev>
Diffstat (limited to 'ext/webgpu/command_encoder.rs')
-rw-r--r-- | ext/webgpu/command_encoder.rs | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/ext/webgpu/command_encoder.rs b/ext/webgpu/command_encoder.rs index b2d659f13..b68bab7bd 100644 --- a/ext/webgpu/command_encoder.rs +++ b/ext/webgpu/command_encoder.rs @@ -31,7 +31,7 @@ impl Resource for WebGpuCommandBuffer { fn serialize_store_op(store_op: String) -> wgpu_core::command::StoreOp { match store_op.as_str() { "store" => wgpu_core::command::StoreOp::Store, - "discard" => wgpu_core::command::StoreOp::Clear, + "discard" => wgpu_core::command::StoreOp::Discard, _ => unreachable!(), } } @@ -323,7 +323,7 @@ pub struct GpuImageCopyTexture { pub texture: u32, pub mip_level: Option<u32>, pub origin: Option<GpuOrigin3D>, - pub _aspect: Option<String>, // not yet implemented + pub aspect: String, } #[derive(Deserialize)] @@ -373,6 +373,12 @@ pub fn op_webgpu_command_encoder_copy_buffer_to_texture( y: origin.y.unwrap_or(0), z: origin.z.unwrap_or(0), }), + aspect: match args.destination.aspect.as_str() { + "all" => wgpu_types::TextureAspect::All, + "stencil-only" => wgpu_types::TextureAspect::StencilOnly, + "depth-only" => wgpu_types::TextureAspect::DepthOnly, + _ => unreachable!(), + }, }; gfx_ok!(command_encoder => instance.command_encoder_copy_buffer_to_texture( command_encoder, @@ -424,6 +430,12 @@ pub fn op_webgpu_command_encoder_copy_texture_to_buffer( z: origin.z.unwrap_or(0), } }), + aspect: match args.source.aspect.as_str() { + "all" => wgpu_types::TextureAspect::All, + "stencil-only" => wgpu_types::TextureAspect::StencilOnly, + "depth-only" => wgpu_types::TextureAspect::DepthOnly, + _ => unreachable!(), + }, }; let destination = wgpu_core::command::ImageCopyBuffer { buffer: destination_buffer_resource.0, @@ -487,6 +499,12 @@ pub fn op_webgpu_command_encoder_copy_texture_to_texture( z: origin.z.unwrap_or(0), } }), + aspect: match args.source.aspect.as_str() { + "all" => wgpu_types::TextureAspect::All, + "stencil-only" => wgpu_types::TextureAspect::StencilOnly, + "depth-only" => wgpu_types::TextureAspect::DepthOnly, + _ => unreachable!(), + }, }; let destination = wgpu_core::command::ImageCopyTexture { texture: destination_texture_resource.0, @@ -499,6 +517,12 @@ pub fn op_webgpu_command_encoder_copy_texture_to_texture( y: origin.y.unwrap_or(0), z: origin.z.unwrap_or(0), }), + aspect: match args.destination.aspect.as_str() { + "all" => wgpu_types::TextureAspect::All, + "stencil-only" => wgpu_types::TextureAspect::StencilOnly, + "depth-only" => wgpu_types::TextureAspect::DepthOnly, + _ => unreachable!(), + }, }; gfx_ok!(command_encoder => instance.command_encoder_copy_texture_to_texture( command_encoder, |