Struct rspirv::mr::Module[][src]

pub struct Module {
    pub header: Option<ModuleHeader>,
    pub capabilities: Vec<Instruction>,
    pub extensions: Vec<Instruction>,
    pub ext_inst_imports: Vec<Instruction>,
    pub memory_model: Option<Instruction>,
    pub entry_points: Vec<Instruction>,
    pub execution_modes: Vec<Instruction>,
    pub debugs: Vec<Instruction>,
    pub annotations: Vec<Instruction>,
    pub types_global_values: Vec<Instruction>,
    pub functions: Vec<Function>,
}

Data representation of a SPIR-V module.

Most of the fields are just vectors of Instructions, but some fields store values decomposed from Instructions for better investigation.

The order of its fields basically reveal the requirements in the Logical Layout of a Module of the SPIR-V of the SPIR-V specification.

Fields

The module header.

All OpCapability instructions.

All OpExtension instructions.

All OpExtInstImport instructions.

The OpMemoryModel instruction.

Although it is required by the specification to appear exactly once per module, we keep it optional here to allow flexibility.

All entry point declarations, using OpEntryPoint.

All execution mode declarations, using OpExecutionMode.

All non-location debug instructions.

All annotation instructions.

All types, constants, and global variables.

As per the specification, they have to be bundled together because they can depend on one another.

All functions.

Methods

impl Module
[src]

Creates a new empty Module instance.

Important traits for InstIter<'i>

Returns an iterator over all global instructions.

This method internally creates a vector of references to all global instructions, therefore it has some overheads.

Trait Implementations

impl Assemble for Module
[src]

Assembles the current object and returns the binary code.

impl Disassemble for Module
[src]

Disassembles the current object and returns the assembly code.

impl Debug for Module
[src]

Formats the value using the given formatter. Read more

impl Default for Module
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for Module

impl Sync for Module