Trait shades::stage::ShaderModule
source · [−]pub trait ShaderModule<I, O> {
type Inputs;
type Outputs;
fn new_shader_module<E>(
f: impl FnOnce(ModBuilder<Self, I, O, E>, Self::Inputs, Self::Outputs, E::Env) -> Stage<Self, I, O, E>
) -> Stage<Self, I, O, E>
where
E: Environment;
}
Expand description
Shader module.
A shader module is defined by its type, which leads to the possible kinds ofinputs and outputs.
Shader modules that define a main
functions are usually called “shader stages”, and the ones that don’t are
referred to as simple “modules.”
Required Associated Types
Required Methods
fn new_shader_module<E>(
f: impl FnOnce(ModBuilder<Self, I, O, E>, Self::Inputs, Self::Outputs, E::Env) -> Stage<Self, I, O, E>
) -> Stage<Self, I, O, E> where
E: Environment,
fn new_shader_module<E>(
f: impl FnOnce(ModBuilder<Self, I, O, E>, Self::Inputs, Self::Outputs, E::Env) -> Stage<Self, I, O, E>
) -> Stage<Self, I, O, E> where
E: Environment,
Create a new shader stage.
This method creates a Stage
that can be used only by the kind of flavour defined by the S
type variable.
Return
This method returns the fully built Stage
, which cannot be mutated anymore once it has been built,
and can be passed to various writers
to generate actual code for target shading languages.