Mesa (main): anv: Set graphics pipeline active_stages earlier

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Oct 4 19:18:16 UTC 2021


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

Author: Marcin Ślusarz <marcin.slusarz at intel.com>
Date:   Tue Aug 31 14:43:08 2021 +0200

anv: Set graphics pipeline active_stages earlier

So that we can use the active_stages in copy_non_dynamic_state() later.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13047>

---

 src/intel/vulkan/anv_pipeline.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index dd163394338..eded787ea66 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -1400,8 +1400,6 @@ anv_pipeline_compile_graphics(struct anv_graphics_pipeline *pipeline,
    const struct brw_compiler *compiler = pipeline->base.device->physical->compiler;
    struct anv_pipeline_stage stages[MESA_SHADER_STAGES] = {};
 
-   pipeline->active_stages = 0;
-
    /* Information on which states are considered dynamic. */
    const VkPipelineDynamicStateCreateInfo *dyn_info =
       info->pDynamicState;
@@ -1417,8 +1415,6 @@ anv_pipeline_compile_graphics(struct anv_graphics_pipeline *pipeline,
       const VkPipelineShaderStageCreateInfo *sinfo = &info->pStages[i];
       gl_shader_stage stage = vk_to_mesa_shader_stage(sinfo->stage);
 
-      pipeline->active_stages |= sinfo->stage;
-
       int64_t stage_start = os_time_get_nano();
 
       stages[stage].stage = stage;
@@ -1478,9 +1474,6 @@ anv_pipeline_compile_graphics(struct anv_graphics_pipeline *pipeline,
       stages[stage].feedback.flags |= VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT_EXT;
    }
 
-   if (pipeline->active_stages & VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT)
-      pipeline->active_stages |= VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT;
-
    assert(pipeline->active_stages & VK_SHADER_STAGE_VERTEX_BIT);
 
    ANV_FROM_HANDLE(anv_pipeline_layout, layout, info->layout);
@@ -2375,6 +2368,14 @@ anv_graphics_pipeline_init(struct anv_graphics_pipeline *pipeline,
             pCreateInfo->pDynamicState->pDynamicStates[s]);
       }
    }
+
+   pipeline->active_stages = 0;
+   for (uint32_t i = 0; i < pCreateInfo->stageCount; i++)
+      pipeline->active_stages |= pCreateInfo->pStages[i].stage;
+
+   if (pipeline->active_stages & VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT)
+      pipeline->active_stages |= VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT;
+
    copy_non_dynamic_state(pipeline, pCreateInfo);
 
    pipeline->depth_clamp_enable = pCreateInfo->pRasterizationState->depthClampEnable;



More information about the mesa-commit mailing list