[Mesa-dev] [PATCH] radv: Use correct image layout for blit based copies.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Sun Jun 25 20:05:08 UTC 2017


On Sun, Jun 25, 2017 at 9:42 PM, Dave Airlie <airlied at gmail.com> wrote:
> On 25 June 2017 at 04:58, Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl> wrote:
>> Signed-off-by: Bas Nieuwenhuizen <basni at google.com>
>> Fixes: 0628580eff6 "radv: Specify semantics of HTILE layout helpers."
>> ---
>>  src/amd/vulkan/radv_meta_blit2d.c | 29 +++++++++++------------------
>>  1 file changed, 11 insertions(+), 18 deletions(-)
>>
>> diff --git a/src/amd/vulkan/radv_meta_blit2d.c b/src/amd/vulkan/radv_meta_blit2d.c
>> index aae35d2a79e..80bcf370d41 100644
>> --- a/src/amd/vulkan/radv_meta_blit2d.c
>> +++ b/src/amd/vulkan/radv_meta_blit2d.c
>> @@ -179,14 +179,7 @@ blit2d_bind_dst(struct radv_cmd_buffer *cmd_buffer,
>>                 VkFormat depth_format,
>>                  struct blit2d_dst_temps *tmp)
>>  {
>> -       VkImageUsageFlagBits bits;
>> -
>> -       if (dst->aspect_mask == VK_IMAGE_ASPECT_COLOR_BIT)
>> -               bits = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
>> -       else
>> -               bits = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
>> -
>> -       create_iview(cmd_buffer, dst, bits,
>> +       create_iview(cmd_buffer, dst, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
>>                      &tmp->iview, depth_format);
>
> were we mixing up enums here before or after this? bits is usage, you
> changed it to
> pass LAYOUT.

oops, you're right, it was usage, not layouts. Will revert this chunk
then. btw radv_image_view_init doesn't use the arg, so will send a
follow up patch to remove it, since apps won't be passing it in
anyways.
>
> Dave.
>
>>
>>         radv_CreateFramebuffer(radv_device_to_handle(cmd_buffer->device),
>> @@ -713,8 +706,8 @@ blit2d_init_color_pipeline(struct radv_device *device,
>>                                                        .format = format,
>>                                                        .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD,
>>                                                        .storeOp = VK_ATTACHMENT_STORE_OP_STORE,
>> -                                                      .initialLayout = VK_IMAGE_LAYOUT_GENERAL,
>> -                                                      .finalLayout = VK_IMAGE_LAYOUT_GENERAL,
>> +                                                      .initialLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
>> +                                                      .finalLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
>>                                                        },
>>                                                .subpassCount = 1,
>>                                                .pSubpasses = &(VkSubpassDescription) {
>> @@ -723,12 +716,12 @@ blit2d_init_color_pipeline(struct radv_device *device,
>>                                                        .colorAttachmentCount = 1,
>>                                                        .pColorAttachments = &(VkAttachmentReference) {
>>                                                                .attachment = 0,
>> -                                                              .layout = VK_IMAGE_LAYOUT_GENERAL,
>> +                                                              .layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
>>                                                         },
>>                                                .pResolveAttachments = NULL,
>>                                                .pDepthStencilAttachment = &(VkAttachmentReference) {
>>                                                        .attachment = VK_ATTACHMENT_UNUSED,
>> -                                                      .layout = VK_IMAGE_LAYOUT_GENERAL,
>> +                                                      .layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
>>                                                },
>>                                                .preserveAttachmentCount = 1,
>>                                                .pPreserveAttachments = (uint32_t[]) { 0 },
>> @@ -871,8 +864,8 @@ blit2d_init_depth_only_pipeline(struct radv_device *device,
>>                                                                .format = 0,
>>                                                                .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD,
>>                                                                .storeOp = VK_ATTACHMENT_STORE_OP_STORE,
>> -                                                              .initialLayout = VK_IMAGE_LAYOUT_GENERAL,
>> -                                                              .finalLayout = VK_IMAGE_LAYOUT_GENERAL,
>> +                                                              .initialLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
>> +                                                              .finalLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
>>                                                        },
>>                                                        .subpassCount = 1,
>>                                                        .pSubpasses = &(VkSubpassDescription) {
>> @@ -883,7 +876,7 @@ blit2d_init_depth_only_pipeline(struct radv_device *device,
>>                                                        .pResolveAttachments = NULL,
>>                                                        .pDepthStencilAttachment = &(VkAttachmentReference) {
>>                                                                .attachment = 0,
>> -                                                              .layout = VK_IMAGE_LAYOUT_GENERAL,
>> +                                                              .layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
>>                                                        },
>>                                                        .preserveAttachmentCount = 1,
>>                                                        .pPreserveAttachments = (uint32_t[]) { 0 },
>> @@ -1026,8 +1019,8 @@ blit2d_init_stencil_only_pipeline(struct radv_device *device,
>>                                                                .format = 0,
>>                                                                .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD,
>>                                                                .storeOp = VK_ATTACHMENT_STORE_OP_STORE,
>> -                                                              .initialLayout = VK_IMAGE_LAYOUT_GENERAL,
>> -                                                              .finalLayout = VK_IMAGE_LAYOUT_GENERAL,
>> +                                                              .initialLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
>> +                                                              .finalLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
>>                                                        },
>>                                                        .subpassCount = 1,
>>                                                        .pSubpasses = &(VkSubpassDescription) {
>> @@ -1038,7 +1031,7 @@ blit2d_init_stencil_only_pipeline(struct radv_device *device,
>>                                                        .pResolveAttachments = NULL,
>>                                                        .pDepthStencilAttachment = &(VkAttachmentReference) {
>>                                                                .attachment = 0,
>> -                                                              .layout = VK_IMAGE_LAYOUT_GENERAL,
>> +                                                              .layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
>>                                                        },
>>                                                        .preserveAttachmentCount = 1,
>>                                                        .pPreserveAttachments = (uint32_t[]) { 0 },
>> --
>> 2.13.1
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list