Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan: Using window scaling on Windows results in a white screen when switching from r_fullscreen 1 to r_fullscreen 0. #15

Open
Alereon opened this issue Feb 27, 2024 · 1 comment

Comments

@Alereon
Copy link

Alereon commented Feb 27, 2024

Operating system and version:
Windows 10 22H2 (OS Build 19045.4096)

Description of the bug (and if possible, steps to reproduce the bug):
When having window scaling set to something higher than 100%, the game window turns into a bright white screen when switching from r_fullscreen 1 to r_fullscreen 0.
The console also gets spammed with the following messages:

vk_present_frame(): restarting swapchain...
vk_present_frame(): restarting swapchain...
----- Presentation modes -----
 FIFO
 FIFO_RELAXED
 MAILBOX
 IMMEDIATE
selected presentation mode: IMMEDIATE, image count: 3

steps to reproduce:

  1. Turn on window scaling to e.g 125%.
  2. Launch the game using r_fullscreen 1.
  3. On the main menu, set r_fullscreen 1 to 0.
  4. Execute /vid_restart.
  5. The game window turns completely white.

What did you expect to happen instead?
Seeing the game's main menu instead of a bright white screen.

@Alereon
Copy link
Author

Alereon commented Feb 27, 2024

Managed to grab the following validation error:

{1284057537} - {VUID-VkSwapchainCreateInfoKHR-pNext-07781}: {Validation Error: [ VUID-VkSwapchainCreateInfoKHR-pNext-07781 ] | MessageID = 0x4c8929c1 | vkCreateSwapchainKHR(): pCreateInfo->imageExtent (3840, 2160), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (3832,2135), minImageExtent = (3832,2135), maxImageExtent = (3832,2135). The Vulkan spec states: If a VkSwapchainPresentScalingCreateInfoEXT structure was not included in the pNext chain, or it is included and VkSwapchainPresentScalingCreateInfoEXT::scalingBehavior is zero then imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://vulkan.lunarg.com/doc/view/1.3.275.0/windows/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-pNext-07781)}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant