nir: update uses_demote flag in discard_to_demote pass

Otherwise the ctx.ac.postponed_kill will not be allocated.

Fixes: ce87da71e9 ("nir: add pass to lower discard() to demote()")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2662
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4301>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2020-03-24 15:58:59 +01:00
parent fc8432e6d6
commit 84da4ded4b

View file

@ -50,9 +50,11 @@ nir_lower_discard_to_demote(nir_shader *shader)
switch (intrin->intrinsic) {
case nir_intrinsic_discard:
intrin->intrinsic = nir_intrinsic_demote;
shader->info.fs.uses_demote = true;
break;
case nir_intrinsic_discard_if:
intrin->intrinsic = nir_intrinsic_demote_if;
shader->info.fs.uses_demote = true;
break;
case nir_intrinsic_load_helper_invocation:
intrin->intrinsic = nir_intrinsic_is_helper_invocation;