anv/pass: Use a designated initailizer for attachments
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 24 Apr 2018 16:11:34 +0000 (09:11 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 9 Jul 2018 17:11:53 +0000 (10:11 -0700)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_pass.c

index 994a7e274f4e2c59ff18849be7753e485bb2ef51..38460cb2fe3e787f97e505c5b6b011b82cad1e6e 100644 (file)
@@ -87,17 +87,17 @@ VkResult anv_CreateRenderPass(
    pass->subpass_flushes = subpass_flushes;
 
    for (uint32_t i = 0; i < pCreateInfo->attachmentCount; i++) {
-      struct anv_render_pass_attachment *att = &pass->attachments[i];
-
-      att->format = pCreateInfo->pAttachments[i].format;
-      att->samples = pCreateInfo->pAttachments[i].samples;
-      att->usage = 0;
-      att->load_op = pCreateInfo->pAttachments[i].loadOp;
-      att->store_op = pCreateInfo->pAttachments[i].storeOp;
-      att->stencil_load_op = pCreateInfo->pAttachments[i].stencilLoadOp;
-      att->initial_layout = pCreateInfo->pAttachments[i].initialLayout;
-      att->final_layout = pCreateInfo->pAttachments[i].finalLayout;
-      att->first_subpass_layout = VK_IMAGE_LAYOUT_UNDEFINED;
+      pass->attachments[i] = (struct anv_render_pass_attachment) {
+         .format                 = pCreateInfo->pAttachments[i].format,
+         .samples                = pCreateInfo->pAttachments[i].samples,
+         .usage                  = 0,
+         .load_op                = pCreateInfo->pAttachments[i].loadOp,
+         .store_op               = pCreateInfo->pAttachments[i].storeOp,
+         .stencil_load_op        = pCreateInfo->pAttachments[i].stencilLoadOp,
+         .initial_layout         = pCreateInfo->pAttachments[i].initialLayout,
+         .final_layout           = pCreateInfo->pAttachments[i].finalLayout,
+         .first_subpass_layout   = VK_IMAGE_LAYOUT_UNDEFINED,
+      };
    }
 
    bool has_color = false, has_depth = false, has_input = false;