mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-20 08:00:06 +01:00
render/vulkan: destroy vulkan instance when drm phdev mismatch
This commit is contained in:
parent
c39b3ce7a3
commit
c14aa1d0b8
1 changed files with 6 additions and 3 deletions
|
|
@ -2514,14 +2514,13 @@ struct wlr_renderer *wlr_vk_renderer_create_with_drm_fd(int drm_fd) {
|
||||||
if (!phdev) {
|
if (!phdev) {
|
||||||
// We rather fail here than doing some guesswork
|
// We rather fail here than doing some guesswork
|
||||||
wlr_log(WLR_ERROR, "Could not match drm and vulkan device");
|
wlr_log(WLR_ERROR, "Could not match drm and vulkan device");
|
||||||
return NULL;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_vk_device *dev = vulkan_device_create(ini, phdev);
|
struct wlr_vk_device *dev = vulkan_device_create(ini, phdev);
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
wlr_log(WLR_ERROR, "Failed to create vulkan device");
|
wlr_log(WLR_ERROR, "Failed to create vulkan device");
|
||||||
vulkan_instance_destroy(ini);
|
goto error;
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do not use the drm_fd that was passed in: we should prefer the render
|
// Do not use the drm_fd that was passed in: we should prefer the render
|
||||||
|
|
@ -2529,6 +2528,10 @@ struct wlr_renderer *wlr_vk_renderer_create_with_drm_fd(int drm_fd) {
|
||||||
dev->drm_fd = vulkan_open_phdev_drm_fd(phdev);
|
dev->drm_fd = vulkan_open_phdev_drm_fd(phdev);
|
||||||
|
|
||||||
return vulkan_renderer_create_for_device(dev);
|
return vulkan_renderer_create_for_device(dev);
|
||||||
|
|
||||||
|
error:
|
||||||
|
vulkan_instance_destroy(ini);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkInstance wlr_vk_renderer_get_instance(struct wlr_renderer *renderer) {
|
VkInstance wlr_vk_renderer_get_instance(struct wlr_renderer *renderer) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue