From 5a51bdeec6cbe1f5f4b8abcb194cbe4f8b5b5a95 Mon Sep 17 00:00:00 2001 From: David Sodman Date: Mon, 4 Apr 2016 19:16:24 -0700 Subject: [PATCH] Add sanity checking of API version Bug: 27640790 Change-Id: I8b4d1b9311908ef3591ec20f34996a2e68384410 --- .../vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp index e4d5da9..ed6cfc6 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp @@ -32,6 +32,7 @@ #include "vkDeviceUtil.hpp" #include "vkQueryUtil.hpp" #include "vkImageUtil.hpp" +#include "vkApiVersion.hpp" #include "tcuTestLog.hpp" #include "tcuFormatUtil.hpp" @@ -762,6 +763,23 @@ tcu::TestStatus deviceProperties (Context& context) return tcu::TestStatus::fail("deviceProperties incomplete initialization"); } + { + const ApiVersion deviceVersion = unpackVersion(props->apiVersion); + const ApiVersion deqpVersion = unpackVersion(VK_API_VERSION); + + if (deviceVersion.majorNum != deqpVersion.majorNum) + { + log << TestLog::Message << "deviceProperties - API Major Version " << deviceVersion.majorNum << " is not valid" << TestLog::EndMessage; + return tcu::TestStatus::fail("deviceProperties apiVersion not valid"); + } + + if (deviceVersion.minorNum > deqpVersion.minorNum) + { + log << TestLog::Message << "deviceProperties - API Minor Version " << deviceVersion.minorNum << " is not valid for this version of dEQP" << TestLog::EndMessage; + return tcu::TestStatus::fail("deviceProperties apiVersion not valid"); + } + } + return tcu::TestStatus::pass("DeviceProperites query succeeded"); } -- 2.7.4