nir: update uses_demote flag in discard_to_demote pass
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tue, 24 Mar 2020 14:58:59 +0000 (15:58 +0100)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Wed, 25 Mar 2020 07:19:33 +0000 (08:19 +0100)
Otherwise the ctx.ac.postponed_kill will not be allocated.

Fixes: ce87da71e93 ("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>

src/compiler/nir/nir_lower_discard_to_demote.c

index cbb7da9a89210d36aaf7140a061c8a218d364ec4..eb13796d952926e16607f654835a8f3d0185bbe9 100644 (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;