From ed57b4c1e3a129c14bc65ec5dad03a89feb6ac82 Mon Sep 17 00:00:00 2001 From: Piotr Byszewski Date: Thu, 18 Oct 2018 11:55:56 +0200 Subject: [PATCH] Correct copy_and_blit on Null driver On Null driver all features are enabled which leads copy_and_blit tests to be executed for incompatible image formats. This change detects that and fails the verification to prevent hiting assertions in the framework. VK-GL-CTS issue: 1427 Components: Vulkan Affects: dEQP-VK.api.copy_and_blit.* Change-Id: I0d105c297f5548175580434cc2a12fa53b69339d --- .../vulkan/api/vktApiCopiesAndBlittingTests.cpp | 34 ++++++++++++++++++---- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp index 7022834..b85af36 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp @@ -1988,12 +1988,26 @@ bool BlittingImages::checkLinearFilteredResult (const tcu::ConstPixelBufferAcces const tcu::ConstPixelBufferAccess& unclampedExpected, const tcu::TextureFormat& srcFormat) { - tcu::TestLog& log (m_context.getTestContext().getLog()); - const tcu::TextureFormat dstFormat = result.getFormat(); - bool isOk = false; + tcu::TestLog& log (m_context.getTestContext().getLog()); + const tcu::TextureFormat dstFormat = result.getFormat(); + const tcu::TextureChannelClass dstChannelClass = tcu::getTextureChannelClass(dstFormat.type); + const tcu::TextureChannelClass srcChannelClass = tcu::getTextureChannelClass(srcFormat.type); + bool isOk = false; log << tcu::TestLog::Section("ClampedSourceImage", "Region with clamped edges on source image."); + // if either of srcImage or dstImage was created with a signed/unsigned integer VkFormat, + // the other must also have been created with a signed/unsigned integer VkFormat + bool dstImageIsIntClass = dstChannelClass == tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER || + dstChannelClass == tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER; + bool srcImageIsIntClass = srcChannelClass == tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER || + srcChannelClass == tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER; + if (dstImageIsIntClass != srcImageIsIntClass) + { + log << tcu::TestLog::EndSection; + return false; + } + if (isFloatFormat(dstFormat)) { const bool srcIsSRGB = tcu::isSRGB(srcFormat); @@ -2221,7 +2235,9 @@ bool BlittingImages::checkNearestFilteredResult (const tcu::ConstPixelBufferAcce { tcu::TestLog& log (m_context.getTestContext().getLog()); const tcu::TextureFormat dstFormat = result.getFormat(); + const tcu::TextureFormat srcFormat = source.getFormat(); const tcu::TextureChannelClass dstChannelClass = tcu::getTextureChannelClass(dstFormat.type); + const tcu::TextureChannelClass srcChannelClass = tcu::getTextureChannelClass(srcFormat.type); tcu::TextureLevel errorMaskStorage (tcu::TextureFormat(tcu::TextureFormat::RGB, tcu::TextureFormat::UNORM_INT8), result.getWidth(), result.getHeight()); tcu::PixelBufferAccess errorMask = errorMaskStorage.getAccess(); @@ -2231,8 +2247,16 @@ bool BlittingImages::checkNearestFilteredResult (const tcu::ConstPixelBufferAcce tcu::clear(errorMask, tcu::Vec4(0.0f, 1.0f, 0.0f, 1.0)); - if (dstChannelClass == tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER || - dstChannelClass == tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER) + // if either of srcImage or dstImage was created with a signed/unsigned integer VkFormat, + // the other must also have been created with a signed/unsigned integer VkFormat + bool dstImageIsIntClass = dstChannelClass == tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER || + dstChannelClass == tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER; + bool srcImageIsIntClass = srcChannelClass == tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER || + srcChannelClass == tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER; + if (dstImageIsIntClass != srcImageIsIntClass) + return false; + + if (dstImageIsIntClass) { ok = intNearestBlitCompare(source, result, errorMask, m_params.regions); } -- 2.7.4