nir: Fixes for UE4 and Portal with RTX RT shaders on RADV
These two commits fix validation errors I've come across while trying to compile UE4 Ray Tracing shaders with RADV.
The first commit makes nir_opt_dead_cf
remove phi instructions without sources (which occur if the block containing the instructions is unreachable and all predecessors were removed by nir_opt_dead_cf
). If phi instructions without sources are present during nir_opt_cse
, they are collapsed even if their destination types are different, leading to validation errors.
The second commit fixes an assert I was hitting (https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/compiler/nir/nir.h#L4042) that Removed the commit, it was a hacky workaround at bestif
blocks mustn't follow jumps. if
blocks following jumps are always removed by nir_opt_dead_cf
, so I moved it above the pass that requires