Add extra checks before querying gl calls for MSAA.#20923
Conversation
Prevents potential crash on startup.
cyrush
left a comment
There was a problem hiding this comment.
Looks good to me!
Are there other potentially other startup context race condition params?
It's a possibility, of course, but I think at least for querying the MSAA availablity, I think we are covered. With no config files (or config files with no rendering atts changed from default), when MSAAAvailable is called (opening rendering atts window or creating a plot), we call Make Current and that succeeds, then the query of GL_MAX_SAMPLES also succeeds. |
|
Per concerns discussed in the bug ticket between Mark and myself, going to hold off on this until after the 3.5.0 release so we have more time to explore possible gotchas with this approach. |
Prevents potential crash on startup.
@markcmiller86 had the initial idea of testing if OGL window was current before making the gl call.
I had the idea of adding a call to MakeCurrent.
These weren't quite sufficient, codex added the rest and cleaned up the logic.
Description
Resolves #20920.
Type of change
How Has This Been Tested?
Tested with no config files.
Tested with Config files with no rendering defaults changed.
Tested with config files with SR mode set to always
Tested with config file with antialiasing mode set to MSAA. (this no longer causes the crash, but antialising does not remain set to MSAA but rather, antialiasing gets turned off.)
On my Windows machine where MSAA should be available, it remains available in all these scenarios.
Reminders:
Checklist: