Accept saturated values for the 32bit buffer
authorTomasz Owczarek <tomasz.owczarek@arm.com>
Mon, 9 Sep 2019 15:03:44 +0000 (16:03 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 12 Sep 2019 16:12:21 +0000 (12:12 -0400)
API documentation, extension 1.1, vkGetQueryPoolResults description:
"If VK_QUERY_RESULT_64_BIT is not set and the result overflows a 32-bit
value, the value may either wrap or saturate."

Affects:
dEQP-VK.pipeline.timestamp.misc_tests.*

Components: Vulkan

VK-GL-CTS issue: 1985

Change-Id: Id229ea4c13b52bf27c00de734c437d878365fef9

external/vulkancts/modules/vulkan/pipeline/vktPipelineTimestampTests.cpp

index f78b09f..69f4439 100644 (file)
@@ -3024,6 +3024,8 @@ tcu::TestStatus ConsistentQueryResultsTestInstance::iterate(void)
        deUint32                                        tsGet32Bits;
        deUint64                                        tsGet64Bits;
 
+       constexpr deUint32                      maxDeUint32Value = std::numeric_limits<deUint32>::max();
+
        submitCommandsAndWait(vk, vkDevice, queue, m_cmdBuffer.get());
 
        // Get results from buffers.
@@ -3043,7 +3045,8 @@ tcu::TestStatus ConsistentQueryResultsTestInstance::iterate(void)
        // Check results are consistent.
        if (tsBuffer32Bits == tsGet32Bits &&
                tsBuffer64Bits == tsGet64Bits &&
-               (tsGet64Bits & std::numeric_limits<deUint32>::max()) == tsGet32Bits)
+               (((tsGet64Bits & maxDeUint32Value) == tsGet32Bits) ||
+               ((tsGet64Bits > maxDeUint32Value) && (maxDeUint32Value == tsGet32Bits))))
        {
                return tcu::TestStatus::pass("Pass");
        }