Enum wgpu::Dx12Compiler

source ·
pub enum Dx12Compiler {
    Fxc,
    Dxc {
        dxil_path: Option<PathBuf>,
        dxc_path: Option<PathBuf>,
    },
}
Expand description

Selects which DX12 shader compiler to use.

If the wgpu-hal/dx12-shader-compiler feature isn’t enabled then this will fall back to the Fxc compiler at runtime and log an error. This feature is always enabled when using wgpu.

If the Dxc 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.

wgpu::utils::init::dx12_shader_compiler_from_env can be used to set the compiler from the WGPU_DX12_SHADER_COMPILER environment variable, but this should only be used for testing.

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.

§

Dxc

Fields

§dxil_path: Option<PathBuf>

Path to the dxcompiler.dll file. Passing None will use standard platform specific dll loading rules.

§dxc_path: Option<PathBuf>

Path to the dxil.dll file. Passing None will use standard platform specific dll loading rules.

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

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.