pub enum Dx12Compiler {
Fxc,
DynamicDxc {
dxc_path: String,
dxil_path: String,
},
StaticDxc,
}
Expand description
Selects which DX12 shader compiler to use.
If the DynamicDxc
option is selected, but dxcompiler.dll
and dxil.dll
files aren’t found,
then this will fall back to the Fxc compiler at runtime and log an error.
Variants§
Fxc
The Fxc compiler (default) is old, slow and unmaintained.
However, it doesn’t require any additional .dlls to be shipped with the application.
DynamicDxc
The Dxc compiler is new, fast and maintained.
However, it requires both dxcompiler.dll
and dxil.dll
to be shipped with the application.
These files can be downloaded from https://github.com/microsoft/DirectXShaderCompiler/releases.
Minimum supported version: v1.5.2010
It also requires WDDM 2.1 (Windows 10 version 1607).
StaticDxc
The statically-linked variant of Dxc.
The static-dxc
feature is required for this setting to be used successfully on DX12.
Not available on windows-aarch64-pc-*
targets.
Implementations§
source§impl Dx12Compiler
impl Dx12Compiler
sourcepub fn default_dynamic_dxc() -> Dx12Compiler
pub fn default_dynamic_dxc() -> Dx12Compiler
Helper function to construct a DynamicDxc
variant with default paths.
sourcepub fn from_env() -> Option<Dx12Compiler>
pub fn from_env() -> Option<Dx12Compiler>
Choose which DX12 shader compiler to use from the environment variable WGPU_DX12_COMPILER
.
Valid values, case insensitive:
Fxc
Dxc
orDynamicDxc
StaticDxc
sourcepub fn with_env(self) -> Dx12Compiler
pub fn with_env(self) -> Dx12Compiler
Takes the given compiler, modifies it based on the WGPU_DX12_COMPILER
environment variable, and returns the result.
See from_env
for more information.
Trait Implementations§
source§impl Clone for Dx12Compiler
impl Clone for Dx12Compiler
source§fn clone(&self) -> Dx12Compiler
fn clone(&self) -> Dx12Compiler
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Dx12Compiler
impl Debug for Dx12Compiler
source§impl Default for Dx12Compiler
impl Default for Dx12Compiler
source§fn default() -> Dx12Compiler
fn default() -> Dx12Compiler
Auto Trait Implementations§
impl Freeze for Dx12Compiler
impl RefUnwindSafe for Dx12Compiler
impl Send for Dx12Compiler
impl Sync for Dx12Compiler
impl Unpin for Dx12Compiler
impl UnwindSafe for Dx12Compiler
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)