diff options
author | Jason Ekstrand <[email protected]> | 2015-12-01 13:09:22 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-12-03 13:43:53 -0800 |
commit | 43f3e92348939ba6e0c09d219739001f195a69fd (patch) | |
tree | 68d0c3b8fc314d46ed571d5d9a35fd025d8549b1 /src/vulkan | |
parent | 299f8f1511cfa2bfab77038ba28a90bcfc136a5d (diff) |
vk/0.210.0: Rework render pass description structures
Diffstat (limited to 'src/vulkan')
-rw-r--r-- | src/vulkan/anv_meta.c | 8 | ||||
-rw-r--r-- | src/vulkan/anv_meta_clear.c | 8 | ||||
-rw-r--r-- | src/vulkan/anv_pass.c | 30 |
3 files changed, 27 insertions, 19 deletions
diff --git a/src/vulkan/anv_meta.c b/src/vulkan/anv_meta.c index 419667a9f30..de5a037b5a8 100644 --- a/src/vulkan/anv_meta.c +++ b/src/vulkan/anv_meta.c @@ -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, diff --git a/src/vulkan/anv_meta_clear.c b/src/vulkan/anv_meta_clear.c index 0531eccad9b..76ca1b6df99 100644 --- a/src/vulkan/anv_meta_clear.c +++ b/src/vulkan/anv_meta_clear.c @@ -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, diff --git a/src/vulkan/anv_pass.c b/src/vulkan/anv_pass.c index a89c494f7e0..4990b6a6c40 100644 --- a/src/vulkan/anv_pass.c +++ b/src/vulkan/anv_pass.c @@ -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); |