Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

average_z3_ordering_depth

Function average_z3_ordering_depth 

Source
pub fn average_z3_ordering_depth(depths: [u16; 3], zsf3: i16) -> u16
Expand description

Compute AVSZ3’s saturated OTZ result from three cached projected depths.

This pure-software form is useful for host processing and for callers that cannot disturb the live GTE FIFO. MIPS render loops should normally prefer average_cached_z3. The arithmetic is exactly the GTE operation: sum the unsigned 16-bit depths, multiply by signed ZSF3, shift right by 12, then saturate to OTZ’s unsigned 16-bit range.