X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglx%2Fglxclient.h;h=141e46a31cda51d84cf5f65d879d081e70bcc749;hb=d656736bbf926c219b6bcbc0ad59132fc82a7382;hp=e4adedd509b7315f3ca2007d82b1cce2500a23c7;hpb=814345f54b74eee2597cf84f3c34817488f07522;p=mesa.git diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index e4adedd509b..141e46a31cd 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -47,19 +47,20 @@ #include #include #include -#ifdef _WIN32 #include -#endif +#include #include "GL/glxproto.h" #include "glxconfig.h" #include "glxhash.h" -#if defined( HAVE_PTHREAD ) -# include -#endif +#include "util/macros.h" #include "glxextensions.h" -#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) + +#ifdef __cplusplus +extern "C" { +#endif + #define GLX_MAJOR_VERSION 1 /* current version numbers */ #define GLX_MINOR_VERSION 4 @@ -113,9 +114,9 @@ struct __GLXDRIscreenRec { struct glx_config *config); int64_t (*swapBuffers)(__GLXDRIdrawable *pdraw, int64_t target_msc, - int64_t divisor, int64_t remainder); + int64_t divisor, int64_t remainder, Bool flush); void (*copySubBuffer)(__GLXDRIdrawable *pdraw, - int x, int y, int width, int height); + int x, int y, int width, int height, Bool flush); int (*getDrawableMSC)(struct glx_screen *psc, __GLXDRIdrawable *pdraw, int64_t *ust, int64_t *msc, int64_t *sbc); int (*waitForMSC)(__GLXDRIdrawable *pdraw, int64_t target_msc, @@ -125,6 +126,7 @@ struct __GLXDRIscreenRec { int64_t *msc, int64_t *sbc); int (*setSwapInterval)(__GLXDRIdrawable *pdraw, int interval); int (*getSwapInterval)(__GLXDRIdrawable *pdraw); + int (*getBufferAge)(__GLXDRIdrawable *pdraw); }; struct __GLXDRIdrawableRec @@ -150,6 +152,7 @@ extern __GLXDRIdisplay *dri2CreateDisplay(Display * dpy); extern void dri2InvalidateBuffers(Display *dpy, XID drawable); extern unsigned dri2GetSwapEventType(Display *dpy, XID drawable); +extern __GLXDRIdisplay *dri3_create_display(Display * dpy); /* ** Functions to obtain driver configuration information from a direct @@ -210,6 +213,10 @@ typedef struct __GLXattributeMachineRec __GLXattribute **stackPointer; } __GLXattributeMachine; +typedef struct _mesa_glinterop_device_info mesa_glinterop_device_info; +typedef struct _mesa_glinterop_export_in mesa_glinterop_export_in; +typedef struct _mesa_glinterop_export_out mesa_glinterop_export_out; + struct glx_context_vtable { void (*destroy)(struct glx_context *ctx); int (*bind)(struct glx_context *context, struct glx_context *old, @@ -224,6 +231,11 @@ struct glx_context_vtable { int buffer, const int *attrib_list); void (*release_tex_image)(Display * dpy, GLXDrawable drawable, int buffer); void * (*get_proc_address)(const char *symbol); + int (*interop_query_device_info)(struct glx_context *ctx, + mesa_glinterop_device_info *out); + int (*interop_export_object)(struct glx_context *ctx, + const mesa_glinterop_export_in *in, + mesa_glinterop_export_out *out); }; /** @@ -474,7 +486,12 @@ struct glx_screen_vtable { unsigned num_attrib, const uint32_t *attribs, unsigned *error); - + int (*query_renderer_integer)(struct glx_screen *psc, + int attribute, + unsigned int *value); + int (*query_renderer_string)(struct glx_screen *psc, + int attribute, + const char **value); }; struct glx_screen @@ -582,6 +599,7 @@ struct glx_display __GLXDRIdisplay *driswDisplay; __GLXDRIdisplay *driDisplay; __GLXDRIdisplay *dri2Display; + __GLXDRIdisplay *dri3Display; #endif }; @@ -623,7 +641,6 @@ extern void __glXPreferEGL(int state); extern int __glXDebug; /* This is per-thread storage in an MT environment */ -#if defined( HAVE_PTHREAD ) extern void __glXSetCurrentContext(struct glx_context * c); @@ -640,14 +657,6 @@ extern struct glx_context *__glXGetCurrentContext(void); # endif /* defined( GLX_USE_TLS ) */ -#else - -extern struct glx_context *__glXcurrentContext; -#define __glXGetCurrentContext() __glXcurrentContext -#define __glXSetCurrentContext(gc) __glXcurrentContext = gc - -#endif /* defined( HAVE_PTHREAD ) */ - extern void __glXSetCurrentContextNull(void); @@ -655,14 +664,9 @@ extern void __glXSetCurrentContextNull(void); ** Global lock for all threads in this address space using the GLX ** extension */ -#if defined( HAVE_PTHREAD ) extern pthread_mutex_t __glXmutex; #define __glXLock() pthread_mutex_lock(&__glXmutex) #define __glXUnlock() pthread_mutex_unlock(&__glXmutex) -#else -#define __glXLock() -#define __glXUnlock() -#endif /* ** Setup for a command. Initialize the extension for dpy if necessary. @@ -759,9 +763,6 @@ extern char *__glXQueryServerString(Display * dpy, int opcode, extern char *__glXGetString(Display * dpy, int opcode, CARD32 screen, CARD32 name); -extern char *__glXstrdup(const char *str); - - extern const char __glXGLClientVersion[]; extern const char __glXGLClientExtensions[]; @@ -774,7 +775,7 @@ extern GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable, #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) extern GLboolean -__glxGetMscRate(__GLXDRIdrawable *glxDraw, +__glxGetMscRate(struct glx_screen *psc, int32_t * numerator, int32_t * denominator); /* So that dri2.c:DRI2WireToEvent() can access @@ -803,6 +804,9 @@ extern int applegl_create_display(struct glx_display *display); #endif +extern Bool validate_renderType_against_config(const struct glx_config *config, + int renderType); + extern struct glx_drawable *GetGLXDrawable(Display *dpy, GLXDrawable drawable); extern int InitGLXDrawable(Display *dpy, struct glx_drawable *glxDraw, @@ -817,5 +821,16 @@ extern struct glx_context * indirect_create_context(struct glx_screen *psc, struct glx_config *mode, struct glx_context *shareList, int renderType); +extern struct glx_context * +indirect_create_context_attribs(struct glx_screen *base, + struct glx_config *config_base, + struct glx_context *shareList, + unsigned num_attribs, + const uint32_t *attribs, + unsigned *error); + +#ifdef __cplusplus +} +#endif #endif /* !__GLX_client_h__ */