Fix bitshift issue in dEQP-VK.api.copy_and_blit.*
authorPaavo Pessi <paavo.pessi@siru.fi>
Mon, 28 Aug 2017 10:58:34 +0000 (13:58 +0300)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Wed, 6 Sep 2017 16:30:38 +0000 (12:30 -0400)
Use 64-bit integers to calculate maximum color value to avoid situations
where 32-bit integers are shifted left by 32 bits.

Affects:

dEQP-VK.api.copy_and_blit.*

Components: Vulkan

VK-GL-CTS issue: 643

Change-Id: I90aab8a31a363716a3bb1ce0ca79272adf3b2b1e

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

index 6e38fdb..8491776 100644 (file)
@@ -354,7 +354,7 @@ void CopiesAndBlittingTestInstance::generateBuffer (tcu::PixelBufferAccess buffe
                for (int i = 0; i < 4; ++i)
                {
                        if (bits[i] != 0)
-                               maxValue[i] = static_cast<float>((1 << (bits[i] - signBit)) - 1);
+                               maxValue[i] = static_cast<float>((deUint64(1) << (bits[i] - signBit)) - 1);
                }
        }