FromCompilation

Trait FromCompilation 

Source
pub trait FromCompilation<T, S> {
    type Target: OutputTarget;
    type Options;
    type Context;
    type Output: CompileShader<Self::Target, Context = Self::Context, Options = Self::Options> + ReflectShader;

    // Required method
    fn from_compilation(
        compile: T,
    ) -> Result<CompilerBackend<Self::Output>, ShaderReflectError>;
}
Expand description

A trait for reflectable compilations that can be transformed into an object ready for reflection or compilation.

T is the compiled reflectable form of the shader. S is the semantics under which the shader is reflected.

librashader currently supports two semantics, SpirvCross

Required Associated Types§

Source

type Target: OutputTarget

The target that the transformed object is expected to compile for.

Source

type Options

Options provided to the compiler.

Source

type Context

Additional context returned by the compiler after compilation.

Source

type Output: CompileShader<Self::Target, Context = Self::Context, Options = Self::Options> + ReflectShader

The output type after conversion.

Required Methods§

Source

fn from_compilation( compile: T, ) -> Result<CompilerBackend<Self::Output>, ShaderReflectError>

Tries to convert the input object into an object ready for compilation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl FromCompilation<SpirvCompilation, SpirvCross> for GLSL

Available on non-crate feature stable only.
Source§

impl FromCompilation<SpirvCompilation, SpirvCross> for HLSL

Available on non-crate feature stable only.
Source§

impl FromCompilation<SpirvCompilation, SpirvCross> for MSL

Available on non-crate feature stable only.
Source§

impl FromCompilation<SpirvCompilation, SpirvCross> for SPIRV

Available on non-crate feature stable only.
Source§

impl FromCompilation<SpirvCompilation, Naga> for MSL

Available on non-crate feature stable only.
Source§

impl FromCompilation<SpirvCompilation, Naga> for SPIRV

Available on non-crate feature stable only.
Source§

impl FromCompilation<SpirvCompilation, Naga> for WGSL

Available on non-crate feature stable only.