From 1f1ad5a9b43e1757e6603668b1266f29af2dba9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20=C5=9Alusarz?= Date: Tue, 31 Aug 2021 14:49:57 +0200 Subject: [PATCH] anv: Use input assembly state only when pipeline has vertex stage Reviewed-by: Caio Marcelo de Oliveira Filho Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_pipeline.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index eded787ea66..509bb500b58 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -2036,7 +2036,8 @@ copy_non_dynamic_state(struct anv_graphics_pipeline *pipeline, pCreateInfo->pRasterizationState->frontFace; } - if (states & ANV_CMD_DIRTY_DYNAMIC_PRIMITIVE_TOPOLOGY) { + if ((states & ANV_CMD_DIRTY_DYNAMIC_PRIMITIVE_TOPOLOGY) && + (pipeline->active_stages & VK_SHADER_STAGE_VERTEX_BIT)) { assert(pCreateInfo->pInputAssemblyState); dynamic->primitive_topology = pCreateInfo->pInputAssemblyState->topology; } @@ -2053,7 +2054,8 @@ copy_non_dynamic_state(struct anv_graphics_pipeline *pipeline, pCreateInfo->pRasterizationState->depthBiasEnable; } - if (states & ANV_CMD_DIRTY_DYNAMIC_PRIMITIVE_RESTART_ENABLE) { + if ((states & ANV_CMD_DIRTY_DYNAMIC_PRIMITIVE_RESTART_ENABLE) && + (pipeline->active_stages & VK_SHADER_STAGE_VERTEX_BIT)) { assert(pCreateInfo->pInputAssemblyState); dynamic->primitive_restart_enable = pCreateInfo->pInputAssemblyState->primitiveRestartEnable;