From d79c518a32b5d95ab300fbc765c3edad4cf517c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20=C5=9Alusarz?= Date: Tue, 31 Aug 2021 14:43:08 +0200 Subject: [PATCH] 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 Reviewed-by: Lionel Landwerlin Part-of: --- 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;