venus: pre-initialize device groups

We don't need to worry about how vkEnumeratePhysicalDeviceGroups is
called (props is NULL, props is non-NULL but count is 0, etc.) this way.
It also allows us to fix up VkPhysicalDeviceGroupProperties easily.

v2: let the for-loop increment (Yiwei)

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> (v1)
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12637>
This commit is contained in:
Chia-I Wu
2021-08-28 20:40:33 -07:00
committed by Marge Bot
parent e2020484eb
commit a7ebcbbd6b
3 changed files with 111 additions and 69 deletions
+1
View File
@@ -779,6 +779,7 @@ vn_DestroyInstance(VkInstance _instance,
return;
if (instance->physical_devices) {
vk_free(alloc, instance->physical_device_groups);
for (uint32_t i = 0; i < instance->physical_device_count; i++)
vn_physical_device_fini(&instance->physical_devices[i]);
vk_free(alloc, instance->physical_devices);