Mesa (staging/22.1): lavapipe: fix renderpass info handling during pipeline creation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 27 16:23:25 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: ddaadc3da050ad9c2aae872aa6a36e142ef4d4b1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ddaadc3da050ad9c2aae872aa6a36e142ef4d4b1

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Jun 23 10:26:09 2022 -0400

lavapipe: fix renderpass info handling during pipeline creation

only the viewMask parameter of VkPipelineRenderingCreateInfoKHR can
be accessed in the fragment stage, so for pipeline libraries it should
be assumed that zs attachments exist for the purpose of copying dynamic
state values, and then these dynamic states will naturally be pruned
during final pipeline construction if the attachments turn out to not
be present

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17219>
(cherry picked from commit 2a69aeb9c1f2324ec5b988786152b52d6ea9cbc8)

---

 .pick_status.json                             |  2 +-
 src/gallium/frontends/lavapipe/lvp_pipeline.c | 14 ++++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index e5675b77100..73f18881ded 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -292,7 +292,7 @@
         "description": "lavapipe: fix renderpass info handling during pipeline creation",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/frontends/lavapipe/lvp_pipeline.c b/src/gallium/frontends/lavapipe/lvp_pipeline.c
index 6b016035575..28166d12e68 100644
--- a/src/gallium/frontends/lavapipe/lvp_pipeline.c
+++ b/src/gallium/frontends/lavapipe/lvp_pipeline.c
@@ -393,7 +393,7 @@ deep_copy_graphics_create_info(void *mem_ctx,
    dst->pNext = NULL;
    dst->flags = src->flags;
    dst->layout = src->layout;
-   if (shaders & (VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT | VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT)) {
+   if (shaders & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT) {
       assert(!dst->renderPass || !src->renderPass || dst->renderPass == src->renderPass);
       assert(!dst->subpass || !src->subpass || dst->subpass == src->subpass);
       dst->subpass = src->subpass;
@@ -411,6 +411,14 @@ deep_copy_graphics_create_info(void *mem_ctx,
    if (rp_info) {
       has_depth = rp_info->depthAttachmentFormat != VK_FORMAT_UNDEFINED;
       has_stencil = rp_info->stencilAttachmentFormat != VK_FORMAT_UNDEFINED;
+   } else if ((shaders & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT) &&
+              (shaders ^ VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT)) {
+      /* if this is a fragment stage without a fragment output,
+       * assume both of these exist so the dynamic states are covered,
+       * then let them be naturally pruned in the final pipeline
+       */
+      has_depth = true;
+      has_stencil = true;
    }
    dst->basePipelineHandle = src->basePipelineHandle;
    dst->basePipelineIndex = src->basePipelineIndex;
@@ -494,8 +502,6 @@ deep_copy_graphics_create_info(void *mem_ctx,
    }
 
    if (shaders & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT) {
-      assert(rp_info);
-      bool have_output = (shaders & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT) > 0;
       /* pDepthStencilState */
       if (src->pDepthStencilState && !rasterization_disabled &&
           /*
@@ -513,7 +519,7 @@ deep_copy_graphics_create_info(void *mem_ctx,
                state but not fragment output interface state, pDepthStencilState must be a valid pointer
                to a valid VkPipelineDepthStencilStateCreateInfo structure
           */
-          (!have_output || has_depth || has_stencil)) {
+          (has_depth || has_stencil)) {
          LVP_PIPELINE_DUP(dst->pDepthStencilState,
                           src->pDepthStencilState,
                           VkPipelineDepthStencilStateCreateInfo,



More information about the mesa-commit mailing list