2 Replies Latest reply on Aug 26, 2016 4:23 AM by dwitczak

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

    timon

      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 wtf[6];

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

                              wtf[i] = region;

                              wtf[i].srcSubresource.baseArrayLayer = i;

                              wtf[i].srcSubresource.layerCount = 1;

                              wtf[i].dstSubresource.baseArrayLayer = i;

                              wtf[i].dstSubresource.layerCount = 1;

                          }

                          vkCmdBlitImage(cb.BE_Get(),

                              dstimage, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,

                              dstimage, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,

                              6, wtf,

                              VK_FILTER_LINEAR

                          );

                      }