Closed dor666 closed 3 years ago
This issue occurs if the game tries to render to a window of a size that extends the actual screen - glitches are just uncleared image areas (this is disabled by default and can be toggled via vk_clear
command). I never bothered looking into it seeing that OpenGL also doesn't handle situations like these too well (fov and positioning is incorrect). This doesn't impact normal usage, so there's little benefit in spending time on getting this fixed. I'll be happy to accept PRs if you feel like playing around with the code here.
Rotating a screen causes corruptions like this on Intel:
on NVidia black parts instead of corruptions:
Game is unplayable then (view is stretched, hud not)
To reproduce if you do not have laptop with automatic screen rotation:
Download MultiMonitorTool
Create two shortcuts to executable, one rotating, and one resetting: Here assuming your display is named \.\DISPLAY1 ( you can verify it in MultiMonitorTool GUI)
MultiMonitorTool.exe /SetOrientation \.\DISPLAY1 90 MultiMonitorTool.exe /SetOrientation \.\DISPLAY1 0
Attach shortcuts as firsts icons on taskbar ( this will make them available at Win+1 and Win+2 hotkeys)
Launch a game
Make sure in video options, that exclusive fullscreen and fullscreen are disabled.
Rotate screen with hotkey
Click anywhere in game window.
Game will recreate swapchain (due to VK_SUBOPTIMAL_KHR or VK_ERROR_OUT_OF_DATE_KHR)
Now you will see stretched image with corruptions(intel), black part(nvidia).
Using WindowInspector, I see that after rotating screen. Client Rect is rotated too: Looking at source, I don't see a place where rotating of window happens, and I don't see such rotation in apps like vkCube.
Using renderdoc, I see that corruptions/black parts are never cleared/drawn.
After rotating back and clicking at game window. Swapchain is recreated correctly.
Feel free to close the issue if you feel impact is too low. I'm curious why clientRect gets rotated too.