use crate::{
sr::constants::Constant,
sr::instructions,
sr::ops::{self, Op},
sr::storage::*,
sr::types::Type,
};
#[derive(Debug)]
pub struct EntryPoint {
pub execution_model: spirv::ExecutionModel,
pub function: Token<Function>,
pub name: String,
}
#[derive(Debug)]
pub struct Block {
pub arguments: Vec<Token<Type>>,
pub ops: Vec<Token<Op>>,
pub terminator: ops::Terminator,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Jump {
pub block: Token<Block>,
pub arguments: Vec<Token<Op>>,
}
pub struct Function {
pub control: spirv::FunctionControl,
pub result: Token<Type>,
pub parameters: Vec<Token<Type>>,
pub blocks: Storage<Block>,
pub start_block: Token<Block>,
}
pub struct Module {
pub version: spirv::Word,
pub capabilities: Vec<spirv::Capability>,
pub extensions: Vec<String>,
pub ext_inst_imports: Vec<String>,
pub memory_model: instructions::MemoryModel,
pub entry_points: Vec<EntryPoint>,
pub types: Storage<Type>,
pub constants: Storage<Constant>,
pub ops: Storage<Op>,
pub functions: Vec<Function>,
}