Struct naga::Module[][src]

pub struct Module {
    pub header: Header,
    pub types: Arena<Type>,
    pub constants: Arena<Constant>,
    pub global_variables: Arena<GlobalVariable>,
    pub functions: Arena<Function>,
    pub entry_points: FastHashMap<(ShaderStage, String), EntryPoint>,
}

Shader module.

A module is a set of constants, global variables and functions, as well as the types required to define them.

Some functions are marked as entry points, to be used in a certain shader stage.

To create a new module, use Module::from_header or Module::generate_empty. Alternatively, you can load an existing shader using one of the available front ends.

When finished, you can export modules using one of the available back ends.

Fields

header: Header

Header containing module metadata.

types: Arena<Type>

Storage for the types defined in this module.

constants: Arena<Constant>

Storage for the constants defined in this module.

global_variables: Arena<GlobalVariable>

Storage for the global variables defined in this module.

functions: Arena<Function>

Storage for the functions defined in this module.

entry_points: FastHashMap<(ShaderStage, String), EntryPoint>

Exported entry points.

Implementations

impl Module[src]

pub fn from_header(header: Header) -> Self[src]

pub fn generate_empty() -> Self[src]

Trait Implementations

impl Debug for Module[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.