Skip to content

nir: replace undef with 0 or NaN (nir_opt_undef), collapse FP opcodes sourcing NaN (nir_opt_algebraic), etc.

Marek Olšák requested to merge mareko/mesa:nir-opt-undef-nan into main

What does this MR do and why?

It replaces undef with NaN if it leads to better code (such as removing FP opcodes), and with 0 for other ALU opcodes. Undefs used by stores and phis are not touched. There are also workarounds for Viewperf13 in nir_opt_undef.

This will help remove shader inputs and outputs with a new varying optimizer by turning output store parameters into constants.

TODO: Need to check that #2689 (closed) doesn't resurface.

Edited by Marek Olšák

Merge request reports