mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 23:30:10 +01:00
venus: fix missing renderer destructions
With failed compatibility check, the created renderer must be destroyed
within vn_instance_init_renderer.
Cc: mesa-stable
Fixes: 25b8f4f714 ("venus: handle device probing properly.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34613>
This commit is contained in:
parent
39e4fd98ce
commit
2a4675ee9f
1 changed files with 9 additions and 2 deletions
|
|
@ -181,7 +181,7 @@ vn_instance_init_renderer(struct vn_instance *instance)
|
|||
vn_log(instance, "wire format version %d != %d",
|
||||
renderer_info->wire_format_version, version);
|
||||
}
|
||||
return VK_ERROR_INITIALIZATION_FAILED;
|
||||
goto out_renderer_destroy;
|
||||
}
|
||||
|
||||
version = vn_info_vk_xml_version();
|
||||
|
|
@ -197,7 +197,7 @@ vn_instance_init_renderer(struct vn_instance *instance)
|
|||
VK_VERSION_MINOR(VN_MIN_RENDERER_VERSION),
|
||||
VK_VERSION_PATCH(VN_MIN_RENDERER_VERSION));
|
||||
}
|
||||
return VK_ERROR_INITIALIZATION_FAILED;
|
||||
goto out_renderer_destroy;
|
||||
}
|
||||
|
||||
uint32_t spec_version =
|
||||
|
|
@ -226,6 +226,12 @@ vn_instance_init_renderer(struct vn_instance *instance)
|
|||
}
|
||||
|
||||
return VK_SUCCESS;
|
||||
|
||||
out_renderer_destroy:
|
||||
vn_renderer_destroy(instance->renderer, alloc);
|
||||
/* needed by stub instance creation */
|
||||
instance->renderer = NULL;
|
||||
return VK_ERROR_INITIALIZATION_FAILED;
|
||||
}
|
||||
|
||||
/* instance commands */
|
||||
|
|
@ -309,6 +315,7 @@ vn_CreateInstance(const VkInstanceCreateInfo *pCreateInfo,
|
|||
|
||||
result = vn_instance_init_renderer(instance);
|
||||
if (result == VK_ERROR_INITIALIZATION_FAILED) {
|
||||
assert(!instance->renderer);
|
||||
*pInstance = instance_handle;
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue