mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 18:10:11 +01:00
mesa: Require current libxcb.
Without that, people with buggy apps that looked at just the server string for GLX_ARB_create_context would call this function that just threw an error when you tried to make a context. Google shows plenty of complaints about this. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
f92873be2c
commit
6882381a2e
5 changed files with 2 additions and 53 deletions
21
configure.ac
21
configure.ac
|
|
@ -1030,29 +1030,12 @@ xyesno)
|
||||||
GL_PC_CFLAGS="$X11_INCLUDES"
|
GL_PC_CFLAGS="$X11_INCLUDES"
|
||||||
|
|
||||||
# XCB can only be used from pkg-config
|
# XCB can only be used from pkg-config
|
||||||
PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
|
PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx >= 1.8.1])
|
||||||
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
|
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
|
||||||
X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
|
X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
|
||||||
GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
|
GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check to see if the xcb-glx library is new enough to support
|
|
||||||
# GLX_ARB_create_context. This bit of hackery is necessary until XCB 1.8
|
|
||||||
# is released.
|
|
||||||
save_CPPFLAGS="$CPPFLAGS"
|
|
||||||
save_LDFLAGS="$LDFLAGS"
|
|
||||||
CPPFLAGS="$CPPFLAGS $X11_INCLUDES"
|
|
||||||
LDFLAGS="$LDFLAGS $GL_LIB_DEPS"
|
|
||||||
AC_CHECK_LIB(xcb-glx, xcb_glx_create_context_attribs_arb_checked,
|
|
||||||
[HAVE_XCB_GLX_CREATE_CONTEXT=yes],
|
|
||||||
[HAVE_XCB_GLX_CREATE_CONTEXT=no])
|
|
||||||
CPPFLAGS="$save_CPPFLAGS"
|
|
||||||
LDFLAGS="$save_LDFLAGS"
|
|
||||||
|
|
||||||
if test x$HAVE_XCB_GLX_CREATE_CONTEXT = xyes; then
|
|
||||||
X11_INCLUDES="$X11_INCLUDES -DHAVE_XCB_GLX_CREATE_CONTEXT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# need DRM libs, -lpthread, etc.
|
# need DRM libs, -lpthread, etc.
|
||||||
GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
|
GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
|
||||||
GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
|
GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
|
||||||
|
|
@ -1061,8 +1044,6 @@ esac
|
||||||
|
|
||||||
# This is outside the case (above) so that it is invoked even for non-GLX
|
# This is outside the case (above) so that it is invoked even for non-GLX
|
||||||
# builds.
|
# builds.
|
||||||
AM_CONDITIONAL(HAVE_XCB_GLX_CREATE_CONTEXT,
|
|
||||||
test x$HAVE_XCB_GLX_CREATE_CONTEXT = xyes)
|
|
||||||
AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
|
AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
|
||||||
|
|
||||||
GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
|
GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ __glX_send_client_info(struct glx_display *glx_dpy)
|
||||||
Bool any_screen_has_ARB_create_context = False;
|
Bool any_screen_has_ARB_create_context = False;
|
||||||
Bool any_screen_has_ARB_create_context_profile = False;
|
Bool any_screen_has_ARB_create_context_profile = False;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
#ifdef HAVE_XCB_GLX_CREATE_CONTEXT
|
|
||||||
static const uint32_t gl_versions[] = {
|
static const uint32_t gl_versions[] = {
|
||||||
1, 4,
|
1, 4,
|
||||||
};
|
};
|
||||||
|
|
@ -48,7 +47,6 @@ __glX_send_client_info(struct glx_display *glx_dpy)
|
||||||
};
|
};
|
||||||
static const char glx_extensions[] =
|
static const char glx_extensions[] =
|
||||||
"GLX_ARB_create_context GLX_ARB_create_context_profile";
|
"GLX_ARB_create_context GLX_ARB_create_context_profile";
|
||||||
#endif
|
|
||||||
|
|
||||||
/* There are three possible flavors of the client info structure that the
|
/* There are three possible flavors of the client info structure that the
|
||||||
* client could send to the server. The version sent depends on the
|
* client could send to the server. The version sent depends on the
|
||||||
|
|
@ -125,7 +123,6 @@ __glX_send_client_info(struct glx_display *glx_dpy)
|
||||||
* THE ORDER IS IMPORTANT. We want to send the most recent version of the
|
* THE ORDER IS IMPORTANT. We want to send the most recent version of the
|
||||||
* protocol that the server can support.
|
* protocol that the server can support.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_XCB_GLX_CREATE_CONTEXT
|
|
||||||
if (glx_dpy->majorVersion == 1 && glx_dpy->minorVersion == 4
|
if (glx_dpy->majorVersion == 1 && glx_dpy->minorVersion == 4
|
||||||
&& any_screen_has_ARB_create_context_profile) {
|
&& any_screen_has_ARB_create_context_profile) {
|
||||||
xcb_glx_set_client_info_2arb(c,
|
xcb_glx_set_client_info_2arb(c,
|
||||||
|
|
@ -148,9 +145,7 @@ __glX_send_client_info(struct glx_display *glx_dpy)
|
||||||
gl_versions,
|
gl_versions,
|
||||||
gl_extension_string,
|
gl_extension_string,
|
||||||
glx_extensions);
|
glx_extensions);
|
||||||
} else
|
} else {
|
||||||
#endif
|
|
||||||
{
|
|
||||||
xcb_glx_client_info(c,
|
xcb_glx_client_info(c,
|
||||||
GLX_MAJOR_VERSION, GLX_MINOR_VERSION,
|
GLX_MAJOR_VERSION, GLX_MINOR_VERSION,
|
||||||
gl_extension_length,
|
gl_extension_length,
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,6 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
|
||||||
* the protocol error and handle it. Part of handling the error is freeing
|
* the protocol error and handle it. Part of handling the error is freeing
|
||||||
* the possibly non-NULL value returned by this function.
|
* the possibly non-NULL value returned by this function.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_XCB_GLX_CREATE_CONTEXT
|
|
||||||
cookie =
|
cookie =
|
||||||
xcb_glx_create_context_attribs_arb_checked(c,
|
xcb_glx_create_context_attribs_arb_checked(c,
|
||||||
gc->xid,
|
gc->xid,
|
||||||
|
|
@ -111,19 +110,6 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
|
||||||
(const uint32_t *)
|
(const uint32_t *)
|
||||||
attrib_list);
|
attrib_list);
|
||||||
err = xcb_request_check(c, cookie);
|
err = xcb_request_check(c, cookie);
|
||||||
#else
|
|
||||||
/* This is a hugely ugly hack to make things compile on systems that lack
|
|
||||||
* the proper XCB version.
|
|
||||||
*/
|
|
||||||
memset(&cookie, 0, sizeof(cookie));
|
|
||||||
|
|
||||||
err = calloc(1, sizeof(*err));
|
|
||||||
err->error_code = BadRequest;
|
|
||||||
err->sequence = dpy->request;
|
|
||||||
err->resource_id = gc->xid;
|
|
||||||
err->minor_code = gc->majorOpcode;
|
|
||||||
err->major_code = 34;
|
|
||||||
#endif
|
|
||||||
if (err != NULL) {
|
if (err != NULL) {
|
||||||
gc->vtable->destroy(gc);
|
gc->vtable->destroy(gc);
|
||||||
gc = NULL;
|
gc = NULL;
|
||||||
|
|
|
||||||
|
|
@ -71,15 +71,9 @@ struct extension_info
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
static const struct extension_info known_glx_extensions[] = {
|
static const struct extension_info known_glx_extensions[] = {
|
||||||
#ifdef HAVE_XCB_GLX_CREATE_CONTEXT
|
|
||||||
{ GLX(ARB_create_context), VER(0,0), Y, N, N, N },
|
{ GLX(ARB_create_context), VER(0,0), Y, N, N, N },
|
||||||
{ GLX(ARB_create_context_profile), VER(0,0), Y, N, N, N },
|
{ GLX(ARB_create_context_profile), VER(0,0), Y, N, N, N },
|
||||||
{ GLX(ARB_create_context_robustness), VER(0,0), Y, N, N, N },
|
{ GLX(ARB_create_context_robustness), VER(0,0), Y, N, N, N },
|
||||||
#else
|
|
||||||
{ GLX(ARB_create_context), VER(0,0), N, N, N, N },
|
|
||||||
{ GLX(ARB_create_context_profile), VER(0,0), N, N, N, N },
|
|
||||||
{ GLX(ARB_create_context_robustness), VER(0,0), N, N, N, N },
|
|
||||||
#endif
|
|
||||||
{ GLX(ARB_get_proc_address), VER(1,4), Y, N, Y, N },
|
{ GLX(ARB_get_proc_address), VER(1,4), Y, N, Y, N },
|
||||||
{ GLX(ARB_multisample), VER(1,4), Y, Y, N, N },
|
{ GLX(ARB_multisample), VER(1,4), Y, Y, N, N },
|
||||||
{ GLX(ATI_pixel_format_float), VER(0,0), N, N, N, N },
|
{ GLX(ATI_pixel_format_float), VER(0,0), N, N, N, N },
|
||||||
|
|
@ -87,11 +81,7 @@ static const struct extension_info known_glx_extensions[] = {
|
||||||
{ GLX(EXT_visual_info), VER(0,0), Y, Y, N, N },
|
{ GLX(EXT_visual_info), VER(0,0), Y, Y, N, N },
|
||||||
{ GLX(EXT_visual_rating), VER(0,0), Y, Y, N, N },
|
{ GLX(EXT_visual_rating), VER(0,0), Y, Y, N, N },
|
||||||
{ GLX(EXT_framebuffer_sRGB), VER(0,0), Y, Y, N, N },
|
{ GLX(EXT_framebuffer_sRGB), VER(0,0), Y, Y, N, N },
|
||||||
#ifdef HAVE_XCB_GLX_CREATE_CONTEXT
|
|
||||||
{ GLX(EXT_create_context_es2_profile), VER(0,0), Y, N, N, Y },
|
{ GLX(EXT_create_context_es2_profile), VER(0,0), Y, N, N, Y },
|
||||||
#else
|
|
||||||
{ GLX(EXT_create_context_es2_profile), VER(0,0), N, N, N, N },
|
|
||||||
#endif
|
|
||||||
{ GLX(MESA_copy_sub_buffer), VER(0,0), Y, N, N, N },
|
{ GLX(MESA_copy_sub_buffer), VER(0,0), Y, N, N, N },
|
||||||
{ GLX(MESA_multithread_makecurrent),VER(0,0), Y, N, Y, N },
|
{ GLX(MESA_multithread_makecurrent),VER(0,0), Y, N, Y, N },
|
||||||
{ GLX(MESA_swap_control), VER(0,0), Y, N, N, Y },
|
{ GLX(MESA_swap_control), VER(0,0), Y, N, N, Y },
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ AM_CPPFLAGS = \
|
||||||
-I$(top_builddir)/include \
|
-I$(top_builddir)/include \
|
||||||
$(X11_CFLAGS)
|
$(X11_CFLAGS)
|
||||||
|
|
||||||
if HAVE_XCB_GLX_CREATE_CONTEXT
|
|
||||||
TESTS = glx-test
|
TESTS = glx-test
|
||||||
check_PROGRAMS = glx-test
|
check_PROGRAMS = glx-test
|
||||||
|
|
||||||
|
|
@ -20,5 +19,3 @@ glx_test_LDADD = \
|
||||||
$(top_builddir)/src/glx/libglx.la \
|
$(top_builddir)/src/glx/libglx.la \
|
||||||
$(top_builddir)/src/gtest/libgtest.la \
|
$(top_builddir)/src/gtest/libgtest.la \
|
||||||
-lpthread
|
-lpthread
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue