xlib: fix X_GLXCreateContextAtrribs/Attribs typo
In case the glproto.h file isn't up to date, we provide the #define for X_GLXCreateContextAttribsARB. v2: fix other occurances, improve #ifndef test, per Jose. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
This commit is contained in:
parent
dce53a7d24
commit
eec904d29c
|
@ -40,6 +40,13 @@
|
||||||
|
|
||||||
#include "xm_api.h"
|
#include "xm_api.h"
|
||||||
|
|
||||||
|
/* 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
|
||||||
|
|
||||||
/* This indicates the client-side GLX API and GLX encoder version. */
|
/* This indicates the client-side GLX API and GLX encoder version. */
|
||||||
#define CLIENT_MAJOR_VERSION 1
|
#define CLIENT_MAJOR_VERSION 1
|
||||||
|
@ -2168,7 +2175,7 @@ glXQueryDrawable(Display *dpy, GLXDrawable draw, int attribute,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
generate_error(dpy, BadValue, 0, X_GLXCreateContextAtrribsARB, true);
|
generate_error(dpy, BadValue, 0, X_GLXCreateContextAttribsARB, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2762,14 +2769,14 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* bad attribute */
|
/* bad attribute */
|
||||||
generate_error(dpy, BadValue, 0, X_GLXCreateContextAtrribsARB, True);
|
generate_error(dpy, BadValue, 0, X_GLXCreateContextAttribsARB, True);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check contextFlags */
|
/* check contextFlags */
|
||||||
if (contextFlags & ~contextFlagsAll) {
|
if (contextFlags & ~contextFlagsAll) {
|
||||||
generate_error(dpy, BadValue, 0, X_GLXCreateContextAtrribsARB, True);
|
generate_error(dpy, BadValue, 0, X_GLXCreateContextAttribsARB, True);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2777,14 +2784,14 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
|
||||||
if (profileMask != GLX_CONTEXT_CORE_PROFILE_BIT_ARB &&
|
if (profileMask != GLX_CONTEXT_CORE_PROFILE_BIT_ARB &&
|
||||||
profileMask != GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB &&
|
profileMask != GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB &&
|
||||||
profileMask != GLX_CONTEXT_ES_PROFILE_BIT_EXT) {
|
profileMask != GLX_CONTEXT_ES_PROFILE_BIT_EXT) {
|
||||||
generate_error(dpy, GLXBadProfileARB, 0, X_GLXCreateContextAtrribsARB, False);
|
generate_error(dpy, GLXBadProfileARB, 0, X_GLXCreateContextAttribsARB, False);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check renderType */
|
/* check renderType */
|
||||||
if (renderType != GLX_RGBA_TYPE &&
|
if (renderType != GLX_RGBA_TYPE &&
|
||||||
renderType != GLX_COLOR_INDEX_TYPE) {
|
renderType != GLX_COLOR_INDEX_TYPE) {
|
||||||
generate_error(dpy, BadValue, 0, X_GLXCreateContextAtrribsARB, True);
|
generate_error(dpy, BadValue, 0, X_GLXCreateContextAttribsARB, True);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2797,7 +2804,7 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
|
||||||
(majorVersion == 3 && minorVersion > 3) ||
|
(majorVersion == 3 && minorVersion > 3) ||
|
||||||
(majorVersion == 4 && minorVersion > 5) ||
|
(majorVersion == 4 && minorVersion > 5) ||
|
||||||
majorVersion > 4))) {
|
majorVersion > 4))) {
|
||||||
generate_error(dpy, BadMatch, 0, X_GLXCreateContextAtrribsARB, True);
|
generate_error(dpy, BadMatch, 0, X_GLXCreateContextAttribsARB, True);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (profileMask == GLX_CONTEXT_ES_PROFILE_BIT_EXT &&
|
if (profileMask == GLX_CONTEXT_ES_PROFILE_BIT_EXT &&
|
||||||
|
@ -2809,18 +2816,18 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
|
||||||
* different error code for invalid ES versions, but this is what NVIDIA
|
* different error code for invalid ES versions, but this is what NVIDIA
|
||||||
* does and piglit expects.
|
* does and piglit expects.
|
||||||
*/
|
*/
|
||||||
generate_error(dpy, GLXBadProfileARB, 0, X_GLXCreateContextAtrribsARB, False);
|
generate_error(dpy, GLXBadProfileARB, 0, X_GLXCreateContextAttribsARB, False);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((contextFlags & GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB) &&
|
if ((contextFlags & GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB) &&
|
||||||
majorVersion < 3) {
|
majorVersion < 3) {
|
||||||
generate_error(dpy, BadMatch, 0, X_GLXCreateContextAtrribsARB, True);
|
generate_error(dpy, BadMatch, 0, X_GLXCreateContextAttribsARB, True);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (renderType == GLX_COLOR_INDEX_TYPE && majorVersion >= 3) {
|
if (renderType == GLX_COLOR_INDEX_TYPE && majorVersion >= 3) {
|
||||||
generate_error(dpy, BadMatch, 0, X_GLXCreateContextAtrribsARB, True);
|
generate_error(dpy, BadMatch, 0, X_GLXCreateContextAttribsARB, True);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2830,7 +2837,7 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
|
||||||
majorVersion, minorVersion,
|
majorVersion, minorVersion,
|
||||||
profileMask, contextFlags);
|
profileMask, contextFlags);
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
generate_error(dpy, GLXBadFBConfig, 0, X_GLXCreateContextAtrribsARB, False);
|
generate_error(dpy, GLXBadFBConfig, 0, X_GLXCreateContextAttribsARB, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctx;
|
return ctx;
|
||||||
|
|
Loading…
Reference in New Issue