[][src]Trait spirv_tools::opt::Optimizer

pub trait Optimizer {
    pub fn with_env(target_env: TargetEnv) -> Self;
pub fn optimize<MC: MessageCallback>(
        &self,
        input: impl AsRef<[u32]>,
        msg_callback: &mut MC,
        options: Option<Options>
    ) -> Result<Binary, Error>;
pub fn register_pass(&mut self, pass: Passes) -> &mut Self;
pub fn register_performance_passes(&mut self) -> &mut Self;
pub fn register_size_passes(&mut self) -> &mut Self;
pub fn register_hlsl_legalization_passes(&mut self) -> &mut Self; }

Required methods

pub fn with_env(target_env: TargetEnv) -> Self[src]

pub fn optimize<MC: MessageCallback>(
    &self,
    input: impl AsRef<[u32]>,
    msg_callback: &mut MC,
    options: Option<Options>
) -> Result<Binary, Error>
[src]

pub fn register_pass(&mut self, pass: Passes) -> &mut Self[src]

Register a single pass with the the optimizer.

pub fn register_performance_passes(&mut self) -> &mut Self[src]

Registers passes that attempt to improve performance of generated code. This sequence of passes is subject to constant review and will change from time to time.

pub fn register_size_passes(&mut self) -> &mut Self[src]

Registers passes that attempt to improve the size of generated code. This sequence of passes is subject to constant review and will change from time to time.

pub fn register_hlsl_legalization_passes(&mut self) -> &mut Self[src]

Registers passes that attempt to legalize the generated code.

Note: this recipe is specially designed for legalizing SPIR-V. It should be used by compilers after translating HLSL source code literally. It should not be used by general workloads for performance or size improvement.

This sequence of passes is subject to constant review and will change from time to time.

Loading content...

Implementors

impl Optimizer for CompiledOptimizer[src]

pub fn register_pass(&mut self, pass: Passes) -> &mut Self[src]

Register a single pass with the the optimizer.

pub fn register_performance_passes(&mut self) -> &mut Self[src]

Registers passes that attempt to improve performance of generated code. This sequence of passes is subject to constant review and will change from time to time.

pub fn register_size_passes(&mut self) -> &mut Self[src]

Registers passes that attempt to improve the size of generated code. This sequence of passes is subject to constant review and will change from time to time.

pub fn register_hlsl_legalization_passes(&mut self) -> &mut Self[src]

Registers passes that attempt to legalize the generated code.

Note: this recipe is specially designed for legalizing SPIR-V. It should be used by compilers after translating HLSL source code literally. It should not be used by general workloads for performance or size improvement.

This sequence of passes is subject to constant review and will change from time to time.

Loading content...