timon

Vulkan: vkCmdBlitImage blits only base layer even when layerCount > 1

Discussion created by timon on Jul 29, 2016
Latest reply on Aug 26, 2016 by dwitczak

In vulkan when we call vkCmdBlitImage with

baseArrayLayer = 0 and layerCount = 6 (for both srcSubresource and dstSubresource)

only the first layer gets blitted.

if I replace the call

 

 

 

                if (1) {

                    region.srcSubresource.baseArrayLayer = 0;

                    region.srcSubresource.layerCount = 6;

                    region.dstSubresource.baseArrayLayer = 0;

                    region.dstSubresource.layerCount = 6;

                    vkCmdBlitImage(cb.BE_Get(),

                        dstimage, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,

                        dstimage, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,

                        1, &region,

                        VK_FILTER_LINEAR

                    );

                }

                else {//TODO @Timon seems like blitting multiple layers (using layerCount) doesn't work on amd?

                    VkImageBlit ***[6];

                    for (int i = 0; i < 6; ++i) {

                        ***[i] = region;

                        ***[i].srcSubresource.baseArrayLayer = i;

                        ***[i].srcSubresource.layerCount = 1;

                        ***[i].dstSubresource.baseArrayLayer = i;

                        ***[i].dstSubresource.layerCount = 1;

                    }

                    vkCmdBlitImage(cb.BE_Get(),

                        dstimage, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,

                        dstimage, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,

                        6, ***,

                        VK_FILTER_LINEAR

                    );

                }

Outcomes