-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sdl_glimp,tr_init: rewrite the original GL selection code, improve gf…
…xinfo :: sdl_glimp: rewrite the original GL selection code - Detect best configuration possible. - Try custom configuration if exists. - If no custom configuration or if it fails, load the recommended configuration if possible (OpenGL 3.2 core) or the best one available. - Reuse window and context when possible. - Display meaningful popup telling user OpenGL version is too low or required extensions are missing when that happens. - Rely on more return codes for GLimp_SetMode(). - Test for negative SDL_Init return value, not just -1. Request the best configuration possible so engine gfxinfo command tells the user what is supported by his hardware and driver even if the engine needs less. :: sdl_glimp,tr_init: rewrite logging, improve gfxinfo - Move GL query for logging purpose from tr_init to sdl_glimp. - Do not split MODE log message. - Unify some log. - Add more debug log when building GL extension list. - Also increase the extensions_string length to not truncate the string, 4096 is not enough, there can be more than 6000 characters on an OpenGL 4.6 driver. - Also log missing extensions to make gfxinfo more useful. - Rewrite gfxinfo in more useful way. - List enabled and missing GL extensions. :: sdl_glimp: silence the GL error when querying if context is core on non-core implementation - Silence the error that may happen when querying if the OpenGL context uses core profile when core profile is not supported by the OpenGL implementation to begin with. For example this may happen on implementations not supporting higher than OpenGL 2.1, while forcing OpenGL 2.1 on implementations supporting higher versions including core profiles may not raise an error. :: sdl_glimp: make GLimp_StartDriverAndSetMode only return true on RSERR_OK - Only return true on OK, don't return true on unknown errors. :: sdl_glimp: catch errors from GLimp_DetectAvailableModes to prevent further segfault It may be possible to create a valid context that is unusable. For example the 3840×2160 resolution is too large for the Radeon 9700 and the Mesa r300 driver may print this error when the requested resolution is higher than what is supported by hardware: > r300: Implementation error: Render targets are too big in r300_set_framebuffer_state, refusing to bind framebuffer state! It will unfortunately return a valid but unusable context that will make the engine segfault when calling GL_SetDefaultState(). :: sdl_glimp: flag fullscreen window as borderless when borderless is enabled Flag fullscreen window as borderless when borderless is enabled otherwise the window will be bordered when leaving fullscreen while the borderless option would be enabled. :: sdl_glimp,tr_init: do not test all OpenGL versions unless r_glExtendedValidation is set
- Loading branch information
Showing
6 changed files
with
1,142 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.