<div dir="auto"><div>R-b<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 12, 2019, 11:44 AM Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com">samuel.pitoiset@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Only supported with vkCreateRenderPass2().<br>
<br>
v2: - do not set has_resolve (now has_color_resolve) for ds resolves<br>
<br>
Signed-off-by: Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com" target="_blank" rel="noreferrer">samuel.pitoiset@gmail.com</a>><br>
---<br>
 src/amd/vulkan/radv_pass.c    | 27 ++++++++++++++++++++++++++-<br>
 src/amd/vulkan/radv_private.h |  3 +++<br>
 2 files changed, 29 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/amd/vulkan/radv_pass.c b/src/amd/vulkan/radv_pass.c<br>
index 728b6113206..688a17919bd 100644<br>
--- a/src/amd/vulkan/radv_pass.c<br>
+++ b/src/amd/vulkan/radv_pass.c<br>
@@ -91,6 +91,10 @@ radv_render_pass_compile(struct radv_render_pass *pass)<br>
                    subpass->depth_stencil_attachment->attachment == VK_ATTACHMENT_UNUSED)<br>
                        subpass->depth_stencil_attachment = NULL;<br>
<br>
+               if (subpass->ds_resolve_attachment &&<br>
+                   subpass->ds_resolve_attachment->attachment == VK_ATTACHMENT_UNUSED)<br>
+                       subpass->ds_resolve_attachment = NULL;<br>
+<br>
                for (uint32_t j = 0; j < subpass->attachment_count; j++) {<br>
                        struct radv_subpass_attachment *subpass_att =<br>
                                &subpass->attachments[j];<br>
@@ -309,10 +313,15 @@ VkResult radv_CreateRenderPass(<br>
 static unsigned<br>
 radv_num_subpass_attachments2(const VkSubpassDescription2KHR *desc)<br>
 {<br>
+       const VkSubpassDescriptionDepthStencilResolveKHR *ds_resolve =<br>
+               vk_find_struct_const(desc->pNext,<br>
+                                    SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR);<br>
+<br>
        return desc->inputAttachmentCount +<br>
               desc->colorAttachmentCount +<br>
               (desc->pResolveAttachments ? desc->colorAttachmentCount : 0) +<br>
-              (desc->pDepthStencilAttachment != NULL);<br>
+              (desc->pDepthStencilAttachment != NULL) +<br>
+              (ds_resolve && ds_resolve->pDepthStencilResolveAttachment);<br>
 }<br>
<br>
 VkResult radv_CreateRenderPass2KHR(<br>
@@ -429,6 +438,22 @@ VkResult radv_CreateRenderPass2KHR(<br>
                                .layout = desc->pDepthStencilAttachment->layout,<br>
                        };<br>
                }<br>
+<br>
+               const VkSubpassDescriptionDepthStencilResolveKHR *ds_resolve =<br>
+                       vk_find_struct_const(desc->pNext,<br>
+                                            SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR);<br>
+<br>
+               if (ds_resolve && ds_resolve->pDepthStencilResolveAttachment) {<br>
+                       subpass->ds_resolve_attachment = p++;<br>
+<br>
+                       *subpass->ds_resolve_attachment = (struct radv_subpass_attachment) {<br>
+                               .attachment =  ds_resolve->pDepthStencilResolveAttachment->attachment,<br>
+                               .layout =      ds_resolve->pDepthStencilResolveAttachment->layout,<br>
+                       };<br>
+<br>
+                       subpass->depth_resolve_mode = ds_resolve->depthResolveMode;<br>
+                       subpass->stencil_resolve_mode = ds_resolve->stencilResolveMode;<br>
+               }<br>
        }<br>
<br>
        for (unsigned i = 0; i < pCreateInfo->dependencyCount; ++i) {<br>
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h<br>
index 848fd427ef0..af7e90140a4 100644<br>
--- a/src/amd/vulkan/radv_private.h<br>
+++ b/src/amd/vulkan/radv_private.h<br>
@@ -1909,6 +1909,9 @@ struct radv_subpass {<br>
        struct radv_subpass_attachment *             color_attachments;<br>
        struct radv_subpass_attachment *             resolve_attachments;<br>
        struct radv_subpass_attachment *             depth_stencil_attachment;<br>
+       struct radv_subpass_attachment *             ds_resolve_attachment;<br>
+       VkResolveModeFlagBitsKHR                     depth_resolve_mode;<br>
+       VkResolveModeFlagBitsKHR                     stencil_resolve_mode;<br>
<br>
        /** Subpass has at least one color resolve attachment */<br>
        bool                                         has_color_resolve;<br>
-- <br>
2.22.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank" rel="noreferrer">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a></blockquote></div></div></div>