Skip to content

Add extra checks before querying gl calls for MSAA.#20923

Draft
biagas wants to merge 1 commit into
developfrom
bugfix/biagas/fix_startup_crash_MSAA
Draft

Add extra checks before querying gl calls for MSAA.#20923
biagas wants to merge 1 commit into
developfrom
bugfix/biagas/fix_startup_crash_MSAA

Conversation

@biagas

@biagas biagas commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

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

  • Bug fix~~
  • New feature~~
  • Documentation update~~
  • Other~~

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:

  • Please follow the style guidelines of this project.
  • Please perform a self-review of your code before submitting a PR and asking others to review it.
  • Please assign reviewers (see VisIt's PR procedures for more information).

Checklist:

  • I have commented my code where applicable.~~
  • I have updated the release notes.~~
  • I have made corresponding changes to the documentation.~~
  • I have added debugging support to my changes.~~
  • I have added tests that prove my fix is effective or that my feature works.~~
  • I have confirmed new and existing unit tests pass locally with my changes.~~
  • I have added new baselines for any new tests to the repo.~~
  • I have NOT made any changes to protocol or public interfaces in an RC branch.~~

Prevents potential crash on startup.
@biagas biagas requested review from cyrush and markcmiller86 April 17, 2026 22:09

@cyrush cyrush left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Are there other potentially other startup context race condition params?

@biagas

biagas commented Apr 17, 2026

Copy link
Copy Markdown
Contributor Author

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.
On my Windows machine, when config file has SR set to always, first time MSAAAvailable is called, we call MakeCurrent, but it doesn't actually make the window current, so we return false.
The second time it is called, the window is current and other checks succeed, so we query GL_MAX_SAMPLES successfully.

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.

@biagas

biagas commented Apr 18, 2026

Copy link
Copy Markdown
Contributor Author

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.
For 3.5 I will create a new PR that disables MMSA for now.

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.

3.5.0 viewer crashes on startup when scalable rendering is set to always

2 participants