lavapipe: ignore tess pipeline info if no tess shaders in pipeline
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Sat, 24 Apr 2021 17:17:34 +0000 (13:17 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 6 May 2021 14:59:32 +0000 (14:59 +0000)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10625>

src/gallium/frontends/lavapipe/lvp_pipeline.c

index 142eb1d..354c3a0 100644 (file)
@@ -238,12 +238,14 @@ deep_copy_graphics_create_info(void *mem_ctx,
    dst->basePipelineIndex = src->basePipelineIndex;
 
    /* pStages */
+   VkShaderStageFlags stages_present = 0;
    dst->stageCount = src->stageCount;
    stages = ralloc_array(mem_ctx, VkPipelineShaderStageCreateInfo, dst->stageCount);
    for (i = 0 ; i < dst->stageCount; i++) {
       result = deep_copy_shader_stage(mem_ctx, &stages[i], &src->pStages[i]);
       if (result != VK_SUCCESS)
          return result;
+      stages_present |= src->pStages[i].stage;
    }
    dst->pStages = stages;
 
@@ -262,7 +264,9 @@ deep_copy_graphics_create_info(void *mem_ctx,
                     1);
 
    /* pTessellationState */
-   if (src->pTessellationState) {
+   if (src->pTessellationState &&
+      (stages_present & (VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT | VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT)) ==
+                        (VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT | VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT)) {
       LVP_PIPELINE_DUP(dst->pTessellationState,
                        src->pTessellationState,
                        VkPipelineTessellationStateCreateInfo,