Skip to content

Commit

Permalink
EGLBE: Always expose GLX_EXT_framebuffer_sRGB
Browse files Browse the repository at this point in the history
... regardless of which EGL API version the underlying EGL
implementation supports.  Referring to
9882331, sRGB rendering is required by
the OpenGL 3.0 spec.  We can't support GLX_ARB_create_context* with EGL
1.4- because eglCreateContext() lacks the necessary attributes, but
nothing prevents us from supporting GLX_EXT_framebuffer_sRGB with any
EGL API version.  (Making that extension contingent upon EGL 1.5 was an
error on my part when I authored
9882331.)  This is known to affect
VMware Linux guests.

This commit also modifies GLXspheres so that it only checks for the
existence of GLX_EXT_framebuffer_sRGB if -srgb is specified.
  • Loading branch information
dcommander committed Jul 19, 2024
1 parent 50b07e0 commit 88d071c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ had previously been initialized on the 2D X server without VirtualGL.
other elements of the Firefox browser window to disappear when the window was
resized.

10. Fixed an issue in the EGL back end whereby `GLX_EXT_framebuffer_sRGB` was
not added to the list of extensions returned by
`glXGetClientString(..., GLX_EXTENSIONS)`, `glXQueryExtensionsString()`, or
`glXQueryServerString(..., GLX_EXTENSIONS)` unless the underlying EGL
implementation supported v1.5 or later of the EGL API.


3.0.2
=====
Expand Down
2 changes: 1 addition & 1 deletion demos/glxspheres.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ int main(int argc, char **argv)
rgbAttribs[19] = 32 - bpc * 3;
}

if(!GLX_EXTENSION_EXISTS(GLX_EXT_framebuffer_sRGB))
if(useSRGB && !GLX_EXTENSION_EXISTS(GLX_EXT_framebuffer_sRGB))
THROW("GLX_EXT_framebuffer_sRGB extension is not available");

c = glXChooseFBConfig(dpy, screen, rgbAttribs, &n);
Expand Down
7 changes: 5 additions & 2 deletions server/faker-glx.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C)2004 Landmark Graphics Corporation
// Copyright (C)2005, 2006 Sun Microsystems, Inc.
// Copyright (C)2009, 2011-2023 D. R. Commander
// Copyright (C)2009, 2011-2024 D. R. Commander
//
// This library is free software and may be redistributed and/or modified under
// the terms of the wxWindows Library License, Version 3.1 or (at your option)
Expand Down Expand Up @@ -866,7 +866,10 @@ static const char *getGLXExtensions(void)
if((faker::eglMajor > 1 || (faker::eglMajor == 1 && faker::eglMinor >= 5))
&& !strstr(glxextensions, "GLX_ARB_create_context"))
strncat(glxextensions,
" GLX_ARB_create_context GLX_ARB_create_context_profile GLX_EXT_framebuffer_sRGB",
" GLX_ARB_create_context GLX_ARB_create_context_profile",
1023 - strlen(glxextensions));
if(!strstr(glxextensions, "GLX_EXT_framebuffer_sRGB"))
strncat(glxextensions, " GLX_EXT_framebuffer_sRGB",
1023 - strlen(glxextensions));
return glxextensions;
}
Expand Down

0 comments on commit 88d071c

Please sign in to comment.