Skip to content

Commit

Permalink
PsychVulkanCore/Windows: Make sure fullscreen exclusive is forbidden …
Browse files Browse the repository at this point in the history
…if usercode doesn't want it.

So updating the AMD graphics+display driver to the latest pile of horseshit,
version 21.11.2 30.0.13033.5003, brings us new Vulkan bugs on top of all the
old Vulkan bugs, because nobody nowadays can be arsed to do QA
anymore. This on Windows 10 21H1 with all updates applied.

Now fullscreen exclusive mode is broken to the point where it only displays a
black screen, and vkQueuePresent() failure with error code -1000255000 aka
VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT despite the switching
function reporting successful switch to fs exclusive mode before. Also no keyboard
input is accepted anymore and one has to kill Matlab/Octave to escape the black
screen. This is one step down from having to ALT+Tab in a previous driver
version to escape the black screen, because why stop at merely bad if one can go
to much worse?

We now make sure that if the "disable fs exclusive mode" flags 2 are specified, we
not just merely do not request fullscreen exclusive, but instead explicitely forbid the
driver to switch to fs exclusive.

This gives us a picture back, and working keyboard input, and non-crashing
Matlab/Octave, and as a side-effect broken visual stimulation timing, ofc.

Also, now we run into a new problem in that in non-fs-exclusive mode, HDR needs
to be manually enabled/disabled by the user in the Windows display settings GUI.
and apparently the Windows DWM compositor has forgotten how to properly do
HDR compositing in the first place, and all HDR stimuli look wrong, as if a HDR
signal is sent to the monitor (monitor confirms), but with SDR EOTF instead of a
HDR EOTF.

There's just no winning on Windows... But hey, it worked fine for a year, before
falling apart. What more can one want?
  • Loading branch information
kleinerm committed Nov 17, 2021
1 parent 8ff9c0e commit b30c6ef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions PsychSourceGL/Source/Common/PsychVulkanCore/PsychVulkan.c
Expand Up @@ -1099,6 +1099,10 @@ VkSurfaceFullScreenExclusiveInfoEXT fullscreenExclusiveInfo = {
void PsychInitFullScreenExlusiveStructs(PsychVulkanWindow* window)
{
fullscreenExclusiveInfoWin32.hmonitor = MonitorFromWindow(window->win32PrivateWindow, MONITOR_DEFAULTTOPRIMARY);
if (window->isFullscreen && !(window->createFlags & 0x2))
fullscreenExclusiveInfo.fullScreenExclusive = VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT;
else
fullscreenExclusiveInfo.fullScreenExclusive = VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT;
}

void PsychMSDXGIQueryOutputHDR(PsychVulkanWindow* window, PsychVulkanDevice* vulkan)
Expand Down

0 comments on commit b30c6ef

Please sign in to comment.