Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL reports it 'Can't find matching GLX visual' when requesting an sRGB capable framebuffer #1786

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.1
Reported for operating system, platform: Linux, x86_64

Comments on the original bug report:

On 2015-03-02 10:06:30 +0000, wrote:

I'm using Ubuntu Gnome 14.10, with Nvidia 550 TI and proprietary drivers.

Whenever I request SDL_GL_SetAttribute(SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1), I get "Can't find matching GLX visual" message on trying to create the window.

Thing is, that I DO get an sRGB capable OpenGL framebuffer on the machine, even if I don't explicitly request it.

I've also tested it on Windows and got an sRGB framebuffer there regardless of the state of SDL_GL_FRAMEBUFFER_SRGB_CAPABLE flag.

This bug impairs creation of cross-platform projects that require sRGB for proper display of color.

On 2015-03-04 06:09:12 +0000, Ryan C. Gordon wrote:

I remember hearing something about this. We'll look at this for 2.0.4.

--ryan.

On 2015-04-06 01:14:42 +0000, Ryan C. Gordon wrote:

Created attachment 2106
reproduction case

This program fails to make a GL context on X11 with Nvidia's proprietary drivers (prints "(nil)") It works on Intel's open source drivers, at least on this machine (prints a valid pointer address for the GL context).

--ryan.

On 2015-04-06 03:42:25 +0000, Ryan C. Gordon wrote:

Hmm, the Nvidia drivers don't like when you choose a visual with:

attribs[i++] = GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB;

...it instead wants...

attribs[i++] = GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB;
attribs[i++] = True;

(which appears to be incorrect, according to the GLX specification.)

Mesa seems to allow this, though, so I guess we'll just force that True item for now.

--ryan.

On 2015-04-06 04:08:04 +0000, Ryan C. Gordon wrote:

(In reply to Ryan C. Gordon from comment # 3)

Hmm, the Nvidia drivers don't like when you choose a visual with:

attribs[i++] = GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB;

...it instead wants...

attribs[i++] = GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB;
attribs[i++] = True;

(which appears to be incorrect, according to the GLX specification.)

Uh, wait, Mesa wants the same thing, maybe it was just more forgiving about picking a visual, or some other cosmic force stepped in.

http://cgit.freedesktop.org/mesa/mesa/tree/src/glx/glxext.c?id=5e59f895c468c1ac497ad925b8bddd7f227c89a2#n548

It's not clear to me where it says this attribute needs a "True" specified; other boolean items in the Mesa implementation don't do this (look for FETCH_OR_SET).

I'm confused. But at least the fix is easy now!

--ryan.

On 2015-04-06 04:15:51 +0000, Ryan C. Gordon wrote:

Oh well, this should be fixed now in http://hg.libsdl.org/SDL/rev/f5b468964b0b

--ryan.

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

No branches or pull requests

1 participant