Skip to content

Commit

Permalink
Implement Clone for ShaderModuleDescriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Aug 7, 2022
1 parent 537c6be commit 964e9d6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ default-members = ["wgpu", "wgpu-hal", "wgpu-info"]
#web-sys = { path = "../wasm-bindgen/crates/web-sys" }
#js-sys = { path = "../wasm-bindgen/crates/js-sys" }
#wasm-bindgen = { path = "../wasm-bindgen" }
# https://github.com/gfx-rs/naga/pull/2013
naga = { git = "https://github.com/daxpedda/naga", branch = "module-clone" }
1 change: 1 addition & 0 deletions wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ env_logger = "0.9"
#git = "https://github.com/gfx-rs/naga"
#rev = "27d38aae"
version = "0.9"
features = ["clone"]
optional = true

# used to test all the example shaders
Expand Down
2 changes: 2 additions & 0 deletions wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,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.
#[derive(Clone)]
#[non_exhaustive]
pub enum ShaderSource<'a> {
/// SPIR-V module represented as a slice of words.
Expand Down Expand Up @@ -847,6 +848,7 @@ pub enum ShaderSource<'a> {
///
/// 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>,
Expand Down

0 comments on commit 964e9d6

Please sign in to comment.