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@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13047>
This commit is contained in:
Marcin Ślusarz
2021-08-31 14:43:08 +02:00
committed by Marge Bot
parent bc2545fc57
commit d79c518a32
+8 -7
View File
@@ -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;