anv: Validate vertex related states only when VS is present

Mesh pipeline doesn't use those states, so we can't assert them
unconditionally for a graphics pipeline.

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:
Caio Marcelo de Oliveira Filho 2021-05-19 11:26:21 -07:00 committed by Marge Bot
parent 82c69c9a9d
commit bc2545fc57
1 changed files with 4 additions and 2 deletions

View File

@ -2265,8 +2265,6 @@ anv_pipeline_validate_create_info(const VkGraphicsPipelineCreateInfo *info)
subpass = &renderpass->subpasses[info->subpass];
assert(info->stageCount >= 1);
assert(info->pVertexInputState);
assert(info->pInputAssemblyState);
assert(info->pRasterizationState);
if (!info->pRasterizationState->rasterizerDiscardEnable) {
assert(info->pViewportState);
@ -2291,6 +2289,10 @@ anv_pipeline_validate_create_info(const VkGraphicsPipelineCreateInfo *info)
for (uint32_t i = 0; i < info->stageCount; ++i) {
switch (info->pStages[i].stage) {
case VK_SHADER_STAGE_VERTEX_BIT:
assert(info->pVertexInputState);
assert(info->pInputAssemblyState);
break;
case VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT:
case VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT:
assert(info->pTessellationState);