Mesa (master): anv/pipeline: use less instructions for multiview

Jason Ekstrand jekstrand at kemper.freedesktop.org
Wed Mar 21 21:50:12 UTC 2018


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

Author: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Date:   Wed Mar 14 16:12:44 2018 -0700

anv/pipeline: use less instructions for multiview

The view_index is encoded in the remainder of dividing instance id by
the number of views in the view mask (n). In the general case (handled
by the else clause), there is a need to map from 0..n-1 into the
number of the view being masked. For that a map is encoded.

In the case only the first n bits in the mask are set, the mapping is
trivial, 0..n-1 already represent what view is being referred to.

That case was in the original patch that added
anv_nir_lower_multiview.c but disabled.

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/intel/vulkan/anv_nir_lower_multiview.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_nir_lower_multiview.c b/src/intel/vulkan/anv_nir_lower_multiview.c
index 88e6f9af87..d2aefdee62 100644
--- a/src/intel/vulkan/anv_nir_lower_multiview.c
+++ b/src/intel/vulkan/anv_nir_lower_multiview.c
@@ -86,7 +86,7 @@ build_view_index(struct lower_multiview_state *state)
             nir_umod(b, nir_load_instance_id(b),
                         nir_imm_int(b, _mesa_bitcount(state->view_mask)));
 
-         if (0 && util_is_power_of_two(state->view_mask + 1)) {
+         if (util_is_power_of_two(state->view_mask + 1)) {
             /* If we have a full view mask, then compacted is what we want */
             state->view_index = compacted;
          } else {




More information about the mesa-commit mailing list