Struct naga::Module

source · []
pub struct Module {
    pub types: UniqueArena<Type>,
    pub constants: Arena<Constant>,
    pub global_variables: Arena<GlobalVariable>,
    pub functions: Arena<Function>,
    pub entry_points: Vec<EntryPoint>,
}
Expand description

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 the Default implementation. 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 backends.

Fields

types: UniqueArena<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.

Each function must appear in this arena strictly before all its callers. Recursion is not supported.

entry_points: Vec<EntryPoint>

Entry points.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. 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

Performs the conversion.

Performs the conversion.

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.