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

Author: Chia-I Wu <olva...@gmail.com>
Date:   Wed Nov  1 18:00:56 2023 -0700

vulkan, tu, pvr: remove vk_render_pass_state::render_pass

The spec says

  A VkRenderPass or VkPipelineLayout object passed as a parameter to
  create another object is not further accessed by that object after the
  duration of the command it is passed into.

The object could have been destroyed if we get the pointer from a
pipeline library.  Since it has no user now, let's remove it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26000>

---

 src/freedreno/vulkan/tu_pipeline.cc    | 10 +---------
 src/imagination/vulkan/pvr_pipeline.c  |  2 --
 src/vulkan/runtime/vk_graphics_state.c |  4 ----
 src/vulkan/runtime/vk_graphics_state.h |  6 ------
 4 files changed, 1 insertion(+), 21 deletions(-)

diff --git a/src/freedreno/vulkan/tu_pipeline.cc 
b/src/freedreno/vulkan/tu_pipeline.cc
index 1f4eb6051b2..abed3318dc6 100644
--- a/src/freedreno/vulkan/tu_pipeline.cc
+++ b/src/freedreno/vulkan/tu_pipeline.cc
@@ -4092,10 +4092,7 @@ tu_pipeline_builder_init_graphics(
       builder->create_info->pRasterizationState->rasterizerDiscardEnable &&
       !rasterizer_discard_dynamic;
 
-   struct vk_render_pass_state rp_state = {
-      .render_pass = builder->create_info->renderPass,
-      .subpass = builder->create_info->subpass,
-   };
+   struct vk_render_pass_state rp_state = {};
    const struct vk_render_pass_state *driver_rp = NULL;
 
    builder->unscaled_input_fragcoord = 0;
@@ -4115,11 +4112,6 @@ tu_pipeline_builder_init_graphics(
       const struct tu_subpass *subpass =
          &pass->subpasses[create_info->subpass];
 
-      rp_state = (struct vk_render_pass_state) {
-         .render_pass = builder->create_info->renderPass,
-         .subpass = builder->create_info->subpass,
-      };
-
       tu_fill_render_pass_state(&rp_state, pass, subpass);
 
       rp_state.feedback_loop_input_only = true;
diff --git a/src/imagination/vulkan/pvr_pipeline.c 
b/src/imagination/vulkan/pvr_pipeline.c
index 0b88f87535b..b5ea7448e22 100644
--- a/src/imagination/vulkan/pvr_pipeline.c
+++ b/src/imagination/vulkan/pvr_pipeline.c
@@ -2266,8 +2266,6 @@ pvr_create_renderpass_state(const 
VkGraphicsPipelineCreateInfo *const info)
 
    return (struct vk_render_pass_state){
       .attachment_aspects = attachment_aspects,
-      .render_pass = info->renderPass,
-      .subpass = info->subpass,
 
       /* TODO: This is only needed for VK_KHR_create_renderpass2 (or core 1.2),
        * which is not currently supported.
diff --git a/src/vulkan/runtime/vk_graphics_state.c 
b/src/vulkan/runtime/vk_graphics_state.c
index eb526cc1b3a..d5c2284876b 100644
--- a/src/vulkan/runtime/vk_graphics_state.c
+++ b/src/vulkan/runtime/vk_graphics_state.c
@@ -1064,16 +1064,12 @@ vk_render_pass_state_init(struct vk_render_pass_state 
*rp,
    }
 
    *rp = (struct vk_render_pass_state) {
-      .render_pass = info->renderPass,
-      .subpass = info->subpass,
       .pipeline_flags = pipeline_flags,
       .depth_attachment_format = VK_FORMAT_UNDEFINED,
       .stencil_attachment_format = VK_FORMAT_UNDEFINED,
    };
 
    if (info->renderPass != VK_NULL_HANDLE && driver_rp != NULL) {
-      assert(driver_rp->render_pass == info->renderPass);
-      assert(driver_rp->subpass == info->subpass);
       *rp = *driver_rp;
       return;
    }
diff --git a/src/vulkan/runtime/vk_graphics_state.h 
b/src/vulkan/runtime/vk_graphics_state.h
index 1a0a01ed7af..5e6541956de 100644
--- a/src/vulkan/runtime/vk_graphics_state.h
+++ b/src/vulkan/runtime/vk_graphics_state.h
@@ -672,12 +672,6 @@ struct vk_render_pass_state {
     */
    VkImageAspectFlags attachment_aspects;
 
-   /** VkGraphicsPipelineCreateInfo::renderPass */
-   VkRenderPass render_pass;
-
-   /** VkGraphicsPipelineCreateInfo::subpass */
-   uint32_t subpass;
-
    /** VkPipelineRenderingCreateInfo::viewMask */
    uint32_t view_mask;
 

Reply via email to