radv: use the new attachments array when starting subpasses
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 29 Jan 2019 21:18:52 +0000 (22:18 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 4 Feb 2019 12:17:57 +0000 (13:17 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c

index 440f09a363c1f2bbecc6943d722bedb93af042dc..914ff0055d9956bc8dc63f4b1972839e7f24a22e 100644 (file)
@@ -3401,20 +3401,13 @@ radv_cmd_buffer_begin_subpass(struct radv_cmd_buffer *cmd_buffer,
 
        radv_subpass_barrier(cmd_buffer, &subpass->start_barrier);
 
-       for (unsigned i = 0; i < subpass->color_count; ++i) {
-               if (subpass->color_attachments[i].attachment != VK_ATTACHMENT_UNUSED)
-                       radv_handle_subpass_image_transition(cmd_buffer,
-                                                           subpass->color_attachments[i]);
-       }
-
-       for (unsigned i = 0; i < subpass->input_count; ++i) {
-               radv_handle_subpass_image_transition(cmd_buffer,
-                                                    subpass->input_attachments[i]);
-       }
+       for (uint32_t i = 0; i < subpass->attachment_count; ++i) {
+               const uint32_t a = subpass->attachments[i].attachment;
+               if (a == VK_ATTACHMENT_UNUSED)
+                       continue;
 
-       if (subpass->depth_stencil_attachment) {
                radv_handle_subpass_image_transition(cmd_buffer,
-                                                    *subpass->depth_stencil_attachment);
+                                                    subpass->attachments[i]);
        }
 
        radv_cmd_buffer_set_subpass(cmd_buffer, subpass);