From 3dd299c3d5b88114894ec30d1fac85fba688201f Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 20 Aug 2019 15:43:06 -0400 Subject: [PATCH] glx: Sync with Khronos Minor fixups required to keep the prototypes matching and to remove mention of retired enums. Acked-by: Eric Engestrom Reviewed-by: Eric Anholt --- include/GL/glxext.h | 23 ++++++++++++------- src/gallium/state_trackers/glx/xlib/glx_api.c | 7 +++--- src/glx/apple/glx_empty.c | 2 +- src/glx/glx_pbuffer.c | 4 ++-- src/glx/tests/query_renderer_unittest.cpp | 2 -- src/mesa/drivers/x11/fakeglx.c | 7 +++--- src/mesa/drivers/x11/glxapi.c | 8 +++---- src/mesa/drivers/x11/glxapi.h | 2 +- 8 files changed, 29 insertions(+), 26 deletions(-) diff --git a/include/GL/glxext.h b/include/GL/glxext.h index 4c984ef4b89..a6f1c0c4331 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -34,7 +34,7 @@ extern "C" { ** https://github.com/KhronosGroup/OpenGL-Registry */ -#define GLX_GLXEXT_VERSION 20180525 +#define GLX_GLXEXT_VERSION 20190728 /* Generated C header for: * API: glx @@ -280,6 +280,14 @@ void glXBlitContextFramebufferAMD (GLXContext dstCtx, GLint srcX0, GLint srcY0, #define GLX_BACK_BUFFER_AGE_EXT 0x20F4 #endif /* GLX_EXT_buffer_age */ +#ifndef GLX_EXT_context_priority +#define GLX_EXT_context_priority 1 +#define GLX_CONTEXT_PRIORITY_LEVEL_EXT 0x3100 +#define GLX_CONTEXT_PRIORITY_HIGH_EXT 0x3101 +#define GLX_CONTEXT_PRIORITY_MEDIUM_EXT 0x3102 +#define GLX_CONTEXT_PRIORITY_LOW_EXT 0x3103 +#endif /* GLX_EXT_context_priority */ + #ifndef GLX_EXT_create_context_es2_profile #define GLX_EXT_create_context_es2_profile 1 #define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 @@ -476,7 +484,6 @@ GLXPixmap glXCreateGLXPixmapMESA (Display *dpy, XVisualInfo *visual, Pixmap pixm #define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B #define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C #define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D -#define GLX_RENDERER_ID_MESA 0x818E typedef Bool ( *PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int *value); typedef const char *( *PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute); typedef Bool ( *PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display *dpy, int screen, int renderer, int attribute, unsigned int *value); @@ -501,9 +508,9 @@ Bool glXReleaseBuffersMESA (Display *dpy, GLXDrawable drawable); #define GLX_MESA_set_3dfx_mode 1 #define GLX_3DFX_WINDOW_MODE_MESA 0x1 #define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 -typedef Bool ( *PFNGLXSET3DFXMODEMESAPROC) (int mode); +typedef GLboolean ( *PFNGLXSET3DFXMODEMESAPROC) (GLint mode); #ifdef GLX_GLXEXT_PROTOTYPES -Bool glXSet3DfxModeMESA (int mode); +GLboolean glXSet3DfxModeMESA (GLint mode); #endif #endif /* GLX_MESA_set_3dfx_mode */ @@ -836,13 +843,13 @@ int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int si #define GLX_PBUFFER_SGIX 0x8023 typedef GLXPbufferSGIX ( *PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list); typedef void ( *PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf); -typedef int ( *PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); +typedef void ( *PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); typedef void ( *PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask); typedef void ( *PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask); #ifdef GLX_GLXEXT_PROTOTYPES GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list); void glXDestroyGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf); -int glXQueryGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); +void glXQueryGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); void glXSelectEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long mask); void glXGetSelectedEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long *mask); #endif @@ -940,9 +947,9 @@ int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int *count); #ifndef GLX_SUN_get_transparent_index #define GLX_SUN_get_transparent_index 1 -typedef Status ( *PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex); +typedef Status ( *PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); #ifdef GLX_GLXEXT_PROTOTYPES -Status glXGetTransparentIndexSUN (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex); +Status glXGetTransparentIndexSUN (Display *dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); #endif #endif /* GLX_SUN_get_transparent_index */ diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index 97c3913b5a4..748efea8649 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -2495,7 +2495,7 @@ glXDestroyGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf) } -PUBLIC int +PUBLIC void glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value) { @@ -2503,7 +2503,7 @@ glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf, int attribute, if (!xmbuf) { /* Generate GLXBadPbufferSGIX for bad pbuffer */ - return 0; + return; } switch (attribute) { @@ -2525,7 +2525,6 @@ glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf, int attribute, default: *value = 0; } - return 0; } @@ -2654,7 +2653,7 @@ glXAssociateDMPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuffer, PUBLIC Status glXGetTransparentIndexSUN(Display *dpy, Window overlay, Window underlay, - long *pTransparent) + unsigned long *pTransparent) { (void) dpy; (void) overlay; diff --git a/src/glx/apple/glx_empty.c b/src/glx/apple/glx_empty.c index b7afbce7dd5..1b3abca6daa 100644 --- a/src/glx/apple/glx_empty.c +++ b/src/glx/apple/glx_empty.c @@ -147,7 +147,7 @@ glXCopySubBufferMESA(Display * dpy, GLXDrawable drawable, } -_X_EXPORT int +_X_EXPORT void glXQueryGLXPbufferSGIX(Display * dpy, GLXDrawable drawable, int attribute, unsigned int *value) { diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index fd3327f1209..6bdb6354f45 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -834,11 +834,11 @@ glXQueryDrawable(Display * dpy, GLXDrawable drawable, /** * Query an attribute of a pbuffer. */ -_GLX_PUBLIC int +_GLX_PUBLIC void glXQueryGLXPbufferSGIX(Display * dpy, GLXPbufferSGIX drawable, int attribute, unsigned int *value) { - return __glXGetDrawableAttribute(dpy, drawable, attribute, value); + __glXGetDrawableAttribute(dpy, drawable, attribute, value); } #endif diff --git a/src/glx/tests/query_renderer_unittest.cpp b/src/glx/tests/query_renderer_unittest.cpp index dc88cc94f49..1323ab770e3 100644 --- a/src/glx/tests/query_renderer_unittest.cpp +++ b/src/glx/tests/query_renderer_unittest.cpp @@ -171,7 +171,6 @@ TEST_F(query_renderer_string_test, invalid_attribute) E(GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA), E(GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA), E(GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA), - E(GLX_RENDERER_ID_MESA), }; for (unsigned i = 0; i < ARRAY_SIZE(invalid_attributes); i++) { @@ -322,7 +321,6 @@ TEST_F(query_renderer_integer_test, invalid_attribute) E(GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA + 0x10000), E(GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA + 0x10000), E(GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA + 0x10000), - E(GLX_RENDERER_ID_MESA + 0x10000), }; for (unsigned i = 0; i < ARRAY_SIZE(invalid_attributes); i++) { diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index e6d488c4dc3..af60bfaaa4e 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -2536,14 +2536,14 @@ Fake_glXDestroyGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf) } -static int +static void Fake_glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value) { const XMesaBuffer xmbuf = XMesaFindBuffer(dpy, pbuf); if (!xmbuf) { /* Generate GLXBadPbufferSGIX for bad pbuffer */ - return 0; + return; } switch (attribute) { @@ -2565,7 +2565,6 @@ Fake_glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf, int attribute, un default: *value = 0; } - return 0; } @@ -2687,7 +2686,7 @@ Fake_glXAssociateDMPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuffer, DMparams *p /*** GLX_SUN_get_transparent_index ***/ static Status -Fake_glXGetTransparentIndexSUN(Display *dpy, Window overlay, Window underlay, long *pTransparent) +Fake_glXGetTransparentIndexSUN(Display *dpy, Window overlay, Window underlay, unsigned long *pTransparent) { (void) dpy; (void) overlay; diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index f112c8ab090..2ef675682e4 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -795,14 +795,14 @@ glXDestroyGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf) t->DestroyGLXPbufferSGIX(dpy, pbuf); } -int PUBLIC +void PUBLIC glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value) { struct _glxapi_table *t; GET_DISPATCH(dpy, t); if (!t) - return 0; - return t->QueryGLXPbufferSGIX(dpy, pbuf, attribute, value); + return; + t->QueryGLXPbufferSGIX(dpy, pbuf, attribute, value); } void PUBLIC @@ -913,7 +913,7 @@ glXAssociateDMPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params /*** GLX_SUN_get_transparent_index ***/ Status PUBLIC -glXGetTransparentIndexSUN(Display *dpy, Window overlay, Window underlay, long *pTransparent) +glXGetTransparentIndexSUN(Display *dpy, Window overlay, Window underlay, unsigned long *pTransparent) { struct _glxapi_table *t; GET_DISPATCH(dpy, t); diff --git a/src/mesa/drivers/x11/glxapi.h b/src/mesa/drivers/x11/glxapi.h index 03af158afae..90323a24731 100644 --- a/src/mesa/drivers/x11/glxapi.h +++ b/src/mesa/drivers/x11/glxapi.h @@ -165,7 +165,7 @@ struct _glxapi_table { #endif /*** GLX_SUN_get_transparent_index ***/ - Status (*GetTransparentIndexSUN)(Display *, Window, Window, long *); + Status (*GetTransparentIndexSUN)(Display *, Window, Window, unsigned long *); /*** GLX_MESA_copy_sub_buffer ***/ void (*CopySubBufferMESA)(Display *dpy, GLXDrawable drawable, int x, int y, int width, int height); -- 2.30.2