anv: Don't claim the null RT as a valid color target
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 30 Oct 2019 20:53:11 +0000 (15:53 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Thu, 31 Oct 2019 21:07:15 +0000 (21:07 +0000)
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@intel.com>
src/intel/vulkan/anv_pipeline.c

index 1a2eb4599c8611165756d393c1ac58e399dcb88f..63e6e6e3fea1f5034fa7f9a3ff330b16ee219111 100644 (file)
@@ -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,