Use correct image extent for image to buffer copies
authorPetros Bantolas <petros.bantolas@imgtec.com>
Wed, 20 Sep 2017 10:58:15 +0000 (11:58 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 3 Oct 2017 09:16:45 +0000 (05:16 -0400)
The final stage of those tests (reading back to a host-mapped buffer)
would use an incorrect depth for the source image extent, when that is a
2D texture array. Because the test didn't factor in the image type, it
would set both the image extent and the subresource layerCount to the
number of layers being copied.

Using `getExtent3D` we get the appropriate behaviour.

Affects:
- dEQP-VK.api.copy_and_blit.*.3d_images.3d_to_2d*
- dEQP-VK.api.copy_and_blit.*.resolve_image.whole_array_image.*
- dEQP-VK.api.copy_and_blit.*.resolve_image.diff_image_size.
  dst_256_256_11*

Components: Vulkan

VK-GL-CTS issue: 729

Change-Id: I26109772c42286a741a38aa9c9cd8a42a5873adc

external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp

index ca1af214833bc4af14de7f5c312ebf8ade791597..d1435e975a7cd5256f03c2d16656282ccd89d358 100644 (file)
@@ -656,12 +656,7 @@ void CopiesAndBlittingTestInstance::readImageAspect (vk::VkImage                                   image,
        const deUint32                          queueFamilyIndex        = m_context.getUniversalQueueFamilyIndex();
        const VkDeviceSize                      pixelDataSize           = calculateSize(dst);
 
-       const VkExtent3D                        imageExtent                     =
-       {
-               (deUint32)dst.getWidth(),
-               (deUint32)dst.getHeight(),
-               (deUint32)dst.getDepth(),
-       };
+       const VkExtent3D                        imageExtent                     = getExtent3D(imageParms);
 
        // Create destination buffer
        {