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

Game startup and shutdown fixes #849

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

SRSaunders
Copy link

@SRSaunders SRSaunders commented Jan 20, 2024

Possibly fixes #844, but not yet confirmed.

I have decided to push this anyways since it fixes known issues with game startup and shutdown:

  1. Windows only: Fixes issues for non-contiguous display numbers caused by having multiple display adaptors installed with active desktop monitors plugged into each one. This can result in display numbering gaps representing unused outputs on the display cards (or even internal iGPUs). Allows display selection menu to work properly in this circumstance. Also removes assumption that display 1 is always defined and available. Not an issue with a single display adaptor with multiple monitors on Windows, or with any combo for SDL on Linux or macOS.
  2. Windows only: Fixes edge conditions with determining the pimary display and the maximum display number. Added code to fall back to minimum active display if primary display not found. According to Windows forums this can happen rarely on some PC configs, and could result in startup failures in windowed-mode with previous code.
  3. Windows only: Moved display mode reset code from DestroyDeviceAndSwapChain() to GLimp_Shutdown() for better error recovery. Windowing shutdown code retained in DestroyDeviceAndSwapChain().
  4. Windows only: Removed and/or commented out some redundant/unused code in DeviceManager_DX12.cpp
  5. All Platforms: Made safeMode more robust for startup display mode selection and error recovery.
  6. All Platforms: Fixed Shutdown() code to wait on nvrhi device idle vs. GL_BlockingSwapBuffers() which was an OpenGL holdover. Waiting on device idle is more robust for slow renderers which otherwise can complain about vertexCache.Shutdown() causing missing resources if queues are not empty and rendering is not completely finished.
  7. All Platforms: Fixed a bunch of status and error messages to be more relevant to the nvrhi code base vs. OpenGL.

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

Successfully merging this pull request may close these issues.

Unable to initialize OpenGL, render device is null
1 participant