Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/Vulkan-Loader.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>2022-10-26 19:11:45 +0300
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>2022-10-26 19:29:53 +0300
commit201c2d83b133eea61e2c580dfdbe93e3fa706f11 (patch)
tree304892213a53e5c756aa7f27b420028f8f8ca184
parent363c106d4d4a2cc6ce59bae51c1b99d93d5a08f6 (diff)
Revert "Remove vkCreateSwapchainKHR from ICD Dispatch table"
This reverts commit d79e2731d45bf4c81f650f27205e208a023269aa.
-rw-r--r--loader/generated/vk_loader_extensions.c10
-rw-r--r--loader/generated/vk_loader_extensions.h2
-rw-r--r--loader/wsi.c53
-rw-r--r--scripts/loader_extension_generator.py18
-rw-r--r--tests/framework/icd/test_icd.cpp17
-rw-r--r--tests/framework/test_util.cpp1
-rw-r--r--tests/framework/test_util.h1
-rw-r--r--tests/loader_regression_tests.cpp41
8 files changed, 39 insertions, 104 deletions
diff --git a/loader/generated/vk_loader_extensions.c b/loader/generated/vk_loader_extensions.c
index b3287512d..4960ab816 100644
--- a/loader/generated/vk_loader_extensions.c
+++ b/loader/generated/vk_loader_extensions.c
@@ -98,6 +98,8 @@ VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_icd_term *icd_t
LOOKUP_GIPA(GetPhysicalDeviceSurfacePresentModesKHR, false);
// ---- VK_KHR_swapchain extension commands
+ LOOKUP_GIPA(CreateSwapchainKHR, false);
+ LOOKUP_GIPA(GetDeviceGroupSurfacePresentModesKHR, false);
LOOKUP_GIPA(GetPhysicalDevicePresentRectanglesKHR, false);
// ---- VK_KHR_display extension commands
@@ -3935,7 +3937,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_DebugMarkerSetObjectTagEXT(
local_tag_info.object = (uint64_t)(uintptr_t)phys_dev_term->phys_dev;
// If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call.
} else if (pTagInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT) {
- if (NULL != dev && NULL != dev->loader_dispatch.core_dispatch.CreateSwapchainKHR) {
+ if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) {
VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pTagInfo->object;
if (NULL != icd_surface->real_icd_surfaces) {
local_tag_info.object = (uint64_t)icd_surface->real_icd_surfaces[icd_index];
@@ -3983,7 +3985,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_DebugMarkerSetObjectNameEXT(
local_name_info.object = (uint64_t)(uintptr_t)phys_dev_term->phys_dev;
// If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call.
} else if (pNameInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT) {
- if (NULL != dev && NULL != dev->loader_dispatch.core_dispatch.CreateSwapchainKHR) {
+ if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) {
VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pNameInfo->object;
if (NULL != icd_surface->real_icd_surfaces) {
local_name_info.object = (uint64_t)icd_surface->real_icd_surfaces[icd_index];
@@ -4537,7 +4539,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_SetDebugUtilsObjectNameEXT(
local_name_info.objectHandle = (uint64_t)(uintptr_t)phys_dev_term->phys_dev;
// If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call.
} else if (pNameInfo->objectType == VK_OBJECT_TYPE_SURFACE_KHR) {
- if (NULL != dev && NULL != dev->loader_dispatch.core_dispatch.CreateSwapchainKHR) {
+ if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) {
VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pNameInfo->objectHandle;
if (NULL != icd_surface->real_icd_surfaces) {
local_name_info.objectHandle = (uint64_t)icd_surface->real_icd_surfaces[icd_index];
@@ -4589,7 +4591,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_SetDebugUtilsObjectTagEXT(
local_tag_info.objectHandle = (uint64_t)(uintptr_t)phys_dev_term->phys_dev;
// If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call.
} else if (pTagInfo->objectType == VK_OBJECT_TYPE_SURFACE_KHR) {
- if (NULL != dev && NULL != dev->loader_dispatch.core_dispatch.CreateSwapchainKHR) {
+ if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) {
VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pTagInfo->objectHandle;
if (NULL != icd_surface->real_icd_surfaces) {
local_tag_info.objectHandle = (uint64_t)icd_surface->real_icd_surfaces[icd_index];
diff --git a/loader/generated/vk_loader_extensions.h b/loader/generated/vk_loader_extensions.h
index ce19d6c9e..c0bcfa877 100644
--- a/loader/generated/vk_loader_extensions.h
+++ b/loader/generated/vk_loader_extensions.h
@@ -250,6 +250,8 @@ struct loader_icd_term_dispatch {
PFN_vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR;
// ---- VK_KHR_swapchain extension commands
+ PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
+ PFN_vkGetDeviceGroupSurfacePresentModesKHR GetDeviceGroupSurfacePresentModesKHR;
PFN_vkGetPhysicalDevicePresentRectanglesKHR GetPhysicalDevicePresentRectanglesKHR;
// ---- VK_KHR_display extension commands
diff --git a/loader/wsi.c b/loader/wsi.c
index a1dbe0f40..e44c37fbf 100644
--- a/loader/wsi.c
+++ b/loader/wsi.c
@@ -457,27 +457,25 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateSwapchainKHR(VkDevice device, co
uint32_t icd_index = 0;
struct loader_device *dev;
struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index);
- if (NULL == icd_term || NULL == dev || NULL == dev->loader_dispatch.core_dispatch.CreateSwapchainKHR) {
- loader_log(NULL, VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
- "vkCreateSwapchainKHR: Invalid device [VUID-vkCreateSwapchainKHR-device-parameter]");
- abort(); /* Intentionally fail so user can correct issue. */
- }
- VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pCreateInfo->surface;
- if (NULL != icd_surface->real_icd_surfaces) {
- if ((VkSurfaceKHR)(uintptr_t)NULL != icd_surface->real_icd_surfaces[icd_index]) {
- // We found the ICD, and there is an ICD KHR surface
- // associated with it, so copy the CreateInfo struct
- // and point it at the ICD's surface.
- VkSwapchainCreateInfoKHR *pCreateCopy = loader_stack_alloc(sizeof(VkSwapchainCreateInfoKHR));
- if (NULL == pCreateCopy) {
- return VK_ERROR_OUT_OF_HOST_MEMORY;
+ if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) {
+ VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pCreateInfo->surface;
+ if (NULL != icd_surface->real_icd_surfaces) {
+ if ((VkSurfaceKHR)(uintptr_t)NULL != icd_surface->real_icd_surfaces[icd_index]) {
+ // We found the ICD, and there is an ICD KHR surface
+ // associated with it, so copy the CreateInfo struct
+ // and point it at the ICD's surface.
+ VkSwapchainCreateInfoKHR *pCreateCopy = loader_stack_alloc(sizeof(VkSwapchainCreateInfoKHR));
+ if (NULL == pCreateCopy) {
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+ memcpy(pCreateCopy, pCreateInfo, sizeof(VkSwapchainCreateInfoKHR));
+ pCreateCopy->surface = icd_surface->real_icd_surfaces[icd_index];
+ return icd_term->dispatch.CreateSwapchainKHR(device, pCreateCopy, pAllocator, pSwapchain);
}
- memcpy(pCreateCopy, pCreateInfo, sizeof(VkSwapchainCreateInfoKHR));
- pCreateCopy->surface = icd_surface->real_icd_surfaces[icd_index];
- return dev->loader_dispatch.core_dispatch.CreateSwapchainKHR(device, pCreateCopy, pAllocator, pSwapchain);
}
+ return icd_term->dispatch.CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain);
}
- return dev->loader_dispatch.core_dispatch.CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain);
+ return VK_SUCCESS;
}
// This is the trampoline entrypoint for DestroySwapchainKHR
@@ -2166,18 +2164,15 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDeviceGroupSurfacePresentModesKHR(V
uint32_t icd_index = 0;
struct loader_device *dev;
struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index);
- if (NULL == icd_term || NULL == dev || NULL == dev->loader_dispatch.core_dispatch.GetDeviceGroupSurfacePresentModesKHR) {
- loader_log(NULL, VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
- "vkGetDeviceGroupSurfacePresentModesKHR: Invalid device "
- "[VUID-vkGetDeviceGroupSurfacePresentModesKHR-device-parameter]");
- abort(); /* Intentionally fail so user can correct issue. */
- }
- VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface;
- if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)(uintptr_t)NULL != icd_surface->real_icd_surfaces[icd_index]) {
- return dev->loader_dispatch.core_dispatch.GetDeviceGroupSurfacePresentModesKHR(
- device, icd_surface->real_icd_surfaces[icd_index], pModes);
+ if (NULL != icd_term && NULL != icd_term->dispatch.GetDeviceGroupSurfacePresentModesKHR) {
+ VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface;
+ if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)(uintptr_t)NULL != icd_surface->real_icd_surfaces[icd_index]) {
+ return icd_term->dispatch.GetDeviceGroupSurfacePresentModesKHR(device, icd_surface->real_icd_surfaces[icd_index],
+ pModes);
+ }
+ return icd_term->dispatch.GetDeviceGroupSurfacePresentModesKHR(device, surface, pModes);
}
- return dev->loader_dispatch.core_dispatch.GetDeviceGroupSurfacePresentModesKHR(device, surface, pModes);
+ return VK_SUCCESS;
}
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice,
diff --git a/scripts/loader_extension_generator.py b/scripts/loader_extension_generator.py
index eabcc76c3..cee011f25 100644
--- a/scripts/loader_extension_generator.py
+++ b/scripts/loader_extension_generator.py
@@ -596,10 +596,6 @@ class LoaderExtensionOutputGenerator(OutputGenerator):
table = ''
cur_extension_name = ''
- skip_commands = ['vkCreateSwapchainKHR',
- 'vkGetDeviceGroupSurfacePresentModesKHR'
- ]
-
table += '// ICD function pointer dispatch table\n'
table += 'struct loader_icd_term_dispatch {\n'
@@ -612,7 +608,7 @@ class LoaderExtensionOutputGenerator(OutputGenerator):
for cur_cmd in commands:
is_inst_handle_type = cur_cmd.name in ADD_INST_CMDS or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice'
if ((is_inst_handle_type or cur_cmd.name in DEVICE_CMDS_NEED_TERM) and
- (cur_cmd.name != 'vkGetInstanceProcAddr' and cur_cmd.name != 'vkEnumerateDeviceLayerProperties') and cur_cmd.name not in skip_commands):
+ (cur_cmd.name != 'vkGetInstanceProcAddr' and cur_cmd.name != 'vkEnumerateDeviceLayerProperties')):
if cur_cmd.ext_name != cur_extension_name:
if 'VK_VERSION_' in cur_cmd.ext_name:
@@ -662,8 +658,6 @@ class LoaderExtensionOutputGenerator(OutputGenerator):
'vkEnumerateInstanceExtensionProperties',
'vkEnumerateInstanceLayerProperties',
'vkEnumerateInstanceVersion',
- 'vkCreateSwapchainKHR',
- 'vkGetDeviceGroupSurfacePresentModesKHR',
]
for x in range(0, 2):
@@ -924,7 +918,7 @@ class LoaderExtensionOutputGenerator(OutputGenerator):
return tables
#
- # Create the appropriate trampoline (and possibly terminator) functions
+ # Create the appropriate trampoline (and possibly terminator) functinos
def CreateTrampTermFuncs(self):
entries = []
funcs = ''
@@ -1260,7 +1254,7 @@ class LoaderExtensionOutputGenerator(OutputGenerator):
funcs += ' local_name_info.object = (uint64_t)(uintptr_t)phys_dev_term->phys_dev;\n'
funcs += ' // If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call.\n'
funcs += ' } else if (pNameInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT) {\n'
- funcs += ' if (NULL != dev && NULL != dev->loader_dispatch.core_dispatch.CreateSwapchainKHR) {\n'
+ funcs += ' if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) {\n'
funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pNameInfo->object;\n'
funcs += ' if (NULL != icd_surface->real_icd_surfaces) {\n'
funcs += ' local_name_info.object = (uint64_t)icd_surface->real_icd_surfaces[icd_index];\n'
@@ -1276,7 +1270,7 @@ class LoaderExtensionOutputGenerator(OutputGenerator):
funcs += ' local_tag_info.object = (uint64_t)(uintptr_t)phys_dev_term->phys_dev;\n'
funcs += ' // If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call.\n'
funcs += ' } else if (pTagInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT) {\n'
- funcs += ' if (NULL != dev && NULL != dev->loader_dispatch.core_dispatch.CreateSwapchainKHR) {\n'
+ funcs += ' if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) {\n'
funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pTagInfo->object;\n'
funcs += ' if (NULL != icd_surface->real_icd_surfaces) {\n'
funcs += ' local_tag_info.object = (uint64_t)icd_surface->real_icd_surfaces[icd_index];\n'
@@ -1292,7 +1286,7 @@ class LoaderExtensionOutputGenerator(OutputGenerator):
funcs += ' local_name_info.objectHandle = (uint64_t)(uintptr_t)phys_dev_term->phys_dev;\n'
funcs += ' // If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call.\n'
funcs += ' } else if (pNameInfo->objectType == VK_OBJECT_TYPE_SURFACE_KHR) {\n'
- funcs += ' if (NULL != dev && NULL != dev->loader_dispatch.core_dispatch.CreateSwapchainKHR) {\n'
+ funcs += ' if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) {\n'
funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pNameInfo->objectHandle;\n'
funcs += ' if (NULL != icd_surface->real_icd_surfaces) {\n'
funcs += ' local_name_info.objectHandle = (uint64_t)icd_surface->real_icd_surfaces[icd_index];\n'
@@ -1308,7 +1302,7 @@ class LoaderExtensionOutputGenerator(OutputGenerator):
funcs += ' local_tag_info.objectHandle = (uint64_t)(uintptr_t)phys_dev_term->phys_dev;\n'
funcs += ' // If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call.\n'
funcs += ' } else if (pTagInfo->objectType == VK_OBJECT_TYPE_SURFACE_KHR) {\n'
- funcs += ' if (NULL != dev && NULL != dev->loader_dispatch.core_dispatch.CreateSwapchainKHR) {\n'
+ funcs += ' if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) {\n'
funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pTagInfo->objectHandle;\n'
funcs += ' if (NULL != icd_surface->real_icd_surfaces) {\n'
funcs += ' local_tag_info.objectHandle = (uint64_t)icd_surface->real_icd_surfaces[icd_index];\n'
diff --git a/tests/framework/icd/test_icd.cpp b/tests/framework/icd/test_icd.cpp
index 890394d5d..75ccb8191 100644
--- a/tests/framework/icd/test_icd.cpp
+++ b/tests/framework/icd/test_icd.cpp
@@ -593,20 +593,6 @@ VKAPI_ATTR VkResult VKAPI_CALL test_vkCreateSwapchainKHR(VkDevice device, const
return VK_SUCCESS;
}
-VKAPI_ATTR VkResult VKAPI_CALL test_vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain,
- uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages) {
- std::vector<uint64_t> handles{123, 234, 345, 345, 456};
- if (pSwapchainImages == nullptr) {
- if (pSwapchainImageCount) *pSwapchainImageCount = static_cast<uint32_t>(handles.size());
- } else if (pSwapchainImageCount) {
- for (uint32_t i = 0; i < *pSwapchainImageCount && i < handles.size(); i++) {
- pSwapchainImages[i] = to_nondispatch_handle<VkImage>(handles.back());
- }
- if (*pSwapchainImageCount < handles.size()) return VK_INCOMPLETE;
- }
- return VK_SUCCESS;
-}
-
VKAPI_ATTR void VKAPI_CALL test_vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain,
const VkAllocationCallbacks* pAllocator) {
if (swapchain != VK_NULL_HANDLE) {
@@ -614,7 +600,7 @@ VKAPI_ATTR void VKAPI_CALL test_vkDestroySwapchainKHR(VkDevice device, VkSwapcha
auto found_iter = icd.swapchain_handles.erase(
std::remove(icd.swapchain_handles.begin(), icd.swapchain_handles.end(), fake_swapchain_handle),
icd.swapchain_handles.end());
- if (!icd.swapchain_handles.empty() && found_iter == icd.swapchain_handles.end()) {
+ if (found_iter == icd.swapchain_handles.end()) {
assert(false && "Swapchain not found during destroy!");
}
}
@@ -1309,7 +1295,6 @@ PFN_vkVoidFunction get_device_func(VkDevice device, const char* pName) {
}
if (string_eq(pName, "vkDestroyDevice")) return to_vkVoidFunction(test_vkDestroyDevice);
if (string_eq(pName, "vkCreateSwapchainKHR")) return to_vkVoidFunction(test_vkCreateSwapchainKHR);
- if (string_eq(pName, "vkGetSwapchainImagesKHR")) return to_vkVoidFunction(test_vkGetSwapchainImagesKHR);
if (string_eq(pName, "vkDestroySwapchainKHR")) return to_vkVoidFunction(test_vkDestroySwapchainKHR);
if (string_eq(pName, "vkCreateCommandPool")) return to_vkVoidFunction(test_vkCreateCommandPool);
if (string_eq(pName, "vkAllocateCommandBuffers")) return to_vkVoidFunction(test_vkAllocateCommandBuffers);
diff --git a/tests/framework/test_util.cpp b/tests/framework/test_util.cpp
index 6b47ff820..f7acaee19 100644
--- a/tests/framework/test_util.cpp
+++ b/tests/framework/test_util.cpp
@@ -637,7 +637,6 @@ DeviceFunctions::DeviceFunctions(const VulkanFunctions& vulkan_functions, VkDevi
vkAllocateCommandBuffers = load(device, "vkAllocateCommandBuffers");
vkDestroyCommandPool = load(device, "vkDestroyCommandPool");
vkCreateSwapchainKHR = load(device, "vkCreateSwapchainKHR");
- vkGetSwapchainImagesKHR = load(device, "vkGetSwapchainImagesKHR");
vkDestroySwapchainKHR = load(device, "vkDestroySwapchainKHR");
}
diff --git a/tests/framework/test_util.h b/tests/framework/test_util.h
index 7ff100aae..37791c265 100644
--- a/tests/framework/test_util.h
+++ b/tests/framework/test_util.h
@@ -769,7 +769,6 @@ struct DeviceFunctions {
PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers = nullptr;
PFN_vkDestroyCommandPool vkDestroyCommandPool = nullptr;
PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR = nullptr;
- PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR = nullptr;
PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR = nullptr;
DeviceFunctions() = default;
diff --git a/tests/loader_regression_tests.cpp b/tests/loader_regression_tests.cpp
index f78808916..7390596bd 100644
--- a/tests/loader_regression_tests.cpp
+++ b/tests/loader_regression_tests.cpp
@@ -1013,47 +1013,6 @@ TEST(CreateDevice, ConsecutiveCreateWithoutDestruction) {
}
}
-TEST(CreateDevice, SwapchainFunctional) {
- FrameworkEnvironment env{};
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
- auto& driver = env.get_test_icd();
-
- MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
-
- driver.physical_devices.emplace_back("physical_device_0");
- driver.physical_devices.back().queue_family_properties.push_back(family_props);
-
- InstWrapper inst{env.vulkan_functions};
- inst.CheckCreate();
-
- VkPhysicalDevice phys_dev = inst.GetPhysDev();
-
- uint32_t familyCount = 0;
- inst->vkGetPhysicalDeviceQueueFamilyProperties(phys_dev, &familyCount, nullptr);
- ASSERT_EQ(familyCount, 1U);
-
- VkQueueFamilyProperties families;
- inst->vkGetPhysicalDeviceQueueFamilyProperties(phys_dev, &familyCount, &families);
- ASSERT_EQ(familyCount, 1U);
- ASSERT_EQ(families, family_props.properties);
-
- DeviceWrapper dev{inst};
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
-
- dev.CheckCreate(phys_dev);
-
- VkSwapchainKHR swapchain{};
- VkSwapchainCreateInfoKHR swap_create_info{};
- DeviceFunctions funcs{*inst.functions, dev};
- ASSERT_EQ(VK_SUCCESS, funcs.vkCreateSwapchainKHR(dev, &swap_create_info, nullptr, &swapchain));
- uint32_t count = 0;
- ASSERT_EQ(VK_SUCCESS, funcs.vkGetSwapchainImagesKHR(dev, swapchain, &count, nullptr));
- ASSERT_GT(count, 0U);
- std::array<VkImage, 16> images;
- ASSERT_EQ(VK_SUCCESS, funcs.vkGetSwapchainImagesKHR(dev, swapchain, &count, images.data()));
- funcs.vkDestroySwapchainKHR(dev, swapchain, nullptr);
-}
-
TEST(TryLoadWrongBinaries, WrongICD) {
FrameworkEnvironment env{};
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));