pan/bi: Include ATEST datum in the instruction
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 19 Jan 2021 00:14:23 +0000 (19:14 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 8 Feb 2021 14:07:29 +0000 (14:07 +0000)
Rather than doing this at pack time like before, or adding extra
constraints to the already overcomplicated scheduler, let's just include
it like a regular FAU source.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8354>

src/panfrost/bifrost/bifrost_compile.c

index dec6264..1983054 100644 (file)
@@ -381,8 +381,12 @@ bi_emit_fragment_out(bi_builder *b, nir_intrinsic_instr *instr)
                         (T == nir_type_float32) ? bi_word(rgba, 3) :
                         bi_dontcare();
 
-                bi_atest_to(b, bi_register(60), bi_register(60), alpha);
+                bi_instr *atest = bi_atest_to(b, bi_register(60),
+                                bi_register(60), alpha);
                 b->shader->emitted_atest = true;
+
+                /* Pseudo-source to encode in the tuple */
+                atest->src[2] = bi_fau(BIR_FAU_ATEST_PARAM, false);
         }
 
         if (emit_zs) {