xref: /third_party/mesa3d/src/mapi/u_current.h (revision bf215546)
1#ifndef _U_CURRENT_H_
2#define _U_CURRENT_H_
3
4#include "util/macros.h"
5
6
7#if defined(MAPI_MODE_UTIL) || defined(MAPI_MODE_GLAPI) || \
8    defined(MAPI_MODE_BRIDGE)
9
10#include "glapi/glapi.h"
11
12#define u_current_table _glapi_tls_Dispatch
13#define u_current_context _glapi_tls_Context
14
15#define u_current_get_table_internal _glapi_get_dispatch
16#define u_current_get_context_internal _glapi_get_context
17
18#define u_current_table_tsd _gl_DispatchTSD
19
20#else /* MAPI_MODE_UTIL || MAPI_MODE_GLAPI || MAPI_MODE_BRIDGE */
21
22struct _glapi_table;
23
24extern __THREAD_INITIAL_EXEC struct _glapi_table *u_current_table;
25extern __THREAD_INITIAL_EXEC void *u_current_context;
26
27#endif /* MAPI_MODE_UTIL || MAPI_MODE_GLAPI || MAPI_MODE_BRIDGE */
28
29void
30u_current_set_table(const struct _glapi_table *tbl);
31
32_GLAPI_EXPORT struct _glapi_table *
33u_current_get_table_internal(void);
34
35void
36u_current_set_context(const void *ptr);
37
38_GLAPI_EXPORT void *
39u_current_get_context_internal(void);
40
41#endif /* _U_CURRENT_H_ */
42