I have a game using vulkan running on Ubuntu 22.04 that looks to see if Display.displays.Length is greater than 1 and activates the second display if it finds it. The second display is a touchscreen display that supports touch there in case that is relevant. I have everything working - both screen work great with vulkan and can maintain 60fps with mutiple displays and everything is running well.
If I disconnect the second display Unity will not get past the splash screen and never makes it to any of my code. I don’t think it even launches the first scene that I can tell - none of my awake methods log out. If I plug the second monitor in then it will proceed - even if I hot plugged it in it will just start running again. It feels like something is cached somewhere that tells Unity that it had two screens last time and it will just sit there waiting for the second screen to show up. I want it to just continue on with only the one screen and my game will handle that, but it just hangs.
My current workaround is to build with support for both opengl & vulkan. Then I check in a shell script to see if the display count is > 1 and then launch it with vulkan otherwise launch it with opengl and that works, but is not a real solution. I tried deleteing the persistant folder, the /tmp folder and completely re-copying the game to my system but if it ever started with 2 monitors it will never start with only one again that I can see.
I am currently using 2021.3.8f1 (stuck here because of an audio bug). The last entry I see in the Player.log is usually this or the next one:
“InitializeOrResetSwapChain 1080x1920 hdr=0 samples=1”
“Desktop is 1080 x 1920 @ 60 Hz”
But I never get to the what is typically after those:
“UnloadTime: 0.804973 ms”
I feel like there must be caching going on somewhere with vulkan that isn’t the /tmp or persistent data path, but I am not having much luck gooogling it. I marked it as a bug as I have a hard time believing this is intended behavior and I am betting this is not a common use case.
Any assistance would be greatly appreciated.