mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
venus: fix device group enumeration with unsupported devices
instance->physical_devices includes only supported devices, not all devices. One example is that it does not include 1.0 devices. We need to fix up VkPhysicalDeviceGroupProperties to exclude unsupported devices. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Ryan Neph <ryanneph@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12637>
This commit is contained in:
parent
a7ebcbbd6b
commit
86cb30baaf
1 changed files with 17 additions and 2 deletions
|
|
@ -1219,22 +1219,37 @@ vn_instance_enumerate_physical_device_groups_locked(
|
|||
}
|
||||
|
||||
/* fix VkPhysicalDeviceGroupProperties::physicalDevices to point to
|
||||
* physical_devs
|
||||
* physical_devs and discard unsupported ones
|
||||
*/
|
||||
uint32_t supported_count = 0;
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
VkPhysicalDeviceGroupProperties *group = &groups[i];
|
||||
|
||||
uint32_t group_physical_dev_count = 0;
|
||||
for (uint32_t j = 0; j < group->physicalDeviceCount; j++) {
|
||||
struct vn_physical_device_base *temp_obj =
|
||||
(struct vn_physical_device_base *)group->physicalDevices[j];
|
||||
struct vn_physical_device *physical_dev = find_physical_device(
|
||||
physical_devs, physical_dev_count, temp_obj->id);
|
||||
if (!physical_dev)
|
||||
continue;
|
||||
|
||||
group->physicalDevices[j] =
|
||||
group->physicalDevices[group_physical_dev_count++] =
|
||||
vn_physical_device_to_handle(physical_dev);
|
||||
}
|
||||
|
||||
group->physicalDeviceCount = group_physical_dev_count;
|
||||
if (!group->physicalDeviceCount)
|
||||
continue;
|
||||
|
||||
if (supported_count < i)
|
||||
groups[supported_count] = *group;
|
||||
supported_count++;
|
||||
}
|
||||
|
||||
count = supported_count;
|
||||
assert(count);
|
||||
|
||||
vk_free(alloc, temp_objs);
|
||||
|
||||
instance->physical_device_groups = groups;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue