Make ForceShaderModelToken’s functions const.

This commit is contained in:
Kevin Reid authored and Erich Gubler committed 2026-08-03 06:34:29 -04:00
1 parent c150de0ba7
commit 9f5c71ffb9
2 files changed
+6 -6

No files matched your search

+2 -2
View File
@@ -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),
}
}
+4 -4
View File
@@ -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,