Mesa (master): anv: Restrict the number of color regions to those actually written

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 2 01:02:54 UTC 2018


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

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Wed Jun 27 18:30:09 2018 -0700

anv: Restrict the number of color regions to those actually written

The back-end compiler emits the number of color writes specified by
wm_prog_key::nr_color_regions regardless of what nir_store_outputs we
have.  Once we've gone through and figured out which render targets
actually exist and are written by the shader, we should restrict the key
to avoid extra RT write messages.

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

---

 src/intel/vulkan/anv_pipeline.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index e2116e2480..914e513276 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -963,6 +963,11 @@ anv_pipeline_compile_fs(struct anv_pipeline *pipeline,
          num_rts = 1;
       }
 
+      /* Now that we've determined the actual number of render targets, adjust
+       * the key accordingly.
+       */
+      key.nr_color_regions = num_rts;
+
       assert(num_rts <= max_rt);
       map.surface_to_descriptor -= num_rts;
       map.surface_count += num_rts;




More information about the mesa-commit mailing list