vyre 0.4.0

GPU compute intermediate representation with a standard operation library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Lowering context — the mutable state carried through WGSL emission.
//!
//! `LowerCtx` tracks indentation depth, variable type scope, which buffers are
//! accessed atomically, and the buffer declaration map.  It is the internal
//! state of the lowering contract, not part of the public API.

use crate::ir::model::program::BufferDecl;
use crate::lower::wgsl::analysis::TypeScope;
use std::collections::{HashMap, HashSet};

/// Mutable context used while emitting WGSL from vyre IR.
pub(crate) struct LowerCtx<'a> {
    pub(crate) indent: usize,
    pub(crate) vars: TypeScope<'a>,
    pub(crate) atomic_buffers: HashSet<String>,
    pub(crate) buffer_map: HashMap<&'a str, &'a BufferDecl>,
}