TEST(LayerPhysDeviceMod, AddPhysicalDevices) {
FrameworkEnvironment env;
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
env.add_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
.set_name("VK_LAYER_LunarG_add_phys_dev")
.set_lib_path(TEST_LAYER_PATH_EXPORT_VERSION_2)
layer.set_add_phys_devs(true);
for (uint32_t icd = 0; icd < 2; ++icd) {
- auto& cur_icd = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2)).set_icd_api_version(VK_API_VERSION_1_2);
+ auto& cur_icd =
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_2)).set_icd_api_version(VK_API_VERSION_1_2);
VkPhysicalDeviceProperties properties{};
properties.apiVersion = VK_API_VERSION_1_2;
properties.vendorID = 0x11000000 + (icd << 6);
TEST(LayerPhysDeviceMod, RemovePhysicalDevices) {
FrameworkEnvironment env;
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
env.add_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
.set_name("VK_LAYER_LunarG_remove_phys_dev")
.set_lib_path(TEST_LAYER_PATH_EXPORT_VERSION_2)
layer.set_remove_phys_devs(true);
for (uint32_t icd = 0; icd < 2; ++icd) {
- auto& cur_icd = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2)).set_icd_api_version(VK_API_VERSION_1_2);
+ auto& cur_icd =
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_2)).set_icd_api_version(VK_API_VERSION_1_2);
VkPhysicalDeviceProperties properties{};
properties.apiVersion = VK_API_VERSION_1_2;
properties.vendorID = 0x11000000 + (icd << 6);
TEST(LayerPhysDeviceMod, ReorderPhysicalDevices) {
FrameworkEnvironment env;
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
env.add_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
.set_name("VK_LAYER_LunarG_reorder_phys_dev")
.set_lib_path(TEST_LAYER_PATH_EXPORT_VERSION_2)
layer.set_reorder_phys_devs(true);
for (uint32_t icd = 0; icd < 2; ++icd) {
- auto& cur_icd = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2)).set_icd_api_version(VK_API_VERSION_1_2);
+ auto& cur_icd =
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_2)).set_icd_api_version(VK_API_VERSION_1_2);
VkPhysicalDeviceProperties properties{};
properties.apiVersion = VK_API_VERSION_1_2;
properties.vendorID = 0x11000000 + (icd << 6);
TEST(LayerPhysDeviceMod, AddRemoveAndReorderPhysicalDevices) {
FrameworkEnvironment env;
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
env.add_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
.set_name("VK_LAYER_LunarG_all_phys_dev")
.set_lib_path(TEST_LAYER_PATH_EXPORT_VERSION_2)
layer.set_add_phys_devs(true).set_remove_phys_devs(true).set_reorder_phys_devs(true);
for (uint32_t icd = 0; icd < 2; ++icd) {
- auto& cur_icd = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2)).set_icd_api_version(VK_API_VERSION_1_2);
+ auto& cur_icd =
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_2)).set_icd_api_version(VK_API_VERSION_1_2);
VkPhysicalDeviceProperties properties{};
properties.apiVersion = VK_API_VERSION_1_2;
properties.vendorID = 0x11000000 + (icd << 6);
TEST(LayerPhysDeviceMod, AddPhysicalDeviceGroups) {
FrameworkEnvironment env;
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
env.add_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
.set_name("VK_LAYER_LunarG_add_phys_dev")
.set_lib_path(TEST_LAYER_PATH_EXPORT_VERSION_2)
layer.set_add_phys_devs(true);
for (uint32_t icd = 0; icd < 2; ++icd) {
- auto& cur_icd = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2)).set_icd_api_version(VK_API_VERSION_1_2);
+ auto& cur_icd =
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_2)).set_icd_api_version(VK_API_VERSION_1_2);
VkPhysicalDeviceProperties properties{};
properties.apiVersion = VK_API_VERSION_1_2;
properties.vendorID = 0x11000000 + (icd << 6);
TEST(LayerPhysDeviceMod, RemovePhysicalDeviceGroups) {
FrameworkEnvironment env;
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ EnvVarWrapper disable_linux_sort("VK_LOADER_DISABLE_SELECT", "1");
env.add_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
.set_name("VK_LAYER_LunarG_remove_phys_dev")
.set_lib_path(TEST_LAYER_PATH_EXPORT_VERSION_2)
layer.set_remove_phys_devs(true);
for (uint32_t icd = 0; icd < 2; ++icd) {
- auto& cur_icd = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2)).set_icd_api_version(VK_API_VERSION_1_2);
+ auto& cur_icd =
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_2)).set_icd_api_version(VK_API_VERSION_1_2);
VkPhysicalDeviceProperties properties{};
properties.apiVersion = VK_API_VERSION_1_2;
properties.vendorID = 0x11000000 + (icd << 6);
cur_icd.physical_device_groups.emplace_back(cur_icd.physical_devices[1]);
cur_icd.physical_device_groups.back().use_physical_device(cur_icd.physical_devices[2]);
}
- const uint32_t icd_groups = 4;
+ const uint32_t icd_groups = 3;
InstWrapper inst{env.vulkan_functions};
inst.create_info.set_api_version(VK_API_VERSION_1_1);
uint32_t grp_count = 0;
ASSERT_EQ(VK_SUCCESS, inst->vkEnumeratePhysicalDeviceGroups(inst, &grp_count, nullptr));
- ASSERT_LT(grp_count, icd_groups);
+ ASSERT_EQ(grp_count, icd_groups);
auto phys_dev_groups =
std::vector<VkPhysicalDeviceGroupProperties>(grp_count, {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES});
TEST(LayerPhysDeviceMod, ReorderPhysicalDeviceGroups) {
FrameworkEnvironment env;
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
env.add_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
.set_name("VK_LAYER_LunarG_reorder_phys_dev")
.set_lib_path(TEST_LAYER_PATH_EXPORT_VERSION_2)
layer.set_reorder_phys_devs(true);
for (uint32_t icd = 0; icd < 2; ++icd) {
- auto& cur_icd = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2)).set_icd_api_version(VK_API_VERSION_1_2);
+ auto& cur_icd =
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_2)).set_icd_api_version(VK_API_VERSION_1_2);
VkPhysicalDeviceProperties properties{};
properties.apiVersion = VK_API_VERSION_1_2;
properties.vendorID = 0x11000000 + (icd << 6);
TEST(LayerPhysDeviceMod, AddRemoveAndReorderPhysicalDeviceGroups) {
FrameworkEnvironment env;
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
env.add_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
.set_name("VK_LAYER_LunarG_all_phys_dev")
.set_lib_path(TEST_LAYER_PATH_EXPORT_VERSION_2)
layer.set_add_phys_devs(true).set_remove_phys_devs(true).set_reorder_phys_devs(true);
for (uint32_t icd = 0; icd < 2; ++icd) {
- auto& cur_icd = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2)).set_icd_api_version(VK_API_VERSION_1_2);
+ auto& cur_icd =
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_2)).set_icd_api_version(VK_API_VERSION_1_2);
VkPhysicalDeviceProperties properties{};
properties.apiVersion = VK_API_VERSION_1_2;
properties.vendorID = 0x11000000 + (icd << 6);
cur_icd.physical_devices.back().set_properties(properties);
}
cur_icd.physical_device_groups.emplace_back(cur_icd.physical_devices[0]);
- cur_icd.physical_device_groups.emplace_back(cur_icd.physical_devices[1]);
- cur_icd.physical_device_groups.back().use_physical_device(cur_icd.physical_devices[2]);
+ cur_icd.physical_device_groups.back().use_physical_device(cur_icd.physical_devices[1]);
+ cur_icd.physical_device_groups.emplace_back(cur_icd.physical_devices[2]);
}
const uint32_t icd_groups = 4;
// Also check if the application didn't enable 1.1 and when a layer 'upgrades' the api version to 1.1
TEST(LoaderInstPhysDevExts, PhysDevProps2Simple) {
FrameworkEnvironment env{};
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, VK_API_VERSION_1_1));
env.get_test_icd(0).icd_api_version = VK_API_VERSION_1_1;
env.get_test_icd(0).add_instance_extension({VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME});
env.get_test_icd(0).physical_devices.push_back({});
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
// ICD 1 should not have 1.1
// Also check if the application didn't enable 1.1 and when a layer 'upgrades' the api version to 1.1
TEST(LoaderInstPhysDevExts, PhysDevFeats2Simple) {
FrameworkEnvironment env{};
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, VK_API_VERSION_1_1));
env.get_test_icd(0).icd_api_version = VK_API_VERSION_1_1;
env.get_test_icd(0).add_instance_extension({VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME});
env.get_test_icd(0).physical_devices.push_back({});
env.get_test_icd(0).physical_devices.back().extensions.push_back({VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, 0});
+ env.get_test_icd(0).physical_devices.back().set_api_version(VK_API_VERSION_1_1);
FillInRandomFeatures(env.get_test_icd(0).physical_devices.back().features);
{
InstWrapper instance(env.vulkan_functions);
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
// ICD 1 should not have 1.1
// Also check if the application didn't enable 1.1 and when a layer 'upgrades' the api version to 1.1
TEST(LoaderInstPhysDevExts, PhysDevFormatProps2Simple) {
FrameworkEnvironment env{};
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, VK_API_VERSION_1_1));
env.get_test_icd(0).icd_api_version = VK_API_VERSION_1_1;
env.get_test_icd(0).add_instance_extension({VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME});
env.get_test_icd(0).physical_devices.push_back({});
env.get_test_icd(0).physical_devices.back().extensions.push_back({VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, 0});
+ env.get_test_icd(0).physical_devices.back().set_api_version(VK_API_VERSION_1_1);
FillInRandomFormatProperties(env.get_test_icd(0).physical_devices.back().format_properties);
{
InstWrapper instance(env.vulkan_functions);
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
// ICD 1 should not have 1.1
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
// ICD 1 should not have 1.1
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
// ICD 1 should not have 1.1
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
// ICD 1 should not have 1.1
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
// ICD 1 should not have 1.1
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
// ICD 1 should not have 1.1
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
// ICD 1 should not have 1.1
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
// ICD 1 should not have 1.1
Extension third_ext{VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME};
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
cur_icd.icd_api_version = VK_API_VERSION_1_0;
cur_icd.min_icd_interface_version = 3;
Extension third_ext{VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME};
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
cur_icd.icd_api_version = VK_API_VERSION_1_0;
cur_icd.enable_icd_wsi = true;
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
cur_icd.icd_api_version = VK_API_VERSION_1_0;
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
cur_icd.icd_api_version = VK_API_VERSION_1_0;
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
cur_icd.icd_api_version = VK_API_VERSION_1_0;
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
cur_icd.icd_api_version = VK_API_VERSION_1_0;
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
cur_icd.icd_api_version = VK_API_VERSION_1_0;
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
cur_icd.icd_api_version = VK_API_VERSION_1_0;
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
cur_icd.icd_api_version = VK_API_VERSION_1_0;
cur_icd.add_instance_extension({VK_KHR_DISPLAY_EXTENSION_NAME});
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
cur_icd.icd_api_version = VK_API_VERSION_1_0;
cur_icd.add_instance_extension({VK_KHR_DISPLAY_EXTENSION_NAME});
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
cur_icd.icd_api_version = VK_API_VERSION_1_0;
cur_icd.add_instance_extension({VK_KHR_DISPLAY_EXTENSION_NAME});
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
cur_icd.icd_api_version = VK_API_VERSION_1_0;
cur_icd.add_instance_extension({VK_KHR_DISPLAY_EXTENSION_NAME});
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
cur_icd.icd_api_version = VK_API_VERSION_1_0;
cur_icd.add_instance_extension({VK_KHR_DISPLAY_EXTENSION_NAME});
const uint32_t max_phys_devs = 7;
for (uint32_t icd = 0; icd < max_icd_count; ++icd) {
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, icd != 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0));
auto& cur_icd = env.get_test_icd(icd);
cur_icd.icd_api_version = VK_API_VERSION_1_0;
cur_icd.add_instance_extension({VK_KHR_DISPLAY_EXTENSION_NAME});
TEST(EnumeratePhysicalDevices, ZeroPhysicalDevicesAfterCreateInstance) {
FrameworkEnvironment env{};
- auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2)).set_min_icd_interface_version(5);
+ auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_1)).set_min_icd_interface_version(5);
InstWrapper inst{env.vulkan_functions};
inst.create_info.set_api_version(VK_API_VERSION_1_1);
inst.CheckCreate();
TEST(EnumeratePhysicalDeviceGroups, OneCall) {
FrameworkEnvironment env{};
- auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2))
+ auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_1))
.set_min_icd_interface_version(5)
.set_icd_api_version(VK_API_VERSION_1_1)
.add_instance_extension({VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME});
for (size_t i = 0; i < 3; i++) {
driver.physical_devices.emplace_back(std::string("physical_device_") + std::to_string(i));
driver.physical_devices.back().extensions.push_back({VK_EXT_PCI_BUS_INFO_EXTENSION_NAME, 0});
+ driver.physical_devices.back().properties.apiVersion = VK_API_VERSION_1_1;
}
driver.physical_device_groups.emplace_back(driver.physical_devices[0]);
driver.physical_device_groups.back().use_physical_device(driver.physical_devices[1]);
TEST(EnumeratePhysicalDeviceGroups, TwoCall) {
FrameworkEnvironment env{};
- auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2))
+ auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_1))
.set_min_icd_interface_version(5)
.set_icd_api_version(VK_API_VERSION_1_1)
.add_instance_extension({VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME});
for (size_t i = 0; i < 3; i++) {
driver.physical_devices.emplace_back(std::string("physical_device_") + std::to_string(i));
driver.physical_devices.back().extensions.push_back({VK_EXT_PCI_BUS_INFO_EXTENSION_NAME, 0});
+ driver.physical_devices.back().properties.apiVersion = VK_API_VERSION_1_1;
}
driver.physical_device_groups.emplace_back(driver.physical_devices[0]);
driver.physical_device_groups.back().use_physical_device(driver.physical_devices[1]);
TEST(EnumeratePhysicalDeviceGroups, TwoCallIncomplete) {
FrameworkEnvironment env{};
- auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2))
+ auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_1))
.set_min_icd_interface_version(5)
.set_icd_api_version(VK_API_VERSION_1_1)
.add_instance_extension({VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME});
for (size_t i = 0; i < 3; i++) {
driver.physical_devices.emplace_back(std::string("physical_device_") + std::to_string(i));
driver.physical_devices.back().extensions.push_back({VK_EXT_PCI_BUS_INFO_EXTENSION_NAME, 0});
+ driver.physical_devices.back().properties.apiVersion = VK_API_VERSION_1_1;
}
driver.physical_device_groups.emplace_back(driver.physical_devices[0]);
driver.physical_device_groups.back().use_physical_device(driver.physical_devices[1]);
// vkEnumeratePhysicalDeviceGroupsKHR, and make sure they return the same info.
TEST(EnumeratePhysicalDeviceGroups, TestCoreVersusExtensionSameReturns) {
FrameworkEnvironment env{};
- auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2))
+ auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_1))
.set_min_icd_interface_version(5)
.set_icd_api_version(VK_API_VERSION_1_1)
.add_instance_extension({VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME})
// Generate the devices
for (size_t i = 0; i < 6; i++) {
driver.physical_devices.emplace_back(std::string("physical_device_") + std::to_string(i));
+ driver.physical_devices.back().properties.apiVersion = VK_API_VERSION_1_1;
}
// Generate the starting groups
// querying vkEnumeratePhysicalDeviceGroups before and after the add.
TEST(EnumeratePhysicalDeviceGroups, CallThriceAddGroupInBetween) {
FrameworkEnvironment env{};
- auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2))
+ auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_1))
.set_min_icd_interface_version(5)
.set_icd_api_version(VK_API_VERSION_1_1);
// Generate the devices
for (size_t i = 0; i < 7; i++) {
driver.physical_devices.emplace_back(std::string("physical_device_") + std::to_string(i));
+ driver.physical_devices.back().properties.apiVersion = VK_API_VERSION_1_1;
}
// Generate the starting groups
// querying vkEnumeratePhysicalDeviceGroups before and after the remove.
TEST(EnumeratePhysicalDeviceGroups, CallTwiceRemoveGroupInBetween) {
FrameworkEnvironment env{};
- auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2))
+ auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_1))
.set_min_icd_interface_version(5)
.set_icd_api_version(VK_API_VERSION_1_1);
// Generate the devices
for (size_t i = 0; i < 7; i++) {
driver.physical_devices.emplace_back(std::string("physical_device_") + std::to_string(i));
+ driver.physical_devices.back().properties.apiVersion = VK_API_VERSION_1_1;
}
// Generate the starting groups
// querying vkEnumeratePhysicalDeviceGroups before and after the add.
TEST(EnumeratePhysicalDeviceGroups, CallTwiceAddDeviceInBetween) {
FrameworkEnvironment env{};
- auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2))
+ auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_1))
.set_min_icd_interface_version(5)
.set_icd_api_version(VK_API_VERSION_1_1);
// Generate the devices
for (size_t i = 0; i < 7; i++) {
driver.physical_devices.emplace_back(std::string("physical_device_") + std::to_string(i));
+ driver.physical_devices.back().properties.apiVersion = VK_API_VERSION_1_1;
}
// Generate the starting groups
// querying vkEnumeratePhysicalDeviceGroups before and after the remove.
TEST(EnumeratePhysicalDeviceGroups, CallTwiceRemoveDeviceInBetween) {
FrameworkEnvironment env{};
- auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2))
+ auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_1))
.set_min_icd_interface_version(5)
.set_icd_api_version(VK_API_VERSION_1_1);
// Generate the devices
for (size_t i = 0; i < 6; i++) {
driver.physical_devices.emplace_back(std::string("physical_device_") + std::to_string(i));
+ driver.physical_devices.back().properties.apiVersion = VK_API_VERSION_1_1;
}
// Generate the starting groups
// various devices and groups while querying in between.
TEST(EnumeratePhysicalDeviceGroups, MultipleAddRemoves) {
FrameworkEnvironment env{};
- auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2))
+ auto& driver = env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_1))
.set_min_icd_interface_version(5)
.set_icd_api_version(VK_API_VERSION_1_1);
// Generate the devices
for (size_t i = 0; i < 9; i++) {
driver.physical_devices.emplace_back(std::string("physical_device_") + std::to_string(i));
+ driver.physical_devices.back().properties.apiVersion = VK_API_VERSION_1_1;
}
// Generate the starting groups
// PhysDev 6: pd6, Discrete, Vulkan 1.1, Bus 2
// Group 0: PhysDev 5, PhysDev 6
// Group 1: PhysDev 4
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, VK_API_VERSION_1_1));
auto& cur_icd_0 = env.get_test_icd(0);
cur_icd_0.set_icd_api_version(VK_API_VERSION_1_1);
cur_icd_0.physical_devices.push_back({"pd0"});
.use_physical_device(cur_icd_0.physical_devices[2]);
cur_icd_0.physical_device_groups.push_back({cur_icd_0.physical_devices[1]});
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, VK_API_VERSION_1_1));
auto& cur_icd_1 = env.get_test_icd(1);
cur_icd_1.set_icd_api_version(VK_API_VERSION_1_1);
cur_icd_1.physical_devices.push_back({"pd4"});
}
{ // core
FrameworkEnvironment env{};
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA))
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, VK_API_VERSION_1_3))
.add_physical_device({})
.set_supports_tooling_info_core(true)
.add_tooling_property(icd_tool_props)
TEST(ICDInterfaceVersion2PlusEnumerateAdapterPhysicalDevices, VerifyPhysDevResults) {
FrameworkEnvironment env{};
auto& driver =
- env.add_icd(TestICDDetails{TEST_ICD_PATH_VERSION_2_EXPORT_ICD_ENUMERATE_ADAPTER_PHYSICAL_DEVICES}.set_discovery_type(
- ManifestDiscoveryType::null_dir))
+ env.add_icd(TestICDDetails{TEST_ICD_PATH_VERSION_2_EXPORT_ICD_ENUMERATE_ADAPTER_PHYSICAL_DEVICES, VK_API_VERSION_1_1}
+ .set_discovery_type(ManifestDiscoveryType::null_dir))
.set_min_icd_interface_version(6)
.set_icd_api_version(VK_API_VERSION_1_1);
const std::vector<std::string> physical_device_names = {"physical_device_4", "physical_device_3", "physical_device_2",
TEST(ICDInterfaceVersion2PlusEnumerateAdapterPhysicalDevices, VerifyGroupResults) {
FrameworkEnvironment env{};
auto& driver =
- env.add_icd(TestICDDetails{TEST_ICD_PATH_VERSION_2_EXPORT_ICD_ENUMERATE_ADAPTER_PHYSICAL_DEVICES}.set_discovery_type(
- ManifestDiscoveryType::null_dir))
+ env.add_icd(TestICDDetails{TEST_ICD_PATH_VERSION_2_EXPORT_ICD_ENUMERATE_ADAPTER_PHYSICAL_DEVICES, VK_API_VERSION_1_1}
+ .set_discovery_type(ManifestDiscoveryType::null_dir))
.set_min_icd_interface_version(6)
.set_icd_api_version(VK_API_VERSION_1_1);
const std::vector<std::string> physical_device_names = {"physical_device_4", "physical_device_3", "physical_device_2",
TEST(MultipleDriverConfig, DifferentICDsWithDevicesAndGroups) {
FrameworkEnvironment env{};
env.add_icd(TestICDDetails(TEST_ICD_PATH_EXPORT_ICD_GIPA));
- env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_API_VERSION_1_1));
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
// The loader has to be able to handle drivers that support device groups in combination
// ICD 1 : 1.1 support (with 1 group with 2 devices)
TestICD& icd1 = env.get_test_icd(1);
- icd1.physical_devices.emplace_back("physical_device_1");
- icd1.physical_devices.emplace_back("physical_device_2");
+ icd1.physical_devices.emplace_back("physical_device_1").set_api_version(VK_API_VERSION_1_1);
+ icd1.physical_devices.emplace_back("physical_device_2").set_api_version(VK_API_VERSION_1_1);
icd1.physical_device_groups.emplace_back(icd1.physical_devices[0]);
icd1.physical_device_groups.back().use_physical_device(icd1.physical_devices[1]);
icd1.min_icd_interface_version = 5;