Mesa (master): vc4: Use the nir_builder helper for loading sample mask.

Eric Anholt anholt at kemper.freedesktop.org
Fri Feb 10 22:18:03 UTC 2017


Module: Mesa
Branch: master
Commit: 30237193f5f0f28c900052296a0f8d0619e7f50d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=30237193f5f0f28c900052296a0f8d0619e7f50d

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Feb 10 12:59:39 2017 -0800

vc4: Use the nir_builder helper for loading sample mask.

---

 src/gallium/drivers/vc4/vc4_nir_lower_blend.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/gallium/drivers/vc4/vc4_nir_lower_blend.c b/src/gallium/drivers/vc4/vc4_nir_lower_blend.c
index 64d70cc..7811f1c 100644
--- a/src/gallium/drivers/vc4/vc4_nir_lower_blend.c
+++ b/src/gallium/drivers/vc4/vc4_nir_lower_blend.c
@@ -631,16 +631,7 @@ vc4_nir_lower_blend_instr(struct vc4_compile *c, nir_builder *b,
         nir_ssa_def *frag_color = intr->src[0].ssa;
 
         if (c->fs_key->sample_coverage) {
-                nir_intrinsic_instr *load =
-                        nir_intrinsic_instr_create(b->shader,
-                                                   nir_intrinsic_load_sample_mask_in);
-                load->num_components = 1;
-                nir_ssa_dest_init(&load->instr, &load->dest, 1, 32, NULL);
-                nir_builder_instr_insert(b, &load->instr);
-
-                nir_ssa_def *bitmask = &load->dest.ssa;
-
-                vc4_nir_store_sample_mask(c, b, bitmask);
+                vc4_nir_store_sample_mask(c, b, nir_load_sample_mask_in(b));
         } else if (c->fs_key->sample_alpha_to_coverage) {
                 nir_ssa_def *a = nir_channel(b, frag_color, 3);
 




More information about the mesa-commit mailing list