From c765e2156a8fb52bdcda758e7c2b0cbdc791d1a9 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 30 Oct 2019 15:53:11 -0500 Subject: [PATCH] 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 --- 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 1a2eb45..63e6e6e 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, -- 2.7.4