Fix source blit image size
authorMarcin Kańtoch <marcin.kantoch@amd.com>
Thu, 25 Feb 2021 16:23:31 +0000 (17:23 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Sat, 6 Mar 2021 09:55:13 +0000 (09:55 +0000)
Changed the way source blit image size is calculated,
so that in all circumstances width > 0 and height > 0.

Affects:
dEQP-VK.memory.pipeline_barrier.host_read_transfer_dst.1024

Components: Vulkan

VK-GL-CTS issue: 2816

Change-Id: Id23a8e613b013e9e40b0075822b80c78b9ca418c

external/vulkancts/modules/vulkan/memory/vktMemoryPipelineBarrierTests.cpp

index 9951b04..5f70d18 100644 (file)
@@ -3648,8 +3648,8 @@ void ImageBlitFromImage::prepare (PrepareContext& context)
        }
        else if (m_scale == BLIT_SCALE_20)
        {
-               m_srcImageWidth                 = m_imageWidth / 2;
-               m_srcImageHeight                = m_imageHeight / 2;
+               m_srcImageWidth                 = m_imageWidth == 1 ? 1 : m_imageWidth / 2;
+               m_srcImageHeight                = m_imageHeight == 1 ? 1 : m_imageHeight / 2;
        }
        else
                DE_FATAL("Unsupported scale");