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

Swapchain images are incorrectly displayed in borderless fullscreen when using particular VkFormats #2306

Open
AlastairHolmes opened this issue Aug 11, 2024 · 0 comments

Comments

@AlastairHolmes
Copy link

AlastairHolmes commented Aug 11, 2024

When using VK_FORMAT_A2R10G10B10_UNORM_PACK32 as the swapchain image format if the window the swapchain is associated with is put into borderless fullscreen (MacOS's default fullscreen mode) the swapchain images are displayed VERY significantly brighter than they are in any other mode (i.e. exclusive fullscreen, MacOS's "old-style" borderless fullscreen, or non-fullscreen).

  • I'm using a 2021 16inch M1 Macbook Pro (32GB) with Sonoma 14.6.1, Vulkan API version 1.2.283, and the Vulkan SDK 1.3.290.0.
  • I'm seeing no errors or warnings from any of the validation/synchronisation checks.
  • I can replicate this on both the Macbook's native display and an external display. Both of which support 10bit colour and the Display P3 colour space. Also it doesn't seem to make any difference if I change the display's "Preset" under Settings > Displays (Though of course doing this does have a slight effect on the colour if set wrong).
  • I can also replicate the behaviour in our code, the vkcube example, and in these examples https://github.com/SaschaWillems/Vulkan (I tried 5 of them randomly). This requires me to make a small change to their source code to make those examples prefer this VkFormat, but no other changes are needed to replicate.
  • Also I have double checked the format is supported by my machine in the CapsViewer.

Interestingly VK_FORMAT_A2B10G10R10_UNORM_PACK32 and VK_FORMAT_B8G8R8A8_UNORM don't show the same behaviour, and work as you would expect. I.e. it is not brighter in borderless fullscreen.

My first thought was this is some kind of Gamma problem, but even black, i.e. RGB: (0, 0, 0), is affected and displayed as an approximately 50% grey. Which if it where just a Gamma issue would not happen.

Also the colorspace of the swapchain seems to matter. Particularly if I use VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT then the problem does not happen, but if I use VK_COLOR_SPACE_SRGB_NONLINEAR_KHR or VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT the problem occurs.

Also importantly, in borderless fullscreen if the mouse is moved near the top of the window, then the menu bar will show up. While the menu bar is shown the image is not brighter, but once you move the mouse away again and the menu bar disappears then it goes back to being too bright.

Finally if I use the "Digital Colour Meter" (which is pre-installed as part of MacOS I believe), its numbers do not seem to reflect this brightness increase (i.e. it shows the RGB values as they are supposed to be, not brightened). Same with if I screenshot the window while in borderless fullscreen, the screenshot is not brighter, i.e. black is still black.

Let me know if you need any more information.

Thanks.

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