{
const tcu::TextureFormat srcTcuFormat = mapVkFormat(m_params.src.image.format);
const tcu::TextureFormat dstTcuFormat = mapVkFormat(m_params.dst.image.format);
+
m_sourceTextureLevel = de::MovePtr<tcu::TextureLevel>(new tcu::TextureLevel(srcTcuFormat,
(int)m_params.src.image.extent.width,
(int)m_params.src.image.extent.height,
std::vector<VkImageCopy> imageCopies;
for (deUint32 i = 0; i < m_params.regions.size(); i++)
- imageCopies.push_back(m_params.regions[i].imageCopy);
+ {
+ const VkImageCopy& ic = m_params.regions[i].imageCopy;
+ imageCopies.push_back(ic);
+ }
const VkImageMemoryBarrier imageBarriers[] =
{
VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo));
vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, DE_LENGTH_OF_ARRAY(imageBarriers), imageBarriers);
- vk.cmdCopyImage(*m_cmdBuffer, m_source.get(), m_params.src.image.operationLayout, m_destination.get(), m_params.dst.image.operationLayout, (deUint32)m_params.regions.size(), imageCopies.data());
+ vk.cmdCopyImage(*m_cmdBuffer, m_source.get(), m_params.src.image.operationLayout, m_destination.get(), m_params.dst.image.operationLayout, (deUint32)imageCopies.size(), imageCopies.data());
VK_CHECK(vk.endCommandBuffer(*m_cmdBuffer));
submitCommandsAndWait (vk, vkDevice, queue, *m_cmdBuffer);
VkExtent3D extent = region.imageCopy.extent;
if (m_params.src.image.imageType == VK_IMAGE_TYPE_3D && m_params.dst.image.imageType == VK_IMAGE_TYPE_2D)
+ {
dstOffset.z = srcOffset.z;
+ extent.depth = std::max(region.imageCopy.extent.depth, region.imageCopy.dstSubresource.layerCount);
+ }
if (m_params.src.image.imageType == VK_IMAGE_TYPE_2D && m_params.dst.image.imageType == VK_IMAGE_TYPE_3D)
{
srcOffset.z = dstOffset.z;
params3DTo2D.dst.image.operationLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
params3DTo2D.allocationKind = allocationKind;
- for (deUint32 slicesLayersNdx = 0; slicesLayersNdx < slicesLayers; ++slicesLayersNdx)
{
const VkImageSubresourceLayers sourceLayer =
{
{0, 0, 0}, // VkOffset3D srcOffset;
destinationLayer, // VkImageSubresourceLayers dstSubresource;
{0, 0, 0}, // VkOffset3D dstOffset;
- params2DTo3D.dst.image.extent, // VkExtent3D extent;
+ params2DTo3D.src.image.extent, // VkExtent3D extent;
};
CopyRegion imageCopy;