Skip to content

nir/lower_clip: Only emit 1 discard

Alyssa Rosenzweig requested to merge alyssa/mesa:nir/lower-clip-opt into main

If we have multiple clip planes, rather than emit multiple discards we can just OR together the discard criteria. Then a nir_opt_algebraic rule kicks in to optimize out the flt/.../flt/ior/.../ior into fmin/.../fmin/flt, generating much less code at the end.

Written while debugging an unrelated issue with the clip lowering.

Signed-off-by: Alyssa Rosenzweig alyssa@rosenzweig.io

Merge request reports