diff options
author | Eric Engestrom <eric@igalia.com> | 2023-03-10 11:23:56 +0000 |
---|---|---|
committer | Piotr Byszewski <piotr.byszewski@mobica.com> | 2023-03-23 17:00:10 +0000 |
commit | e5e42d95242dfa1e1989ba284796639824d45e04 (patch) | |
tree | 615b3b3d937551b1ddec769c511afa17c31896ac /external/vulkancts/modules/vulkan | |
parent | 66467144d0f824115debcbb294e4fcb500990542 (diff) | |
download | VK-GL-CTS-e5e42d95242dfa1e1989ba284796639824d45e04.tar.gz VK-GL-CTS-e5e42d95242dfa1e1989ba284796639824d45e04.tar.bz2 VK-GL-CTS-e5e42d95242dfa1e1989ba284796639824d45e04.zip |
Fix prettySize() in dEQP-VK.info.*
The units were in the wrong order, leading to MiB being picked for
all values below 1 TiB and above or equal to 1 MiB, skipping GiB.
Adding an assert ensures that this stays correct in the future as well,
as the comment was clearly not enough.
Components: Vulkan
Affects: dEQP-VK.info.memory_limits
Change-Id: Ie9ccc14ee8ef703e197af8e5c31387deba1dd1d4
Diffstat (limited to 'external/vulkancts/modules/vulkan')
-rw-r--r-- | external/vulkancts/modules/vulkan/vktInfoTests.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/external/vulkancts/modules/vulkan/vktInfoTests.cpp b/external/vulkancts/modules/vulkan/vktInfoTests.cpp index 63052c948..7dddfefcc 100644 --- a/external/vulkancts/modules/vulkan/vktInfoTests.cpp +++ b/external/vulkancts/modules/vulkan/vktInfoTests.cpp @@ -29,6 +29,7 @@ #include "tcuFormatUtil.hpp" #include "tcuCommandLine.hpp" #include "tcuPlatform.hpp" +#include "deDefs.h" #include "deStringUtil.hpp" #include "vktApiFeatureInfo.hpp" @@ -180,14 +181,16 @@ const SizeUnit* getBestSizeUnit (deUint64 value) { // \note Must be ordered from largest to smallest { "TiB", 1ull<<40ull }, - { "MiB", 1ull<<20ull }, { "GiB", 1ull<<30ull }, + { "MiB", 1ull<<20ull }, { "KiB", 1ull<<10ull }, }; static const SizeUnit s_defaultUnit = { "B", 1u }; for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(s_units); ++ndx) { + DE_ASSERT(ndx == DE_LENGTH_OF_ARRAY(s_units) || + s_units[ndx].value > s_units[ndx + 1].value); if (value >= s_units[ndx].value) return &s_units[ndx]; } |