From bc20f04066dd00a785b4b867c002f68ee335b9c4 Mon Sep 17 00:00:00 2001 From: dAxpeDDa Date: Sat, 8 Oct 2022 09:06:55 +0200 Subject: [PATCH] Implement `Clone` for `ShaderModuleDescriptor` --- CHANGELOG.md | 1 + wgpu/src/lib.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d01d1a4671..1f0675f0e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ Bottom level categories: #### General - Add the `"wgsl"` feature, to enable WGSL shaders in `wgpu-core` and `wgpu`. Enabled by default in `wgpu`. By @daxpedda in [#2890](https://github.com/gfx-rs/wgpu/pull/2890). +- Implement `Clone` for `ShaderSource` and `ShaderModuleDescriptor` in `wgpu`. By @daxpedda in [#3086](https://github.com/gfx-rs/wgpu/pull/3086). #### GLES diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index 9ee5c370a0..8c56ff221a 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -836,6 +836,7 @@ impl Drop for ShaderModule { /// Any necessary shader translation (e.g. from WGSL to SPIR-V or vice versa) /// will be done internally by wgpu. #[cfg_attr(feature = "naga", allow(clippy::large_enum_variant))] +#[derive(Clone)] #[non_exhaustive] pub enum ShaderSource<'a> { /// SPIR-V module represented as a slice of words. @@ -876,6 +877,7 @@ static_assertions::assert_impl_all!(ShaderSource: Send, Sync); /// /// Corresponds to [WebGPU `GPUShaderModuleDescriptor`]( /// https://gpuweb.github.io/gpuweb/#dictdef-gpushadermoduledescriptor). +#[derive(Clone)] pub struct ShaderModuleDescriptor<'a> { /// Debug label of the shader module. This will show up in graphics debuggers for easy identification. pub label: Label<'a>,