Module rspirv::mr [] [src]

Data representation of various SPIR-V language constructs.

By language constructs, I mean general language concepts like module, function, basic block, instruction, and operands. This is different from the "control flow constructs" mentioned in the SPIR-V specification.

This data representation is designed to be lightweight; there are no excessive sanity check or cross referrences within each language construct. It is intended to be used as a plain data vehicle of SPIR-V language constructs in the memory.

Required components of a language construct may still be wrapped around using Option; it makes the data representation more flexible since we don't always require valid language constructs.

Apart from definitions of various language constructs, this module also provides a loader for loading SPIR-V binaries (together with the parser) and a builder for building a SPIR-V data representation interactively.

Structs

BasicBlock

Data representation of a SPIR-V basic block.

Builder

The data representation builder.

Function

Data representation of a SPIR-V function.

InstIter

Instruction iterator.

Instruction

Data representation of a SPIR-V instruction.

Loader

The data representation loader.

Module

Data representation of a SPIR-V module.

ModuleHeader

Data representation of a SPIR-V module header.

Enums

Error

Data representation loading errors.

Operand

Data representation of a SPIR-V operand.

Functions

load_bytes

Loads the SPIR-V binary into memory and returns a Module.

load_words

Loads the SPIR-V binary into memory and returns a Module.