Mesa (master): anv: Don't claim the null RT as a valid color target

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 31 21:32:26 UTC 2019


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

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Wed Oct 30 15:53:11 2019 -0500

anv: Don't claim the null RT as a valid color target

If it's NULL, we can let the compiler go ahead and delete it or flag it
as NULL.

Reviewed-by: Rafael Antognolli <rafael.antognolli at intel.com>

---

 src/intel/vulkan/anv_pipeline.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 1a2eb4599c8..63e6e6e3fea 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -1008,6 +1008,12 @@ anv_pipeline_link_fs(const struct brw_compiler *compiler,
    if (deleted_output)
       nir_fixup_deref_modes(stage->nir);
 
+   /* Now that we've determined the actual number of render targets, adjust
+    * the key accordingly.
+    */
+   stage->key.wm.nr_color_regions = num_rts;
+   stage->key.wm.color_outputs_valid = (1 << num_rts) - 1;
+
    if (num_rts == 0) {
       /* If we have no render targets, we need a null render target */
       rt_bindings[0] = (struct anv_pipeline_binding) {
@@ -1018,12 +1024,6 @@ anv_pipeline_link_fs(const struct brw_compiler *compiler,
       num_rts = 1;
    }
 
-   /* Now that we've determined the actual number of render targets, adjust
-    * the key accordingly.
-    */
-   stage->key.wm.nr_color_regions = num_rts;
-   stage->key.wm.color_outputs_valid = (1 << num_rts) - 1;
-
    assert(num_rts <= max_rt);
    assert(stage->bind_map.surface_count == 0);
    typed_memcpy(stage->bind_map.surface_to_descriptor,




More information about the mesa-commit mailing list