Skip to content

Commit

Permalink
qvk: force single-bit preTransform in swapchain creation, refs #142
Browse files Browse the repository at this point in the history
  • Loading branch information
hanatos committed Oct 22, 2024
1 parent 98d1323 commit 57076ee
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/gui/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,18 @@ out:;
if(surf_capabilities.maxImageCount > 0)
num_images = MIN(num_images, surf_capabilities.maxImageCount);

// boy is this idiotic. but swapchain creation may fail otherwise, see https://github.com/hanatos/vkdt/issues/142
if (surf_capabilities.currentTransform != VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR &&
surf_capabilities.currentTransform != VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR &&
surf_capabilities.currentTransform != VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR &&
surf_capabilities.currentTransform != VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR &&
surf_capabilities.currentTransform != VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR &&
surf_capabilities.currentTransform != VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR &&
surf_capabilities.currentTransform != VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR &&
surf_capabilities.currentTransform != VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR &&
surf_capabilities.currentTransform != VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR)
surf_capabilities.currentTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;

VkSwapchainCreateInfoKHR swpch_create_info = {
.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,
.surface = win->surface,
Expand Down

0 comments on commit 57076ee

Please sign in to comment.