mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
vulkan/wsi/wayland: check directly if we got globals successfully
Until now we had a weird way to bail out if we could not get any globals. Instead, add a direct check, what makes the code easier to read. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com> Reviewed-by: Simon Ser <contact@emersion.fr> Reviewed-by: Eric Engestrom <eric@engestrom.ch> Acked-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12117>
This commit is contained in:
parent
e090316570
commit
4bf011a768
1 changed files with 5 additions and 7 deletions
|
|
@ -486,10 +486,13 @@ wsi_wl_display_init(struct wsi_wayland *wsi_wl,
|
|||
|
||||
/* Round-trip to get wl_shm and zwp_linux_dmabuf_v1 globals */
|
||||
wl_display_roundtrip_queue(display->wl_display, display->queue);
|
||||
if (!display->dmabuf.wl_dmabuf && !display->swrast.wl_shm) {
|
||||
result = VK_ERROR_SURFACE_LOST_KHR;
|
||||
goto fail_registry;
|
||||
}
|
||||
|
||||
/* Round-trip again to get formats and modifiers */
|
||||
if (display->dmabuf.wl_dmabuf || display->swrast.wl_shm)
|
||||
wl_display_roundtrip_queue(display->wl_display, display->queue);
|
||||
wl_display_roundtrip_queue(display->wl_display, display->queue);
|
||||
|
||||
if (wsi_wl->wsi->force_bgra8_unorm_first) {
|
||||
/* Find BGRA8_UNORM in the list and swap it to the first position if we
|
||||
|
|
@ -511,11 +514,6 @@ wsi_wl_display_init(struct wsi_wayland *wsi_wl,
|
|||
else if (display->dmabuf.wl_dmabuf)
|
||||
display->formats = &display->dmabuf.formats;
|
||||
|
||||
if (!display->formats) {
|
||||
result = VK_ERROR_SURFACE_LOST_KHR;
|
||||
goto fail_registry;
|
||||
}
|
||||
|
||||
/* We don't need this anymore */
|
||||
wl_registry_destroy(registry);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue