Fix time calibration tests so they use all host time domains
authorRicardo Garcia <rgarcia@igalia.com>
Wed, 18 Sep 2019 13:53:19 +0000 (15:53 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 25 Oct 2019 11:15:00 +0000 (07:15 -0400)
When using std::set_intersection to check which time domains are
available, the input sets are not guaranteed to be sorted. This makes
the code skip some host time domains under Linux-like systems, which may
have more than one host time domain available.

Affected tests:
dEQP-VK.pipeline.timestamp.calibrated.*

Components: Vulkan
VK-GL-CTS issue: 2010

Change-Id: Iea9f0e375d675f9a63671165a78218ca04c6cde9

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

index 1cdda8f..c92fb42 100644 (file)
@@ -46,6 +46,7 @@
 
 #include <sstream>
 #include <vector>
+#include <set>
 #include <cctype>
 #include <locale>
 #include <limits>
@@ -1150,8 +1151,11 @@ CalibratedTimestampTestInstance::CalibratedTimestampTestInstance (Context& conte
 
 std::vector<VkTimeDomainEXT> CalibratedTimestampTestInstance::getDomainSubset (const std::vector<VkTimeDomainEXT>& available, const std::vector<VkTimeDomainEXT>& interesting) const
 {
+       const std::set<VkTimeDomainEXT> availableSet    (begin(available),              end(available));
+       const std::set<VkTimeDomainEXT> interestingSet  (begin(interesting),    end(interesting));
+
        std::vector<VkTimeDomainEXT> subset;
-       std::set_intersection(begin(available), end(available), begin(interesting), end(interesting), std::back_inserter(subset));
+       std::set_intersection(begin(availableSet), end(availableSet), begin(interestingSet), end(interestingSet), std::back_inserter(subset));
        return subset;
 }