Commit 36bcbf76 authored by Adam Jackson's avatar Adam Jackson 💣

glx: Enable GLX 1.4 unconditionally

Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov's avatarEmil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent 2a72789e
......@@ -45,6 +45,7 @@
#include "indirect_dispatch.h"
#include "indirect_table.h"
#include "indirect_util.h"
#include "protocol-versions.h"
static char GLXServerVendorName[] = "SGI";
......@@ -797,8 +798,8 @@ __glXDisp_QueryVersion(__GLXclientState * cl, GLbyte * pc)
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.majorVersion = glxMajorVersion,
.minorVersion = glxMinorVersion
.majorVersion = SERVER_GLX_MAJOR_VERSION,
.minorVersion = SERVER_GLX_MINOR_VERSION
};
if (client->swapped) {
......@@ -2454,7 +2455,6 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc)
char *buf;
__GLXscreen *pGlxScreen;
int err;
char ver_str[16];
REQUEST_SIZE_MATCH(xGLXQueryServerStringReq);
......@@ -2466,11 +2466,7 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc)
ptr = GLXServerVendorName;
break;
case GLX_VERSION:
/* Return to the server version rather than the screen version
* to prevent confusion when they do not match.
*/
snprintf(ver_str, 16, "%d.%d", glxMajorVersion, glxMinorVersion);
ptr = ver_str;
ptr = "1.4";
break;
case GLX_EXTENSIONS:
ptr = pGlxScreen->GLXextensions;
......
......@@ -1000,18 +1000,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
screen->base.GLXextensions);
}
/* We're going to assume (perhaps incorrectly?) that all DRI2-enabled
* drivers support the required extensions for GLX 1.4. The extensions
* we're assuming are:
*
* - GLX_SGI_make_current_read (1.3)
* - GLX_SGIX_fbconfig (1.3)
* - GLX_SGIX_pbuffer (1.3)
* - GLX_ARB_multisample (1.4)
*/
screen->base.GLXmajor = 1;
screen->base.GLXminor = 4;
screen->enterVT = pScrn->EnterVT;
pScrn->EnterVT = glxDRIEnterVT;
screen->leaveVT = pScrn->LeaveVT;
......
......@@ -500,9 +500,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
screen->base.GLXextensions);
}
screen->base.GLXmajor = 1;
screen->base.GLXminor = 4;
__glXsetGetProcAddress(glXGetProcAddressARB);
LogMessage(X_INFO, "AIGLX: Loaded and initialized %s\n", driverName);
......
......@@ -380,8 +380,6 @@ GlxExtensionInit(void)
glxScreen = p->screenProbe(pScreen);
if (glxScreen != NULL) {
if (glxScreen->GLXminor < glxMinorVersion)
glxMinorVersion = glxScreen->GLXminor;
LogMessage(X_INFO,
"GLX: Initialized %s GL provider for screen %d\n",
p->name, i);
......
......@@ -154,9 +154,6 @@ static const char GLServerExtensions[] =
"GL_SGIX_shadow_ambient "
"GL_SUN_slice_accum ";
unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION;
unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION;
static Bool
glxCloseScreen(ScreenPtr pScreen)
{
......@@ -313,15 +310,6 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen)
pGlxScreen->GLextensions = strdup(GLServerExtensions);
pGlxScreen->GLXextensions = NULL;
/* All GLX providers must support all of the functionality required for at
* least GLX 1.2. If the provider supports a higher version, the GLXminor
* version can be changed in the provider's screen-probe routine. For
* most providers, the screen-probe routine is the caller of this
* function.
*/
pGlxScreen->GLXmajor = 1;
pGlxScreen->GLXminor = 2;
pGlxScreen->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = glxCloseScreen;
......
......@@ -140,20 +140,8 @@ struct __GLXscreen {
GLint numVisuals;
char *GLextensions;
char *GLXextensions;
/**
* \name GLX version supported by this screen.
*
* Since the GLX version advertised by the server is for the whole server,
* the GLX protocol code uses the minimum version supported on all screens.
*/
/*@{ */
unsigned GLXmajor;
unsigned GLXminor;
/*@} */
Bool (*CloseScreen) (ScreenPtr pScreen);
};
......
......@@ -548,9 +548,6 @@ __glXAquaScreenProbe(ScreenPtr pScreen)
__glXInitExtensionEnableBits(screen->glx_enable_bits);
__glXScreenInit(&screen->base, pScreen);
screen->base.GLXmajor = 1;
screen->base.GLXminor = 4;
//__glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context");
//__glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context_profile");
......
......@@ -720,27 +720,7 @@ glxWinScreenProbe(ScreenPtr pScreen)
screen->base.GLXextensions);
}
}
//
// Override the GLX version (__glXScreenInit() sets it to "1.2")
// if we have all the needed extensions to operate as a higher version
//
// SGIX_fbconfig && SGIX_pbuffer && SGI_make_current_read -> 1.3
// ARB_multisample -> 1.4
//
if (screen->has_WGL_ARB_pbuffer) {
if (screen->has_WGL_ARB_multisample) {
screen->base.GLXmajor = 1;
screen->base.GLXminor = 4;
}
else {
screen->base.GLXmajor = 1;
screen->base.GLXminor = 3;
}
}
}
LogMessage(X_INFO, "AIGLX: Set GLX version to %d.%d\n",
screen->base.GLXmajor, screen->base.GLXminor);
wglMakeCurrent(NULL, NULL);
wglDeleteContext(hglrc);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment