summaryrefslogtreecommitdiff
path: root/hw/xquartz/GL/indirect.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xquartz/GL/indirect.c')
-rw-r--r--hw/xquartz/GL/indirect.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index 6da27c78a..d15b9a3df 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -666,7 +666,15 @@ GLuint __glFloorLog2(GLuint val)
}
static void setup_dispatch_table(void) {
- struct _glapi_table *disp=_glapi_get_dispatch();
+ static struct _glapi_table *disp = NULL;
+
+ if(disp) {
+ _glapi_set_dispatch(disp);
+ return;
+ }
+
+ disp=calloc(1,sizeof(struct _glapi_table));
+ assert(disp);
/* to update:
* for f in $(grep 'define SET_' ../../../glx/dispatch.h | cut -f2 -d' ' | cut -f1 -d\( | sort -u); do grep -q $f indirect.c || echo $f ; done | grep -v by_offset | sed 's:SET_\(.*\)$:SET_\1(disp, gl\1)\;:' | pbcopy
@@ -1610,4 +1618,6 @@ static void setup_dispatch_table(void) {
SET_PixelTexGenParameterivSGIS(disp, glPixelTexGenParameterivSGIS);
SET_PixelTexGenSGIX(disp, glPixelTexGenSGIX);
#endif
+
+ _glapi_set_dispatch(disp);
}