Skip to content

Commit

Permalink
Merge pull request #43531 from bruvzg/x11_fix_vlk_init_crash
Browse files Browse the repository at this point in the history
Fixes crash if Vulkan presentation surface is not available.
  • Loading branch information
akien-mga authored Nov 14, 2020
2 parents ffbaf71 + f09a37a commit dd54851
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/vulkan/vulkan_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,8 @@ Error VulkanContext::_window_create(DisplayServer::WindowID p_window_id, VkSurfa
// We use a single GPU, but we need a surface to initialize the
// queues, so this process must be deferred until a surface
// is created.
_initialize_queues(p_surface);
Error err = _initialize_queues(p_surface);
ERR_FAIL_COND_V(err != OK, ERR_CANT_CREATE);
}

Window window;
Expand Down
4 changes: 4 additions & 0 deletions platform/linuxbsd/display_server_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3852,6 +3852,10 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
(screen_get_size(0).width - p_resolution.width) / 2,
(screen_get_size(0).height - p_resolution.height) / 2);
WindowID main_window = _create_window(p_mode, p_flags, Rect2i(window_position, p_resolution));
if (main_window == INVALID_WINDOW_ID) {
r_error = ERR_CANT_CREATE;
return;
}
for (int i = 0; i < WINDOW_FLAG_MAX; i++) {
if (p_flags & (1 << i)) {
window_set_flag(WindowFlags(i), true, main_window);
Expand Down

0 comments on commit dd54851

Please sign in to comment.