radv: compute the number of subpass attachments correctly
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 27 Apr 2018 08:53:13 +0000 (10:53 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 1 May 2018 20:18:03 +0000 (22:18 +0200)
Only count color attachments twice if resolves are used, also
account for the depth stencil attachment if present.

Cc: 18.0 18.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_pass.c

index d059af54f9b3a570a760c702ba448d841f582b18..a7d54d7d61b2e9e9df31c0e1b8788b16ed5d3c85 100644 (file)
@@ -87,8 +87,8 @@ VkResult radv_CreateRenderPass(
                subpass_attachment_count +=
                        desc->inputAttachmentCount +
                        desc->colorAttachmentCount +
-                       /* Count colorAttachmentCount again for resolve_attachments */
-                       desc->colorAttachmentCount;
+                       (desc->pResolveAttachments ? desc->colorAttachmentCount : 0) +
+                       (desc->pDepthStencilAttachment != NULL);
        }
 
        if (subpass_attachment_count) {