vk/0.210.0: Rework render pass description structures
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 1 Dec 2015 21:09:22 +0000 (13:09 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 3 Dec 2015 21:43:53 +0000 (13:43 -0800)
include/vulkan/vulkan.h
src/vulkan/anv_meta.c
src/vulkan/anv_meta_clear.c
src/vulkan/anv_pass.c

index cdf491cfba91ead375aca94e800f17db2dc0b4a3..484ce8fbcd61444a1e80b0bea41287a781205597 100644 (file)
@@ -1926,21 +1926,21 @@ typedef struct VkAttachmentReference {
 typedef struct VkSubpassDescription {
     VkSubpassDescriptionFlags                   flags;
     VkPipelineBindPoint                         pipelineBindPoint;
-    uint32_t                                    inputCount;
+    uint32_t                                    inputAttachmentCount;
     const VkAttachmentReference*                pInputAttachments;
-    uint32_t                                    colorCount;
+    uint32_t                                    colorAttachmentCount;
     const VkAttachmentReference*                pColorAttachments;
     const VkAttachmentReference*                pResolveAttachments;
-    VkAttachmentReference                       depthStencilAttachment;
-    uint32_t                                    preserveCount;
+    const VkAttachmentReference*                pDepthStencilAttachment;
+    uint32_t                                    preserveAttachmentCount;
     const VkAttachmentReference*                pPreserveAttachments;
 } VkSubpassDescription;
 
 typedef struct VkSubpassDependency {
     uint32_t                                    srcSubpass;
-    uint32_t                                    destSubpass;
+    uint32_t                                    dstSubpass;
     VkPipelineStageFlags                        srcStageMask;
-    VkPipelineStageFlags                        destStageMask;
+    VkPipelineStageFlags                        dstStageMask;
     VkMemoryOutputFlags                         outputMask;
     VkMemoryInputFlags                          inputMask;
     VkBool32                                    byRegion;
index 419667a9f306d1f3477a867c83d13a8a5be0d108..de5a037b5a859967ff01b42b4bcfc7ff1d25bb95 100644 (file)
@@ -199,18 +199,18 @@ anv_device_init_meta_blit_state(struct anv_device *device)
          .subpassCount = 1,
          .pSubpasses = &(VkSubpassDescription) {
             .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS,
-            .inputCount = 0,
-            .colorCount = 1,
+            .inputAttachmentCount = 0,
+            .colorAttachmentCount = 1,
             .pColorAttachments = &(VkAttachmentReference) {
                .attachment = 0,
                .layout = VK_IMAGE_LAYOUT_GENERAL,
             },
             .pResolveAttachments = NULL,
-            .depthStencilAttachment = (VkAttachmentReference) {
+            .pDepthStencilAttachment = &(VkAttachmentReference) {
                .attachment = VK_ATTACHMENT_UNUSED,
                .layout = VK_IMAGE_LAYOUT_GENERAL,
             },
-            .preserveCount = 1,
+            .preserveAttachmentCount = 1,
             .pPreserveAttachments = &(VkAttachmentReference) {
                .attachment = 0,
                .layout = VK_IMAGE_LAYOUT_GENERAL,
index 0531eccad9ba86a6562cd3975d8b1f3363d9694b..76ca1b6df998146bb0e1d9bb2199d25aa20f0031 100644 (file)
@@ -737,18 +737,18 @@ void anv_CmdClearColorImage(
                   .subpassCount = 1,
                   .pSubpasses = &(VkSubpassDescription) {
                      .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS,
-                     .inputCount = 0,
-                     .colorCount = 1,
+                     .inputAttachmentCount = 0,
+                     .colorAttachmentCount = 1,
                      .pColorAttachments = &(VkAttachmentReference) {
                         .attachment = 0,
                         .layout = VK_IMAGE_LAYOUT_GENERAL,
                      },
                      .pResolveAttachments = NULL,
-                     .depthStencilAttachment = (VkAttachmentReference) {
+                     .pDepthStencilAttachment = &(VkAttachmentReference) {
                         .attachment = VK_ATTACHMENT_UNUSED,
                         .layout = VK_IMAGE_LAYOUT_GENERAL,
                      },
-                     .preserveCount = 1,
+                     .preserveAttachmentCount = 1,
                      .pPreserveAttachments = &(VkAttachmentReference) {
                         .attachment = 0,
                         .layout = VK_IMAGE_LAYOUT_GENERAL,
index a89c494f7e0fee016271c494dd50616ef8519fb0..4990b6a6c406ede2e33992ff7f4eadc2253660ec 100644 (file)
@@ -68,26 +68,28 @@ VkResult anv_CreateRenderPass(
       const VkSubpassDescription *desc = &pCreateInfo->pSubpasses[i];
       struct anv_subpass *subpass = &pass->subpasses[i];
 
-      subpass->input_count = desc->inputCount;
-      subpass->color_count = desc->colorCount;
+      subpass->input_count = desc->inputAttachmentCount;
+      subpass->color_count = desc->colorAttachmentCount;
 
-      if (desc->inputCount > 0) {
+      if (desc->inputAttachmentCount > 0) {
          subpass->input_attachments =
-            anv_device_alloc(device, desc->inputCount * sizeof(uint32_t),
+            anv_device_alloc(device,
+                             desc->inputAttachmentCount * sizeof(uint32_t),
                              8, VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
 
-         for (uint32_t j = 0; j < desc->inputCount; j++) {
+         for (uint32_t j = 0; j < desc->inputAttachmentCount; j++) {
             subpass->input_attachments[j]
                = desc->pInputAttachments[j].attachment;
          }
       }
 
-      if (desc->colorCount > 0) {
+      if (desc->colorAttachmentCount > 0) {
          subpass->color_attachments =
-            anv_device_alloc(device, desc->colorCount * sizeof(uint32_t),
+            anv_device_alloc(device,
+                             desc->colorAttachmentCount * sizeof(uint32_t),
                              8, VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
 
-         for (uint32_t j = 0; j < desc->colorCount; j++) {
+         for (uint32_t j = 0; j < desc->colorAttachmentCount; j++) {
             subpass->color_attachments[j]
                = desc->pColorAttachments[j].attachment;
          }
@@ -95,16 +97,22 @@ VkResult anv_CreateRenderPass(
 
       if (desc->pResolveAttachments) {
          subpass->resolve_attachments =
-            anv_device_alloc(device, desc->colorCount * sizeof(uint32_t),
+            anv_device_alloc(device,
+                             desc->colorAttachmentCount * sizeof(uint32_t),
                              8, VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
 
-         for (uint32_t j = 0; j < desc->colorCount; j++) {
+         for (uint32_t j = 0; j < desc->colorAttachmentCount; j++) {
             subpass->resolve_attachments[j]
                = desc->pResolveAttachments[j].attachment;
          }
       }
 
-      subpass->depth_stencil_attachment = desc->depthStencilAttachment.attachment;
+      if (desc->pDepthStencilAttachment) {
+         subpass->depth_stencil_attachment =
+            desc->pDepthStencilAttachment->attachment;
+      } else {
+         subpass->depth_stencil_attachment = VK_ATTACHMENT_UNUSED;
+      }
    }
 
    *pRenderPass = anv_render_pass_to_handle(pass);