Fix rounding when casting to integer
authorNicolas Capens <capn@google.com>
Wed, 19 Jun 2019 21:33:02 +0000 (17:33 -0400)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Wed, 3 Jul 2019 09:42:22 +0000 (05:42 -0400)
commite81b11867f3a423c69838b2078ab39b12d3952d0
tree03c58e6c321de86877d70b9f8117ffc81b48e083
parentc4369e72de671d69afdb274e11734c5765f5b3b9
Fix rounding when casting to integer

Normalized values that were sampled from textures and have been scaled
by their maximum magnitude will be close to their unnormalized integer
value but may be slightly less. Subsequent casting to integer (with
rounding towards zero) may therefore result in a value one-off from the
original.

Use round-to-nearest to ensure the correct integer value is produced.

Fixes: #151
VK-GL-CTS public issue: 151
VK-GL-CTS issue: 1853
Affects: dEQP-VK.memory.pipeline_barrier.all.*
Components: Vulkan
Change-Id: I435d41145c83957db15c74ea394e89faf142c2a3
external/vulkancts/modules/vulkan/memory/vktMemoryPipelineBarrierTests.cpp