pub enum AlphaComparison {
Output,
Transformed,
Dithered {
scale_word: u32,
},
Unwritten,
}Expand description
What a discard compares against a constant word (an alpha reference), proved from the program’s data flow
(iridia::output_uses::discard_compares).
Variants§
Output
The output alpha itself (including unchanged branch arms).
Transformed
A scalar that reaches output alpha through arithmetic. Cutting the output is an approximation.
Dithered
A pre-transform alpha plus (dither.a - 0.5) * scale. scale_word is a word offset in the reference’s own
buffer. A hard cutoff on output alpha approximates the program’s stochastic, pre-transform test.
Unwritten
The discard compares a value made of texture samples and constants that reaches no target’s alpha (a G-buffer
program writes none: t1.w * t0.w + scale * (noise - 0.5) < reference). The test is the program’s own
expression, read exactly from its graph (iridia::output_uses::alpha_tests); a cutoff on any output alpha is not
it, and a consumer that cuts evaluates that expression, or does not cut.