Mesa (main): anv: Validate vertex related states only when VS is present

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


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

Author: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Date:   Wed May 19 11:26:21 2021 -0700

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 at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13047>

---

 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 c5b6bdddab4..dd163394338 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -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);



More information about the mesa-commit mailing list