Skip to content

Commit ddae7ac

Browse files
committed
Make ForceShaderModelToken’s functions const.
1 parent 837677c commit ddae7ac

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

wgpu-types/src/backend.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,13 +374,13 @@ impl ForceShaderModelToken {
374374
/// # Safety
375375
/// Do not make use in runtime-compiled shaders of any features that may not be supported by the FXC or DXC
376376
/// version you use.
377-
pub unsafe fn with_shader_model(sm: DxcShaderModel) -> Self {
377+
pub const unsafe fn with_shader_model(sm: DxcShaderModel) -> Self {
378378
Self { inner: Some(sm) }
379379
}
380380

381381
/// Returns the shader model version, if any, in this token.
382-
pub fn get(&self) -> Option<DxcShaderModel> {
383-
self.inner.clone()
382+
pub const fn get(&self) -> Option<DxcShaderModel> {
383+
self.inner
384384
}
385385
}
386386

@@ -725,7 +725,7 @@ impl Dx12SwapchainKind {
725725
}
726726

727727
/// DXC shader model.
728-
#[derive(Clone, Debug)]
728+
#[derive(Clone, Copy, Debug)]
729729
#[allow(missing_docs)]
730730
pub enum DxcShaderModel {
731731
V6_0,

0 commit comments

Comments
 (0)