diff --git a/wgpu-hal/src/dx12/shader_compilation.rs b/wgpu-hal/src/dx12/shader_compilation.rs index ff41e503a..7a5dc8cb9 100644 --- a/wgpu-hal/src/dx12/shader_compilation.rs +++ b/wgpu-hal/src/dx12/shader_compilation.rs @@ -93,14 +93,14 @@ impl CompilerContainer { } pub(super) fn max_shader_model(&self) -> Option { - match self { + match *self { CompilerContainer::Fxc(..) => None, CompilerContainer::DynamicDxc(CompilerDynamicDxc { max_shader_model, .. }) | CompilerContainer::StaticDxc(CompilerStaticDxc { max_shader_model, .. - }) => Some(max_shader_model.clone()), + }) => Some(max_shader_model), } } diff --git a/wgpu-types/src/backend.rs b/wgpu-types/src/backend.rs index 6c8449cff..be8af9bef 100644 --- a/wgpu-types/src/backend.rs +++ b/wgpu-types/src/backend.rs @@ -389,13 +389,13 @@ impl ForceShaderModelToken { /// # Safety /// Do not make use in runtime-compiled shaders of any features that may not be supported by the FXC or DXC /// version you use. - pub unsafe fn with_shader_model(sm: DxcShaderModel) -> Self { + pub const unsafe fn with_shader_model(sm: DxcShaderModel) -> Self { Self { inner: Some(sm) } } /// Returns the shader model version, if any, in this token. - pub fn get(&self) -> Option { - self.inner.clone() + pub const fn get(&self) -> Option { + self.inner } } @@ -740,7 +740,7 @@ impl Dx12SwapchainKind { } /// DXC shader model. -#[derive(Clone, Debug)] +#[derive(Clone, Copy, Debug)] #[allow(missing_docs)] pub enum DxcShaderModel { V6_0,