Windows always requests MSAA when creating an OpenGL context.
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 68
- Forks
- 82
- PR merge metrics
- No merged PRs in 30d
Description
You can see the problem here: https://github.com/racket/gui/blob/172b7d5a561b74375004decbb68a7ab471e2c53f/gui-lib/mred/private/wx/win32/gl-context.rkt#L300
If wglChoosePixelFormatARB is present on the system (which it will be for virtually everything), it will always be called with the WGL_SAMPLE_BUFFERS_ARB attribute set, even if the number of samples is set to zero. My machine happily accepts this, despite the number of MSAA samples requested being 0, and creates an MSAA target, greatly degrading rendering performance. My GPU is a nvidia 1060, driver version 460.89. This can be easily verified with Renderdoc, where the final framebuffer will be a Texture 2D MS.
I believe the correct behavior is simply omitting the WGL_SAMPLE_BUFFERS_ARB and WGL_SAMPLES_ARB parameters when the number of samples on the provided gl-config object is 0.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in gui-lib/mred/private/wx/win32/gl-context.rkt around line 300, where the Windows OpenGL pixel format is selected. Inspect the wglChoosePixelFormatARB attributes and use RenderDoc or an equivalent context check to compare zero-sample and multisample configurations. Done means a zero-sample gl-config no longer produces a multisampled framebuffer, while nonzero sample requests still work.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics, desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100