mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-30 01:54:31 +01:00
Make ForceShaderModelToken’s functions const.
This commit is contained in:
1 parent
c150de0ba7
commit
9f5c71ffb9
2 files changed
+6
-6
No files matched your search
@@ -93,14 +93,14 @@ impl CompilerContainer {
|
||||
}
|
||||
|
||||
pub(super) fn max_shader_model(&self) -> Option<wgt::DxcShaderModel> {
|
||||
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),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<DxcShaderModel> {
|
||||
self.inner.clone()
|
||||
pub const fn get(&self) -> Option<DxcShaderModel> {
|
||||
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,
|
||||
|
||||
Reference in new issue
Block a user