summaryrefslogtreecommitdiff
path: root/lib/mesa/src/glx
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2022-02-24 01:57:18 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2022-02-24 01:57:18 +0000
commitb24b5b9049e889ee4eb39b565bcc8d48bd45ab48 (patch)
tree658ca4e6b41655f49463c85edbaeda48979c394c /lib/mesa/src/glx
parent57768bbb154c2879d34ec20e401b19472e77aaf7 (diff)
Import Mesa 21.3.7
Diffstat (limited to 'lib/mesa/src/glx')
-rw-r--r--lib/mesa/src/glx/apple/apple_glx_context.c3
-rw-r--r--lib/mesa/src/glx/apple/apple_glx_log.c17
-rw-r--r--lib/mesa/src/glx/apple/apple_glx_pbuffer.c17
-rw-r--r--lib/mesa/src/glx/apple/meson.build2
-rw-r--r--lib/mesa/src/glx/applegl_glx.c3
-rw-r--r--lib/mesa/src/glx/clientattrib.c17
-rw-r--r--lib/mesa/src/glx/clientinfo.c8
-rw-r--r--lib/mesa/src/glx/create_context.c48
-rw-r--r--lib/mesa/src/glx/dri_common.h24
-rw-r--r--lib/mesa/src/glx/driwindows_glx.c2
-rw-r--r--lib/mesa/src/glx/glx_error.c4
-rw-r--r--lib/mesa/src/glx/glx_query.c4
-rw-r--r--lib/mesa/src/glx/glxcurrent.c34
-rw-r--r--lib/mesa/src/glx/glxext.c138
-rw-r--r--lib/mesa/src/glx/glxextensions.c559
-rw-r--r--lib/mesa/src/glx/indirect_glx.c27
-rw-r--r--lib/mesa/src/glx/single2.c46
-rw-r--r--lib/mesa/src/glx/tests/clientinfo_unittest.cpp4
-rw-r--r--lib/mesa/src/glx/tests/create_context_unittest.cpp9
-rw-r--r--lib/mesa/src/glx/tests/indirect_api.cpp2
-rw-r--r--lib/mesa/src/glx/tests/meson.build4
21 files changed, 377 insertions, 595 deletions
diff --git a/lib/mesa/src/glx/apple/apple_glx_context.c b/lib/mesa/src/glx/apple/apple_glx_context.c
index ff66ed499..d80385b2a 100644
--- a/lib/mesa/src/glx/apple/apple_glx_context.c
+++ b/lib/mesa/src/glx/apple/apple_glx_context.c
@@ -183,8 +183,7 @@ apple_glx_create_context(void **ptr, Display * dpy, int screen,
*x11errorptr = false;
}
- if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false))
- fprintf(stderr, "error: %s\n", apple_cgl.error_string(error));
+ DebugMessageF("error: %s\n", apple_cgl.error_string(error));
return true;
}
diff --git a/lib/mesa/src/glx/apple/apple_glx_log.c b/lib/mesa/src/glx/apple/apple_glx_log.c
index ea39d3095..d95d18dd9 100644
--- a/lib/mesa/src/glx/apple/apple_glx_log.c
+++ b/lib/mesa/src/glx/apple/apple_glx_log.c
@@ -35,17 +35,13 @@
#include <stdlib.h>
#include <inttypes.h>
#include <pthread.h>
+#include "glxclient.h"
#include "apple_glx_log.h"
#include "util/debug.h"
-static bool diagnostic = false;
static aslclient aslc;
void apple_glx_log_init(void) {
- if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
- diagnostic = true;
- }
-
aslc = asl_open(NULL, NULL, 0);
}
@@ -90,15 +86,8 @@ void _apple_glx_vlog(int level, const char *file, const char *function,
#endif
}
- if (diagnostic) {
- va_list args2;
- va_copy(args2, args);
-
- fprintf(stderr, "%-9s %24s:%-4d %s(%"PRIu64"): ",
- _asl_level_string(level), file, line, function, thread);
- vfprintf(stderr, fmt, args2);
- va_end(args2);
- }
+ DebugMessageF("%-9s %24s:%-4d %s(%"PRIu64"): ",
+ _asl_level_string(level), file, line, function, thread);
msg = asl_new(ASL_TYPE_MSG);
if (msg) {
diff --git a/lib/mesa/src/glx/apple/apple_glx_pbuffer.c b/lib/mesa/src/glx/apple/apple_glx_pbuffer.c
index 8c94d2010..e97e29323 100644
--- a/lib/mesa/src/glx/apple/apple_glx_pbuffer.c
+++ b/lib/mesa/src/glx/apple/apple_glx_pbuffer.c
@@ -44,6 +44,7 @@
#include <stdlib.h>
#include <pthread.h>
#include <assert.h>
+#include "glxclient.h"
#include "apple_glx.h"
#include "glxconfig.h"
#include "apple_cgl.h"
@@ -210,10 +211,8 @@ get_max_size(int *widthresult, int *heightresult)
err = apple_cgl.choose_pixel_format(attr, &pfobj, &vsref);
if (kCGLNoError != err) {
- if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
- printf("choose_pixel_format error in %s: %s\n", __func__,
- apple_cgl.error_string(err));
- }
+ DebugMessageF("choose_pixel_format error in %s: %s\n", __func__,
+ apple_cgl.error_string(err));
return true;
}
@@ -222,10 +221,8 @@ get_max_size(int *widthresult, int *heightresult)
err = apple_cgl.create_context(pfobj, NULL, &newcontext);
if (kCGLNoError != err) {
- if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
- printf("create_context error in %s: %s\n", __func__,
- apple_cgl.error_string(err));
- }
+ DebugMessageF("create_context error in %s: %s\n", __func__,
+ apple_cgl.error_string(err));
apple_cgl.destroy_pixel_format(pfobj);
@@ -235,8 +232,8 @@ get_max_size(int *widthresult, int *heightresult)
err = apple_cgl.set_current_context(newcontext);
if (kCGLNoError != err) {
- printf("set_current_context error in %s: %s\n", __func__,
- apple_cgl.error_string(err));
+ DebugMessageF("set_current_context error in %s: %s\n", __func__,
+ apple_cgl.error_string(err));
return true;
}
diff --git a/lib/mesa/src/glx/apple/meson.build b/lib/mesa/src/glx/apple/meson.build
index 86c4c7636..f88c22de6 100644
--- a/lib/mesa/src/glx/apple/meson.build
+++ b/lib/mesa/src/glx/apple/meson.build
@@ -54,7 +54,7 @@ endif
libappleglx = static_library(
'glxapple',
[files_libappleglx, glapitable_h],
- include_directories: [inc_mesa, inc_glx, inc_src, inc_include, inc_glapi],
+ include_directories: [inc_mesa, inc_glx, inc_src, inc_include, inc_glapi, inc_loader],
dependencies: [dep_xext, dep_xplugin],
gnu_symbol_visibility : 'hidden',
build_by_default: false,
diff --git a/lib/mesa/src/glx/applegl_glx.c b/lib/mesa/src/glx/applegl_glx.c
index fed7b9f66..d6bf6c165 100644
--- a/lib/mesa/src/glx/applegl_glx.c
+++ b/lib/mesa/src/glx/applegl_glx.c
@@ -130,6 +130,9 @@ applegl_create_context(struct glx_screen *psc,
/* TODO: Integrate this with apple_glx_create_context and make
* struct apple_glx_context inherit from struct glx_context. */
+ if (!config)
+ return NULL;
+
gc = calloc(1, sizeof(*gc));
if (gc == NULL)
return NULL;
diff --git a/lib/mesa/src/glx/clientattrib.c b/lib/mesa/src/glx/clientattrib.c
index 37f14c541..181ad0604 100644
--- a/lib/mesa/src/glx/clientattrib.c
+++ b/lib/mesa/src/glx/clientattrib.c
@@ -129,20 +129,3 @@ __indirect_glPopClientAttrib(void)
}
}
#endif
-
-void
-__glFreeAttributeState(struct glx_context * gc)
-{
- __GLXattribute *sp, **spp;
-
- for (spp = &gc->attributes.stack[0];
- spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; spp++) {
- sp = *spp;
- if (sp) {
- free((char *) sp);
- }
- else {
- break;
- }
- }
-}
diff --git a/lib/mesa/src/glx/clientinfo.c b/lib/mesa/src/glx/clientinfo.c
index aed261988..9ea7cb2d8 100644
--- a/lib/mesa/src/glx/clientinfo.c
+++ b/lib/mesa/src/glx/clientinfo.c
@@ -96,7 +96,7 @@ __glX_send_client_info(struct glx_display *glx_dpy)
/* There are three possible flavors of the client info structure that the
* client could send to the server. The version sent depends on the
* combination of GLX versions and extensions supported by the client and
- * the server.
+ * the server. This client only supports GLX major version 1.
*
* Server supports Client sends
* ----------------------------------------------------------------------
@@ -117,7 +117,7 @@ __glX_send_client_info(struct glx_display *glx_dpy)
* requirement in this case does not seem like a limitation.
*/
- if (glx_dpy->majorVersion == 1 && glx_dpy->minorVersion == 0)
+ if (glx_dpy->minorVersion == 0)
return;
/* Determine whether any screen on the server supports either of the
@@ -170,7 +170,7 @@ __glX_send_client_info(struct glx_display *glx_dpy)
* THE ORDER IS IMPORTANT. We want to send the most recent version of the
* protocol that the server can support.
*/
- if (glx_dpy->majorVersion == 1 && glx_dpy->minorVersion == 4
+ if (glx_dpy->minorVersion == 4
&& any_screen_has_ARB_create_context_profile) {
xcb_glx_set_client_info_2arb(c,
GLX_MAJOR_VERSION, GLX_MINOR_VERSION,
@@ -181,7 +181,7 @@ __glX_send_client_info(struct glx_display *glx_dpy)
gl_versions_profiles,
gl_extension_string,
glx_extensions);
- } else if (glx_dpy->majorVersion == 1 && glx_dpy->minorVersion == 4
+ } else if (glx_dpy->minorVersion == 4
&& any_screen_has_ARB_create_context) {
xcb_glx_set_client_info_arb(c,
GLX_MAJOR_VERSION, GLX_MINOR_VERSION,
diff --git a/lib/mesa/src/glx/create_context.c b/lib/mesa/src/glx/create_context.c
index 2709c995c..7e1cec98c 100644
--- a/lib/mesa/src/glx/create_context.c
+++ b/lib/mesa/src/glx/create_context.c
@@ -33,6 +33,14 @@
#error This code requires sizeof(uint32_t) == sizeof(int).
#endif
+/* An "Atrribs/Attribs" typo was fixed in glxproto.h in Nov 2014.
+ * This is in case we don't have the updated header.
+ */
+#if !defined(X_GLXCreateContextAttribsARB) && \
+ defined(X_GLXCreateContextAtrribsARB)
+#define X_GLXCreateContextAttribsARB X_GLXCreateContextAtrribsARB
+#endif
+
_X_HIDDEN GLXContext
glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
GLXContext share_context, Bool direct,
@@ -48,20 +56,11 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
xcb_void_cookie_t cookie;
unsigned dummy_err = 0;
uint32_t xid, share_xid;
+ int screen = -1;
- if (dpy == NULL || cfg == NULL)
+ if (dpy == NULL)
return NULL;
- /* This means that either the caller passed the wrong display pointer or
- * one of the internal GLX data structures (probably the fbconfig) has an
- * error. There is nothing sensible to do, so return an error.
- */
- psc = GetGLXScreenConfigs(dpy, cfg->screen);
- if (psc == NULL)
- return NULL;
-
- assert(cfg->screen == psc->scr);
-
/* Count the number of attributes specified by the application. All
* attributes appear in pairs, except the terminating None.
*/
@@ -70,6 +69,29 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
/* empty */ ;
}
+ if (cfg) {
+ screen = cfg->screen;
+ } else {
+ for (unsigned int i = 0; i < num_attribs; i++) {
+ if (attrib_list[i * 2] == GLX_SCREEN)
+ screen = attrib_list[i * 2 + 1];
+ }
+ if (screen == -1) {
+ __glXSendError(dpy, BadValue, 0, X_GLXCreateContextAttribsARB, True);
+ return NULL;
+ }
+ }
+
+ /* This means that either the caller passed the wrong display pointer or
+ * one of the internal GLX data structures (probably the fbconfig) has an
+ * error. There is nothing sensible to do, so return an error.
+ */
+ psc = GetGLXScreenConfigs(dpy, screen);
+ if (psc == NULL)
+ return NULL;
+
+ assert(screen == psc->scr);
+
if (direct && psc->vtable->create_context_attribs) {
/* GLX drops the error returned by the driver. The expectation is that
* an error will also be returned by the server. The server's error
@@ -104,8 +126,8 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
cookie =
xcb_glx_create_context_attribs_arb_checked(c,
xid,
- cfg->fbconfigID,
- cfg->screen,
+ cfg ? cfg->fbconfigID : 0,
+ screen,
share_xid,
gc ? gc->isDirect : direct,
num_attribs,
diff --git a/lib/mesa/src/glx/dri_common.h b/lib/mesa/src/glx/dri_common.h
index 364ca3faa..455e8541e 100644
--- a/lib/mesa/src/glx/dri_common.h
+++ b/lib/mesa/src/glx/dri_common.h
@@ -63,20 +63,22 @@ driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable);
extern void
driReleaseDrawables(struct glx_context *gc);
-extern void dri_message(int level, const char *f, ...) PRINTFLIKE(2, 3);
-
-#define InfoMessageF(...) dri_message(_LOADER_INFO, __VA_ARGS__)
-#define ErrorMessageF(...) dri_message(_LOADER_WARNING, __VA_ARGS__)
-#define CriticalErrorMessageF(...) dri_message(_LOADER_FATAL, __VA_ARGS__)
-
extern const __DRIextension **driOpenDriver(const char *driverName,
void **out_driver_handle);
-extern bool
-dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs,
- unsigned *major_ver, unsigned *minor_ver,
- uint32_t *render_type, uint32_t *flags, unsigned *api,
- int *reset, int *release, unsigned *error);
+struct dri_ctx_attribs {
+ unsigned major_ver;
+ unsigned minor_ver;
+ uint32_t render_type;
+ uint32_t flags;
+ unsigned api;
+ int reset;
+ int release;
+};
+
+extern int
+dri_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs,
+ struct dri_ctx_attribs *dca);
extern bool
dri2_check_no_error(uint32_t flags, struct glx_context *share_context,
diff --git a/lib/mesa/src/glx/driwindows_glx.c b/lib/mesa/src/glx/driwindows_glx.c
index 6a76a4d35..496de0c73 100644
--- a/lib/mesa/src/glx/driwindows_glx.c
+++ b/lib/mesa/src/glx/driwindows_glx.c
@@ -200,7 +200,7 @@ driwindows_create_context_attribs(struct glx_screen *base,
identical values, so far
*/
- if (!psc->base.driScreen)
+ if (!psc->base.driScreen || !config_base)
return NULL;
/* Check the renderType value */
diff --git a/lib/mesa/src/glx/glx_error.c b/lib/mesa/src/glx/glx_error.c
index 653cbeb2d..a85ba0646 100644
--- a/lib/mesa/src/glx/glx_error.c
+++ b/lib/mesa/src/glx/glx_error.c
@@ -51,13 +51,13 @@ __glXSendError(Display * dpy, int_fast8_t errorCode, uint_fast32_t resourceID,
error.errorCode = errorCode;
}
else {
- error.errorCode = glx_dpy->codes->first_error + errorCode;
+ error.errorCode = glx_dpy->codes.first_error + errorCode;
}
error.sequenceNumber = dpy->request;
error.resourceID = resourceID;
error.minorCode = minorCode;
- error.majorCode = glx_dpy->majorOpcode;
+ error.majorCode = glx_dpy->codes.major_opcode;
_XError(dpy, &error);
diff --git a/lib/mesa/src/glx/glx_query.c b/lib/mesa/src/glx/glx_query.c
index 14e6f7c1c..ce563ef86 100644
--- a/lib/mesa/src/glx/glx_query.c
+++ b/lib/mesa/src/glx/glx_query.c
@@ -40,7 +40,7 @@
* Exchange a protocol request for glXQueryServerString.
*/
char *
-__glXQueryServerString(Display * dpy, int opcode, CARD32 screen, CARD32 name)
+__glXQueryServerString(Display * dpy, CARD32 screen, CARD32 name)
{
xcb_connection_t *c = XGetXCBConnection(dpy);
xcb_glx_query_server_string_reply_t *reply =
@@ -67,7 +67,7 @@ __glXQueryServerString(Display * dpy, int opcode, CARD32 screen, CARD32 name)
* Exchange a protocol request for glGetString.
*/
char *
-__glXGetString(Display * dpy, int opcode, CARD32 contextTag, CARD32 name)
+__glXGetString(Display * dpy, CARD32 contextTag, CARD32 name)
{
xcb_connection_t *c = XGetXCBConnection(dpy);
xcb_glx_get_string_reply_t *reply = xcb_glx_get_string_reply(c,
diff --git a/lib/mesa/src/glx/glxcurrent.c b/lib/mesa/src/glx/glxcurrent.c
index a388df7a7..ffc7c3c76 100644
--- a/lib/mesa/src/glx/glxcurrent.c
+++ b/lib/mesa/src/glx/glxcurrent.c
@@ -76,8 +76,7 @@ _X_HIDDEN pthread_mutex_t __glXmutex = PTHREAD_MUTEX_INITIALIZER;
* \b never be \c NULL. This is important! Because of this
* \c __glXGetCurrentContext can be implemented as trivial macro.
*/
-__thread void *__glX_tls_Context __attribute__ ((tls_model("initial-exec")))
- = &dummyContext;
+__THREAD_INITIAL_EXEC void *__glX_tls_Context = &dummyContext;
_X_HIDDEN void
__glXSetCurrentContext(struct glx_context * c)
@@ -172,7 +171,8 @@ glXGetCurrentDrawable(void)
*/
static Bool
MakeContextCurrent(Display * dpy, GLXDrawable draw,
- GLXDrawable read, GLXContext gc_user)
+ GLXDrawable read, GLXContext gc_user,
+ int opcode)
{
struct glx_context *gc = (struct glx_context *) gc_user;
struct glx_context *oldGC = __glXGetCurrentContext();
@@ -197,7 +197,7 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
/* can't have only one be 0 */
if (!!draw != !!read) {
__glXUnlock();
- __glXSendError(dpy, BadMatch, None, X_GLXMakeContextCurrent, True);
+ __glXSendError(dpy, BadMatch, None, opcode, True);
return False;
}
@@ -220,8 +220,7 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
if (gc->vtable->bind(gc, oldGC, draw, read) != Success) {
__glXSetCurrentContextNull();
__glXUnlock();
- __glXSendError(dpy, GLXBadContext, None, X_GLXMakeContextCurrent,
- False);
+ __glXSendError(dpy, GLXBadContext, None, opcode, False);
return GL_FALSE;
}
@@ -248,19 +247,22 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
return GL_TRUE;
}
-
_GLX_PUBLIC Bool
glXMakeCurrent(Display * dpy, GLXDrawable draw, GLXContext gc)
{
- return MakeContextCurrent(dpy, draw, draw, gc);
+ return MakeContextCurrent(dpy, draw, draw, gc, X_GLXMakeCurrent);
}
-_GLX_PUBLIC
-GLX_ALIAS(Bool, glXMakeCurrentReadSGI,
- (Display * dpy, GLXDrawable d, GLXDrawable r, GLXContext ctx),
- (dpy, d, r, ctx), MakeContextCurrent)
+_GLX_PUBLIC Bool
+glXMakeContextCurrent(Display *dpy, GLXDrawable d, GLXDrawable r,
+ GLXContext ctx)
+{
+ return MakeContextCurrent(dpy, d, r, ctx, X_GLXMakeContextCurrent);
+}
-_GLX_PUBLIC
-GLX_ALIAS(Bool, glXMakeContextCurrent,
- (Display * dpy, GLXDrawable d, GLXDrawable r,
- GLXContext ctx), (dpy, d, r, ctx), MakeContextCurrent)
+_GLX_PUBLIC Bool
+glXMakeCurrentReadSGI(Display *dpy, GLXDrawable d, GLXDrawable r,
+ GLXContext ctx)
+{
+ return MakeContextCurrent(dpy, d, r, ctx, X_GLXvop_MakeCurrentReadSGI);
+}
diff --git a/lib/mesa/src/glx/glxext.c b/lib/mesa/src/glx/glxext.c
index 903a5441d..8930e866f 100644
--- a/lib/mesa/src/glx/glxext.c
+++ b/lib/mesa/src/glx/glxext.c
@@ -39,6 +39,7 @@
#include <assert.h>
#include <stdbool.h>
+#include <stdarg.h>
#include "glxclient.h"
#include <X11/extensions/Xext.h>
@@ -71,9 +72,29 @@
#define __GLX_TOTAL_CONFIG \
(__GLX_MIN_CONFIG_PROPS + 2 * __GLX_EXT_CONFIG_PROPS)
-#ifdef DEBUG
-void __glXDumpDrawBuffer(struct glx_context * ctx);
-#endif
+_X_HIDDEN void
+glx_message(int level, const char *f, ...)
+{
+ va_list args;
+ int threshold = _LOADER_WARNING;
+ const char *libgl_debug;
+
+ libgl_debug = getenv("LIBGL_DEBUG");
+ if (libgl_debug) {
+ if (strstr(libgl_debug, "quiet"))
+ threshold = _LOADER_FATAL;
+ else if (strstr(libgl_debug, "verbose"))
+ threshold = _LOADER_DEBUG;
+ }
+
+ /* Note that the _LOADER_* levels are lower numbers for more severe. */
+ if (level <= threshold) {
+ fprintf(stderr, "libGL%s: ", level <= _LOADER_WARNING ? " error" : "");
+ va_start(args, f);
+ vfprintf(stderr, f, args);
+ va_end(args);
+ }
+}
/*
** You can set this cell to 1 to force the gl drawing stuff to be
@@ -129,7 +150,7 @@ __glXWireToEvent(Display *dpy, XEvent *event, xEvent *wire)
if (glx_dpy == NULL)
return False;
- switch ((wire->u.u.type & 0x7f) - glx_dpy->codes->first_event) {
+ switch ((wire->u.u.type & 0x7f) - glx_dpy->codes.first_event) {
case GLX_PbufferClobber:
{
GLXPbufferClobberEvent *aevent = (GLXPbufferClobberEvent *)event;
@@ -259,8 +280,6 @@ glx_display_free(struct glx_display *priv)
}
FreeScreenConfigs(priv);
- free((char *) priv->serverGLXvendor);
- free((char *) priv->serverGLXversion);
__glxHashDestroy(priv->glXDrawHash);
@@ -596,27 +615,14 @@ __glXInitializeVisualConfigFromTags(struct glx_config * config, int count,
case None:
i = count;
break;
- default:
- if(env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
- long int tagvalue = *bp++;
- fprintf(stderr, "WARNING: unknown GLX tag from server: "
- "tag 0x%lx value 0x%lx\n", tag, tagvalue);
- } else {
- /* Ignore the unrecognized tag's value */
- bp++;
+ default: {
+ long int tagvalue = *bp++;
+ DebugMessageF("WARNING: unknown fbconfig attribute from server: "
+ "tag 0x%lx value 0x%lx\n", tag, tagvalue);
+ break;
}
- break;
}
}
-
- /* The GLX_ARB_fbconfig_float spec says:
- *
- * "Note that floating point rendering is only supported for
- * GLXPbuffer drawables."
- */
- if (config->renderType &
- (GLX_RGBA_FLOAT_BIT_ARB|GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT))
- config->drawableType &= GLX_PBUFFER_BIT;
}
static struct glx_config *
@@ -685,7 +691,7 @@ getVisualConfigs(struct glx_screen *psc,
psc->visuals = NULL;
GetReq(GLXGetVisualConfigs, req);
- req->reqType = priv->majorOpcode;
+ req->reqType = priv->codes.major_opcode;
req->glxCode = X_GLXGetVisualConfigs;
req->screen = screen;
@@ -703,7 +709,7 @@ getVisualConfigs(struct glx_screen *psc,
}
static GLboolean
- getFBConfigs(struct glx_screen *psc, struct glx_display *priv, int screen)
+getFBConfigs(struct glx_screen *psc, struct glx_display *priv, int screen)
{
xGLXGetFBConfigsReq *fb_req;
xGLXGetFBConfigsSGIXReq *sgi_req;
@@ -711,8 +717,7 @@ static GLboolean
xGLXGetFBConfigsReply reply;
Display *dpy = priv->dpy;
- psc->serverGLXexts =
- __glXQueryServerString(dpy, priv->majorOpcode, screen, GLX_EXTENSIONS);
+ psc->serverGLXexts = __glXQueryServerString(dpy, screen, GLX_EXTENSIONS);
if (psc->serverGLXexts == NULL) {
return GL_FALSE;
@@ -721,10 +726,9 @@ static GLboolean
LockDisplay(dpy);
psc->configs = NULL;
- if (priv->majorVersion > 1 ||
- (priv->majorVersion == 1 && priv->minorVersion >= 3)) {
+ if (priv->minorVersion >= 3) {
GetReq(GLXGetFBConfigs, fb_req);
- fb_req->reqType = priv->majorOpcode;
+ fb_req->reqType = priv->codes.major_opcode;
fb_req->glxCode = X_GLXGetFBConfigs;
fb_req->screen = screen;
}
@@ -733,7 +737,7 @@ static GLboolean
sz_xGLXGetFBConfigsSGIXReq -
sz_xGLXVendorPrivateWithReplyReq, vpreq);
sgi_req = (xGLXGetFBConfigsSGIXReq *) vpreq;
- sgi_req->reqType = priv->majorOpcode;
+ sgi_req->reqType = priv->codes.major_opcode;
sgi_req->glxCode = X_GLXVendorPrivateWithReply;
sgi_req->vendorCode = X_GLXvop_GetFBConfigsSGIX;
sgi_req->screen = screen;
@@ -786,6 +790,8 @@ glx_screen_cleanup(struct glx_screen *psc)
psc->visuals = NULL; /* NOTE: just for paranoia */
}
free((char *) psc->serverGLXexts);
+ free((char *) psc->serverGLXvendor);
+ free((char *) psc->serverGLXversion);
}
/*
@@ -806,13 +812,6 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv)
if (!priv->screens)
return GL_FALSE;
- priv->serverGLXversion =
- __glXQueryServerString(dpy, priv->majorOpcode, 0, GLX_VERSION);
- if (priv->serverGLXversion == NULL) {
- FreeScreenConfigs(priv);
- return GL_FALSE;
- }
-
for (i = 0; i < screens; i++, psc++) {
psc = NULL;
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
@@ -853,11 +852,12 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv)
_X_HIDDEN struct glx_display *
__glXInitialize(Display * dpy)
{
+ XExtCodes *codes;
struct glx_display *dpyPriv, *d;
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
Bool glx_direct, glx_accel;
#endif
- int i;
+ int i, majorVersion = 0;
_XLockMutex(_Xglobal_lock);
@@ -875,34 +875,33 @@ __glXInitialize(Display * dpy)
if (!dpyPriv)
return NULL;
- dpyPriv->codes = XInitExtension(dpy, __glXExtensionName);
- if (!dpyPriv->codes) {
+ codes = XInitExtension(dpy, __glXExtensionName);
+ if (!codes) {
free(dpyPriv);
return NULL;
}
+ dpyPriv->codes = *codes;
dpyPriv->dpy = dpy;
- dpyPriv->majorOpcode = dpyPriv->codes->major_opcode;
- dpyPriv->serverGLXvendor = 0x0;
- dpyPriv->serverGLXversion = 0x0;
- /* See if the versions are compatible. This GLX implementation does not
- * work with servers that only support GLX 1.0.
+ /* This GLX implementation requires X_GLXQueryExtensionsString
+ * and X_GLXQueryServerString, which are new in GLX 1.1.
*/
- if (!QueryVersion(dpy, dpyPriv->majorOpcode,
- &dpyPriv->majorVersion, &dpyPriv->minorVersion)
- || (dpyPriv->majorVersion == 1 && dpyPriv->minorVersion < 1)) {
+ if (!QueryVersion(dpy, dpyPriv->codes.major_opcode,
+ &majorVersion, &dpyPriv->minorVersion)
+ || (majorVersion != 1)
+ || (majorVersion == 1 && dpyPriv->minorVersion < 1)) {
free(dpyPriv);
return NULL;
}
for (i = 0; i < __GLX_NUMBER_EVENTS; i++) {
- XESetWireToEvent(dpy, dpyPriv->codes->first_event + i, __glXWireToEvent);
- XESetEventToWire(dpy, dpyPriv->codes->first_event + i, __glXEventToWire);
+ XESetWireToEvent(dpy, dpyPriv->codes.first_event + i, __glXWireToEvent);
+ XESetEventToWire(dpy, dpyPriv->codes.first_event + i, __glXEventToWire);
}
- XESetCloseDisplay(dpy, dpyPriv->codes->extension, __glXCloseDisplay);
- XESetErrorString (dpy, dpyPriv->codes->extension, __glXErrorString);
+ XESetCloseDisplay(dpy, dpyPriv->codes.extension, __glXCloseDisplay);
+ XESetErrorString (dpy, dpyPriv->codes.extension, __glXErrorString);
dpyPriv->glXDrawHash = __glxHashCreate();
@@ -914,7 +913,7 @@ __glXInitialize(Display * dpy)
#ifndef GLX_USE_APPLEGL
/* Set the logger before the *CreateDisplay functions. */
- loader_set_logger(dri_message);
+ loader_set_logger(glx_message);
#endif
/*
@@ -1008,7 +1007,7 @@ __glXSetupForCommand(Display * dpy)
if (!priv) {
return 0;
}
- return priv->majorOpcode;
+ return priv->codes.major_opcode;
}
/**
@@ -1119,30 +1118,3 @@ __glXSendLargeCommand(struct glx_context * ctx,
assert(dataLen <= maxSize);
__glXSendLargeChunk(ctx, requestNumber, totalRequests, data, dataLen);
}
-
-/************************************************************************/
-
-#ifdef DEBUG
-_X_HIDDEN void
-__glXDumpDrawBuffer(struct glx_context * ctx)
-{
- GLubyte *p = ctx->buf;
- GLubyte *end = ctx->pc;
- GLushort opcode, length;
-
- while (p < end) {
- /* Fetch opcode */
- opcode = *((GLushort *) p);
- length = *((GLushort *) (p + 2));
- printf("%2x: %5d: ", opcode, length);
- length -= 4;
- p += 4;
- while (length > 0) {
- printf("%08x ", *((unsigned *) p));
- p += 4;
- length -= 4;
- }
- printf("\n");
- }
-}
-#endif
diff --git a/lib/mesa/src/glx/glxextensions.c b/lib/mesa/src/glx/glxextensions.c
index 10d4faf9a..71f84936a 100644
--- a/lib/mesa/src/glx/glxextensions.c
+++ b/lib/mesa/src/glx/glxextensions.c
@@ -42,7 +42,6 @@
#define CONCAT(a,b) a ## b
#define GLX(n) "GLX_" # n, 4 + sizeof( # n ) - 1, CONCAT(n,_bit)
#define GL(n) "GL_" # n, 3 + sizeof( # n ) - 1, GL_ ## n ## _bit
-#define VER(a,b) a, b
#define Y 1
#define N 0
#define EXT_ENABLED(bit,supported) (IS_SET( supported, bit ))
@@ -55,30 +54,6 @@ struct extension_info
unsigned char bit;
- /* This is the lowest version of GLX that "requires" this extension.
- * For example, GLX 1.3 requires SGIX_fbconfig, SGIX_pbuffer, and
- * SGI_make_current_read. If the extension is not required by any known
- * version of GLX, use 0, 0.
- */
- unsigned char version_major;
- unsigned char version_minor;
-
- /**
- * The client (i.e., libGL) supports this extension.
- *
- * Except during bring up, all extensions should have this set to Y. There
- * are a few cases of extensions that have partial (or speculative)
- * support, but these are rare. There also shouldn't be any new ones
- * added.
- *
- * Generally, extensions require server support and ::client_support to be
- * enabled. If the display is capable of direct rendering,
- * ::direct_support is also required.
- *
- * \sa ::client_only
- */
- unsigned char client_support;
-
/**
* The direct-renderer (e.g., i965_dri.so) supports this extension.
*
@@ -94,242 +69,207 @@ struct extension_info
unsigned char direct_support;
/**
- * The extension depends only on client support.
- *
- * This is for extensions like GLX_ARB_get_proc_address that are contained
- * entirely in the client library. There is no dependency on the server or
- * the direct-renderer.
- *
- * These extensions will be enabled if ::client_support is set.
- *
- * \note
- * An extension \b cannot be both client-only and direct-only because being
- * direct-only implies a dependency on the direct renderer.
- *
- * \sa ::client_support, ::direct_only
- */
- unsigned char client_only;
-
- /**
* The extension only functions with direct-rendering contexts
*
* The extension has no GLX protocol, and, therefore, no explicit
* dependency on the server. The functionality is contained entirely in
* the client library and the direct renderer. A few of the swap-related
* extensions are intended to behave this way.
- *
- * These extensions will be enabled if both ::client_support and
- * ::direct_support are set.
- *
- * \note
- * An extension \b cannot be both client-only and direct-only because being
- * client-only implies that all functionality is outside the
- * direct-renderer.
- *
- * \sa ::direct_support, ::client_only
*/
unsigned char direct_only;
};
/* *INDENT-OFF* */
static const struct extension_info known_glx_extensions[] = {
- { GLX(ARB_context_flush_control), VER(0,0), Y, N, N, N },
- { GLX(ARB_create_context), VER(0,0), Y, N, N, N },
- { GLX(ARB_create_context_no_error), VER(1,4), 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_fbconfig_float), VER(0,0), Y, Y, N, N },
- { GLX(ARB_framebuffer_sRGB), VER(0,0), Y, Y, N, N },
- { GLX(ARB_get_proc_address), VER(1,4), Y, N, Y, N },
- { GLX(ARB_multisample), VER(1,4), Y, Y, N, N },
- { GLX(EXT_buffer_age), VER(0,0), Y, N, N, Y },
- { GLX(EXT_create_context_es2_profile), VER(0,0), Y, N, N, N },
- { GLX(EXT_create_context_es_profile), VER(0,0), Y, N, N, N },
- { GLX(EXT_fbconfig_packed_float), VER(0,0), Y, Y, N, N },
- { GLX(EXT_framebuffer_sRGB), VER(0,0), Y, Y, N, N },
- { GLX(EXT_import_context), VER(0,0), Y, Y, N, N },
- { GLX(EXT_swap_control), VER(0,0), Y, N, N, Y },
- { GLX(EXT_swap_control_tear), VER(0,0), Y, N, N, Y },
- { GLX(EXT_texture_from_pixmap), VER(0,0), Y, N, 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(ATI_pixel_format_float), VER(0,0), N, N, N, N },
- { GLX(INTEL_swap_event), 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, N, Y },
- { GLX(MESA_query_renderer), VER(0,0), Y, N, N, Y },
- { GLX(MESA_swap_control), VER(0,0), Y, N, N, Y },
- { GLX(NV_float_buffer), VER(0,0), N, N, N, N },
- { GLX(OML_swap_method), VER(0,0), Y, Y, N, N },
- { GLX(OML_sync_control), VER(0,0), Y, N, N, Y },
- { GLX(SGIS_multisample), VER(0,0), Y, Y, N, N },
- { GLX(SGIX_fbconfig), VER(1,3), Y, Y, N, N },
- { GLX(SGIX_pbuffer), VER(1,3), Y, Y, N, N },
- { GLX(SGIX_visual_select_group), VER(0,0), Y, Y, N, N },
- { GLX(SGI_make_current_read), VER(1,3), Y, N, N, N },
- { GLX(SGI_swap_control), VER(0,0), Y, N, N, N },
- { GLX(SGI_video_sync), VER(0,0), Y, N, N, Y },
+ { GLX(ARB_context_flush_control), N, N },
+ { GLX(ARB_create_context), N, N },
+ { GLX(ARB_create_context_no_error), N, N },
+ { GLX(ARB_create_context_profile), N, N },
+ { GLX(ARB_create_context_robustness), N, N },
+ { GLX(ARB_fbconfig_float), Y, N },
+ { GLX(ARB_framebuffer_sRGB), Y, N },
+ { GLX(ARB_get_proc_address), N, N },
+ { GLX(ARB_multisample), Y, N },
+ { GLX(EXT_buffer_age), N, Y },
+ { GLX(EXT_create_context_es2_profile), N, N },
+ { GLX(EXT_create_context_es_profile), N, N },
+ { GLX(EXT_fbconfig_packed_float), Y, N },
+ { GLX(EXT_framebuffer_sRGB), Y, N },
+ { GLX(EXT_import_context), Y, N },
+ { GLX(EXT_no_config_context), N, N },
+ { GLX(EXT_swap_control), N, Y },
+ { GLX(EXT_swap_control_tear), N, Y },
+ { GLX(EXT_texture_from_pixmap), N, N },
+ { GLX(EXT_visual_info), Y, N },
+ { GLX(EXT_visual_rating), Y, N },
+ { GLX(ATI_pixel_format_float), N, N },
+ { GLX(INTEL_swap_event), N, N },
+ { GLX(MESA_copy_sub_buffer), N, N },
+ { GLX(MESA_multithread_makecurrent), N, Y },
+ { GLX(MESA_query_renderer), N, Y },
+ { GLX(MESA_swap_control), N, Y },
+ { GLX(NV_float_buffer), N, N },
+ { GLX(OML_swap_method), Y, N },
+ { GLX(OML_sync_control), N, Y },
+ { GLX(SGIS_multisample), Y, N },
+ { GLX(SGIX_fbconfig), Y, N },
+ { GLX(SGIX_pbuffer), Y, N },
+ { GLX(SGIX_visual_select_group), Y, N },
+ { GLX(SGI_make_current_read), N, N },
+ { GLX(SGI_swap_control), N, N },
+ { GLX(SGI_video_sync), N, Y },
{ NULL }
};
static const struct extension_info known_gl_extensions[] = {
- { GL(ARB_depth_texture), VER(1,4), Y, N, N, N },
- { GL(ARB_draw_buffers), VER(0,0), Y, N, N, N },
- { GL(ARB_fragment_program), VER(0,0), Y, N, N, N },
- { GL(ARB_fragment_program_shadow), VER(0,0), Y, N, N, N },
- { GL(ARB_framebuffer_object), VER(0,0), Y, N, N, N },
- { GL(ARB_imaging), VER(0,0), Y, N, N, N },
- { GL(ARB_multisample), VER(1,3), Y, N, N, N },
- { GL(ARB_multitexture), VER(1,3), Y, N, N, N },
- { GL(ARB_occlusion_query), VER(1,5), Y, N, N, N },
- { GL(ARB_point_parameters), VER(1,4), Y, N, N, N },
- { GL(ARB_point_sprite), VER(0,0), Y, N, N, N },
- { GL(ARB_shadow), VER(1,4), Y, N, N, N },
- { GL(ARB_shadow_ambient), VER(0,0), Y, N, N, N },
- { GL(ARB_texture_border_clamp), VER(1,3), Y, N, N, N },
- { GL(ARB_texture_compression), VER(1,3), Y, N, N, N },
- { GL(ARB_texture_cube_map), VER(1,3), Y, N, N, N },
- { GL(ARB_texture_env_add), VER(1,3), Y, N, N, N },
- { GL(ARB_texture_env_combine), VER(1,3), Y, N, N, N },
- { GL(ARB_texture_env_crossbar), VER(1,4), Y, N, N, N },
- { GL(ARB_texture_env_dot3), VER(1,3), Y, N, N, N },
- { GL(ARB_texture_filter_anisotropic), VER(0,0), Y, N, N, N },
- { GL(ARB_texture_mirrored_repeat), VER(1,4), Y, N, N, N },
- { GL(ARB_texture_non_power_of_two), VER(1,5), Y, N, N, N },
- { GL(ARB_texture_rectangle), VER(0,0), Y, N, N, N },
- { GL(ARB_texture_rg), VER(0,0), Y, N, N, N },
- { GL(ARB_transpose_matrix), VER(1,3), Y, N, Y, N },
- { GL(ARB_vertex_buffer_object), VER(1,5), N, N, N, N },
- { GL(ARB_vertex_program), VER(0,0), Y, N, N, N },
- { GL(ARB_window_pos), VER(1,4), Y, N, N, N },
- { GL(EXT_abgr), VER(0,0), Y, N, N, N },
- { GL(EXT_bgra), VER(1,2), Y, N, N, N },
- { GL(EXT_blend_color), VER(1,4), Y, N, N, N },
- { GL(EXT_blend_equation_separate), VER(0,0), Y, N, N, N },
- { GL(EXT_blend_func_separate), VER(1,4), Y, N, N, N },
- { GL(EXT_blend_logic_op), VER(1,4), Y, N, N, N },
- { GL(EXT_blend_minmax), VER(1,4), Y, N, N, N },
- { GL(EXT_blend_subtract), VER(1,4), Y, N, N, N },
- { GL(EXT_clip_volume_hint), VER(0,0), Y, N, N, N },
- { GL(EXT_compiled_vertex_array), VER(0,0), N, N, N, N },
- { GL(EXT_convolution), VER(0,0), N, N, N, N },
- { GL(EXT_copy_texture), VER(1,1), Y, N, N, N },
- { GL(EXT_cull_vertex), VER(0,0), N, N, N, N },
- { GL(EXT_depth_bounds_test), VER(0,0), N, N, N, N },
- { GL(EXT_draw_range_elements), VER(1,2), Y, N, Y, N },
- { GL(EXT_fog_coord), VER(1,4), Y, N, N, N },
- { GL(EXT_framebuffer_blit), VER(0,0), Y, N, N, N },
- { GL(EXT_framebuffer_multisample), VER(0,0), Y, N, N, N },
- { GL(EXT_framebuffer_object), VER(0,0), Y, N, N, N },
- { GL(EXT_framebuffer_sRGB), VER(0,0), Y, N, N, N },
- { GL(EXT_multi_draw_arrays), VER(1,4), Y, N, Y, N },
- { GL(EXT_packed_depth_stencil), VER(0,0), Y, N, N, N },
- { GL(EXT_packed_pixels), VER(1,2), Y, N, N, N },
- { GL(EXT_paletted_texture), VER(0,0), Y, N, N, N },
- { GL(EXT_pixel_buffer_object), VER(0,0), N, N, N, N },
- { GL(EXT_point_parameters), VER(1,4), Y, N, N, N },
- { GL(EXT_polygon_offset), VER(1,1), Y, N, N, N },
- { GL(EXT_rescale_normal), VER(1,2), Y, N, N, N },
- { GL(EXT_secondary_color), VER(1,4), Y, N, N, N },
- { GL(EXT_separate_specular_color), VER(1,2), Y, N, N, N },
- { GL(EXT_shadow_funcs), VER(1,5), Y, N, N, N },
- { GL(EXT_shared_texture_palette), VER(0,0), Y, N, N, N },
- { GL(EXT_stencil_two_side), VER(0,0), Y, N, N, N },
- { GL(EXT_stencil_wrap), VER(1,4), Y, N, N, N },
- { GL(EXT_subtexture), VER(1,1), Y, N, N, N },
- { GL(EXT_texture), VER(1,1), Y, N, N, N },
- { GL(EXT_texture3D), VER(1,2), Y, N, N, N },
- { GL(EXT_texture_compression_dxt1), VER(0,0), Y, N, N, N },
- { GL(EXT_texture_compression_s3tc), VER(0,0), Y, N, N, N },
- { GL(EXT_texture_edge_clamp), VER(1,2), Y, N, N, N },
- { GL(EXT_texture_env_add), VER(1,3), Y, N, N, N },
- { GL(EXT_texture_env_combine), VER(1,3), Y, N, N, N },
- { GL(EXT_texture_env_dot3), VER(0,0), Y, N, N, N },
- { GL(EXT_texture_filter_anisotropic), VER(0,0), Y, N, N, N },
- { GL(EXT_texture_integer), VER(0,0), Y, N, N, N },
- { GL(EXT_texture_lod), VER(1,2), Y, N, N, N },
- { GL(EXT_texture_lod_bias), VER(1,4), Y, N, N, N },
- { GL(EXT_texture_mirror_clamp), VER(0,0), Y, N, N, N },
- { GL(EXT_texture_object), VER(1,1), Y, N, N, N },
- { GL(EXT_texture_rectangle), VER(0,0), Y, N, N, N },
- { GL(EXT_vertex_array), VER(0,0), Y, N, N, N },
- { GL(3DFX_texture_compression_FXT1), VER(0,0), Y, N, N, N },
- { GL(APPLE_packed_pixels), VER(1,2), Y, N, N, N },
- { GL(APPLE_ycbcr_422), VER(0,0), Y, N, N, N },
- { GL(ATI_draw_buffers), VER(0,0), Y, N, N, N },
- { GL(ATI_text_fragment_shader), VER(0,0), Y, N, N, N },
- { GL(ATI_texture_env_combine3), VER(0,0), Y, N, N, N },
- { GL(ATI_texture_float), VER(0,0), Y, N, N, N },
- { GL(ATI_texture_mirror_once), VER(0,0), Y, N, N, N },
- { GL(ATIX_texture_env_combine3), VER(0,0), Y, N, N, N },
- { GL(HP_convolution_border_modes), VER(0,0), Y, N, N, N },
- { GL(HP_occlusion_test), VER(0,0), Y, N, N, N },
- { GL(IBM_cull_vertex), VER(0,0), Y, N, N, N },
- { GL(IBM_pixel_filter_hint), VER(0,0), Y, N, N, N },
- { GL(IBM_rasterpos_clip), VER(0,0), Y, N, N, N },
- { GL(IBM_texture_clamp_nodraw), VER(0,0), Y, N, N, N },
- { GL(IBM_texture_mirrored_repeat), VER(0,0), Y, N, N, N },
- { GL(INGR_blend_func_separate), VER(0,0), Y, N, N, N },
- { GL(INGR_interlace_read), VER(0,0), Y, N, N, N },
- { GL(MESA_pack_invert), VER(0,0), Y, N, N, N },
- { GL(MESA_ycbcr_texture), VER(0,0), Y, N, N, N },
- { GL(NV_blend_square), VER(1,4), Y, N, N, N },
- { GL(NV_copy_depth_to_color), VER(0,0), Y, N, N, N },
- { GL(NV_depth_clamp), VER(0,0), Y, N, N, N },
- { GL(NV_fog_distance), VER(0,0), Y, N, N, N },
- { GL(NV_fragment_program), VER(0,0), Y, N, N, N },
- { GL(NV_fragment_program_option), VER(0,0), Y, N, N, N },
- { GL(NV_fragment_program2), VER(0,0), Y, N, N, N },
- { GL(NV_light_max_exponent), VER(0,0), Y, N, N, N },
- { GL(NV_multisample_filter_hint), VER(0,0), Y, N, N, N },
- { GL(NV_packed_depth_stencil), VER(0,0), Y, N, N, N },
- { GL(NV_point_sprite), VER(0,0), Y, N, N, N },
- { GL(NV_texgen_reflection), VER(0,0), Y, N, N, N },
- { GL(NV_texture_compression_vtc), VER(0,0), Y, N, N, N },
- { GL(NV_texture_env_combine4), VER(0,0), Y, N, N, N },
- { GL(NV_texture_rectangle), VER(0,0), Y, N, N, N },
- { GL(NV_vertex_program), VER(0,0), Y, N, N, N },
- { GL(NV_vertex_program1_1), VER(0,0), Y, N, N, N },
- { GL(NV_vertex_program2), VER(0,0), Y, N, N, N },
- { GL(NV_vertex_program2_option), VER(0,0), Y, N, N, N },
- { GL(NV_vertex_program3), VER(0,0), Y, N, N, N },
- { GL(OES_read_format), VER(0,0), Y, N, N, N },
- { GL(OES_compressed_paletted_texture),VER(0,0), Y, N, N, N },
- { GL(SGI_color_matrix), VER(0,0), Y, N, N, N },
- { GL(SGI_color_table), VER(0,0), Y, N, N, N },
- { GL(SGI_texture_color_table), VER(0,0), Y, N, N, N },
- { GL(SGIS_generate_mipmap), VER(1,4), Y, N, N, N },
- { GL(SGIS_multisample), VER(0,0), Y, N, N, N },
- { GL(SGIS_texture_border_clamp), VER(1,3), Y, N, N, N },
- { GL(SGIS_texture_edge_clamp), VER(1,2), Y, N, N, N },
- { GL(SGIS_texture_lod), VER(1,2), Y, N, N, N },
- { GL(SGIX_blend_alpha_minmax), VER(0,0), Y, N, N, N },
- { GL(SGIX_clipmap), VER(0,0), Y, N, N, N },
- { GL(SGIX_depth_texture), VER(0,0), Y, N, N, N },
- { GL(SGIX_fog_offset), VER(0,0), Y, N, N, N },
- { GL(SGIX_shadow), VER(0,0), Y, N, N, N },
- { GL(SGIX_shadow_ambient), VER(0,0), Y, N, N, N },
- { GL(SGIX_texture_coordinate_clamp), VER(0,0), Y, N, N, N },
- { GL(SGIX_texture_lod_bias), VER(0,0), Y, N, N, N },
- { GL(SGIX_texture_range), VER(0,0), Y, N, N, N },
- { GL(SGIX_texture_scale_bias), VER(0,0), Y, N, N, N },
- { GL(SGIX_vertex_preclip), VER(0,0), Y, N, N, N },
- { GL(SGIX_vertex_preclip_hint), VER(0,0), Y, N, N, N },
- { GL(SGIX_ycrcb), VER(0,0), Y, N, N, N },
- { GL(SUN_convolution_border_modes), VER(0,0), Y, N, N, N },
- { GL(SUN_multi_draw_arrays), VER(0,0), Y, N, Y, N },
- { GL(SUN_slice_accum), VER(0,0), Y, N, N, N },
+ { GL(ARB_depth_texture), N, N },
+ { GL(ARB_draw_buffers), N, N },
+ { GL(ARB_fragment_program), N, N },
+ { GL(ARB_fragment_program_shadow), N, N },
+ { GL(ARB_framebuffer_object), N, N },
+ { GL(ARB_imaging), N, N },
+ { GL(ARB_multisample), N, N },
+ { GL(ARB_multitexture), N, N },
+ { GL(ARB_occlusion_query), N, N },
+ { GL(ARB_point_parameters), N, N },
+ { GL(ARB_point_sprite), N, N },
+ { GL(ARB_shadow), N, N },
+ { GL(ARB_shadow_ambient), N, N },
+ { GL(ARB_texture_border_clamp), N, N },
+ { GL(ARB_texture_compression), N, N },
+ { GL(ARB_texture_cube_map), N, N },
+ { GL(ARB_texture_env_add), N, N },
+ { GL(ARB_texture_env_combine), N, N },
+ { GL(ARB_texture_env_crossbar), N, N },
+ { GL(ARB_texture_env_dot3), N, N },
+ { GL(ARB_texture_filter_anisotropic), N, N },
+ { GL(ARB_texture_mirrored_repeat), N, N },
+ { GL(ARB_texture_non_power_of_two), N, N },
+ { GL(ARB_texture_rectangle), N, N },
+ { GL(ARB_texture_rg), N, N },
+ { GL(ARB_transpose_matrix), N, N },
+ { GL(ARB_vertex_program), N, N },
+ { GL(ARB_window_pos), N, N },
+ { GL(EXT_abgr), N, N },
+ { GL(EXT_bgra), N, N },
+ { GL(EXT_blend_color), N, N },
+ { GL(EXT_blend_equation_separate), N, N },
+ { GL(EXT_blend_func_separate), N, N },
+ { GL(EXT_blend_logic_op), N, N },
+ { GL(EXT_blend_minmax), N, N },
+ { GL(EXT_blend_subtract), N, N },
+ { GL(EXT_clip_volume_hint), N, N },
+ { GL(EXT_copy_texture), N, N },
+ { GL(EXT_draw_range_elements), N, N },
+ { GL(EXT_fog_coord), N, N },
+ { GL(EXT_framebuffer_blit), N, N },
+ { GL(EXT_framebuffer_multisample), N, N },
+ { GL(EXT_framebuffer_object), N, N },
+ { GL(EXT_framebuffer_sRGB), N, N },
+ { GL(EXT_multi_draw_arrays), N, N },
+ { GL(EXT_packed_depth_stencil), N, N },
+ { GL(EXT_packed_pixels), N, N },
+ { GL(EXT_paletted_texture), N, N },
+ { GL(EXT_point_parameters), N, N },
+ { GL(EXT_polygon_offset), N, N },
+ { GL(EXT_rescale_normal), N, N },
+ { GL(EXT_secondary_color), N, N },
+ { GL(EXT_separate_specular_color), N, N },
+ { GL(EXT_shadow_funcs), N, N },
+ { GL(EXT_shared_texture_palette), N, N },
+ { GL(EXT_stencil_two_side), N, N },
+ { GL(EXT_stencil_wrap), N, N },
+ { GL(EXT_subtexture), N, N },
+ { GL(EXT_texture), N, N },
+ { GL(EXT_texture3D), N, N },
+ { GL(EXT_texture_compression_dxt1), N, N },
+ { GL(EXT_texture_compression_s3tc), N, N },
+ { GL(EXT_texture_edge_clamp), N, N },
+ { GL(EXT_texture_env_add), N, N },
+ { GL(EXT_texture_env_combine), N, N },
+ { GL(EXT_texture_env_dot3), N, N },
+ { GL(EXT_texture_filter_anisotropic), N, N },
+ { GL(EXT_texture_integer), N, N },
+ { GL(EXT_texture_lod), N, N },
+ { GL(EXT_texture_lod_bias), N, N },
+ { GL(EXT_texture_mirror_clamp), N, N },
+ { GL(EXT_texture_object), N, N },
+ { GL(EXT_texture_rectangle), N, N },
+ { GL(EXT_vertex_array), N, N },
+ { GL(3DFX_texture_compression_FXT1), N, N },
+ { GL(APPLE_packed_pixels), N, N },
+ { GL(APPLE_ycbcr_422), N, N },
+ { GL(ATI_draw_buffers), N, N },
+ { GL(ATI_text_fragment_shader), N, N },
+ { GL(ATI_texture_env_combine3), N, N },
+ { GL(ATI_texture_float), N, N },
+ { GL(ATI_texture_mirror_once), N, N },
+ { GL(ATIX_texture_env_combine3), N, N },
+ { GL(HP_convolution_border_modes), N, N },
+ { GL(HP_occlusion_test), N, N },
+ { GL(IBM_cull_vertex), N, N },
+ { GL(IBM_pixel_filter_hint), N, N },
+ { GL(IBM_rasterpos_clip), N, N },
+ { GL(IBM_texture_clamp_nodraw), N, N },
+ { GL(IBM_texture_mirrored_repeat), N, N },
+ { GL(INGR_blend_func_separate), N, N },
+ { GL(INGR_interlace_read), N, N },
+ { GL(MESA_pack_invert), N, N },
+ { GL(MESA_ycbcr_texture), N, N },
+ { GL(NV_blend_square), N, N },
+ { GL(NV_copy_depth_to_color), N, N },
+ { GL(NV_depth_clamp), N, N },
+ { GL(NV_fog_distance), N, N },
+ { GL(NV_fragment_program), N, N },
+ { GL(NV_fragment_program_option), N, N },
+ { GL(NV_fragment_program2), N, N },
+ { GL(NV_light_max_exponent), N, N },
+ { GL(NV_multisample_filter_hint), N, N },
+ { GL(NV_packed_depth_stencil), N, N },
+ { GL(NV_point_sprite), N, N },
+ { GL(NV_texgen_reflection), N, N },
+ { GL(NV_texture_compression_vtc), N, N },
+ { GL(NV_texture_env_combine4), N, N },
+ { GL(NV_texture_rectangle), N, N },
+ { GL(NV_vertex_program), N, N },
+ { GL(NV_vertex_program1_1), N, N },
+ { GL(NV_vertex_program2), N, N },
+ { GL(NV_vertex_program2_option), N, N },
+ { GL(NV_vertex_program3), N, N },
+ { GL(OES_read_format), N, N },
+ { GL(OES_compressed_paletted_texture), N, N },
+ { GL(SGI_color_matrix), N, N },
+ { GL(SGI_color_table), N, N },
+ { GL(SGI_texture_color_table), N, N },
+ { GL(SGIS_generate_mipmap), N, N },
+ { GL(SGIS_multisample), N, N },
+ { GL(SGIS_texture_border_clamp), N, N },
+ { GL(SGIS_texture_edge_clamp), N, N },
+ { GL(SGIS_texture_lod), N, N },
+ { GL(SGIX_blend_alpha_minmax), N, N },
+ { GL(SGIX_clipmap), N, N },
+ { GL(SGIX_depth_texture), N, N },
+ { GL(SGIX_fog_offset), N, N },
+ { GL(SGIX_shadow), N, N },
+ { GL(SGIX_shadow_ambient), N, N },
+ { GL(SGIX_texture_coordinate_clamp), N, N },
+ { GL(SGIX_texture_lod_bias), N, N },
+ { GL(SGIX_texture_range), N, N },
+ { GL(SGIX_texture_scale_bias), N, N },
+ { GL(SGIX_vertex_preclip), N, N },
+ { GL(SGIX_vertex_preclip_hint), N, N },
+ { GL(SGIX_ycrcb), N, N },
+ { GL(SUN_convolution_border_modes), N, N },
+ { GL(SUN_multi_draw_arrays), N, N },
+ { GL(SUN_slice_accum), N, N },
{ NULL }
};
/* *INDENT-ON* */
/* global bit-fields of available extensions and their characteristics */
-static unsigned char client_glx_support[__GLX_EXT_BYTES];
static unsigned char client_glx_only[__GLX_EXT_BYTES];
static unsigned char direct_glx_only[__GLX_EXT_BYTES];
-static unsigned char client_gl_support[__GL_EXT_BYTES];
-static unsigned char client_gl_only[__GL_EXT_BYTES];
/**
* Bits representing the set of extensions that are enabled by default in all
@@ -337,12 +277,6 @@ static unsigned char client_gl_only[__GL_EXT_BYTES];
*/
static unsigned char direct_glx_support[__GLX_EXT_BYTES];
-/**
- * Highest core GL version that can be supported for indirect rendering.
- */
-static const unsigned gl_major = 1;
-static const unsigned gl_minor = 4;
-
/* client extensions string */
static const char *__glXGLXClientExtensions = NULL;
@@ -559,50 +493,22 @@ __glXExtensionsCtr(void)
if (ext_list_first_time) {
ext_list_first_time = GL_FALSE;
- (void) memset(client_glx_support, 0, sizeof(client_glx_support));
(void) memset(direct_glx_support, 0, sizeof(direct_glx_support));
(void) memset(client_glx_only, 0, sizeof(client_glx_only));
(void) memset(direct_glx_only, 0, sizeof(direct_glx_only));
- (void) memset(client_gl_support, 0, sizeof(client_gl_support));
- (void) memset(client_gl_only, 0, sizeof(client_gl_only));
-
+ SET_BIT(client_glx_only, ARB_get_proc_address_bit);
for (i = 0; known_glx_extensions[i].name != NULL; i++) {
const unsigned bit = known_glx_extensions[i].bit;
- if (known_glx_extensions[i].client_support) {
- SET_BIT(client_glx_support, bit);
- }
-
if (known_glx_extensions[i].direct_support) {
SET_BIT(direct_glx_support, bit);
}
- if (known_glx_extensions[i].client_only) {
- SET_BIT(client_glx_only, bit);
- }
-
if (known_glx_extensions[i].direct_only) {
SET_BIT(direct_glx_only, bit);
}
}
-
- for (i = 0; known_gl_extensions[i].name != NULL; i++) {
- const unsigned bit = known_gl_extensions[i].bit;
-
- if (known_gl_extensions[i].client_support) {
- SET_BIT(client_gl_support, bit);
- }
-
- if (known_gl_extensions[i].client_only) {
- SET_BIT(client_gl_only, bit);
- }
- }
-
-#if 0
- fprintf(stderr, "[%s:%u] Maximum client library version: %u.%u\n",
- __func__, __LINE__, gl_major, gl_minor);
-#endif
}
}
@@ -679,7 +585,7 @@ __glExtensionBitIsEnabled(struct glx_context *gc, unsigned bit)
*/
static char *
__glXGetStringFromTable(const struct extension_info *ext,
- const unsigned char *supported)
+ const unsigned char *filter)
{
unsigned i;
unsigned ext_str_len;
@@ -689,7 +595,7 @@ __glXGetStringFromTable(const struct extension_info *ext,
ext_str_len = 0;
for (i = 0; ext[i].name != NULL; i++) {
- if (EXT_ENABLED(ext[i].bit, supported)) {
+ if (!filter || EXT_ENABLED(ext[i].bit, filter)) {
ext_str_len += ext[i].name_len + 1;
}
}
@@ -699,7 +605,7 @@ __glXGetStringFromTable(const struct extension_info *ext,
point = ext_str;
for (i = 0; ext[i].name != NULL; i++) {
- if (EXT_ENABLED(ext[i].bit, supported)) {
+ if (!filter || EXT_ENABLED(ext[i].bit, filter)) {
(void) memcpy(point, ext[i].name, ext[i].name_len);
point += ext[i].name_len;
@@ -719,12 +625,12 @@ __glXGetStringFromTable(const struct extension_info *ext,
* Get the string of client library supported extensions.
*/
const char *
-__glXGetClientExtensions(void)
+__glXGetClientExtensions(Display *dpy)
{
if (__glXGLXClientExtensions == NULL) {
__glXExtensionsCtr();
__glXGLXClientExtensions = __glXGetStringFromTable(known_glx_extensions,
- client_glx_support);
+ NULL);
}
return __glXGLXClientExtensions;
@@ -738,13 +644,11 @@ __glXGetClientExtensions(void)
* \param psc Pointer to GLX per-screen record.
* \param display_is_direct_capable True if the display is capable of
* direct rendering.
- * \param minor_version GLX minor version from the server.
*/
void
__glXCalculateUsableExtensions(struct glx_screen * psc,
- GLboolean display_is_direct_capable,
- int minor_version)
+ GLboolean display_is_direct_capable)
{
unsigned char server_support[__GLX_EXT_BYTES];
unsigned char usable[__GLX_EXT_BYTES];
@@ -758,29 +662,6 @@ __glXCalculateUsableExtensions(struct glx_screen * psc,
psc->serverGLXexts, server_support);
- /* This is a hack. Some servers support GLX 1.3 but don't export
- * all of the extensions implied by GLX 1.3. If the server claims
- * support for GLX 1.3, enable support for the extensions that can be
- * "emulated" as well.
- */
-#ifndef GLX_USE_APPLEGL
- if (minor_version >= 3) {
- SET_BIT(server_support, EXT_visual_info_bit);
- SET_BIT(server_support, EXT_visual_rating_bit);
- SET_BIT(server_support, SGI_make_current_read_bit);
- SET_BIT(server_support, SGIX_fbconfig_bit);
- SET_BIT(server_support, SGIX_pbuffer_bit);
-
- /* This one is a little iffy. GLX 1.3 doesn't incorporate all of this
- * extension. However, the only part that is not strictly client-side
- * is shared. That's the glXQueryContext / glXQueryContextInfoEXT
- * function.
- */
-
- SET_BIT(server_support, EXT_import_context_bit);
- }
-#endif
-
/* An extension is supported if the client-side (i.e., libGL) supports
* it and the "server" supports it. In this case that means that either
* the true server supports it or it is only for direct-rendering and
@@ -796,14 +677,12 @@ __glXCalculateUsableExtensions(struct glx_screen * psc,
/* Enable extensions that the client supports that only have a client-side
* component.
*/
- unsigned char u = client_glx_support[i] & client_glx_only[i];
+ unsigned char u = client_glx_only[i];
- /* Enable extensions that the client supports, are supported for direct
- * rendering, and either are supported by the server or only have a
- * direct-rendering component.
+ /* Enable extensions that are supported for direct rendering, and either
+ * are supported by the server or only have a direct-rendering component.
*/
- u |= client_glx_support[i] & psc->direct_support[i] &
- (server_support[i] | direct_glx_only[i]);
+ u |= psc->direct_support[i] & (server_support[i] | direct_glx_only[i]);
/* Finally, apply driconf options to force some extension bits either
* enabled or disabled.
@@ -819,10 +698,10 @@ __glXCalculateUsableExtensions(struct glx_screen * psc,
/* Enable extensions that the client supports that only have a
* client-side component.
*/
- unsigned char u = client_glx_support[i] & client_glx_only[i];
+ unsigned char u = client_glx_only[i];
/* Enable extensions that the client and server both support */
- u |= client_glx_support[i] & server_support[i];
+ u |= server_support[i];
/* Finally, apply driconf options to force some extension bits either
* enabled or disabled.
@@ -838,59 +717,40 @@ __glXCalculateUsableExtensions(struct glx_screen * psc,
usable);
}
-
/**
* Calculate the list of application usable extensions. The resulting
* string is stored in \c gc->extensions.
*
* \param gc Pointer to GLX context.
* \param server_string Extension string from the server.
- * \param major_version GL major version from the server.
- * \param minor_version GL minor version from the server.
*/
void
__glXCalculateUsableGLExtensions(struct glx_context * gc,
- const char *server_string,
- int major_version, int minor_version)
+ const char *server_string)
{
struct glx_screen *psc = gc->psc;
unsigned char server_support[__GL_EXT_BYTES];
unsigned char usable[__GL_EXT_BYTES];
unsigned i;
-
- __glXExtensionsCtr();
-
(void) memset(server_support, 0, sizeof(server_support));
__glXProcessServerString(known_gl_extensions, server_string,
server_support);
-
- /* Handle lazy servers that don't export all the extensions strings that
- * are part of the GL core version that they support.
- */
+ /* These extensions are wholly inside the client-side indirect code */
+ (void) memset(usable, 0, sizeof(usable));
+ SET_BIT(usable, GL_ARB_transpose_matrix_bit);
+ SET_BIT(usable, GL_EXT_draw_range_elements_bit);
+ SET_BIT(usable, GL_EXT_multi_draw_arrays_bit);
+ SET_BIT(usable, GL_SUN_multi_draw_arrays_bit);
for (i = 0; i < __GL_EXT_BYTES; i++) {
- if ((known_gl_extensions[i].version_major != 0)
- && ((major_version > known_gl_extensions[i].version_major)
- || ((major_version == known_gl_extensions[i].version_major)
- && (minor_version >=
- known_gl_extensions[i].version_minor)))) {
- SET_BIT(server_support, known_gl_extensions[i].bit);
- }
- }
+ /* Usable if the server supports it, or if it's been forced on */
+ usable[i] = server_support[i] | psc->gl_force_enabled[i];
-
- /* An extension is supported if the client-side (i.e., libGL) supports
- * it and the server supports it or the client-side library supports it
- * and it only needs client-side support.
- */
-
- for (i = 0; i < __GL_EXT_BYTES; i++) {
- usable[i] = ((client_gl_support[i] & client_gl_only[i])
- | (client_gl_support[i] & server_support[i])
- | psc->gl_force_enabled[i]) & ~psc->gl_force_disabled[i];
+ /* But not if it's been forced off */
+ usable[i] &= ~psc->gl_force_disabled[i];
}
gc->extensions = (unsigned char *)
@@ -898,20 +758,6 @@ __glXCalculateUsableGLExtensions(struct glx_context * gc,
(void) memcpy(gc->gl_extension_bits, usable, sizeof(usable));
}
-
-/**
- * Calculates the maximum core GL version that can be supported for indirect
- * rendering.
- */
-void
-__glXGetGLVersion(int *major_version, int *minor_version)
-{
- __glXExtensionsCtr();
- *major_version = gl_major;
- *minor_version = gl_minor;
-}
-
-
/**
* Get a string representing the set of extensions supported by the client
* library. This is currently only used to send the list of extensions
@@ -920,6 +766,5 @@ __glXGetGLVersion(int *major_version, int *minor_version)
char *
__glXGetClientGLExtensionString(void)
{
- __glXExtensionsCtr();
- return __glXGetStringFromTable(known_gl_extensions, client_gl_support);
+ return __glXGetStringFromTable(known_gl_extensions, NULL);
}
diff --git a/lib/mesa/src/glx/indirect_glx.c b/lib/mesa/src/glx/indirect_glx.c
index fb60cc0ff..7b0cf3b71 100644
--- a/lib/mesa/src/glx/indirect_glx.c
+++ b/lib/mesa/src/glx/indirect_glx.c
@@ -47,6 +47,23 @@ extern struct _glapi_table *__glXNewIndirectAPI(void);
static struct _glapi_table *IndirectAPI = NULL;
static void
+__glFreeAttributeState(struct glx_context * gc)
+{
+ __GLXattribute *sp, **spp;
+
+ for (spp = &gc->attributes.stack[0];
+ spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; spp++) {
+ sp = *spp;
+ if (sp) {
+ free((char *) sp);
+ }
+ else {
+ break;
+ }
+ }
+}
+
+static void
indirect_destroy_context(struct glx_context *gc)
{
__glXFreeVertexArrayState(gc);
@@ -90,7 +107,7 @@ SendMakeCurrentRequest(Display * dpy, GLXContextID gc_id,
* not the SGI extension.
*/
- if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) {
+ if (priv->minorVersion >= 3) {
xGLXMakeContextCurrentReq *req;
GetReq(GLXMakeContextCurrent, req);
@@ -253,10 +270,6 @@ indirect_create_context(struct glx_screen *psc,
* \todo Eliminate \c __glXInitVertexArrayState. Replace it with a new
* function called \c __glXAllocateClientState that allocates the memory and
* does all the initialization (including the pixel pack / unpack).
- *
- * \note
- * This function is \b not the place to validate the context creation
- * parameters. It is just the allocator for the \c glx_context.
*/
_X_HIDDEN struct glx_context *
indirect_create_context_attribs(struct glx_screen *psc,
@@ -302,6 +315,10 @@ indirect_create_context_attribs(struct glx_screen *psc,
return NULL;
}
+ /* We can't share with a direct context */
+ if (shareList && shareList->isDirect)
+ return NULL;
+
/* Allocate our context record */
gc = calloc(1, sizeof *gc);
if (!gc) {
diff --git a/lib/mesa/src/glx/single2.c b/lib/mesa/src/glx/single2.c
index 2a1bf06bc..1ed8c0cd2 100644
--- a/lib/mesa/src/glx/single2.c
+++ b/lib/mesa/src/glx/single2.c
@@ -679,8 +679,7 @@ __indirect_glGetString(GLenum name)
*/
(void) __glXFlushRenderBuffer(gc, gc->pc);
- s = (GLubyte *) __glXGetString(dpy, gc->majorOpcode, gc->currentContextTag,
- name);
+ s = (GLubyte *) __glXGetString(dpy, gc->currentContextTag, name);
if (!s) {
/* Throw data on the floor */
__glXSetError(gc, GL_OUT_OF_MEMORY);
@@ -699,12 +698,11 @@ __indirect_glGetString(GLenum name)
break;
case GL_VERSION:{
- int client_major;
- int client_minor;
+ const int client_major = 1;
+ const int client_minor = 4;
version_from_string((char *) s,
&gc->server_major, &gc->server_minor);
- __glXGetGLVersion(&client_major, &client_minor);
if ((gc->server_major < client_major)
|| ((gc->server_major == client_major)
@@ -743,43 +741,7 @@ __indirect_glGetString(GLenum name)
}
case GL_EXTENSIONS:{
- int major = 1;
- int minor = 0;
-
- /* This code is currently disabled. I was reminded that some
- * vendors intentionally exclude some extensions from their
- * extension string that are part of the core version they
- * advertise. In particular, on Nvidia drivers this means that
- * the functionality is supported by the driver, but is not
- * hardware accelerated. For example, a TNT will show core
- * version 1.5, but most of the post-1.2 functionality is a
- * software fallback.
- *
- * I don't want to break applications that rely on this odd
- * behavior. At the same time, the code is written and tested,
- * so I didn't want to throw it away. Therefore, the code is here
- * but disabled. In the future, we may wish to and an environment
- * variable to enable it.
- */
-
-#if 0
- /* Call glGetString just to make sure that gc->server_major and
- * gc->server_minor are set. This version may be higher than we
- * can completely support, but it may imply support for some
- * extensions that we can support.
- *
- * For example, at the time of this writing, the client-side
- * library only supports upto core GL version 1.2. However, cubic
- * textures, multitexture, multisampling, and some other 1.3
- * features are supported. If the server reports back version
- * 1.3, but does not report all of those extensions, we will
- * enable them.
- */
- (void *) glGetString(GL_VERSION);
- major = gc->server_major, minor = gc->server_minor;
-#endif
-
- __glXCalculateUsableGLExtensions(gc, (char *) s, major, minor);
+ __glXCalculateUsableGLExtensions(gc, (char *) s);
free(s);
s = gc->extensions;
break;
diff --git a/lib/mesa/src/glx/tests/clientinfo_unittest.cpp b/lib/mesa/src/glx/tests/clientinfo_unittest.cpp
index fe168d267..e99960801 100644
--- a/lib/mesa/src/glx/tests/clientinfo_unittest.cpp
+++ b/lib/mesa/src/glx/tests/clientinfo_unittest.cpp
@@ -42,11 +42,7 @@ public:
{
this->next = 0;
this->dpy = dpy;
- this->majorOpcode = 0;
- this->majorVersion = major;
this->minorVersion = minor;
- this->serverGLXvendor = 0;
- this->serverGLXversion = 0;
this->glXDrawHash = 0;
this->screens = new glx_screen *[dpy->nscreens];
diff --git a/lib/mesa/src/glx/tests/create_context_unittest.cpp b/lib/mesa/src/glx/tests/create_context_unittest.cpp
index c4d389226..f78a0f997 100644
--- a/lib/mesa/src/glx/tests/create_context_unittest.cpp
+++ b/lib/mesa/src/glx/tests/create_context_unittest.cpp
@@ -196,15 +196,6 @@ TEST_F(glXCreateContextAttribARB_test, NULL_display_returns_None)
EXPECT_EQ(0, fake_glx_context::contexts_allocated);
}
-TEST_F(glXCreateContextAttribARB_test, NULL_fbconfig_returns_None)
-{
- GLXContext ctx =
- glXCreateContextAttribsARB(this->dpy, NULL, 0, False, NULL);
-
- EXPECT_EQ(None, ctx);
- EXPECT_EQ(0, fake_glx_context::contexts_allocated);
-}
-
TEST_F(glXCreateContextAttribARB_test, NULL_screen_returns_None)
{
delete (fake_glx_screen *)psc;
diff --git a/lib/mesa/src/glx/tests/indirect_api.cpp b/lib/mesa/src/glx/tests/indirect_api.cpp
index e0179a33f..cc24729dd 100644
--- a/lib/mesa/src/glx/tests/indirect_api.cpp
+++ b/lib/mesa/src/glx/tests/indirect_api.cpp
@@ -49,7 +49,9 @@
#include "glapi/glapi.h"
#include "../../mesa/main/dispatch.h"
+#ifndef GLX_USE_APPLEGL
static const void *nil = 0;
+#endif
#define EXTRA_DISPATCH 111
diff --git a/lib/mesa/src/glx/tests/meson.build b/lib/mesa/src/glx/tests/meson.build
index 83f04e47b..0f37543b9 100644
--- a/lib/mesa/src/glx/tests/meson.build
+++ b/lib/mesa/src/glx/tests/meson.build
@@ -43,9 +43,9 @@ if with_shared_glapi
executable(
'glx-test',
[files_glx_test, glx_indirect_size_h, main_dispatch_h],
- link_with : [libglx, libglapi],
+ link_with : [libglx, libglapi, libloader],
include_directories : [
- inc_src, inc_include, inc_mesa, inc_mapi, inc_glx,
+ inc_src, inc_include, inc_mesa, inc_mapi, inc_glx, inc_loader,
],
dependencies : [dep_libdrm, dep_glproto, dep_thread, idep_gtest]
),