Merge branch 'fix-vulkan-context-creation' into 'master'
Fix vulkan context creation Closes #3147 See merge request GNOME/gtk!2555
This commit is contained in:
@@ -813,7 +813,7 @@ gdk_surface_new_toplevel (GdkDisplay *display)
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
return gdk_surface_new (display, GDK_SURFACE_TOPLEVEL,
|
||||
NULL, 0, 0, 0, 0);
|
||||
NULL, 0, 0, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -324,13 +324,13 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
|
||||
|
||||
/*
|
||||
* Per https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkSurfaceCapabilitiesKHR
|
||||
* the current extent may assume a special value, meaning that the extend should assume whatever
|
||||
* the current extent may assume a special value, meaning that the extent should assume whatever
|
||||
* value the surface has.
|
||||
*/
|
||||
if (capabilities.currentExtent.width == -1 || capabilities.currentExtent.height == -1)
|
||||
{
|
||||
capabilities.currentExtent.width = gdk_surface_get_width (surface) * gdk_surface_get_scale_factor (surface);
|
||||
capabilities.currentExtent.height = gdk_surface_get_height (surface) * gdk_surface_get_scale_factor (surface);
|
||||
capabilities.currentExtent.width = MAX (1, gdk_surface_get_width (surface) * gdk_surface_get_scale_factor (surface));
|
||||
capabilities.currentExtent.height = MAX (1, gdk_surface_get_height (surface) * gdk_surface_get_scale_factor (surface));
|
||||
}
|
||||
|
||||
res = GDK_VK_CHECK (vkCreateSwapchainKHR, device,
|
||||
|
||||
Reference in New Issue
Block a user