// underneath us when using this test.
uint32_t icd_group_count = 0;
layer.instance_dispatch_table.EnumeratePhysicalDeviceGroups(instance, &icd_group_count, nullptr);
- std::vector<VkPhysicalDeviceGroupProperties> tmp_vector(icd_group_count);
- for (uint32_t group = 0; group < icd_group_count; ++group) {
- tmp_vector[group].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES;
- }
+ std::vector<VkPhysicalDeviceGroupProperties> tmp_vector(icd_group_count,
+ {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES});
layer.instance_dispatch_table.EnumeratePhysicalDeviceGroups(instance, &icd_group_count, tmp_vector.data());
layer.complete_physical_device_groups.clear();
ASSERT_EQ(VK_SUCCESS, inst->vkEnumeratePhysicalDeviceGroups(inst, &grp_count, nullptr));
ASSERT_GT(grp_count, icd_groups);
- auto not_exp_phys_dev_groups = std::vector<VkPhysicalDeviceGroupProperties>(icd_groups);
- for (uint32_t group = 0; group < icd_groups; ++group) {
- not_exp_phys_dev_groups[group].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES;
- }
+ auto not_exp_phys_dev_groups =
+ std::vector<VkPhysicalDeviceGroupProperties>(icd_groups, {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES});
+
uint32_t returned_group_count = icd_groups;
ASSERT_EQ(VK_INCOMPLETE, inst->vkEnumeratePhysicalDeviceGroups(inst, &returned_group_count, not_exp_phys_dev_groups.data()));
ASSERT_EQ(icd_groups, returned_group_count);
- auto phys_dev_groups = std::vector<VkPhysicalDeviceGroupProperties>(grp_count);
- for (uint32_t group = 0; group < grp_count; ++group) {
- phys_dev_groups[group].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES;
- }
+ auto phys_dev_groups =
+ std::vector<VkPhysicalDeviceGroupProperties>(grp_count, {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES});
+
returned_group_count = grp_count;
ASSERT_EQ(VK_SUCCESS, inst->vkEnumeratePhysicalDeviceGroups(inst, &returned_group_count, phys_dev_groups.data()));
ASSERT_EQ(grp_count, returned_group_count);
ASSERT_EQ(VK_SUCCESS, inst->vkEnumeratePhysicalDeviceGroups(inst, &grp_count, nullptr));
ASSERT_LT(grp_count, icd_groups);
- auto phys_dev_groups = std::vector<VkPhysicalDeviceGroupProperties>(grp_count);
- for (uint32_t group = 0; group < grp_count; ++group) {
- phys_dev_groups[group].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES;
- }
+ auto phys_dev_groups =
+ std::vector<VkPhysicalDeviceGroupProperties>(grp_count, {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES});
+
uint32_t returned_group_count = grp_count;
ASSERT_EQ(VK_SUCCESS, inst->vkEnumeratePhysicalDeviceGroups(inst, &returned_group_count, phys_dev_groups.data()));
ASSERT_EQ(grp_count, returned_group_count);
ASSERT_EQ(VK_SUCCESS, inst->vkEnumeratePhysicalDeviceGroups(inst, &grp_count, nullptr));
ASSERT_EQ(grp_count, icd_groups);
- auto phys_dev_groups = std::vector<VkPhysicalDeviceGroupProperties>(grp_count);
- for (uint32_t group = 0; group < grp_count; ++group) {
- phys_dev_groups[group].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES;
- }
+ auto phys_dev_groups =
+ std::vector<VkPhysicalDeviceGroupProperties>(grp_count, {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES});
+
uint32_t returned_group_count = grp_count;
ASSERT_EQ(VK_SUCCESS, inst->vkEnumeratePhysicalDeviceGroups(inst, &returned_group_count, phys_dev_groups.data()));
ASSERT_EQ(grp_count, returned_group_count);
ASSERT_EQ(VK_SUCCESS, inst->vkEnumeratePhysicalDeviceGroups(inst, &grp_count, nullptr));
ASSERT_GT(grp_count, icd_groups);
- auto phys_dev_groups = std::vector<VkPhysicalDeviceGroupProperties>(grp_count);
- for (uint32_t group = 0; group < grp_count; ++group) {
- phys_dev_groups[group].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES;
- }
+ auto phys_dev_groups =
+ std::vector<VkPhysicalDeviceGroupProperties>(grp_count, {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES});
+
uint32_t returned_group_count = grp_count;
ASSERT_EQ(VK_SUCCESS, inst->vkEnumeratePhysicalDeviceGroups(inst, &returned_group_count, phys_dev_groups.data()));
ASSERT_EQ(grp_count, returned_group_count);