pub enum OptimizationPass {
TypeInference,
RedundantCastRemoval,
AlgebraicSimplification,
LoopDetection,
NodeMerging,
InstructionCounting,
DeadCodeElimination,
ConstantPropagation,
}Expand description
Individual optimization passes that can be applied to a shader graph.
Variants§
TypeInference
Infer types through the graph and insert implicit casts where needed.
RedundantCastRemoval
Remove redundant type casts (e.g., float -> float).
AlgebraicSimplification
Apply algebraic simplifications: x1=x, x+0=x, x0=0, etc.
LoopDetection
Detect cycles/loops in the graph (report errors).
NodeMerging
Merge sequential compatible math operations into single nodes.
InstructionCounting
Estimate instruction count per node and total.
DeadCodeElimination
Dead code elimination (remove nodes not reachable from outputs).
ConstantPropagation
Constant propagation through known-value chains.
Trait Implementations§
Source§impl Clone for OptimizationPass
impl Clone for OptimizationPass
Source§fn clone(&self) -> OptimizationPass
fn clone(&self) -> OptimizationPass
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OptimizationPass
impl Debug for OptimizationPass
Source§impl Hash for OptimizationPass
impl Hash for OptimizationPass
Source§impl PartialEq for OptimizationPass
impl PartialEq for OptimizationPass
impl Copy for OptimizationPass
impl Eq for OptimizationPass
impl StructuralPartialEq for OptimizationPass
Auto Trait Implementations§
impl Freeze for OptimizationPass
impl RefUnwindSafe for OptimizationPass
impl Send for OptimizationPass
impl Sync for OptimizationPass
impl Unpin for OptimizationPass
impl UnsafeUnpin for OptimizationPass
impl UnwindSafe for OptimizationPass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.