VKAPI_ATTR void VKAPI_CALL test_vkGetDeviceQueue([[maybe_unused]] VkDevice device, [[maybe_unused]] uint32_t queueFamilyIndex,
uint32_t queueIndex, VkQueue* pQueue) {
- *pQueue = icd.physical_devices.back().queue_handles[queueIndex].handle;
+ auto fd = icd.lookup_device(device);
+ if (fd.found) {
+ *pQueue = icd.physical_devices.at(fd.phys_dev_index).queue_handles[queueIndex].handle;
+ }
}
// VK_EXT_acquire_drm_display
ASSERT_EQ(family.timestampValidBits, 0U);
DeviceCreateInfo dev_create_info;
- DeviceQueueCreateInfo queue_info;
- queue_info.add_priority(0.0f);
- dev_create_info.add_device_queue(queue_info);
+ dev_create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
VkDevice device;
ASSERT_EQ(inst->vkCreateDevice(physical_device, dev_create_info.get(), tracker.get(), &device), VK_SUCCESS);
+
+ VkQueue queue;
+ inst->vkGetDeviceQueue(device, 0, 0, &queue);
+
inst->vkDestroyDevice(device, tracker.get());
}
ASSERT_TRUE(tracker.empty());
ASSERT_EQ(family.timestampValidBits, 0U);
DeviceCreateInfo dev_create_info;
- DeviceQueueCreateInfo queue_info;
- queue_info.add_priority(0.0f);
- dev_create_info.add_device_queue(queue_info);
+ dev_create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
VkDevice device;
ASSERT_EQ(inst->vkCreateDevice(physical_device, dev_create_info.get(), nullptr, &device), VK_SUCCESS);
+ VkQueue queue;
+ inst->vkGetDeviceQueue(device, 0, 0, &queue);
+
inst->vkDestroyDevice(device, nullptr);
}
ASSERT_TRUE(tracker.empty());
ASSERT_EQ(family.timestampValidBits, 0U);
DeviceCreateInfo dev_create_info;
- DeviceQueueCreateInfo queue_info;
- queue_info.add_priority(0.0f);
- dev_create_info.add_device_queue(queue_info);
+ dev_create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
VkDevice device;
ASSERT_EQ(inst->vkCreateDevice(physical_device, dev_create_info.get(), tracker.get(), &device), VK_SUCCESS);
+
+ VkQueue queue;
+ inst->vkGetDeviceQueue(device, 0, 0, &queue);
+
inst->vkDestroyDevice(device, tracker.get());
}
ASSERT_TRUE(tracker.empty());
MemoryTracker tracker({false, 0, true, fail_index});
DeviceCreateInfo dev_create_info;
- DeviceQueueCreateInfo queue_info;
- queue_info.add_priority(0.0f);
- dev_create_info.add_device_queue(queue_info);
+ dev_create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
VkDevice device;
result = inst->vkCreateDevice(physical_devices[0], dev_create_info.get(), tracker.get(), &device);
if (result == VK_SUCCESS || fail_index > 10000) {
+ VkQueue queue;
+ inst->vkGetDeviceQueue(device, 0, 0, &queue);
+
inst->vkDestroyDevice(device, tracker.get());
break;
}
ASSERT_EQ(family.timestampValidBits, 0U);
DeviceCreateInfo dev_create_info;
- DeviceQueueCreateInfo queue_info;
- queue_info.add_priority(0.0f);
- dev_create_info.add_device_queue(queue_info);
+ dev_create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
VkDevice device;
result = env.vulkan_functions.vkCreateDevice(physical_devices.at(i), dev_create_info.get(), tracker.get(), &device);
}
ASSERT_EQ(result, VK_SUCCESS);
+ VkQueue queue;
+ env.vulkan_functions.vkGetDeviceQueue(device, 0, 0, &queue);
+
env.vulkan_functions.vkDestroyDevice(device, tracker.get());
}
env.vulkan_functions.vkDestroyInstance(instance, tracker.get());
ASSERT_EQ(family.timestampValidBits, 0U);
DeviceCreateInfo dev_create_info;
- DeviceQueueCreateInfo queue_info;
- queue_info.add_priority(0.0f);
- dev_create_info.add_device_queue(queue_info);
+ dev_create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
result = env.vulkan_functions.vkCreateDevice(physical_devices[i], dev_create_info.get(), tracker.get(), &devices[i]);
+
+ VkQueue queue;
+ if (result == VK_SUCCESS) {
+ env.vulkan_functions.vkGetDeviceQueue(devices[i], 0, 0, &queue);
+ }
}
for (uint32_t i = 0; i < returned_physical_count; i++) {
if (result == VK_SUCCESS) {
ASSERT_EQ(family.timestampValidBits, 0U);
DeviceCreateInfo dev_create_info;
- DeviceQueueCreateInfo queue_info;
- queue_info.add_priority(0.0f);
- dev_create_info.add_device_queue(queue_info);
+ dev_create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
result = env.vulkan_functions.vkCreateDevice(physical_devices[i], dev_create_info.get(), tracker.get(), &devices[i]);
if (result == VK_ERROR_OUT_OF_HOST_MEMORY) {
devices[i] = VK_NULL_HANDLE;
+ } else {
+ VkQueue queue;
+ env.vulkan_functions.vkGetDeviceQueue(devices[i], 0, 0, &queue);
}
}
for (uint32_t i = 0; i < returned_physical_count; i++) {
ASSERT_EQ(gdpa_loader, gdpa_inst_queried);
DeviceWrapper dev{inst};
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
dev.CheckCreate(phys_dev);
PFN_vkGetDeviceProcAddr gdpa_dev_queried = dev.load("vkGetDeviceProcAddr");
auto phys_dev = inst.GetPhysDev();
{
DeviceWrapper dev{inst};
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
ASSERT_NO_FATAL_FAILURE(dev.CheckCreate(phys_dev));
DeviceFunctions dev_funcs{env.vulkan_functions, dev};
DeviceWrapper dev{inst};
dev.create_info.add_extensions({"VK_KHR_swapchain", "VK_KHR_display_swapchain", "VK_EXT_debug_marker"});
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
ASSERT_NO_FATAL_FAILURE(dev.CheckCreate(phys_dev));
DeviceFunctions dev_funcs{env.vulkan_functions, dev};
"wrap_objects_layer.json");
driver.physical_devices.emplace_back("physical_device_0");
- MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
- driver.physical_devices.back().queue_family_properties.push_back(family_props);
InstWrapper instance(env.vulkan_functions);
instance.create_info.setup_WSI();
"wrap_objects_layer.json");
driver.physical_devices.emplace_back("physical_device_0");
- MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
- driver.physical_devices.back().queue_family_properties.push_back(family_props);
InstWrapper instance(env.vulkan_functions);
instance.create_info.setup_WSI();
"wrap_objects_layer.json");
driver.physical_devices.emplace_back("physical_device_0");
- MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
- driver.physical_devices.back().queue_family_properties.push_back(family_props);
InstWrapper instance(env.vulkan_functions);
instance.create_info.setup_WSI();
"wrap_objects_layer.json");
driver.physical_devices.emplace_back("physical_device_0");
- MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
- driver.physical_devices.back().queue_family_properties.push_back(family_props);
InstWrapper instance(env.vulkan_functions);
instance.create_info.setup_WSI();
"wrap_objects_layer.json");
driver.physical_devices.emplace_back("physical_device_0");
- MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
- driver.physical_devices.back().queue_family_properties.push_back(family_props);
InstWrapper instance(env.vulkan_functions);
instance.create_info.setup_WSI();
"wrap_objects_layer.json");
driver.physical_devices.emplace_back("physical_device_0");
- MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
- driver.physical_devices.back().queue_family_properties.push_back(family_props);
InstWrapper instance(env.vulkan_functions);
instance.create_info.setup_WSI("VK_USE_PLATFORM_MACOS_MVK");
"wrap_objects_layer.json");
driver.physical_devices.emplace_back("physical_device_0");
- MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
- driver.physical_devices.back().queue_family_properties.push_back(family_props);
InstWrapper instance(env.vulkan_functions);
instance.create_info.setup_WSI("VK_USE_PLATFORM_METAL_EXT");
"wrap_objects_layer.json");
driver.physical_devices.emplace_back("physical_device_0");
- MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
- driver.physical_devices.back().queue_family_properties.push_back(family_props);
InstWrapper instance(env.vulkan_functions);
instance.create_info.setup_WSI();
"wrap_objects_layer.json");
driver.physical_devices.emplace_back("physical_device_0");
- MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
- driver.physical_devices.back().queue_family_properties.push_back(family_props);
InstWrapper instance(env.vulkan_functions);
instance.create_info.setup_WSI();
"wrap_objects_layer.json");
driver.physical_devices.emplace_back("physical_device_0");
- MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
- driver.physical_devices.back().queue_family_properties.push_back(family_props);
InstWrapper instance(env.vulkan_functions);
instance.create_info.setup_WSI("VK_USE_PLATFORM_WAYLAND_KHR");
"wrap_objects_layer.json");
driver.physical_devices.emplace_back("physical_device_0");
- MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
- driver.physical_devices.back().queue_family_properties.push_back(family_props);
InstWrapper instance(env.vulkan_functions);
instance.create_info.setup_WSI();
"wrap_objects_layer.json");
driver.physical_devices.emplace_back("physical_device_0");
- MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
- driver.physical_devices.back().queue_family_properties.push_back(family_props);
InstWrapper instance(env.vulkan_functions);
instance.create_info.setup_WSI();
"wrap_objects_layer.json");
driver.physical_devices.emplace_back("physical_device_0");
- MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
- driver.physical_devices.back().queue_family_properties.push_back(family_props);
InstWrapper instance(env.vulkan_functions);
instance.create_info.setup_WSI("VK_USE_PLATFORM_XLIB_KHR");
"wrap_objects_layer.json");
driver.physical_devices.emplace_back("physical_device_0");
- MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
- driver.physical_devices.back().queue_family_properties.push_back(family_props);
InstWrapper instance(env.vulkan_functions);
instance.create_info.add_extension("VK_EXT_debug_utils");
ManifestLayer::LayerDescription{}.set_name(regular_layer_name_2).set_lib_path(TEST_LAYER_PATH_EXPORT_VERSION_2)),
"regular_layer_2.json");
- 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);
{ // just the wrap layer
InstWrapper inst{env.vulkan_functions};
inst.create_info.add_layer(wrap_objects_name);
VkPhysicalDevice phys_dev = inst.GetPhysDev();
DeviceWrapper dev{inst};
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
dev.CheckCreate(phys_dev);
}
{ // wrap layer first
VkPhysicalDevice phys_dev = inst.GetPhysDev();
DeviceWrapper dev{inst};
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
dev.CheckCreate(phys_dev);
}
{ // wrap layer last
VkPhysicalDevice phys_dev = inst.GetPhysDev();
DeviceWrapper dev{inst};
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
dev.CheckCreate(phys_dev);
}
{ // wrap layer last
VkPhysicalDevice phys_dev = inst.GetPhysDev();
DeviceWrapper dev{inst};
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
dev.CheckCreate(phys_dev);
}
}
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* implicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
const char* enable_env_var = "ENABLE_ME";
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* implicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
const char* enable_env_var = "ENABLE_ME";
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* implicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
const char* enable_env_var = "ENABLE_ME";
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* implicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
const char* enable_env_var = "ENABLE_ME";
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* explicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
env.add_explicit_layer(
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* explicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
env.add_explicit_layer(
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* explicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
env.add_explicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* explicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
env.add_explicit_layer(
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* implicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
const char* enable_env_var = "ENABLE_ME";
handle_assert_has_value(pfn_vkSetDeviceMemoryPriority);
DeviceWrapper dev{inst};
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
dev.CheckCreate(phys_dev);
// Query again after create device to make sure the value returned by vkGetInstanceProcAddr did not change
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* implicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
const char* enable_env_var = "ENABLE_ME";
ASSERT_EQ(true, found);
DeviceWrapper dev{inst};
- dev.create_info.add_extension(VK_KHR_MAINTENANCE1_EXTENSION_NAME).add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
+ dev.create_info.add_extension(VK_KHR_MAINTENANCE1_EXTENSION_NAME);
dev.CheckCreate(phys_dev);
// Make sure only the appropriate function pointers are NULL as well
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* implicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
const char* enable_env_var = "ENABLE_ME";
ASSERT_EQ(true, found);
DeviceWrapper dev{inst};
- dev.create_info.add_extension(VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME)
- .add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
+ dev.create_info.add_extension(VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME);
dev.CheckCreate(phys_dev);
// Make sure only the appropriate function pointers are NULL as well
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* implicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
const char* enable_env_var = "ENABLE_ME";
}
DeviceWrapper dev{inst};
- dev.create_info.add_extension(VK_KHR_MAINTENANCE1_EXTENSION_NAME)
- .add_extension(VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME)
- .add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
+ dev.create_info.add_extension(VK_KHR_MAINTENANCE1_EXTENSION_NAME).add_extension(VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME);
dev.CheckCreate(phys_dev);
// Make sure only the appropriate function pointers are NULL as well
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* explicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
env.add_explicit_layer(
ASSERT_NO_FATAL_FAILURE(inst.EnumerateLayerDeviceExtensions(phys_dev, explicit_layer_name, 0));
DeviceWrapper dev{inst};
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
dev.CheckCreate(phys_dev);
// Make sure all the function pointers are NULL as well
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* explicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
env.add_explicit_layer(
ASSERT_TRUE(string_eq(layer_extensions.at(0).extensionName, VK_KHR_MAINTENANCE1_EXTENSION_NAME));
DeviceWrapper dev{inst};
- dev.create_info.add_extension(VK_KHR_MAINTENANCE1_EXTENSION_NAME).add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
+ dev.create_info.add_extension(VK_KHR_MAINTENANCE1_EXTENSION_NAME);
dev.CheckCreate(phys_dev);
// Make sure only the appropriate function pointers are NULL as well
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* explicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
env.add_explicit_layer(
ASSERT_TRUE(string_eq(layer_extensions.at(0).extensionName, VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME));
DeviceWrapper dev{inst};
- dev.create_info.add_extension(VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME)
- .add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
+ dev.create_info.add_extension(VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME);
dev.CheckCreate(phys_dev);
// Make sure only the appropriate function pointers are NULL as well
FrameworkEnvironment env;
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
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);
const char* explicit_layer_name = "VK_LAYER_LUNARG_wrap_objects";
env.add_explicit_layer(
ASSERT_TRUE(string_eq(layer_extensions.at(1).extensionName, VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME));
DeviceWrapper dev{inst};
- dev.create_info.add_extension(VK_KHR_MAINTENANCE1_EXTENSION_NAME)
- .add_extension(VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME)
- .add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
+ dev.create_info.add_extension(VK_KHR_MAINTENANCE1_EXTENSION_NAME).add_extension(VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME);
dev.CheckCreate(phys_dev);
// Make sure only the appropriate function pointers are NULL as well
// Create a device and query the function pointers
DeviceWrapper dev1{inst1};
- dev1.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
dev1.CheckCreate(phys_dev1);
PFN_vkTrimCommandPoolKHR pfn_TrimCommandPoolBefore = dev1.load("vkTrimCommandPoolKHR");
PFN_vkGetSwapchainStatusKHR pfn_GetSwapchainStatusBefore = dev1.load("vkGetSwapchainStatusKHR");
DeviceWrapper dev2{inst2};
dev2.create_info.add_extension(VK_KHR_MAINTENANCE1_EXTENSION_NAME)
- .add_extension(VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME)
- .add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
+ .add_extension(VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME);
dev2.CheckCreate(phys_dev2);
PFN_vkTrimCommandPoolKHR pfn_TrimCommandPoolAfter = dev2.load("vkTrimCommandPoolKHR");
// Create a device and query the function pointers
DeviceWrapper dev1{inst1};
- dev1.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
dev1.CheckCreate(phys_dev1);
PFN_vkTrimCommandPoolKHR pfn_TrimCommandPoolBefore = dev1.load("vkTrimCommandPoolKHR");
PFN_vkGetSwapchainStatusKHR pfn_GetSwapchainStatusBefore = dev1.load("vkGetSwapchainStatusKHR");
DeviceWrapper dev2{inst2};
dev2.create_info.add_extension(VK_KHR_MAINTENANCE1_EXTENSION_NAME)
.add_extension(VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME)
- .add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f))
.add_layer(explicit_layer_name);
dev2.CheckCreate(phys_dev2, VK_ERROR_EXTENSION_NOT_PRESENT);
DeviceWrapper dev3{inst2};
- dev3.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f)).add_layer(explicit_layer_name);
+ dev3.create_info.add_layer(explicit_layer_name);
dev3.CheckCreate(phys_dev2);
PFN_vkTrimCommandPoolKHR pfn_TrimCommandPoolAfter = dev3.load("vkTrimCommandPoolKHR");
DeviceWrapper dev{inst};
dev.create_info.add_extension(VK_KHR_MAINTENANCE1_EXTENSION_NAME)
.add_extension(VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME)
- .add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f))
.add_layer(explicit_layer_name);
dev.CheckCreate(phys_dev);
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_extension("NotPresent").add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
+ dev.create_info.add_extension("NotPresent");
dev.CheckCreate(phys_dev, VK_ERROR_EXTENSION_NOT_PRESENT);
}
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_layer("NotPresent").add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
+ dev.create_info.add_layer("NotPresent");
dev.CheckCreate(phys_dev);
}
VkPhysicalDevice phys_dev = inst.GetPhysDev();
DeviceWrapper dev{inst};
- dev.create_info.add_layer(layer_name).add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
+ dev.create_info.add_layer(layer_name);
dev.CheckCreate(phys_dev);
}
VkPhysicalDevice phys_dev = inst.GetPhysDev();
DeviceWrapper dev{inst};
- dev.create_info.add_layer(layer_name).add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
+ dev.create_info.add_layer(layer_name);
dev.CheckCreate(phys_dev);
VkPhysicalDevice phys_dev = inst.GetPhysDev();
DeviceWrapper dev{inst};
- dev.create_info.add_layer(layer_name).add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
+ dev.create_info.add_layer(layer_name);
dev.CheckCreate(phys_dev);
}
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};
for (uint32_t i = 0; i < 100; i++) {
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();
auto phys_devs = inst.GetPhysDevs(100);
for (uint32_t i = 0; i < 100; i++) {
DeviceWrapper dev{inst};
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
dev.CheckCreate(phys_devs[i]);
}
}
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};
for (uint32_t i = 0; i < 100; i++) {
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();
for (uint32_t i = 0; i < 100; i++) {
devices.emplace_back(inst);
DeviceWrapper& dev = devices.back();
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
dev.CheckCreate(phys_devs[i]);
}
FrameworkEnvironment env{};
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
env.get_test_icd().add_physical_device({});
- env.get_test_icd().physical_devices.back().queue_family_properties.push_back({{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true});
env.add_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
.set_name("implicit_layer_name")
inst.CheckCreate();
DeviceWrapper dev{inst};
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
dev.CheckCreate(inst.GetPhysDev());
}
FrameworkEnvironment env{};
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
env.get_test_icd(0).physical_devices.emplace_back("Device0");
- env.get_test_icd(0).physical_devices.back().queue_family_properties.push_back({{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true});
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
env.get_test_icd(1).physical_devices.emplace_back("Device1");
- env.get_test_icd(1).physical_devices.back().queue_family_properties.push_back({{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true});
env.add_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
.set_name("implicit_layer_name")
auto phys_devs = inst.GetPhysDevs();
DeviceWrapper dev{inst};
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
dev.CheckCreate(phys_devs.at(0));
-
- uint32_t familyCount = 0;
- inst->vkGetPhysicalDeviceQueueFamilyProperties(phys_devs.at(0), &familyCount, nullptr);
- ASSERT_EQ(familyCount, 1U);
}
TEST(Layer, pfnNextGetInstanceProcAddr_should_not_return_layers_own_functions) {
FrameworkEnvironment env{};
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
env.get_test_icd(0).physical_devices.emplace_back("Device0");
- env.get_test_icd(0).physical_devices.back().queue_family_properties.push_back({{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true});
env.add_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
.set_name("implicit_layer_name")
auto phys_devs = inst.GetPhysDevs();
DeviceWrapper dev{inst};
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
dev.CheckCreate(phys_devs.at(0));
-
- uint32_t familyCount = 0;
- inst->vkGetPhysicalDeviceQueueFamilyProperties(phys_devs.at(0), &familyCount, nullptr);
- ASSERT_EQ(familyCount, 1U);
}
VkPhysicalDevice phys_dev = inst.GetPhysDev();
DeviceWrapper dev{inst};
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(1.0));
dev.CheckCreate(phys_dev);
for (uint32_t j = 0; j < num_loops_try_get_device_proc_addr; j++) {
PFN_vkCmdBindPipeline p = dev.load("vkCmdBindPipeline");
VkPhysicalDevice phys_dev = inst.GetPhysDev();
for (uint32_t i = 0; i < num_loops_create_destroy_device; i++) {
DeviceWrapper dev{inst};
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(1.0));
dev.CheckCreate(phys_dev);
for (uint32_t j = 0; j < num_loops_try_get_proc_addr; j++) {
auto& driver = env.get_test_icd();
driver.physical_devices.emplace_back("physical_device_0");
- driver.physical_devices.back().add_queue_family_properties({});
std::vector<std::string> function_names;
add_function_names(function_names, function_count);
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
auto& driver = env.get_test_icd();
driver.setup_WSI();
- 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);
driver.physical_devices.back().add_extension("VK_KHR_swapchain");
InstWrapper inst{env.vulkan_functions};
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
auto& driver = env.get_test_icd();
driver.setup_WSI();
- 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);
driver.physical_devices.back().add_extension("VK_KHR_swapchain");
InstWrapper inst{env.vulkan_functions};
{ // Use GDPA to get functions
DeviceWrapper dev{inst};
dev.create_info.add_extension("VK_KHR_swapchain");
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
ASSERT_NO_FATAL_FAILURE(dev.CheckCreate(phys_dev));
{ // Use GIPA gotten functions
DeviceWrapper dev{inst};
dev.create_info.add_extension("VK_KHR_swapchain");
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
ASSERT_NO_FATAL_FAILURE(dev.CheckCreate(phys_dev));
{ // forget to set the surface
DeviceWrapper dev{inst};
dev.create_info.add_extension("VK_KHR_swapchain");
- dev.create_info.add_device_queue(DeviceQueueCreateInfo{}.add_priority(0.0f));
dev.CheckCreate(phys_dev);