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

Author: Mike Blumenkrantz <[email protected]>
Date:   Sat Apr 24 13:17:34 2021 -0400

lavapipe: ignore tess pipeline info if no tess shaders in pipeline

Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10625>

---

 src/gallium/frontends/lavapipe/lvp_pipeline.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/frontends/lavapipe/lvp_pipeline.c 
b/src/gallium/frontends/lavapipe/lvp_pipeline.c
index 142eb1d15ab..354c3a00197 100644
--- a/src/gallium/frontends/lavapipe/lvp_pipeline.c
+++ b/src/gallium/frontends/lavapipe/lvp_pipeline.c
@@ -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,

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to