mirror of
https://gitee.com/openharmony/third_party_vulkan-loader
synced 2024-11-27 09:21:56 +00:00
tests: enhance wrapped objects test
This commit is contained in:
parent
40e0752443
commit
6075d63ab2
@ -460,6 +460,36 @@ TEST(CreateInstance, LayerPresent) {
|
||||
instance = VK_NULL_HANDLE;
|
||||
result = vkCreateInstance(info2, VK_NULL_HANDLE, &instance);
|
||||
ASSERT_EQ(result, VK_SUCCESS);
|
||||
|
||||
uint32_t deviceCount;
|
||||
vkEnumeratePhysicalDevices(instance, &deviceCount, nullptr);
|
||||
std::vector<VkPhysicalDevice> devs(deviceCount);
|
||||
vkEnumeratePhysicalDevices(instance, &deviceCount, devs.data());
|
||||
auto device_create_info = VkDeviceCreateInfo{
|
||||
VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, // sType
|
||||
nullptr, // pNext
|
||||
0, // flags
|
||||
0, // queueCreateInfoCount
|
||||
nullptr, // pQueueCreateInfos
|
||||
0, // enabledLayerCount
|
||||
nullptr, // ppEnabledLayerNames
|
||||
0, // enabledExtensionCount
|
||||
nullptr, // ppEnabledExtensionNames
|
||||
nullptr // pEnabledFeatures
|
||||
};
|
||||
auto deviceQueue = VkDeviceQueueCreateInfo{};
|
||||
deviceQueue.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
|
||||
float prios = 1;
|
||||
deviceQueue.queueFamilyIndex = 0;
|
||||
deviceQueue.queueCount = 1;
|
||||
deviceQueue.pQueuePriorities = &prios;
|
||||
device_create_info.pQueueCreateInfos = &deviceQueue;
|
||||
device_create_info.queueCreateInfoCount = 1;
|
||||
VkDevice dev;
|
||||
vkCreateDevice(devs[0], &device_create_info, nullptr, &dev);
|
||||
|
||||
vkDestroyDevice(dev, nullptr);
|
||||
|
||||
vkDestroyInstance(instance, nullptr);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user