spirv2dxil: Remove dead branches early during shader compilation

Apparently spiregg can produce not-taken branches that somehow try
to access textures that aren't actually declared. These branches
need to be trimmed before any texture lowering is done.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27531>
This commit is contained in:
Jesse Natalie
2024-02-07 15:59:02 -08:00
committed by Marge Bot
parent a8758afabd
commit a3c45306e2
@@ -1173,6 +1173,8 @@ dxil_spirv_nir_passes(nir_shader *nir,
}
NIR_PASS(progress, nir, nir_lower_vars_to_ssa);
NIR_PASS(progress, nir, nir_opt_algebraic);
NIR_PASS(progress, nir, nir_opt_dead_cf);
NIR_PASS(progress, nir, nir_opt_remove_phis);
} while (progress);
}