external/vulkancts/modules/vulkan/api/vktApiDescriptorPoolTests.cpp \
external/vulkancts/modules/vulkan/api/vktApiDescriptorSetTests.cpp \
external/vulkancts/modules/vulkan/api/vktApiDeviceInitializationTests.cpp \
+ external/vulkancts/modules/vulkan/api/vktApiDriverPropertiesTests.cpp \
external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp \
external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp \
external/vulkancts/modules/vulkan/api/vktApiFillBufferTests.cpp \
dEQP-VK.info.memory_limits
dEQP-VK.api.version_check.version
dEQP-VK.api.version_check.entry_points
+dEQP-VK.api.driver_properties.properties
dEQP-VK.api.smoke.create_sampler
dEQP-VK.api.smoke.create_shader
dEQP-VK.api.smoke.triangle
#define VK_API_VERSION_1_1 (static_cast<deUint32> (VK_MAKE_VERSION(1, 1, 0)))
#define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE (static_cast<size_t> (256))
#define VK_MAX_EXTENSION_NAME_SIZE (static_cast<size_t> (256))
+#define VK_MAX_DRIVER_NAME_SIZE_KHR (static_cast<size_t> (256))
+#define VK_MAX_DRIVER_INFO_SIZE_KHR (static_cast<size_t> (256))
#define VK_UUID_SIZE (static_cast<size_t> (16))
#define VK_LUID_SIZE (static_cast<size_t> (8))
#define VK_MAX_MEMORY_TYPES (static_cast<size_t> (32))
return VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR;
}
+template<> VkStructureType getStructureType<VkPhysicalDeviceDriverPropertiesKHR> (void)
+{
+ return VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR;
+}
+
template<> VkStructureType getStructureType<VkDebugReportCallbackCreateInfoEXT> (void)
{
return VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT;
std::ostream& operator<< (std::ostream& s, const VkDisplayPlaneInfo2KHR& value);
std::ostream& operator<< (std::ostream& s, const VkDisplayPlaneCapabilities2KHR& value);
std::ostream& operator<< (std::ostream& s, const VkImageFormatListCreateInfoKHR& value);
+std::ostream& operator<< (std::ostream& s, const VkConformanceVersionKHR& value);
+std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceDriverPropertiesKHR& value);
std::ostream& operator<< (std::ostream& s, const VkDebugReportCallbackCreateInfoEXT& value);
std::ostream& operator<< (std::ostream& s, const VkPipelineRasterizationStateRasterizationOrderAMD& value);
std::ostream& operator<< (std::ostream& s, const VkDebugMarkerObjectNameInfoEXT& value);
return s;
}
+std::ostream& operator<< (std::ostream& s, const VkConformanceVersionKHR& value)
+{
+ s << "VkConformanceVersionKHR = {\n";
+ s << "\tmajor = " << value.major << '\n';
+ s << "\tminor = " << value.minor << '\n';
+ s << "\tsubminor = " << value.subminor << '\n';
+ s << "\tpatch = " << value.patch << '\n';
+ s << '}';
+ return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceDriverPropertiesKHR& value)
+{
+ s << "VkPhysicalDeviceDriverPropertiesKHR = {\n";
+ s << "\tsType = " << value.sType << '\n';
+ s << "\tpNext = " << value.pNext << '\n';
+ s << "\tdriverID = " << value.driverID << '\n';
+ s << "\tdriverName = " << '\n' << tcu::formatArray(tcu::Format::HexIterator<char>(DE_ARRAY_BEGIN(value.driverName)), tcu::Format::HexIterator<char>(DE_ARRAY_END(value.driverName))) << '\n';
+ s << "\tdriverInfo = " << '\n' << tcu::formatArray(tcu::Format::HexIterator<char>(DE_ARRAY_BEGIN(value.driverInfo)), tcu::Format::HexIterator<char>(DE_ARRAY_END(value.driverInfo))) << '\n';
+ s << "\tconformanceVersion = " << value.conformanceVersion << '\n';
+ s << '}';
+ return s;
+}
+
std::ostream& operator<< (std::ostream& s, const VkDebugReportCallbackCreateInfoEXT& value)
{
s << "VkDebugReportCallbackCreateInfoEXT = {\n";
const VkFormat* pViewFormats;
};
+struct VkConformanceVersionKHR
+{
+ deUint8 major;
+ deUint8 minor;
+ deUint8 subminor;
+ deUint8 patch;
+};
+
+struct VkPhysicalDeviceDriverPropertiesKHR
+{
+ VkStructureType sType;
+ void* pNext;
+ deUint32 driverID;
+ char driverName[VK_MAX_DRIVER_NAME_SIZE_KHR];
+ char driverInfo[VK_MAX_DRIVER_INFO_SIZE_KHR];
+ VkConformanceVersionKHR conformanceVersion;
+};
+
struct VkDebugReportCallbackCreateInfoEXT
{
VkStructureType sType;
return res;
}
+inline VkConformanceVersionKHR makeConformanceVersionKHR (deUint8 major, deUint8 minor, deUint8 subminor, deUint8 patch)
+{
+ VkConformanceVersionKHR res;
+ res.major = major;
+ res.minor = minor;
+ res.subminor = subminor;
+ res.patch = patch;
+ return res;
+}
+
inline VkIndirectCommandsTokenNVX makeIndirectCommandsTokenNVX (VkIndirectCommandsTokenTypeNVX tokenType, VkBuffer buffer, VkDeviceSize offset)
{
VkIndirectCommandsTokenNVX res;
vktApiSmokeTests.hpp
vktApiDeviceInitializationTests.cpp
vktApiDeviceInitializationTests.hpp
+ vktApiDriverPropertiesTests.cpp
+ vktApiDriverPropertiesTests.hpp
vktApiObjectManagementTests.cpp
vktApiObjectManagementTests.hpp
vktApiBufferTests.cpp
--- /dev/null
+/*-------------------------------------------------------------------------
+* Vulkan Conformance Tests
+* ------------------------
+*
+* Copyright (c) 2018 Advanced Micro Devices, Inc.
+* Copyright (c) 2018 The Khronos Group Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*//*!
+* \file
+* \brief VK_KHR_driver_properties tests
+*//*--------------------------------------------------------------------*/
+
+#include "vktApiDriverPropertiesTests.hpp"
+#include "vktTestGroupUtil.hpp"
+#include "vktTestCaseUtil.hpp"
+#include "vkQueryUtil.hpp"
+#include "vkTypeUtil.hpp"
+
+using namespace vk;
+
+namespace vkt
+{
+namespace api
+{
+namespace
+{
+
+static const deUint32 knownDriverIds[] =
+{
+ // Specified in the Vulkan registry (vk.xml)
+ 1, // author = "Advanced Micro Devices, Inc." comment = "AMD proprietary driver"
+ 2, // author = "Advanced Micro Devices, Inc." comment = "AMD open-source driver"
+ 3, // author = "Mesa open source project" comment = "Mesa RADV driver"
+ 4, // author = "NVIDIA Corporation" comment = "NVIDIA proprietary driver"
+ 5, // author = "Intel Corporation" comment = "Intel proprietary Windows driver"
+ 6, // author = "Intel Corporation" comment = "Intel open-source Mesa driver"
+ 7, // author = "Imagination Technologies" comment = "Imagination proprietary driver"
+ 8, // author = "Qualcomm Technologies, Inc." comment = "Qualcomm proprietary driver"
+ 9, // author = "Arm Limited" comment = "Arm proprietary driver"
+};
+
+static const VkConformanceVersionKHR knownConformanceVersions[] =
+{
+ makeConformanceVersionKHR(1, 1, 2, 1),
+ makeConformanceVersionKHR(1, 1, 2, 0),
+ makeConformanceVersionKHR(1, 1, 1, 3),
+ makeConformanceVersionKHR(1, 1, 1, 2),
+ makeConformanceVersionKHR(1, 1, 1, 1),
+ makeConformanceVersionKHR(1, 1, 1, 0),
+ makeConformanceVersionKHR(1, 1, 0, 3),
+ makeConformanceVersionKHR(1, 0, 2, 6),
+ makeConformanceVersionKHR(1, 0, 2, 5),
+ makeConformanceVersionKHR(1, 0, 2, 4),
+ makeConformanceVersionKHR(1, 0, 2, 3),
+ makeConformanceVersionKHR(1, 0, 2, 2),
+ makeConformanceVersionKHR(1, 0, 2, 1),
+ makeConformanceVersionKHR(1, 0, 2, 0),
+};
+
+DE_INLINE bool isNullTerminated(const char* str, const deUint32 maxSize)
+{
+ return deStrnlen(str, maxSize) < maxSize;
+}
+
+DE_INLINE bool operator==(const VkConformanceVersionKHR& a, const VkConformanceVersionKHR& b)
+{
+ return ((a.major == b.major) &&
+ (a.minor == b.minor) &&
+ (a.subminor == b.subminor) &&
+ (a.patch == b.patch));
+}
+
+tcu::TestStatus testQueryProperties (Context& context)
+{
+ // Check extension support
+
+ if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_driver_properties"))
+ TCU_THROW(NotSupportedError, "Unsupported extension: VK_KHR_driver_properties");
+
+ // Query the driver properties
+
+ const VkPhysicalDevice physDevice = context.getPhysicalDevice();
+ const int memsetPattern = 0xaa;
+ VkPhysicalDeviceProperties2 deviceProperties2;
+ VkPhysicalDeviceDriverPropertiesKHR deviceDriverProperties;
+
+ deMemset(&deviceDriverProperties, memsetPattern, sizeof(deviceDriverProperties));
+ deviceDriverProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR;
+ deviceDriverProperties.pNext = DE_NULL;
+
+ deMemset(&deviceProperties2, memsetPattern, sizeof(deviceProperties2));
+ deviceProperties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+ deviceProperties2.pNext = &deviceDriverProperties;
+
+ context.getInstanceInterface().getPhysicalDeviceProperties2(physDevice, &deviceProperties2);
+
+ // Verify the returned values
+
+ bool match = false;
+
+ for (const deUint32* pDriverId = knownDriverIds; (pDriverId != DE_ARRAY_END(knownDriverIds)) && !match; ++pDriverId)
+ {
+ if (deviceDriverProperties.driverID == *pDriverId)
+ {
+ match = true;
+
+ if (!isNullTerminated(deviceDriverProperties.driverName, VK_MAX_DRIVER_NAME_SIZE_KHR))
+ TCU_FAIL("Driver name is not a null-terminated string");
+
+ if (deviceDriverProperties.driverName[0] == 0)
+ TCU_FAIL("Driver name is empty");
+
+ if (!isNullTerminated(deviceDriverProperties.driverInfo, VK_MAX_DRIVER_INFO_SIZE_KHR))
+ TCU_FAIL("Driver info is not a null-terminated string");
+
+ bool conformanceVersionMatch = false;
+
+ for (const VkConformanceVersionKHR* pConformanceVersion = knownConformanceVersions;
+ pConformanceVersion != DE_ARRAY_END(knownConformanceVersions);
+ ++pConformanceVersion)
+ {
+ if (deviceDriverProperties.conformanceVersion == *pConformanceVersion)
+ {
+ conformanceVersionMatch = true;
+ break;
+ }
+ }
+
+ if (!conformanceVersionMatch)
+ TCU_FAIL("Wrong driver conformance version");
+ }
+ }
+
+ if (!match)
+ TCU_FAIL("Driver ID did not match any known driver");
+
+ return tcu::TestStatus::pass("Pass");
+}
+
+void createTestCases (tcu::TestCaseGroup* group)
+{
+ addFunctionCase(group, "properties", "Query VkPhysicalDeviceDriverPropertiesKHR and check its values", testQueryProperties);
+}
+
+} // anonymous
+
+tcu::TestCaseGroup* createDriverPropertiesTests(tcu::TestContext& testCtx)
+{
+ return createTestGroup(testCtx, "driver_properties", "VK_KHR_driver_properties tests", createTestCases);
+}
+
+} // api
+} // vkt
--- /dev/null
+#ifndef _VKTAPIDRIVERPROPERTIESTESTS_HPP
+#define _VKTAPIDRIVERPROPERTIESTESTS_HPP
+/*-------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2018 Advanced Micro Devices, Inc.
+ * Copyright (c) 2018 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief VK_KHR_driver_properties tests
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuDefs.hpp"
+#include "tcuTestCase.hpp"
+
+namespace vkt
+{
+namespace api
+{
+
+tcu::TestCaseGroup* createDriverPropertiesTests (tcu::TestContext& testCtx);
+
+} // api
+} // vkt
+
+#endif // _VKTAPIDRIVERPROPERTIESTESTS_HPP
#include "vktTestGroupUtil.hpp"
#include "vktApiSmokeTests.hpp"
#include "vktApiDeviceInitializationTests.hpp"
+#include "vktApiDriverPropertiesTests.hpp"
#include "vktApiObjectManagementTests.hpp"
#include "vktApiBufferTests.hpp"
#include "vktApiBufferViewCreateTests.hpp"
tcu::TestContext& testCtx = apiTests->getTestContext();
apiTests->addChild(createVersionSanityCheckTests (testCtx));
+ apiTests->addChild(createDriverPropertiesTests (testCtx));
apiTests->addChild(createSmokeTests (testCtx));
apiTests->addChild(api::createFeatureInfoTests (testCtx));
apiTests->addChild(createDeviceInitializationTests (testCtx));
dEQP-VK.info.memory_limits
dEQP-VK.api.version_check.version
dEQP-VK.api.version_check.entry_points
+dEQP-VK.api.driver_properties.properties
dEQP-VK.api.smoke.create_sampler
dEQP-VK.api.smoke.create_shader
dEQP-VK.api.smoke.triangle
dEQP-VK.info.memory_limits
dEQP-VK.api.version_check.version
dEQP-VK.api.version_check.entry_points
+dEQP-VK.api.driver_properties.properties
dEQP-VK.api.smoke.create_sampler
dEQP-VK.api.smoke.create_shader
dEQP-VK.api.smoke.triangle
("VK_API_VERSION_1_1", "deUint32"),
("VK_MAX_PHYSICAL_DEVICE_NAME_SIZE", "size_t"),
("VK_MAX_EXTENSION_NAME_SIZE", "size_t"),
+ ("VK_MAX_DRIVER_NAME_SIZE_KHR", "size_t"),
+ ("VK_MAX_DRIVER_INFO_SIZE_KHR", "size_t"),
("VK_UUID_SIZE", "size_t"),
("VK_LUID_SIZE", "size_t"),
("VK_MAX_MEMORY_TYPES", "size_t"),
VkDescriptorSetLayoutSupport* pSupport);
#endif
+#define VK_KHR_driver_properties 1
+#define VK_MAX_DRIVER_NAME_SIZE_KHR 256
+#define VK_MAX_DRIVER_INFO_SIZE_KHR 256
+#define VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION 1
+#define VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME "VK_KHR_driver_properties"
+
+typedef struct VkConformanceVersionKHR {
+ uint8_t major;
+ uint8_t minor;
+ uint8_t subminor;
+ uint8_t patch;
+} VkConformanceVersionKHR;
+
+typedef struct VkPhysicalDeviceDriverPropertiesKHR {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t driverID;
+ char driverName[VK_MAX_DRIVER_NAME_SIZE_KHR];
+ char driverInfo[VK_MAX_DRIVER_INFO_SIZE_KHR];
+ VkConformanceVersionKHR conformanceVersion;
+} VkPhysicalDeviceDriverPropertiesKHR;
+
#define VK_EXT_debug_report 1
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT)