Windows always requests MSAA when creating an OpenGL context.

Open Beginner friendly
#235 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale

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.

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.

Dominant language
Racket
Stars
68
Forks
83
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from racket/gui

All issues in racket/gui

Similar issues

More Computer Graphics issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.