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
#include <sstream>
#include <vector>
+#include <set>
#include <cctype>
#include <locale>
#include <limits>
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;
}