Use correct extent for 1D compute texel_view_compatible tests
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 29 Nov 2022 11:17:17 +0000 (12:17 +0100)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Mon, 23 Jan 2023 16:14:05 +0000 (16:14 +0000)
We weren't sanitizing the size in the parameters, resulting in
copyDataToImage() passing an extent with a non-1 height to when
uploading to a 1D image. Sanitize fullSize, and remove a case where
where we were workaround it not being sanitized.

Components: Vulkan

Affects: dEQP-VK.image.texel_view_compatible.compute.basic.1d_image.*

VK-GL-CTS Issue: 4143

Change-Id: Icdb50c09137a947f47b1afc7426e53e73c31f689

external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp

index 2fc1a2e..17524cb 100644 (file)
@@ -542,7 +542,7 @@ TestStatus BasicComputeTestInstance::iterate (void)
        Allocator&                                                              allocator                       = m_context.getDefaultAllocator();
        const Unique<VkCommandPool>                             cmdPool                         (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
        const Unique<VkCommandBuffer>                   cmdBuffer                       (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
-       const UVec3                                                             fullSize                        (m_parameters.size.x(), m_parameters.size.y(), 1);
+       const UVec3                                                             fullSize                        (m_parameters.size.x(), m_parameters.imageType == IMAGE_TYPE_1D ? 1 : m_parameters.size.y(), 1);
        const vector<UVec3>                                             mipMapSizes                     = m_parameters.useMipmaps ? getMipLevelSizes (getLayerDims()) : vector<UVec3>(1, fullSize);
        vector<ImageData>                                               imageData                       (m_parameters.imagesCount);
        const deUint32                                                  compressedNdx           = 0u;
@@ -1026,7 +1026,7 @@ bool BasicComputeTestInstance::decompressImage (const VkCommandBuffer&    cmdBuffer
        {
                const bool                                              layoutShaderReadOnly    = (layerNdx % 2u) == 1;
                const deUint32                                  imageNdx                                = layerNdx + mipNdx * getLayerCount();
-               const VkExtent3D                                extentCompressed                = imageType == VK_IMAGE_TYPE_1D ? makeExtent3D(mipMapSizes[mipNdx].x(), 1, mipMapSizes[mipNdx].z()) : makeExtent3D(mipMapSizes[mipNdx]);
+               const VkExtent3D                                extentCompressed                = makeExtent3D(mipMapSizes[mipNdx]);
                const VkImage&                                  uncompressed                    = imageData[m_parameters.imagesCount -1].getImage(imageNdx);
                const VkExtent3D                                extentUncompressed              = imageData[m_parameters.imagesCount -1].getImageInfo(imageNdx).extent;
                const VkDeviceSize                              bufferSizeComp                  = getCompressedImageSizeInBytes(m_parameters.formatCompressed, mipMapSizes[mipNdx]);