From c33eade2c4cc2cfc1dd10bc2f95aa5622981e50e Mon Sep 17 00:00:00 2001 From: Pyry Haulos Date: Thu, 28 May 2015 15:29:09 -0700 Subject: [PATCH] Add collection of basic utilities for Vulkan Utilities are not complete yet, but represent a set of useful patterns and abstractions test cases should use to be future-proof. * DeviceUtil: creating default instance, selecting device * MemUtil: device memory management * QueryUtil: convenience wrappers for API queries Change-Id: I7a60f74fa5cba0f49a359efd35f749f8dac56eaf --- framework/vulkan/CMakeLists.txt | 6 ++ framework/vulkan/vkDeviceUtil.cpp | 82 +++++++++++++++++++++ framework/vulkan/vkDeviceUtil.hpp | 42 +++++++++++ framework/vulkan/vkMemUtil.cpp | 125 ++++++++++++++++++++++++++++++++ framework/vulkan/vkMemUtil.hpp | 87 ++++++++++++++++++++++ framework/vulkan/vkQueryUtil.cpp | 26 +++++++ framework/vulkan/vkQueryUtil.hpp | 144 +++++++++++++++++++++++++++++++++++++ modules/vulkan/vktInfo.cpp | 59 +++------------ modules/vulkan/vktTestCaseUtil.hpp | 2 +- 9 files changed, 521 insertions(+), 52 deletions(-) create mode 100644 framework/vulkan/vkDeviceUtil.cpp create mode 100644 framework/vulkan/vkDeviceUtil.hpp create mode 100644 framework/vulkan/vkMemUtil.cpp create mode 100644 framework/vulkan/vkMemUtil.hpp create mode 100644 framework/vulkan/vkQueryUtil.cpp create mode 100644 framework/vulkan/vkQueryUtil.hpp diff --git a/framework/vulkan/CMakeLists.txt b/framework/vulkan/CMakeLists.txt index d7d08b5..369e82e 100644 --- a/framework/vulkan/CMakeLists.txt +++ b/framework/vulkan/CMakeLists.txt @@ -11,6 +11,12 @@ set(VKUTIL_SRCS vkPrograms.hpp vkStrUtil.cpp vkStrUtil.hpp + vkQueryUtil.cpp + vkQueryUtil.hpp + vkMemUtil.cpp + vkMemUtil.hpp + vkDeviceUtil.cpp + vkDeviceUtil.hpp ) set(VKUTIL_LIBS diff --git a/framework/vulkan/vkDeviceUtil.cpp b/framework/vulkan/vkDeviceUtil.cpp new file mode 100644 index 0000000..be56082 --- /dev/null +++ b/framework/vulkan/vkDeviceUtil.cpp @@ -0,0 +1,82 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program Vulkan Utilities + * ----------------------------------------------- + * + * Copyright 2015 The Android Open Source Project + * + * 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 Instance and device initialization utilities. + *//*--------------------------------------------------------------------*/ + +#include "vkDeviceUtil.hpp" + +#include "qpInfo.h" + +#include + +namespace vk +{ + +using std::vector; + +Move createDefaultInstance (const PlatformInterface& vkPlatform) +{ + const struct VkApplicationInfo appInfo = + { + VK_STRUCTURE_TYPE_APPLICATION_INFO, // VkStructureType sType; + DE_NULL, // const void* pNext; + "deqp", // const char* pAppName; + qpGetReleaseId(), // deUint32 appVersion; + "deqp", // const char* pEngineName; + qpGetReleaseId(), // deUint32 engineVersion; + VK_API_VERSION // deUint32 apiVersion; + }; + const struct VkInstanceCreateInfo instanceInfo = + { + VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, // VkStructureType sType; + DE_NULL, // const void* pNext; + &appInfo, // const VkApplicationInfo* pAppInfo; + DE_NULL, // const VkAllocCallbacks* pAllocCb; + 0u, // deUint32 extensionCount; + DE_NULL // const char*const* ppEnabledExtensionNames; + }; + + return createInstance(vkPlatform, &instanceInfo); +} + +VkPhysicalDevice chooseDevice (const PlatformInterface& vkPlatform, VkInstance instance, const tcu::CommandLine&) +{ + vector devices; + deUint32 numDevices = 0; + + VK_CHECK(vkPlatform.enumeratePhysicalDevices(instance, &numDevices, DE_NULL)); + + if (numDevices > 0) + { + devices.resize(numDevices); + VK_CHECK(vkPlatform.enumeratePhysicalDevices(instance, &numDevices, &devices[0])); + + if (numDevices != devices.size()) + TCU_FAIL("Number of devices changed between queries"); + + // \todo [2015-05-28 pyry] Add --deqp-vk-device=N command line option + return devices[0]; + } + else + TCU_THROW(NotSupportedError, "No Vulkan devices available"); +} + +} // vk diff --git a/framework/vulkan/vkDeviceUtil.hpp b/framework/vulkan/vkDeviceUtil.hpp new file mode 100644 index 0000000..4bed3d3 --- /dev/null +++ b/framework/vulkan/vkDeviceUtil.hpp @@ -0,0 +1,42 @@ +#ifndef _VKDEVICEUTIL_HPP +#define _VKDEVICEUTIL_HPP +/*------------------------------------------------------------------------- + * drawElements Quality Program Vulkan Utilities + * ----------------------------------------------- + * + * Copyright 2015 The Android Open Source Project + * + * 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 Instance and device initialization utilities. + *//*--------------------------------------------------------------------*/ + +#include "vkDefs.hpp" +#include "vkRef.hpp" + +namespace tcu +{ +class CommandLine; +} + +namespace vk +{ + +Move createDefaultInstance (const PlatformInterface& vkPlatform); +VkPhysicalDevice chooseDevice (const PlatformInterface& vkPlatform, VkInstance instance, const tcu::CommandLine& cmdLine); + +} // vk + +#endif // _VKDEVICEUTIL_HPP diff --git a/framework/vulkan/vkMemUtil.cpp b/framework/vulkan/vkMemUtil.cpp new file mode 100644 index 0000000..a9ae606 --- /dev/null +++ b/framework/vulkan/vkMemUtil.cpp @@ -0,0 +1,125 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program Vulkan Utilities + * ----------------------------------------------- + * + * Copyright 2015 The Android Open Source Project + * + * 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 Memory management utilities. + *//*--------------------------------------------------------------------*/ + +#include "vkMemUtil.hpp" +#include "vkStrUtil.hpp" + +#include + +namespace vk +{ + +using de::MovePtr; + +// Allocation + +Allocation::Allocation (VkDeviceMemory memory, VkDeviceSize offset) + : m_memory (memory) + , m_offset (offset) +{ +} + +Allocation::~Allocation (void) +{ +} + +// SimpleAllocator + +class SimpleAllocation : public Allocation +{ +public: + SimpleAllocation (const DeviceInterface& vk, VkDevice device, VkDeviceMemory memory); + virtual ~SimpleAllocation (void); + +private: + const DeviceInterface& m_vk; + const VkDevice m_device; +}; + +SimpleAllocation::SimpleAllocation (const DeviceInterface& vk, VkDevice device, VkDeviceMemory memory) + : Allocation(memory, (VkDeviceSize)0) + , m_vk (vk) + , m_device (device) +{ +} + +SimpleAllocation::~SimpleAllocation (void) +{ + m_vk.freeMemory(m_device, getMemory()); +} + +SimpleAllocator::SimpleAllocator (const DeviceInterface& vk, VkDevice device) + : m_vk (vk) + , m_device (device) +{ +} + +MovePtr SimpleAllocator::allocate (const VkMemoryAllocInfo* allocInfo, VkDeviceSize alignment) +{ + VkDeviceMemory mem = DE_NULL; + + VK_CHECK(m_vk.allocMemory(m_device, allocInfo, &mem)); + TCU_CHECK(mem); + + DE_UNREF(alignment); + + try + { + return MovePtr(new SimpleAllocation(m_vk, m_device, mem)); + } + catch (...) + { + m_vk.freeMemory(m_device, mem); + throw; + } +} + +// Utils + +MovePtr allocate (Allocator& allocator, VkDeviceSize allocationSize, VkMemoryPropertyFlags memProps, VkDeviceSize alignment, VkMemoryPriority memPriority) +{ + const VkMemoryAllocInfo allocInfo = + { + VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO, // VkStructureType sType; + DE_NULL, // const void* pNext; + allocationSize, // VkDeviceSize allocationSize; + memProps, // VkMemoryPropertyFlags memProps; + memPriority, // VkMemoryPriority memPriority; + }; + + return allocator.allocate(&allocInfo, alignment); +} + +MovePtr allocate (Allocator& allocator, const VkMemoryRequirements& requirements, VkMemoryPropertyFlags memProps, VkMemoryPriority priority) +{ + if ((requirements.memPropsAllowed & memProps) != memProps) + { + std::ostringstream msg; + msg << getMemoryPropertyFlagsStr(memProps & ~requirements.memPropsAllowed) << " not supported by object type"; + TCU_THROW(NotSupportedError, msg.str().c_str()); + } + + return allocate(allocator, requirements.size, memProps | requirements.memPropsRequired, requirements.alignment, priority); +} + +} // vk diff --git a/framework/vulkan/vkMemUtil.hpp b/framework/vulkan/vkMemUtil.hpp new file mode 100644 index 0000000..3b0cebe --- /dev/null +++ b/framework/vulkan/vkMemUtil.hpp @@ -0,0 +1,87 @@ +#ifndef _VKMEMUTIL_HPP +#define _VKMEMUTIL_HPP +/*------------------------------------------------------------------------- + * drawElements Quality Program Vulkan Utilities + * ----------------------------------------------- + * + * Copyright 2015 The Android Open Source Project + * + * 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 Memory management utilities. + *//*--------------------------------------------------------------------*/ + +#include "vkDefs.hpp" +#include "deUniquePtr.hpp" + +namespace vk +{ + +//! Memory allocation interface +class Allocation +{ +public: + virtual ~Allocation (void); + + VkDeviceMemory getMemory (void) const { return m_memory; } + VkDeviceSize getOffset (void) const { return m_offset; } + +protected: + Allocation (VkDeviceMemory memory, VkDeviceSize offset); + +private: + const VkDeviceMemory m_memory; + const VkDeviceSize m_offset; +}; + +//! Memory allocator interface +class Allocator +{ +public: + Allocator (void) {} + virtual ~Allocator (void) {} + + virtual de::MovePtr allocate (const VkMemoryAllocInfo* allocInfo, VkDeviceSize alignment) = 0; +}; + +//! Allocator that backs every allocation with its own VkDeviceMemory +class SimpleAllocator : public Allocator +{ +public: + SimpleAllocator (const DeviceInterface& vk, VkDevice device); + + de::MovePtr allocate (const VkMemoryAllocInfo* allocInfo, VkDeviceSize alignment); + +private: + const DeviceInterface& m_vk; + VkDevice m_device; +}; + +// Utilities + +de::MovePtr allocate (Allocator& allocator, + VkDeviceSize allocationSize, + VkMemoryPropertyFlags memProps, + VkDeviceSize alignment, + VkMemoryPriority memPriority = VK_MEMORY_PRIORITY_UNUSED); + +de::MovePtr allocate (Allocator& allocator, + const VkMemoryRequirements& requirements, + VkMemoryPropertyFlags memProps = 0u, + VkMemoryPriority priority = VK_MEMORY_PRIORITY_UNUSED); + +} // vk + +#endif // _VKMEMUTIL_HPP diff --git a/framework/vulkan/vkQueryUtil.cpp b/framework/vulkan/vkQueryUtil.cpp new file mode 100644 index 0000000..e64d561 --- /dev/null +++ b/framework/vulkan/vkQueryUtil.cpp @@ -0,0 +1,26 @@ +/*------------------------------------------------------------------------- + * drawElements Quality Program Vulkan Utilities + * ----------------------------------------------- + * + * Copyright 2015 The Android Open Source Project + * + * 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 Vulkan query utilities. + *//*--------------------------------------------------------------------*/ + +#include "vkQueryUtil.hpp" + +DE_EMPTY_CPP_FILE diff --git a/framework/vulkan/vkQueryUtil.hpp b/framework/vulkan/vkQueryUtil.hpp new file mode 100644 index 0000000..20e4219 --- /dev/null +++ b/framework/vulkan/vkQueryUtil.hpp @@ -0,0 +1,144 @@ +#ifndef _VKQUERYUTIL_HPP +#define _VKQUERYUTIL_HPP +/*------------------------------------------------------------------------- + * drawElements Quality Program Vulkan Utilities + * ----------------------------------------------- + * + * Copyright 2015 The Android Open Source Project + * + * 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 Vulkan query utilities. + *//*--------------------------------------------------------------------*/ + +#include "vkDefs.hpp" +#include "vkRef.hpp" +#include "deMeta.hpp" + +#include + +namespace vk +{ +namespace querydetails +{ + +enum QueryResultCount +{ + QUERY_RESULT_COUNT_SINGLE = 0, + QUERY_RESULT_COUNT_MULTIPLE = 1 +}; + +template +struct PhysicalDeviceInfoTraits; + +#define VK_DECLARE_QUERY_TRAITS(QUERY_CLASS, QUERY_PARAM, RESULT_TYPE, RESULT_COUNT) \ +template<> \ +struct QUERY_CLASS##Traits \ +{ \ + typedef RESULT_TYPE Type; \ + enum { QUERY_RESULT_COUNT = QUERY_RESULT_COUNT_##RESULT_COUNT }; \ +} + +VK_DECLARE_QUERY_TRAITS(PhysicalDeviceInfo, VK_PHYSICAL_DEVICE_INFO_TYPE_PROPERTIES, VkPhysicalDeviceProperties, SINGLE); +VK_DECLARE_QUERY_TRAITS(PhysicalDeviceInfo, VK_PHYSICAL_DEVICE_INFO_TYPE_QUEUE_PROPERTIES, VkPhysicalDeviceQueueProperties, MULTIPLE); + +template +std::vector::Type> getPhysicalDeviceInfoImpl (const DeviceInterface& vk, VkPhysicalDevice physicalDevice) +{ + std::vector::Type> values; + deUintptr infoSize = 0; + + VK_CHECK(vk.getPhysicalDeviceInfo(physicalDevice, InfoType, &infoSize, DE_NULL)); + + if (infoSize % sizeof(typename PhysicalDeviceInfoTraits::Type) != 0) + TCU_FAIL("Returned info size is not divisible by structure size"); + + if (infoSize > 0) + { + values.resize(infoSize / sizeof(typename PhysicalDeviceInfoTraits::Type)); + VK_CHECK(vk.getPhysicalDeviceInfo(physicalDevice, InfoType, &infoSize, &values[0])); + + if (infoSize != values.size()*sizeof(typename PhysicalDeviceInfoTraits::Type)) + TCU_FAIL("Returned info size changed between queries"); + } + + return values; +} + +template +std::vector::Type> getPhysicalDeviceInfo (typename de::meta::EnableIf::QUERY_RESULT_COUNT == QUERY_RESULT_COUNT_MULTIPLE>::Type vk, VkPhysicalDevice physicalDevice) +{ + return getPhysicalDeviceInfoImpl(vk, physicalDevice); +} + +template +typename PhysicalDeviceInfoTraits::Type getPhysicalDeviceInfo (typename de::meta::EnableIf::QUERY_RESULT_COUNT == QUERY_RESULT_COUNT_SINGLE>::Type vk, VkPhysicalDevice physicalDevice) +{ + const std::vector::Type> values = getPhysicalDeviceInfoImpl(vk, physicalDevice); + + if (values.size() != 1) + TCU_FAIL("Expected only single value"); + + return values[0]; +} + +template +struct ObjectInfoTraits; + +VK_DECLARE_QUERY_TRAITS(ObjectInfo, VK_OBJECT_INFO_TYPE_MEMORY_REQUIREMENTS, VkMemoryRequirements, MULTIPLE); + +template +std::vector::Type> getObjectInfoImpl (const DeviceInterface& vk, VkDevice device, VkObjectType objectType, VkObject object) +{ + std::vector::Type> values; + deUintptr infoSize = 0; + + VK_CHECK(vk.getObjectInfo(device, objectType, object, InfoType, &infoSize, DE_NULL)); + + if (infoSize % sizeof(typename ObjectInfoTraits::Type) != 0) + TCU_FAIL("Returned info size is not divisible by structure size"); + + if (infoSize > 0) + { + values.resize(infoSize / sizeof(typename ObjectInfoTraits::Type)); + VK_CHECK(vk.getObjectInfo(device, objectType, object, InfoType, &infoSize, &values[0])); + + if (infoSize != values.size()*sizeof(typename ObjectInfoTraits::Type)) + TCU_FAIL("Returned info size changed between queries"); + } + + return values; +} + +template +std::vector::Type> getObjectInfo (typename de::meta::EnableIf::QUERY_RESULT_COUNT == QUERY_RESULT_COUNT_MULTIPLE>::Type vk, VkDevice device, VkObjectType objectType, VkObject object) +{ + return getObjectInfoImpl(vk, device, objectType, object); +} + +template +std::vector::Type> getObjectInfo (typename de::meta::EnableIf::QUERY_RESULT_COUNT == QUERY_RESULT_COUNT_MULTIPLE>::Type vk, VkDevice device, const Unique& object) +{ + return getObjectInfo(vk, device, getObjectType(), object.get()); +} + +} // querydetails + +using querydetails::getPhysicalDeviceInfo; +using querydetails::getObjectInfo; + +} // vk + +#endif // _VKQUERYUTIL_HPP diff --git a/modules/vulkan/vktInfo.cpp b/modules/vulkan/vktInfo.cpp index 5892d48..044ba89 100644 --- a/modules/vulkan/vktInfo.cpp +++ b/modules/vulkan/vktInfo.cpp @@ -28,6 +28,8 @@ #include "vkPlatform.hpp" #include "vkStrUtil.hpp" #include "vkRef.hpp" +#include "vkDeviceUtil.hpp" +#include "vkQueryUtil.hpp" #include "tcuTestLog.hpp" #include "tcuFormatUtil.hpp" @@ -35,8 +37,6 @@ #include "deUniquePtr.hpp" #include "deStringUtil.hpp" -#include "qpInfo.h" - namespace vkt { @@ -47,29 +47,9 @@ using tcu::TestLog; tcu::TestStatus enumeratePhysicalDevices (Context& context) { - const struct VkApplicationInfo appInfo = - { - VK_STRUCTURE_TYPE_APPLICATION_INFO, // VkStructureType sType; - DE_NULL, // const void* pNext; - "deqp", // const char* pAppName; - qpGetReleaseId(), // deUint32 appVersion; - "deqp", // const char* pEngineName; - qpGetReleaseId(), // deUint32 engineVersion; - VK_API_VERSION // deUint32 apiVersion; - }; - const struct VkInstanceCreateInfo instanceInfo = - { - VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, // VkStructureType sType; - DE_NULL, // const void* pNext; - &appInfo, // const VkApplicationInfo* pAppInfo; - DE_NULL, // const VkAllocCallbacks* pAllocCb; - 0u, // deUint32 extensionCount; - DE_NULL // const char*const* ppEnabledExtensionNames; - }; - const PlatformInterface& vkPlatform = context.getPlatformInterface(); TestLog& log = context.getTestContext().getLog(); - const Unique instance (createInstance(vkPlatform, &instanceInfo)); + const Unique instance (createDefaultInstance(vkPlatform)); vector devices; deUint32 numDevices = 0; @@ -91,29 +71,9 @@ tcu::TestStatus enumeratePhysicalDevices (Context& context) tcu::TestStatus deviceProperties (Context& context) { - const struct VkApplicationInfo appInfo = - { - VK_STRUCTURE_TYPE_APPLICATION_INFO, // VkStructureType sType; - DE_NULL, // const void* pNext; - "deqp", // const char* pAppName; - qpGetReleaseId(), // deUint32 appVersion; - "deqp", // const char* pEngineName; - qpGetReleaseId(), // deUint32 engineVersion; - VK_API_VERSION // deUint32 apiVersion; - }; - const struct VkInstanceCreateInfo instanceInfo = - { - VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, // VkStructureType sType; - DE_NULL, // const void* pNext; - &appInfo, // const VkApplicationInfo* pAppInfo; - DE_NULL, // const VkAllocCallbacks* pAllocCb; - 0u, // deUint32 extensionCount; - DE_NULL // const char*const* ppEnabledExtensionNames; - }; - const PlatformInterface& vkPlatform = context.getPlatformInterface(); TestLog& log = context.getTestContext().getLog(); - const Unique instance (createInstance(vkPlatform, &instanceInfo)); + const Unique instance (createDefaultInstance(vkPlatform)); vector devices; deUint32 numDevices = 0; @@ -126,13 +86,10 @@ tcu::TestStatus deviceProperties (Context& context) for (deUint32 ndx = 0; ndx < numDevices; ndx++) { - const VkPhysicalDevice physicalDevice = devices[ndx]; - const tcu::ScopedLogSection section (log, string("Device") + de::toString(ndx), string("Device ") + de::toString(ndx) + " (" + de::toString(tcu::toHex(physicalDevice)) + ")"); - const vk::DeviceDriver vkDevice (vkPlatform, physicalDevice); - VkPhysicalDeviceProperties properties; - deUintptr propertiesSize = sizeof(properties); - - VK_CHECK(vkDevice.getPhysicalDeviceInfo(physicalDevice, VK_PHYSICAL_DEVICE_INFO_TYPE_PROPERTIES, &propertiesSize, &properties)); + const VkPhysicalDevice physicalDevice = devices[ndx]; + const tcu::ScopedLogSection section (log, string("Device") + de::toString(ndx), string("Device ") + de::toString(ndx) + " (" + de::toString(tcu::toHex(physicalDevice)) + ")"); + const vk::DeviceDriver vkDevice (vkPlatform, physicalDevice); + const VkPhysicalDeviceProperties properties = getPhysicalDeviceInfo(vkDevice, physicalDevice); log << TestLog::Message << "apiVersion = " << unpackVersion(properties.apiVersion) << "\n" << "driverVersion = " << tcu::toHex(properties.driverVersion) << "\n" diff --git a/modules/vulkan/vktTestCaseUtil.hpp b/modules/vulkan/vktTestCaseUtil.hpp index 289f403..190b065 100644 --- a/modules/vulkan/vktTestCaseUtil.hpp +++ b/modules/vulkan/vktTestCaseUtil.hpp @@ -122,7 +122,7 @@ inline TestCase* createFunctionCase (tcu::TestContext& testCtx, const std::string& desc, FunctionInstance0::Function testFunction) { - return new InstanceFactory1(testCtx, type, name, desc, testFunction); + return new InstanceFactory1(testCtx, type, name, desc, testFunction); } template -- 2.7.4