From 8304b4eef7e2418ae04be32e1791b16eb3fbfbf4 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 10 Mar 2021 01:10:18 -0600 Subject: [PATCH] radv/meta: Use CreateRenderPass2 Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_meta_blit.c | 60 ++++++++++++++++---------- src/amd/vulkan/radv_meta_blit2d.c | 61 +++++++++++++++++---------- src/amd/vulkan/radv_meta_clear.c | 60 ++++++++++++++++---------- src/amd/vulkan/radv_meta_decompress.c | 19 ++++++--- src/amd/vulkan/radv_meta_fast_clear.c | 22 ++++++---- src/amd/vulkan/radv_meta_resolve.c | 23 ++++++---- src/amd/vulkan/radv_meta_resolve_fs.c | 41 +++++++++++------- 7 files changed, 181 insertions(+), 105 deletions(-) diff --git a/src/amd/vulkan/radv_meta_blit.c b/src/amd/vulkan/radv_meta_blit.c index 733a92fc117..78e68f1c37d 100644 --- a/src/amd/vulkan/radv_meta_blit.c +++ b/src/amd/vulkan/radv_meta_blit.c @@ -950,11 +950,12 @@ radv_device_init_meta_blit_color(struct radv_device *device, bool on_demand) unsigned key = radv_format_meta_fs_key(device, radv_fs_key_format_exemplars[i]); for(unsigned j = 0; j < RADV_META_DST_LAYOUT_COUNT; ++j) { VkImageLayout layout = radv_meta_dst_layout_to_layout(j); - result = radv_CreateRenderPass(radv_device_to_handle(device), - &(VkRenderPassCreateInfo) { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + result = radv_CreateRenderPass2(radv_device_to_handle(device), + &(VkRenderPassCreateInfo2) { + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .attachmentCount = 1, - .pAttachments = &(VkAttachmentDescription) { + .pAttachments = &(VkAttachmentDescription2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, .format = radv_fs_key_format_exemplars[i], .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD, .storeOp = VK_ATTACHMENT_STORE_OP_STORE, @@ -962,16 +963,19 @@ radv_device_init_meta_blit_color(struct radv_device *device, bool on_demand) .finalLayout = layout, }, .subpassCount = 1, - .pSubpasses = &(VkSubpassDescription) { + .pSubpasses = &(VkSubpassDescription2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, .inputAttachmentCount = 0, .colorAttachmentCount = 1, - .pColorAttachments = &(VkAttachmentReference) { + .pColorAttachments = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = 0, .layout = layout, }, .pResolveAttachments = NULL, - .pDepthStencilAttachment = &(VkAttachmentReference) { + .pDepthStencilAttachment = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = VK_ATTACHMENT_UNUSED, .layout = VK_IMAGE_LAYOUT_GENERAL, }, @@ -979,8 +983,9 @@ radv_device_init_meta_blit_color(struct radv_device *device, bool on_demand) .pPreserveAttachments = NULL, }, .dependencyCount = 2, - .pDependencies = (VkSubpassDependency[]) { + .pDependencies = (VkSubpassDependency2[]) { { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = VK_SUBPASS_EXTERNAL, .dstSubpass = 0, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -990,6 +995,7 @@ radv_device_init_meta_blit_color(struct radv_device *device, bool on_demand) .dependencyFlags = 0 }, { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = 0, .dstSubpass = VK_SUBPASS_EXTERNAL, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -1033,11 +1039,12 @@ radv_device_init_meta_blit_depth(struct radv_device *device, bool on_demand) for (enum radv_blit_ds_layout ds_layout = RADV_BLIT_DS_LAYOUT_TILE_ENABLE; ds_layout < RADV_BLIT_DS_LAYOUT_COUNT; ds_layout++) { VkImageLayout layout = radv_meta_blit_ds_to_layout(ds_layout); - result = radv_CreateRenderPass(radv_device_to_handle(device), - &(VkRenderPassCreateInfo) { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + result = radv_CreateRenderPass2(radv_device_to_handle(device), + &(VkRenderPassCreateInfo2) { + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .attachmentCount = 1, - .pAttachments = &(VkAttachmentDescription) { + .pAttachments = &(VkAttachmentDescription2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, .format = VK_FORMAT_D32_SFLOAT, .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD, .storeOp = VK_ATTACHMENT_STORE_OP_STORE, @@ -1045,13 +1052,15 @@ radv_device_init_meta_blit_depth(struct radv_device *device, bool on_demand) .finalLayout = layout, }, .subpassCount = 1, - .pSubpasses = &(VkSubpassDescription) { + .pSubpasses = &(VkSubpassDescription2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, .inputAttachmentCount = 0, .colorAttachmentCount = 0, .pColorAttachments = NULL, .pResolveAttachments = NULL, - .pDepthStencilAttachment = &(VkAttachmentReference) { + .pDepthStencilAttachment = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = 0, .layout = layout, }, @@ -1059,8 +1068,9 @@ radv_device_init_meta_blit_depth(struct radv_device *device, bool on_demand) .pPreserveAttachments = NULL, }, .dependencyCount = 2, - .pDependencies = (VkSubpassDependency[]) { + .pDependencies = (VkSubpassDependency2[]) { { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = VK_SUBPASS_EXTERNAL, .dstSubpass = 0, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -1070,6 +1080,7 @@ radv_device_init_meta_blit_depth(struct radv_device *device, bool on_demand) .dependencyFlags = 0 }, { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = 0, .dstSubpass = VK_SUBPASS_EXTERNAL, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -1110,11 +1121,12 @@ radv_device_init_meta_blit_stencil(struct radv_device *device, bool on_demand) for (enum radv_blit_ds_layout ds_layout = RADV_BLIT_DS_LAYOUT_TILE_ENABLE; ds_layout < RADV_BLIT_DS_LAYOUT_COUNT; ds_layout++) { VkImageLayout layout = radv_meta_blit_ds_to_layout(ds_layout); - result = radv_CreateRenderPass(radv_device_to_handle(device), - &(VkRenderPassCreateInfo) { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + result = radv_CreateRenderPass2(radv_device_to_handle(device), + &(VkRenderPassCreateInfo2) { + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .attachmentCount = 1, - .pAttachments = &(VkAttachmentDescription) { + .pAttachments = &(VkAttachmentDescription2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, .format = VK_FORMAT_S8_UINT, .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD, .storeOp = VK_ATTACHMENT_STORE_OP_STORE, @@ -1122,13 +1134,15 @@ radv_device_init_meta_blit_stencil(struct radv_device *device, bool on_demand) .finalLayout = layout, }, .subpassCount = 1, - .pSubpasses = &(VkSubpassDescription) { + .pSubpasses = &(VkSubpassDescription2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, .inputAttachmentCount = 0, .colorAttachmentCount = 0, .pColorAttachments = NULL, .pResolveAttachments = NULL, - .pDepthStencilAttachment = &(VkAttachmentReference) { + .pDepthStencilAttachment = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = 0, .layout = layout, }, @@ -1136,8 +1150,9 @@ radv_device_init_meta_blit_stencil(struct radv_device *device, bool on_demand) .pPreserveAttachments = NULL, }, .dependencyCount = 2, - .pDependencies = (VkSubpassDependency[]) { + .pDependencies = (VkSubpassDependency2[]) { { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = VK_SUBPASS_EXTERNAL, .dstSubpass = 0, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -1147,6 +1162,7 @@ radv_device_init_meta_blit_stencil(struct radv_device *device, bool on_demand) .dependencyFlags = 0 }, { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = 0, .dstSubpass = VK_SUBPASS_EXTERNAL, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, diff --git a/src/amd/vulkan/radv_meta_blit2d.c b/src/amd/vulkan/radv_meta_blit2d.c index f7e74b2640d..f3ddcf36a8f 100644 --- a/src/amd/vulkan/radv_meta_blit2d.c +++ b/src/amd/vulkan/radv_meta_blit2d.c @@ -760,11 +760,12 @@ blit2d_init_color_pipeline(struct radv_device *device, if (!device->meta_state.blit2d_render_passes[fs_key][dst_layout]) { VkImageLayout layout = radv_meta_dst_layout_to_layout(dst_layout); - result = radv_CreateRenderPass(radv_device_to_handle(device), - &(VkRenderPassCreateInfo) { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + result = radv_CreateRenderPass2(radv_device_to_handle(device), + &(VkRenderPassCreateInfo2) { + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .attachmentCount = 1, - .pAttachments = &(VkAttachmentDescription) { + .pAttachments = &(VkAttachmentDescription2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, .format = format, .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD, .storeOp = VK_ATTACHMENT_STORE_OP_STORE, @@ -772,16 +773,19 @@ blit2d_init_color_pipeline(struct radv_device *device, .finalLayout = layout, }, .subpassCount = 1, - .pSubpasses = &(VkSubpassDescription) { + .pSubpasses = &(VkSubpassDescription2) { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, .inputAttachmentCount = 0, .colorAttachmentCount = 1, - .pColorAttachments = &(VkAttachmentReference) { + .pColorAttachments = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = 0, .layout = layout, }, .pResolveAttachments = NULL, - .pDepthStencilAttachment = &(VkAttachmentReference) { + .pDepthStencilAttachment = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = VK_ATTACHMENT_UNUSED, .layout = layout, }, @@ -789,8 +793,9 @@ blit2d_init_color_pipeline(struct radv_device *device, .pPreserveAttachments = NULL, }, .dependencyCount = 2, - .pDependencies = (VkSubpassDependency[]) { + .pDependencies = (VkSubpassDependency2[]) { { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = VK_SUBPASS_EXTERNAL, .dstSubpass = 0, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -800,6 +805,7 @@ blit2d_init_color_pipeline(struct radv_device *device, .dependencyFlags = 0 }, { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = 0, .dstSubpass = VK_SUBPASS_EXTERNAL, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -954,11 +960,12 @@ blit2d_init_depth_only_pipeline(struct radv_device *device, for (enum radv_blit_ds_layout ds_layout = RADV_BLIT_DS_LAYOUT_TILE_ENABLE; ds_layout < RADV_BLIT_DS_LAYOUT_COUNT; ds_layout++) { if (!device->meta_state.blit2d_depth_only_rp[ds_layout]) { VkImageLayout layout = radv_meta_blit_ds_to_layout(ds_layout); - result = radv_CreateRenderPass(radv_device_to_handle(device), - &(VkRenderPassCreateInfo) { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + result = radv_CreateRenderPass2(radv_device_to_handle(device), + &(VkRenderPassCreateInfo2) { + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .attachmentCount = 1, - .pAttachments = &(VkAttachmentDescription) { + .pAttachments = &(VkAttachmentDescription2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, .format = VK_FORMAT_D32_SFLOAT, .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD, .storeOp = VK_ATTACHMENT_STORE_OP_STORE, @@ -966,13 +973,14 @@ blit2d_init_depth_only_pipeline(struct radv_device *device, .finalLayout = layout, }, .subpassCount = 1, - .pSubpasses = &(VkSubpassDescription) { - .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, + .pSubpasses = &(VkSubpassDescription2) { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, .inputAttachmentCount = 0, .colorAttachmentCount = 0, .pColorAttachments = NULL, .pResolveAttachments = NULL, - .pDepthStencilAttachment = &(VkAttachmentReference) { + .pDepthStencilAttachment = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = 0, .layout = layout, }, @@ -980,8 +988,9 @@ blit2d_init_depth_only_pipeline(struct radv_device *device, .pPreserveAttachments = NULL, }, .dependencyCount = 2, - .pDependencies = (VkSubpassDependency[]) { + .pDependencies = (VkSubpassDependency2[]) { { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = VK_SUBPASS_EXTERNAL, .dstSubpass = 0, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -991,6 +1000,7 @@ blit2d_init_depth_only_pipeline(struct radv_device *device, .dependencyFlags = 0 }, { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = 0, .dstSubpass = VK_SUBPASS_EXTERNAL, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -1144,11 +1154,12 @@ blit2d_init_stencil_only_pipeline(struct radv_device *device, for (enum radv_blit_ds_layout ds_layout = RADV_BLIT_DS_LAYOUT_TILE_ENABLE; ds_layout < RADV_BLIT_DS_LAYOUT_COUNT; ds_layout++) { if (!device->meta_state.blit2d_stencil_only_rp[ds_layout]) { VkImageLayout layout = radv_meta_blit_ds_to_layout(ds_layout); - result = radv_CreateRenderPass(radv_device_to_handle(device), - &(VkRenderPassCreateInfo) { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + result = radv_CreateRenderPass2(radv_device_to_handle(device), + &(VkRenderPassCreateInfo2) { + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .attachmentCount = 1, - .pAttachments = &(VkAttachmentDescription) { + .pAttachments = &(VkAttachmentDescription2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, .format = VK_FORMAT_S8_UINT, .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD, .storeOp = VK_ATTACHMENT_STORE_OP_STORE, @@ -1156,13 +1167,15 @@ blit2d_init_stencil_only_pipeline(struct radv_device *device, .finalLayout = layout, }, .subpassCount = 1, - .pSubpasses = &(VkSubpassDescription) { + .pSubpasses = &(VkSubpassDescription2) { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, .inputAttachmentCount = 0, .colorAttachmentCount = 0, .pColorAttachments = NULL, .pResolveAttachments = NULL, - .pDepthStencilAttachment = &(VkAttachmentReference) { + .pDepthStencilAttachment = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = 0, .layout = layout, }, @@ -1170,8 +1183,9 @@ blit2d_init_stencil_only_pipeline(struct radv_device *device, .pPreserveAttachments = NULL, }, .dependencyCount = 2, - .pDependencies = (VkSubpassDependency[]) { + .pDependencies = (VkSubpassDependency2[]) { { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = VK_SUBPASS_EXTERNAL, .dstSubpass = 0, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -1181,6 +1195,7 @@ blit2d_init_stencil_only_pipeline(struct radv_device *device, .dependencyFlags = 0 }, { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = 0, .dstSubpass = VK_SUBPASS_EXTERNAL, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c index ade62752ed0..75dbf8eecb9 100644 --- a/src/amd/vulkan/radv_meta_clear.c +++ b/src/amd/vulkan/radv_meta_clear.c @@ -194,11 +194,12 @@ create_color_renderpass(struct radv_device *device, return VK_SUCCESS; } - VkResult result = radv_CreateRenderPass(radv_device_to_handle(device), - &(VkRenderPassCreateInfo) { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + VkResult result = radv_CreateRenderPass2(radv_device_to_handle(device), + &(VkRenderPassCreateInfo2) { + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .attachmentCount = 1, - .pAttachments = &(VkAttachmentDescription) { + .pAttachments = &(VkAttachmentDescription2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, .format = vk_format, .samples = samples, .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD, @@ -207,16 +208,19 @@ create_color_renderpass(struct radv_device *device, .finalLayout = VK_IMAGE_LAYOUT_GENERAL, }, .subpassCount = 1, - .pSubpasses = &(VkSubpassDescription) { + .pSubpasses = &(VkSubpassDescription2) { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, .inputAttachmentCount = 0, .colorAttachmentCount = 1, - .pColorAttachments = &(VkAttachmentReference) { + .pColorAttachments = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = 0, .layout = VK_IMAGE_LAYOUT_GENERAL, }, .pResolveAttachments = NULL, - .pDepthStencilAttachment = &(VkAttachmentReference) { + .pDepthStencilAttachment = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = VK_ATTACHMENT_UNUSED, .layout = VK_IMAGE_LAYOUT_GENERAL, }, @@ -224,8 +228,9 @@ create_color_renderpass(struct radv_device *device, .pPreserveAttachments = NULL, }, .dependencyCount = 2, - .pDependencies = (VkSubpassDependency[]) { + .pDependencies = (VkSubpassDependency2[]) { { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = VK_SUBPASS_EXTERNAL, .dstSubpass = 0, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -235,6 +240,7 @@ create_color_renderpass(struct radv_device *device, .dependencyFlags = 0 }, { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = 0, .dstSubpass = VK_SUBPASS_EXTERNAL, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -553,11 +559,12 @@ create_depthstencil_renderpass(struct radv_device *device, return VK_SUCCESS; } - VkResult result = radv_CreateRenderPass(radv_device_to_handle(device), - &(VkRenderPassCreateInfo) { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + VkResult result = radv_CreateRenderPass2(radv_device_to_handle(device), + &(VkRenderPassCreateInfo2) { + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .attachmentCount = 1, - .pAttachments = &(VkAttachmentDescription) { + .pAttachments = &(VkAttachmentDescription2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, .format = VK_FORMAT_D32_SFLOAT_S8_UINT, .samples = samples, .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD, @@ -566,13 +573,15 @@ create_depthstencil_renderpass(struct radv_device *device, .finalLayout = VK_IMAGE_LAYOUT_GENERAL, }, .subpassCount = 1, - .pSubpasses = &(VkSubpassDescription) { + .pSubpasses = &(VkSubpassDescription2) { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, .inputAttachmentCount = 0, .colorAttachmentCount = 0, .pColorAttachments = NULL, .pResolveAttachments = NULL, - .pDepthStencilAttachment = &(VkAttachmentReference) { + .pDepthStencilAttachment = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = 0, .layout = VK_IMAGE_LAYOUT_GENERAL, }, @@ -580,8 +589,9 @@ create_depthstencil_renderpass(struct radv_device *device, .pPreserveAttachments = NULL, }, .dependencyCount = 2, - .pDependencies = (VkSubpassDependency[]) { + .pDependencies = (VkSubpassDependency2[]) { { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = VK_SUBPASS_EXTERNAL, .dstSubpass = 0, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -591,6 +601,7 @@ create_depthstencil_renderpass(struct radv_device *device, .dependencyFlags = 0 }, { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = 0, .dstSubpass = VK_SUBPASS_EXTERNAL, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -2002,7 +2013,8 @@ radv_clear_image_layer(struct radv_cmd_buffer *cmd_buffer, &cmd_buffer->pool->alloc, &fb); - VkAttachmentDescription att_desc = { + VkAttachmentDescription2 att_desc = { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, .format = iview.vk_format, .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD, .storeOp = VK_ATTACHMENT_STORE_OP_STORE, @@ -2012,7 +2024,8 @@ radv_clear_image_layer(struct radv_cmd_buffer *cmd_buffer, .finalLayout = image_layout, }; - VkSubpassDescription subpass_desc = { + VkSubpassDescription2 subpass_desc = { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, .inputAttachmentCount = 0, .colorAttachmentCount = 0, @@ -2023,7 +2036,8 @@ radv_clear_image_layer(struct radv_cmd_buffer *cmd_buffer, .pPreserveAttachments = NULL, }; - const VkAttachmentReference att_ref = { + const VkAttachmentReference2 att_ref = { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = 0, .layout = image_layout, }; @@ -2036,16 +2050,17 @@ radv_clear_image_layer(struct radv_cmd_buffer *cmd_buffer, } VkRenderPass pass; - radv_CreateRenderPass(device_h, - &(VkRenderPassCreateInfo) { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + radv_CreateRenderPass2(device_h, + &(VkRenderPassCreateInfo2) { + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .attachmentCount = 1, .pAttachments = &att_desc, .subpassCount = 1, .pSubpasses = &subpass_desc, .dependencyCount = 2, - .pDependencies = (VkSubpassDependency[]) { + .pDependencies = (VkSubpassDependency2[]) { { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = VK_SUBPASS_EXTERNAL, .dstSubpass = 0, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -2055,6 +2070,7 @@ radv_clear_image_layer(struct radv_cmd_buffer *cmd_buffer, .dependencyFlags = 0 }, { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = 0, .dstSubpass = VK_SUBPASS_EXTERNAL, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, diff --git a/src/amd/vulkan/radv_meta_decompress.c b/src/amd/vulkan/radv_meta_decompress.c index 31b993cde32..3ab2a4b73e1 100644 --- a/src/amd/vulkan/radv_meta_decompress.c +++ b/src/amd/vulkan/radv_meta_decompress.c @@ -47,8 +47,9 @@ create_pass(struct radv_device *device, VkResult result; VkDevice device_h = radv_device_to_handle(device); const VkAllocationCallbacks *alloc = &device->meta_state.alloc; - VkAttachmentDescription attachment; + VkAttachmentDescription2 attachment; + attachment.sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2; attachment.flags = 0; attachment.format = VK_FORMAT_D32_SFLOAT_S8_UINT; attachment.samples = samples; @@ -59,19 +60,21 @@ create_pass(struct radv_device *device, attachment.initialLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; attachment.finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; - result = radv_CreateRenderPass(device_h, - &(VkRenderPassCreateInfo) { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + result = radv_CreateRenderPass2(device_h, + &(VkRenderPassCreateInfo2) { + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .attachmentCount = 1, .pAttachments = &attachment, .subpassCount = 1, - .pSubpasses = &(VkSubpassDescription) { + .pSubpasses = &(VkSubpassDescription2) { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, .inputAttachmentCount = 0, .colorAttachmentCount = 0, .pColorAttachments = NULL, .pResolveAttachments = NULL, - .pDepthStencilAttachment = &(VkAttachmentReference) { + .pDepthStencilAttachment = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = 0, .layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, }, @@ -79,8 +82,9 @@ create_pass(struct radv_device *device, .pPreserveAttachments = NULL, }, .dependencyCount = 2, - .pDependencies = (VkSubpassDependency[]) { + .pDependencies = (VkSubpassDependency2[]) { { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = VK_SUBPASS_EXTERNAL, .dstSubpass = 0, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -90,6 +94,7 @@ create_pass(struct radv_device *device, .dependencyFlags = 0 }, { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = 0, .dstSubpass = VK_SUBPASS_EXTERNAL, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, diff --git a/src/amd/vulkan/radv_meta_fast_clear.c b/src/amd/vulkan/radv_meta_fast_clear.c index b2540992457..91eea8f368e 100644 --- a/src/amd/vulkan/radv_meta_fast_clear.c +++ b/src/amd/vulkan/radv_meta_fast_clear.c @@ -181,8 +181,9 @@ create_pass(struct radv_device *device) VkResult result; VkDevice device_h = radv_device_to_handle(device); const VkAllocationCallbacks *alloc = &device->meta_state.alloc; - VkAttachmentDescription attachment; + VkAttachmentDescription2 attachment; + attachment.sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2; attachment.format = VK_FORMAT_UNDEFINED; attachment.samples = 1; attachment.loadOp = VK_ATTACHMENT_LOAD_OP_LOAD; @@ -190,32 +191,36 @@ create_pass(struct radv_device *device) attachment.initialLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; attachment.finalLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; - result = radv_CreateRenderPass(device_h, - &(VkRenderPassCreateInfo) { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + result = radv_CreateRenderPass2(device_h, + &(VkRenderPassCreateInfo2) { + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .attachmentCount = 1, .pAttachments = &attachment, .subpassCount = 1, - .pSubpasses = &(VkSubpassDescription) { + .pSubpasses = &(VkSubpassDescription2) { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, .inputAttachmentCount = 0, .colorAttachmentCount = 1, - .pColorAttachments = (VkAttachmentReference[]) { + .pColorAttachments = (VkAttachmentReference2[]) { { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = 0, .layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, }, }, .pResolveAttachments = NULL, - .pDepthStencilAttachment = &(VkAttachmentReference) { + .pDepthStencilAttachment = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = VK_ATTACHMENT_UNUSED, }, .preserveAttachmentCount = 0, .pPreserveAttachments = NULL, }, .dependencyCount = 2, - .pDependencies = (VkSubpassDependency[]) { + .pDependencies = (VkSubpassDependency2[]) { { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = VK_SUBPASS_EXTERNAL, .dstSubpass = 0, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -225,6 +230,7 @@ create_pass(struct radv_device *device) .dependencyFlags = 0 }, { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = 0, .dstSubpass = VK_SUBPASS_EXTERNAL, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, diff --git a/src/amd/vulkan/radv_meta_resolve.c b/src/amd/vulkan/radv_meta_resolve.c index b248a1fb661..78d45424b99 100644 --- a/src/amd/vulkan/radv_meta_resolve.c +++ b/src/amd/vulkan/radv_meta_resolve.c @@ -53,10 +53,11 @@ create_pass(struct radv_device *device, VkFormat vk_format, VkRenderPass *pass) VkResult result; VkDevice device_h = radv_device_to_handle(device); const VkAllocationCallbacks *alloc = &device->meta_state.alloc; - VkAttachmentDescription attachments[2]; + VkAttachmentDescription2 attachments[2]; int i; for (i = 0; i < 2; i++) { + attachments[i].sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2; attachments[i].format = vk_format; attachments[i].samples = 1; attachments[i].loadOp = VK_ATTACHMENT_LOAD_OP_LOAD; @@ -67,36 +68,41 @@ create_pass(struct radv_device *device, VkFormat vk_format, VkRenderPass *pass) attachments[1].initialLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; attachments[1].finalLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; - result = radv_CreateRenderPass(device_h, - &(VkRenderPassCreateInfo) { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + result = radv_CreateRenderPass2(device_h, + &(VkRenderPassCreateInfo2) { + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .attachmentCount = 2, .pAttachments = attachments, .subpassCount = 1, - .pSubpasses = &(VkSubpassDescription) { + .pSubpasses = &(VkSubpassDescription2) { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, .inputAttachmentCount = 0, .colorAttachmentCount = 2, - .pColorAttachments = (VkAttachmentReference[]) { + .pColorAttachments = (VkAttachmentReference2[]) { { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = 0, .layout = VK_IMAGE_LAYOUT_GENERAL, }, { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = 1, .layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, }, }, .pResolveAttachments = NULL, - .pDepthStencilAttachment = &(VkAttachmentReference) { + .pDepthStencilAttachment = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = VK_ATTACHMENT_UNUSED, }, .preserveAttachmentCount = 0, .pPreserveAttachments = NULL, }, .dependencyCount = 2, - .pDependencies = (VkSubpassDependency[]) { + .pDependencies = (VkSubpassDependency2[]) { { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = VK_SUBPASS_EXTERNAL, .dstSubpass = 0, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -106,6 +112,7 @@ create_pass(struct radv_device *device, VkFormat vk_format, VkRenderPass *pass) .dependencyFlags = 0 }, { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = 0, .dstSubpass = VK_SUBPASS_EXTERNAL, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, diff --git a/src/amd/vulkan/radv_meta_resolve_fs.c b/src/amd/vulkan/radv_meta_resolve_fs.c index 16211f5ca9f..104c1b5f4ad 100644 --- a/src/amd/vulkan/radv_meta_resolve_fs.c +++ b/src/amd/vulkan/radv_meta_resolve_fs.c @@ -190,11 +190,12 @@ create_resolve_pipeline(struct radv_device *device, for (unsigned dst_layout = 0; dst_layout < RADV_META_DST_LAYOUT_COUNT; ++dst_layout) { VkImageLayout layout = radv_meta_dst_layout_to_layout(dst_layout); - result = radv_CreateRenderPass(radv_device_to_handle(device), - &(VkRenderPassCreateInfo) { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + result = radv_CreateRenderPass2(radv_device_to_handle(device), + &(VkRenderPassCreateInfo2) { + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .attachmentCount = 1, - .pAttachments = &(VkAttachmentDescription) { + .pAttachments = &(VkAttachmentDescription2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, .format = format, .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD, .storeOp = VK_ATTACHMENT_STORE_OP_STORE, @@ -202,16 +203,19 @@ create_resolve_pipeline(struct radv_device *device, .finalLayout = layout, }, .subpassCount = 1, - .pSubpasses = &(VkSubpassDescription) { + .pSubpasses = &(VkSubpassDescription2) { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, .inputAttachmentCount = 0, .colorAttachmentCount = 1, - .pColorAttachments = &(VkAttachmentReference) { + .pColorAttachments = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = 0, .layout = layout, }, .pResolveAttachments = NULL, - .pDepthStencilAttachment = &(VkAttachmentReference) { + .pDepthStencilAttachment = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = VK_ATTACHMENT_UNUSED, .layout = VK_IMAGE_LAYOUT_GENERAL, }, @@ -219,8 +223,9 @@ create_resolve_pipeline(struct radv_device *device, .pPreserveAttachments = NULL, }, .dependencyCount = 2, - .pDependencies = (VkSubpassDependency[]) { + .pDependencies = (VkSubpassDependency2[]) { { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = VK_SUBPASS_EXTERNAL, .dstSubpass = 0, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -230,6 +235,7 @@ create_resolve_pipeline(struct radv_device *device, .dependencyFlags = 0 }, { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = 0, .dstSubpass = VK_SUBPASS_EXTERNAL, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -523,11 +529,12 @@ create_depth_stencil_resolve_pipeline(struct radv_device *device, } if (!*render_pass) { - result = radv_CreateRenderPass(radv_device_to_handle(device), - &(VkRenderPassCreateInfo) { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, + result = radv_CreateRenderPass2(radv_device_to_handle(device), + &(VkRenderPassCreateInfo2) { + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, .attachmentCount = 1, - .pAttachments = &(VkAttachmentDescription) { + .pAttachments = &(VkAttachmentDescription2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, .format = src_format, .loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE, .storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE, @@ -537,13 +544,15 @@ create_depth_stencil_resolve_pipeline(struct radv_device *device, .finalLayout = VK_IMAGE_LAYOUT_GENERAL, }, .subpassCount = 1, - .pSubpasses = &(VkSubpassDescription) { + .pSubpasses = &(VkSubpassDescription2) { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, .inputAttachmentCount = 0, .colorAttachmentCount = 0, .pColorAttachments = NULL, .pResolveAttachments = NULL, - .pDepthStencilAttachment = &(VkAttachmentReference) { + .pDepthStencilAttachment = &(VkAttachmentReference2) { + .sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, .attachment = 0, .layout = VK_IMAGE_LAYOUT_GENERAL, }, @@ -551,8 +560,9 @@ create_depth_stencil_resolve_pipeline(struct radv_device *device, .pPreserveAttachments = NULL, }, .dependencyCount = 2, - .pDependencies = (VkSubpassDependency[]) { + .pDependencies = (VkSubpassDependency2[]) { { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = VK_SUBPASS_EXTERNAL, .dstSubpass = 0, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -562,6 +572,7 @@ create_depth_stencil_resolve_pipeline(struct radv_device *device, .dependencyFlags = 0 }, { + .sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, .srcSubpass = 0, .dstSubpass = VK_SUBPASS_EXTERNAL, .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,