iridia-ir 0.6.0

iridia's shader IR: typed SSA values and operations in structured regions or a control flow graph, with the interface vocabulary, a validator and a text form
Documentation
//! How large a program is, in the unit its reader counts.
#[allow(unused_imports)]
use alloc::{
    boxed::Box,
    format,
    string::{String, ToString},
    vec,
    vec::Vec,
};

use serde::Serialize;

/// The source's counting unit. DXBC counts decoded instructions including control flow, excluding declarations;
/// DXIL counts LLVM instructions
/// in the functions the lifter reads. Neither is an executed instruction count or an IR expression count.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum InstructionUnit {
    /// Instructions of a DXBC shader (Shader Model 4 or 5) as decoded.
    DxbcInstructions,
    /// Instructions of a DXIL shader (Shader Model 6) in the functions the lifter reads.
    DxilInstructions,
}
/// How many instructions a program has, in the unit that says how they were counted.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize)]
pub struct InstructionCount {
    /// The number of instructions counted.
    pub count: u64,
    /// What `count` counts; counts of different units are not comparable.
    pub unit: InstructionUnit,
}