glsl: define some GLES3 constants in GLSL 4.1
[mesa.git] / src / glx / g_glxglvnddispatchfuncs.c
index 13fbc5ea81b4fb37f8caa81c57f055f4b02cb0b4..e6b9c0ba374e17634c6ad7ad72b5d2b24d2b5298 100644 (file)
@@ -9,7 +9,8 @@
 #include "g_glxglvnddispatchindices.h"
 
 const int DI_FUNCTION_COUNT = DI_LAST_INDEX;
-int __glXDispatchTableIndices[DI_LAST_INDEX];
+/* Allocate an extra 'dummy' to ease lookup. See FindGLXFunction() */
+int __glXDispatchTableIndices[DI_LAST_INDEX + 1];
 const __GLXapiExports *__glXGLVNDAPIExports;
 
 const char * const __glXDispatchTableStrings[DI_LAST_INDEX] = {
@@ -922,7 +923,8 @@ static Bool dispatch_glXWaitForSbcOML(Display *dpy, GLXDrawable drawable,
 #undef __FETCH_FUNCTION_PTR
 
 
-const void * const __glXDispatchFunctions[DI_LAST_INDEX] = {
+/* Allocate an extra 'dummy' to ease lookup. See FindGLXFunction() */
+const void * const __glXDispatchFunctions[DI_LAST_INDEX + 1] = {
 #define __ATTRIB(field) \
     [DI_##field] = (void *)dispatch_##field
 
@@ -939,20 +941,14 @@ const void * const __glXDispatchFunctions[DI_LAST_INDEX] = {
     __ATTRIB(GetFBConfigAttribSGIX),
     __ATTRIB(GetFBConfigFromVisualSGIX),
     __ATTRIB(GetSelectedEventSGIX),
-#if defined(GLX_SGI_video_sync)
     __ATTRIB(GetVideoSyncSGI),
-#endif // defined(GLX_SGI_video_sync)
     __ATTRIB(GetVisualFromFBConfigSGIX),
     __ATTRIB(QueryContextInfoEXT),
     __ATTRIB(QueryGLXPbufferSGIX),
     __ATTRIB(ReleaseTexImageEXT),
     __ATTRIB(SelectEventSGIX),
-#if defined(GLX_SGI_swap_control)
     __ATTRIB(SwapIntervalSGI),
-#endif // defined(GLX_SGI_swap_control)
-#if defined(GLX_SGI_video_sync)
     __ATTRIB(WaitVideoSyncSGI),
-#endif // defined(GLX_SGI_video_sync)
     __ATTRIB(glXBindSwapBarrierSGIX),
     __ATTRIB(glXCopySubBufferMESA),
     __ATTRIB(glXCreateGLXPixmapMESA),
@@ -972,5 +968,6 @@ const void * const __glXDispatchFunctions[DI_LAST_INDEX] = {
     __ATTRIB(glXWaitForMscOML),
     __ATTRIB(glXWaitForSbcOML),
 
+    [DI_LAST_INDEX] = NULL,
 #undef __ATTRIB
 };