nir_to_tgsi: Use nir_lower_discard_if for demote_if.

TGSI doesn't have a DEMOTE_IF, so we want to lower it back to IF DEMOTE
ENDIF.  Fixes a regression with nvc0 on nir-to-tgsi.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15932>
This commit is contained in:
Emma Anholt 2022-04-13 10:39:05 -07:00 committed by Marge Bot
parent 28b2252d0a
commit 1c4b64f016

View file

@ -3838,6 +3838,9 @@ const void *nir_to_tgsi_options(struct nir_shader *s,
NIR_PASS_V(s, nir_lower_indirect_derefs, no_indirects_mask, UINT32_MAX);
/* Lower demote_if to if (cond) { demote } because TGSI doesn't have a DEMOTE_IF. */
NIR_PASS_V(s, nir_lower_discard_if, nir_lower_demote_if_to_cf);
bool progress;
do {
progress = false;