Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
authorBen Skeggs <skeggsb@gmail.com>
Sun, 25 May 2008 04:19:18 +0000 (14:19 +1000)
committerBen Skeggs <skeggsb@gmail.com>
Sun, 25 May 2008 04:19:18 +0000 (14:19 +1000)
167 files changed:
Makefile
configs/linux-dri
configs/linux-egl [new file with mode: 0644]
progs/beos/.gitignore [new file with mode: 0644]
progs/demos/drawpix.c
progs/demos/lodbias.c
progs/demos/streaming_rect.c
progs/directfb/.gitignore [new file with mode: 0644]
progs/egl/.gitignore [new file with mode: 0644]
progs/egl/Makefile
progs/egl/demo1.c
progs/egl/demo2.c
progs/egl/demo3.c
progs/egl/eglgears.c
progs/egl/eglinfo.c
progs/fbdev/.gitignore [new file with mode: 0644]
progs/glsl/.gitignore
progs/glsl/Makefile
progs/glsl/convolution.frag [new file with mode: 0644]
progs/glsl/convolution.vert [new file with mode: 0644]
progs/glsl/convolutions.c [new file with mode: 0644]
progs/glsl/texdemo1.c
progs/miniglx/.gitignore [new file with mode: 0644]
progs/osdemos/.gitignore [new file with mode: 0644]
progs/samples/.gitignore
progs/slang/.gitignore [new file with mode: 0644]
progs/tests/.gitignore
progs/tools/trace/.gitignore [new file with mode: 0644]
progs/trivial/.gitignore
progs/trivial/quad-tex-2d.c
progs/vp/.gitignore [new file with mode: 0644]
progs/xdemos/.gitignore
src/gallium/auxiliary/draw/draw_pipe_aaline.c
src/gallium/auxiliary/draw/draw_pipe_pstipple.c
src/gallium/auxiliary/draw/draw_vs_exec.c
src/gallium/auxiliary/draw/draw_vs_llvm.c
src/gallium/auxiliary/draw/draw_vs_sse.c
src/gallium/auxiliary/gallivm/gallivm.cpp
src/gallium/auxiliary/gallivm/gallivm.h
src/gallium/auxiliary/gallivm/gallivm_builtins.cpp
src/gallium/auxiliary/gallivm/gallivm_cpu.cpp
src/gallium/auxiliary/gallivm/instructionssoa.cpp
src/gallium/auxiliary/gallivm/instructionssoa.h
src/gallium/auxiliary/gallivm/llvm_builtins.c
src/gallium/auxiliary/gallivm/soabuiltins.c
src/gallium/auxiliary/gallivm/tgsitollvm.cpp
src/gallium/auxiliary/tgsi/util/tgsi_parse.c
src/gallium/auxiliary/tgsi/util/tgsi_parse.h
src/gallium/drivers/cell/ppu/cell_state_shader.c
src/gallium/drivers/i915simple/i915_state.c
src/gallium/drivers/i965simple/brw_state.c
src/gallium/drivers/softpipe/sp_fs_exec.c
src/gallium/drivers/softpipe/sp_fs_sse.c
src/gallium/drivers/softpipe/sp_state.h
src/gallium/drivers/softpipe/sp_state_fs.c
src/gallium/include/pipe/p_format.h
src/gallium/include/pipe/p_util.h
src/gallium/winsys/dri/intel/Makefile
src/gallium/winsys/dri/intel/intel_batchbuffer.c
src/gallium/winsys/dri/intel/intel_batchbuffer.h
src/gallium/winsys/dri/intel/intel_batchpool.c [deleted file]
src/gallium/winsys/dri/intel/intel_batchpool.h [deleted file]
src/gallium/winsys/dri/intel/intel_context.c
src/gallium/winsys/dri/intel/intel_context.h
src/gallium/winsys/dri/intel/intel_screen.c
src/gallium/winsys/dri/intel/intel_screen.h
src/gallium/winsys/dri/intel/intel_swapbuffers.c
src/gallium/winsys/dri/intel/intel_winsys.h
src/gallium/winsys/dri/intel/intel_winsys_i915.c
src/gallium/winsys/dri/intel/intel_winsys_pipe.c
src/gallium/winsys/dri/intel/server/i830_common.h
src/gallium/winsys/dri/intel/ws_dri_bufmgr.c [new file with mode: 0644]
src/gallium/winsys/dri/intel/ws_dri_bufmgr.h [new file with mode: 0644]
src/gallium/winsys/dri/intel/ws_dri_bufpool.h [new file with mode: 0644]
src/gallium/winsys/dri/intel/ws_dri_drmpool.c [new file with mode: 0644]
src/gallium/winsys/dri/intel/ws_dri_fencemgr.c [new file with mode: 0644]
src/gallium/winsys/dri/intel/ws_dri_fencemgr.h [new file with mode: 0644]
src/gallium/winsys/dri/intel/ws_dri_mallocpool.c [new file with mode: 0644]
src/gallium/winsys/dri/intel/ws_dri_slabpool.c [new file with mode: 0644]
src/gallium/winsys/egl_drm/Makefile [new file with mode: 0644]
src/gallium/winsys/egl_drm/Makefile.template [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/Makefile [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/SConscript [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_batchbuffer.c [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_batchbuffer.h [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_context.c [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_context.h [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_egl.c [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_egl.h [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_lock.c [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_reg.h [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_screen.c [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_screen.h [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_swapbuffers.c [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_swapbuffers.h [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_winsys.h [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_winsys_i915.c [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_winsys_pipe.c [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/intel_winsys_softpipe.c [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/ws_dri_bufmgr.c [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/ws_dri_bufmgr.h [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/ws_dri_bufpool.h [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/ws_dri_drmpool.c [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/ws_dri_fencemgr.c [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/ws_dri_fencemgr.h [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/ws_dri_mallocpool.c [new file with mode: 0644]
src/gallium/winsys/egl_drm/intel/ws_dri_slabpool.c [new file with mode: 0644]
src/glx/x11/indirect.c
src/glx/x11/indirect.h
src/glx/x11/indirect_init.c
src/mesa/drivers/dri/common/extension_helper.h
src/mesa/glapi/dispatch.h
src/mesa/glapi/gl_API.xml
src/mesa/glapi/gl_x86_asm.py
src/mesa/glapi/glapioffsets.h
src/mesa/glapi/glapitable.h
src/mesa/glapi/glapitemp.h
src/mesa/glapi/glprocs.h
src/mesa/glapi/glthread.h
src/mesa/main/config.h
src/mesa/main/context.c
src/mesa/main/dlist.c
src/mesa/main/state.c
src/mesa/shader/arbprogram.c
src/mesa/shader/arbprogram.syn
src/mesa/shader/arbprogram_syn.h
src/mesa/shader/atifragshader.c
src/mesa/shader/nvprogram.c
src/mesa/shader/nvprogram.h
src/mesa/shader/prog_execute.c
src/mesa/shader/prog_execute.h
src/mesa/shader/prog_parameter.c
src/mesa/shader/prog_parameter.h
src/mesa/shader/prog_print.c
src/mesa/shader/prog_statevars.c
src/mesa/shader/program.c
src/mesa/shader/shader_api.c
src/mesa/shader/slang/library/Makefile
src/mesa/shader/slang/library/slang_common_builtin.gc
src/mesa/shader/slang/library/slang_common_builtin_gc.h
src/mesa/shader/slang/library/slang_core.gc
src/mesa/shader/slang/library/slang_core_gc.h
src/mesa/shader/slang/library/slang_version_syn.h [deleted file]
src/mesa/shader/slang/slang_builtin.c
src/mesa/shader/slang/slang_codegen.c
src/mesa/shader/slang/slang_compile.c
src/mesa/shader/slang/slang_compile_operation.h
src/mesa/shader/slang/slang_emit.c
src/mesa/shader/slang/slang_link.c
src/mesa/shader/slang/slang_typeinfo.h
src/mesa/sparc/glapi_sparc.S
src/mesa/state_tracker/st_cb_bitmap.c
src/mesa/state_tracker/st_cb_clear.c
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_drawpixels.h
src/mesa/state_tracker/st_cb_program.c
src/mesa/state_tracker/st_cb_readpixels.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_context.h
src/mesa/state_tracker/st_format.c
src/mesa/state_tracker/st_gen_mipmap.c
src/mesa/swrast/s_fragprog.c
src/mesa/vbo/vbo_exec_draw.c
src/mesa/vbo/vbo_save_draw.c
src/mesa/x86-64/glapi_x86-64.S
src/mesa/x86/glapi_x86.S

index 1ec8ce7cbaf8521510657e1b5ed63cd9b0de9e2b..9b3be43d5052bf18152a67f63acde14460612eaa 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -108,6 +108,7 @@ linux-dri-x86 \
 linux-dri-x86-64 \
 linux-dri-ppc \
 linux-dri-xcb \
+linux-egl \
 linux-indirect \
 linux-fbdev \
 linux-glide \
index bf7881937e457e2b426b0b0a34a14a1f91eed3b4..4fdef196d968eac6c5a36f73e1a797643634ea24 100644 (file)
@@ -59,8 +59,10 @@ SRC_DIRS := egl $(SRC_DIRS)
 PROGRAM_DIRS = egl
 endif
 
+
+
 DRIVER_DIRS = dri
-WINDOW_SYSTEM=dri
+WINDOW_SYSTEM = dri
 GALLIUM_WINSYS_DIRS = dri
 
 # gamma are missing because they have not been converted to use the new
diff --git a/configs/linux-egl b/configs/linux-egl
new file mode 100644 (file)
index 0000000..e906806
--- /dev/null
@@ -0,0 +1,65 @@
+# -*-makefile-*-
+# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
+
+include $(TOP)/configs/default
+
+CONFIG_NAME = linux-dri
+
+# Compiler and flags
+CC = gcc
+CXX = g++
+
+#MKDEP = /usr/X11R6/bin/makedepend
+#MKDEP = gcc -M
+#MKDEP_OPTIONS = -MF depend
+
+OPT_FLAGS  = -O -g
+PIC_FLAGS  = -fPIC
+
+# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
+ARCH_FLAGS ?=
+
+DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
+       -D_BSD_SOURCE -D_GNU_SOURCE \
+       -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
+       -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
+       -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
+
+X11_INCLUDES = -I/usr/X11R6/include
+
+CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \
+       $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS)
+
+CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
+
+
+MESA_ASM_SOURCES = 
+
+# Library/program dependencies
+EXTRA_LIB_PATH=-L/usr/X11R6/lib
+
+LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
+LIBDRM_LIB = $(shell pkg-config --libs libdrm)
+DRI_LIB_DEPS  = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
+GL_LIB_DEPS   = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
+               -lm -lpthread -ldl \
+                $(LIBDRM_LIB)
+
+
+# This is now 0 by default since it seems to confuse the hell out of people
+# and generate a lot of extra noise on bugzilla.  If you need to build with
+# EGL, do 'make linux-dri USING_EGL=1'
+
+USING_EGL=0
+
+# Directories
+SRC_DIRS = gallium mesa gallium/winsys glu egl
+PROGRAM_DIRS = egl
+
+DRIVER_DIRS = dri
+WINDOW_SYSTEM = dri
+GALLIUM_WINSYS_DIRS = egl_drm
+
+# gamma are missing because they have not been converted to use the new
+# interface.
+DRI_DIRS = intel 
diff --git a/progs/beos/.gitignore b/progs/beos/.gitignore
new file mode 100644 (file)
index 0000000..53011ca
--- /dev/null
@@ -0,0 +1,3 @@
+demo
+GLInfo
+sample
index d2f57486744ecb5b98b80da050b0cd270983542f..5490bcc6355fd486fa451fce9e70f9105837da06 100644 (file)
@@ -28,6 +28,7 @@ static GLfloat Zpos = -1.0;
 static float Xzoom, Yzoom;
 static GLboolean DrawFront = GL_FALSE;
 static GLboolean Dither = GL_TRUE;
+static int win = 0;
 
 
 static void Reset( void )
@@ -215,6 +216,7 @@ static void Key( unsigned char key, int x, int y )
          printf("glDrawBuffer(%s)\n", DrawFront ? "GL_FRONT" : "GL_BACK");
          break;
       case 27:
+         glutDestroyWindow(win);
          exit(0);
          break;
    }
@@ -343,7 +345,7 @@ int main( int argc, char *argv[] )
    else
       glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
 
-   glutCreateWindow(argv[0]);
+   win = glutCreateWindow(argv[0]);
 
    Init(ciMode, filename);
    Usage();
index c5a2a1b457315f99530692e4d1781d781ae4df47..30b1ed13d5f5283beff2358f65896135a8ea8c66 100644 (file)
@@ -42,7 +42,7 @@ static GLfloat Xrot = 0, Yrot = -30, Zrot = 0;
 static GLboolean Anim = GL_TRUE;
 static GLint Bias = 0, BiasStepSign = +1; /* ints avoid fp precision problem */
 static GLint BiasMin = -400, BiasMax = 400;
-
+static int win = 0;
 
 
 static void
@@ -172,6 +172,7 @@ static void Key( unsigned char key, int x, int y )
          Bias = 100.0 * (key - '0');
          break;
       case 27:
+         glutDestroyWindow(win);
          exit(0);
          break;
    }
@@ -281,7 +282,7 @@ int main( int argc, char *argv[] )
    glutInitWindowPosition( 0, 0 );
    glutInitWindowSize( 350, 350 );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
-   glutCreateWindow(argv[0]);
+   win = glutCreateWindow(argv[0]);
    glutReshapeFunc( Reshape );
    glutKeyboardFunc( Key );
    glutSpecialFunc( SpecialKey );
index 86e00803c01b6894a1f81192e9521afe9c1ac0bb..4c1d8535fd78f92f13769f8b2a7144f72e8d4992 100644 (file)
@@ -1,13 +1,9 @@
-
 /*
- * GL_ARB_multitexture demo
+ * GL_ARB_pixel_buffer_object test
  *
  * Command line options:
- *    -info      print GL implementation information
- *
+ *    -w WIDTH -h HEIGHT   sets window size
  *
- * Brian Paul  November 1998  This program is in the public domain.
- * Modified on 12 Feb 2002 for > 2 texture units.
  */
 
 #define GL_GLEXT_PROTOTYPES
@@ -25,6 +21,8 @@
 #define PBO 11
 #define QUIT 100
 
+static GLuint DrawPBO;
+
 static GLboolean Animate = GL_TRUE;
 static GLboolean use_pbo = 1;
 static GLboolean whole_rect = 1;
@@ -49,7 +47,7 @@ static void Idle( void )
    }
 }
 
-static int max( int a, int b ) { return a > b ? a : b; }
+/*static int max( int a, int b ) { return a > b ? a : b; }*/
 static int min( int a, int b ) { return a < b ? a : b; }
 
 static void DrawObject()
@@ -62,6 +60,7 @@ static void DrawObject()
        * release the old copy of the texture and allocate a new one
        * without waiting for outstanding rendering to complete.
        */
+      glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, DrawPBO);
       glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_EXT, size, NULL, GL_STREAM_DRAW_ARB);
 
       {
@@ -69,7 +68,7 @@ static void DrawObject()
       
         printf("char %d\n", (unsigned char)(Drift * 255));
 
-        memset(image, size, (unsigned char)(Drift * 255));
+        memset(image, (unsigned char)(Drift * 255), size);
       
         glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT);
       }
@@ -86,7 +85,9 @@ static void DrawObject()
       if (image == NULL) 
         image = malloc(size);
 
-      memset(image, size, (unsigned char)(Drift * 255));
+      glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
+
+      memset(image, (unsigned char)(Drift * 255), size);
 
       /* BGRA should be the fast path for regular uploads as well.
        */
@@ -227,12 +228,12 @@ static void SpecialKey( int key, int x, int y )
 static void Init( int argc, char *argv[] )
 {
    const char *exten = (const char *) glGetString(GL_EXTENSIONS);
-   GLuint texObj, DrawPBO;
+   GLuint texObj;
    GLint size;
 
 
-   if (!strstr(exten, "GL_ARB_multitexture")) {
-      printf("Sorry, GL_ARB_multitexture not supported by this renderer.\n");
+   if (!strstr(exten, "GL_ARB_pixel_buffer_object")) {
+      printf("Sorry, GL_ARB_pixel_buffer_object not supported by this renderer.\n");
       exit(1);
    }
 
diff --git a/progs/directfb/.gitignore b/progs/directfb/.gitignore
new file mode 100644 (file)
index 0000000..55d65fb
--- /dev/null
@@ -0,0 +1,4 @@
+df_gears
+df_morph3d
+df_reflect
+multi_window
diff --git a/progs/egl/.gitignore b/progs/egl/.gitignore
new file mode 100644 (file)
index 0000000..1751108
--- /dev/null
@@ -0,0 +1,5 @@
+demo1
+demo2
+demo3
+eglgears
+eglinfo
index 33447a9d57502c65a5a433d266d523ef73ccf70f..da710cbbbfc7ec3930550fff1f3400d0893173e6 100644 (file)
@@ -46,7 +46,7 @@ demo3.o: demo3.c $(HEADERS)
 
 
 eglinfo: eglinfo.o $(TOP)/$(LIB_DIR)/libEGL.so
-       $(CC) $(CFLAGS) eglinfo.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) -o $@
+       $(CC) $(CFLAGS) eglinfo.o -L$(TOP)/$(LIB_DIR) -lGL -lEGL $(LIBDRM_LIB) -o $@
 
 eglinfo.o: eglinfo.c $(HEADERS)
        $(CC) -c $(CFLAGS) -I$(TOP)/include eglinfo.c
@@ -63,3 +63,9 @@ clean:
        rm -f *.o *~
        rm -f *.so
        rm -f $(PROGRAMS)
+
+run:
+       LD_LIBRARY_PATH=$(TOP)/lib ./eglgears
+
+debug:
+       LD_LIBRARY_PATH=$(TOP)/lib gdb ./eglgears
index 9ef17e38b7daa4845283af90d31383681ba885aa..0cc6f59777f9f19ee5a5bfafc7dd6228be969afb 100644 (file)
@@ -102,7 +102,7 @@ main(int argc, char *argv[])
    /*
    EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    */
-   EGLDisplay d = eglGetDisplay("!fb_dri");
+   EGLDisplay d = eglGetDisplay("!EGL_i915");
    assert(d);
 
    if (!eglInitialize(d, &maj, &min)) {
index 17bbca61587da64aaa875df2d6f591e4bd431863..3f6f53c18efce8a1ce7780227144431f91d7e040 100644 (file)
@@ -102,7 +102,7 @@ main(int argc, char *argv[])
    /*
    EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    */
-   EGLDisplay d = eglGetDisplay("!fb_dri");
+   EGLDisplay d = eglGetDisplay("!EGL_i915");
    assert(d);
 
    if (!eglInitialize(d, &maj, &min)) {
index 9edf7c952b3cc5a49f8786ca7fd55665c2726c0e..e9d2180bf07598be2336d73f2273d594c1a9e256 100644 (file)
@@ -576,7 +576,7 @@ main(int argc, char *argv[])
    /*
    EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    */
-   EGLDisplay d = eglGetDisplay(":0");
+   EGLDisplay d = eglGetDisplay("!EGL_i915");
    assert(d);
 
    if (!eglInitialize(d, &maj, &min)) {
index 9feee20d889befc0cfa4135f419a42bd0a6ec2a8..909f4837b2af1ecb51f7ac9303324aae450e13c7 100644 (file)
@@ -385,7 +385,7 @@ main(int argc, char *argv[])
        }
        
        /* DBR : Create EGL context/surface etc */
-        d = eglGetDisplay(":0");
+        d = eglGetDisplay("!EGL_i915");
        assert(d);
 
        if (!eglInitialize(d, &maj, &min)) {
index f9c24754457f1fd34f8feda54fcb8013c686fdd6..85de2173fc0e0ffe5b4d0c051b63ef3c21a53593 100644 (file)
@@ -140,7 +140,7 @@ main(int argc, char *argv[])
 {
    int maj, min;
    /*EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);*/
-   EGLDisplay d = eglGetDisplay(":0");
+   EGLDisplay d = eglGetDisplay("!EGL_i915");
 
    if (!eglInitialize(d, &maj, &min)) {
       printf("eglinfo: eglInitialize failed\n");
diff --git a/progs/fbdev/.gitignore b/progs/fbdev/.gitignore
new file mode 100644 (file)
index 0000000..b9ddf55
--- /dev/null
@@ -0,0 +1 @@
+glfbdevtest
index 622e0417a850105e8d48ed40f7c3fc6d08daa135..81ecf5bdd5e92976377e4e68ac703fe7d3884f1d 100644 (file)
@@ -1,5 +1,6 @@
 brick
 bump
+convolutions
 deriv
 extfuncs.h
 mandelbrot
index 37fa312c30c0a242f0dd57fca4d77110eeb20d9b..b9cae668152fb9e360aa39957f50860329c7d89b 100644 (file)
@@ -14,7 +14,8 @@ PROGS = \
        mandelbrot \
        noise \
        toyball \
-       texdemo1
+       texdemo1 \
+        convolutions
 
 
 ##### RULES #####
@@ -62,6 +63,12 @@ texdemo1: texdemo1.o readtex.o
 texdemo1.o: texdemo1.c readtex.h extfuncs.h
        $(CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c
 
+convolutions: convolutions.o readtex.o
+       $(CC) -I$(INCDIR) $(CFLAGS) convolutions.o readtex.o $(APP_LIB_DEPS) -o $@
+
+convolutions.o: convolutions.c readtex.h
+       $(CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c
+
 
 clean:
        -rm -f $(PROGS)
diff --git a/progs/glsl/convolution.frag b/progs/glsl/convolution.frag
new file mode 100644 (file)
index 0000000..e49b8ac
--- /dev/null
@@ -0,0 +1,21 @@
+
+const int KernelSize = 9;
+
+//texture offsets
+uniform vec2 Offset[KernelSize];
+//convolution kernel
+uniform vec4 KernelValue[KernelSize];
+uniform sampler2D srcTex;
+uniform vec4 ScaleFactor;
+uniform vec4 BaseColor;
+
+void main(void)
+{
+    int i;
+    vec4 sum = vec4(0.0);
+    for (i = 0; i < KernelSize; ++i) {
+        vec4 tmp = texture2D(srcTex, gl_TexCoord[0].st + Offset[i]);
+        sum += tmp * KernelValue[i];
+    }
+    gl_FragColor = sum * ScaleFactor + BaseColor;
+}
diff --git a/progs/glsl/convolution.vert b/progs/glsl/convolution.vert
new file mode 100644 (file)
index 0000000..752c546
--- /dev/null
@@ -0,0 +1,5 @@
+void main() {
+    gl_FrontColor = gl_Color;
+    gl_TexCoord[0] = gl_MultiTexCoord0;
+    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+}
diff --git a/progs/glsl/convolutions.c b/progs/glsl/convolutions.c
new file mode 100644 (file)
index 0000000..be88771
--- /dev/null
@@ -0,0 +1,441 @@
+#define GL_GLEXT_PROTOTYPES
+#include "readtex.h"
+
+#include <GL/glut.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <math.h>
+
+enum Filter {
+   GAUSSIAN_BLUR,
+   SHARPEN,
+   MEAN_REMOVAL,
+   EMBOSS,
+   NO_FILTER,
+   LAST
+};
+#define QUIT LAST
+
+struct BoundingBox {
+   float minx, miny, minz;
+   float maxx, maxy, maxz;
+};
+struct Texture {
+   GLuint id;
+   GLfloat x;
+   GLfloat y;
+   GLint width;
+   GLint height;
+   GLenum format;
+};
+
+static const char *textureLocation = "../images/girl2.rgb";
+
+static GLfloat viewRotx = 0.0, viewRoty = 0.0, viewRotz = 0.0;
+static struct BoundingBox box;
+static struct Texture texture;
+static GLuint program;
+static GLint menuId;
+static enum Filter filter = GAUSSIAN_BLUR;
+
+
+static void checkError(int line)
+{
+   GLenum err = glGetError();
+   if (err) {
+      printf("GL Error %s (0x%x) at line %d\n",
+             gluErrorString(err), (int) err, line);
+   }
+}
+
+static void loadAndCompileShader(GLuint shader, const char *text)
+{
+   GLint stat;
+
+   glShaderSource(shader, 1, (const GLchar **) &text, NULL);
+
+   glCompileShader(shader);
+
+   glGetShaderiv(shader, GL_COMPILE_STATUS, &stat);
+   if (!stat) {
+      GLchar log[1000];
+      GLsizei len;
+      glGetShaderInfoLog(shader, 1000, &len, log);
+      fprintf(stderr, "Problem compiling shader: %s\n", log);
+      exit(1);
+   }
+   else {
+      printf("Shader compiled OK\n");
+   }
+}
+
+static void readShader(GLuint shader, const char *filename)
+{
+   const int max = 100*1000;
+   int n;
+   char *buffer = (char*) malloc(max);
+   FILE *f = fopen(filename, "r");
+   if (!f) {
+      fprintf(stderr, "Unable to open shader file %s\n", filename);
+      exit(1);
+   }
+
+   n = fread(buffer, 1, max, f);
+   printf("Read %d bytes from shader file %s\n", n, filename);
+   if (n > 0) {
+      buffer[n] = 0;
+      loadAndCompileShader(shader, buffer);
+   }
+
+   fclose(f);
+   free(buffer);
+}
+
+
+static void
+checkLink(GLuint prog)
+{
+   GLint stat;
+   glGetProgramiv(prog, GL_LINK_STATUS, &stat);
+   if (!stat) {
+      GLchar log[1000];
+      GLsizei len;
+      glGetProgramInfoLog(prog, 1000, &len, log);
+      fprintf(stderr, "Linker error:\n%s\n", log);
+   }
+   else {
+      fprintf(stderr, "Link success!\n");
+   }
+}
+
+static void fillConvolution(GLint *k,
+                            GLfloat *scale,
+                            GLfloat *color)
+{
+   switch(filter) {
+   case GAUSSIAN_BLUR:
+      k[0] = 1; k[1] = 2; k[2] = 1;
+      k[3] = 2; k[4] = 4; k[5] = 2;
+      k[6] = 1; k[7] = 2; k[8] = 1;
+
+      *scale = 1./16.;
+      break;
+   case SHARPEN:
+      k[0] =  0; k[1] = -2; k[2] =  0;
+      k[3] = -2; k[4] = 11; k[5] = -2;
+      k[6] =  0; k[7] = -2; k[8] =  0;
+
+      *scale = 1./3.;
+      break;
+   case MEAN_REMOVAL:
+      k[0] = -1; k[1] = -1; k[2] = -1;
+      k[3] = -1; k[4] =  9; k[5] = -1;
+      k[6] = -1; k[7] = -1; k[8] = -1;
+
+      *scale = 1./1.;
+      break;
+   case EMBOSS:
+      k[0] = -1; k[1] =  0; k[2] = -1;
+      k[3] =  0; k[4] =  4; k[5] =  0;
+      k[6] = -1; k[7] =  0; k[8] = -1;
+
+      *scale = 1./1.;
+      color[0] = 0.5;
+      color[1] = 0.5;
+      color[2] = 0.5;
+      color[3] = 0.5;
+      break;
+   case NO_FILTER:
+      k[0] =  0; k[1] =  0; k[2] =  0;
+      k[3] =  0; k[4] =  1; k[5] =  0;
+      k[6] =  0; k[7] =  0; k[8] =  0;
+
+      *scale = 1.;
+      break;
+   default:
+      assert(!"Unhandled switch value");
+   }
+}
+
+static void setupConvolution()
+{
+   GLint *kernel = (GLint*)malloc(sizeof(GLint) * 9);
+   GLfloat scale;
+   GLfloat *vecKer = (GLfloat*)malloc(sizeof(GLfloat) * 9 * 4);
+   GLuint loc;
+   GLuint i;
+   GLfloat baseColor[4];
+   baseColor[0] = 0;
+   baseColor[1] = 0;
+   baseColor[2] = 0;
+   baseColor[3] = 0;
+
+   fillConvolution(kernel, &scale, baseColor);
+   /*vector of 4*/
+   for (i = 0; i < 9; ++i) {
+      vecKer[i*4 + 0] = kernel[i];
+      vecKer[i*4 + 1] = kernel[i];
+      vecKer[i*4 + 2] = kernel[i];
+      vecKer[i*4 + 3] = kernel[i];
+   }
+
+   loc = glGetUniformLocationARB(program, "KernelValue");
+   glUniform4fv(loc, 9, vecKer);
+   loc = glGetUniformLocationARB(program, "ScaleFactor");
+   glUniform4f(loc, scale, scale, scale, scale);
+   loc = glGetUniformLocationARB(program, "BaseColor");
+   glUniform4f(loc, baseColor[0], baseColor[1],
+               baseColor[2], baseColor[3]);
+
+   free(vecKer);
+   free(kernel);
+}
+
+static void createProgram(const char *vertProgFile,
+                          const char *fragProgFile)
+{
+   GLuint fragShader = 0, vertShader = 0;
+
+   program = glCreateProgram();
+   if (vertProgFile) {
+      vertShader = glCreateShader(GL_VERTEX_SHADER);
+      readShader(vertShader, vertProgFile);
+      glAttachShader(program, vertShader);
+   }
+
+   if (fragProgFile) {
+      fragShader = glCreateShader(GL_FRAGMENT_SHADER);
+      readShader(fragShader, fragProgFile);
+      glAttachShader(program, fragShader);
+   }
+
+   glLinkProgram(program);
+   checkLink(program);
+
+   glUseProgram(program);
+
+   assert(glIsProgram(program));
+   assert(glIsShader(fragShader));
+   assert(glIsShader(vertShader));
+
+   checkError(__LINE__);
+   {/*texture*/
+      GLuint texLoc = glGetUniformLocationARB(program, "srcTex");
+      glUniform1iARB(texLoc, 0);
+   }
+   {/*setup offsets */
+      float offsets[] = { 1.0 / texture.width,  1.0 / texture.height,
+                          0.0                ,  1.0 / texture.height,
+                          -1.0 / texture.width,  1.0 / texture.height,
+                          1.0 / texture.width,  0.0,
+                          0.0                ,  0.0,
+                          -1.0 / texture.width,  0.0,
+                          1.0 / texture.width, -1.0 / texture.height,
+                          0.0                , -1.0 / texture.height,
+                          -1.0 / texture.width, -1.0 / texture.height };
+      GLuint offsetLoc = glGetUniformLocationARB(program, "Offset");
+      glUniform2fv(offsetLoc, 9, offsets);
+   }
+   setupConvolution();
+
+   checkError(__LINE__);
+}
+
+
+static void readTexture(const char *filename)
+{
+   GLubyte *data;
+
+   texture.x = 0;
+   texture.y = 0;
+
+   glGenTextures(1, &texture.id);
+   glBindTexture(GL_TEXTURE_2D, texture.id);
+   glTexParameteri(GL_TEXTURE_2D,
+                   GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+   glTexParameteri(GL_TEXTURE_2D,
+                   GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
+   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+   glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+   data = LoadRGBImage(filename, &texture.width, &texture.height,
+                       &texture.format);
+   if (!data) {
+      printf("Error: couldn't load texture image '%s'\n", filename);
+      exit(1);
+   }
+   printf("Texture %s (%d x %d)\n",
+          filename, texture.width, texture.height);
+   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
+                texture.width, texture.height, 0, texture.format,
+                GL_UNSIGNED_BYTE, data);
+}
+
+static void menuSelected(int entry)
+{
+   switch (entry) {
+   case QUIT:
+      exit(0);
+      break;
+   default:
+      filter = (enum Filter)entry;
+   }
+   setupConvolution();
+
+   glutPostRedisplay();
+}
+
+static void menuInit()
+{
+   menuId = glutCreateMenu(menuSelected);
+
+   glutAddMenuEntry("Gaussian blur", GAUSSIAN_BLUR);
+   glutAddMenuEntry("Sharpen", SHARPEN);
+   glutAddMenuEntry("Mean removal", MEAN_REMOVAL);
+   glutAddMenuEntry("Emboss", EMBOSS);
+   glutAddMenuEntry("None", NO_FILTER);
+
+   glutAddMenuEntry("Quit", QUIT);
+
+   glutAttachMenu(GLUT_RIGHT_BUTTON);
+}
+
+static void init()
+{
+   fprintf(stderr, "GL_RENDERER   = %s\n", (char *) glGetString(GL_RENDERER));
+   fprintf(stderr, "GL_VERSION    = %s\n", (char *) glGetString(GL_VERSION));
+   fprintf(stderr, "GL_VENDOR     = %s\n", (char *) glGetString(GL_VENDOR));
+
+   menuInit();
+   readTexture(textureLocation);
+   createProgram("convolution.vert", "convolution.frag");
+
+   glEnable(GL_TEXTURE_2D);
+   glClearColor(1.0, 1.0, 1.0, 1.0);
+   /*glShadeModel(GL_SMOOTH);*/
+   glShadeModel(GL_FLAT);
+}
+
+static void reshape(int width, int height)
+{
+   glViewport(0, 0, width, height);
+   glMatrixMode(GL_PROJECTION);
+   glLoadIdentity();
+   box.minx = 0;
+   box.maxx = width;
+   box.miny = 0;
+   box.maxy = height;
+   box.minz = 0;
+   box.maxz = 1;
+   glOrtho(box.minx, box.maxx, box.miny, box.maxy, -999999, 999999);
+   glMatrixMode(GL_MODELVIEW);
+}
+
+static void keyPress(unsigned char key, int x, int y)
+{
+   switch(key) {
+   case 27:
+      exit(0);
+   default:
+      return;
+   }
+   glutPostRedisplay();
+}
+
+static void
+special(int k, int x, int y)
+{
+   switch (k) {
+   case GLUT_KEY_UP:
+      viewRotx += 2.0;
+      break;
+   case GLUT_KEY_DOWN:
+      viewRotx -= 2.0;
+      break;
+   case GLUT_KEY_LEFT:
+      viewRoty += 2.0;
+      break;
+   case GLUT_KEY_RIGHT:
+      viewRoty -= 2.0;
+      break;
+   default:
+      return;
+   }
+   glutPostRedisplay();
+}
+
+
+static void draw()
+{
+   GLfloat center[2];
+   GLfloat anchor[2];
+
+   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+   glLoadIdentity();
+   glPushMatrix();
+
+   center[0] = box.maxx/2;
+   center[1] = box.maxy/2;
+   anchor[0] = center[0] - texture.width/2;
+   anchor[1] = center[1] - texture.height/2;
+
+   glTranslatef(center[0], center[1], 0);
+   glRotatef(viewRotx, 1.0, 0.0, 0.0);
+   glRotatef(viewRoty, 0.0, 1.0, 0.0);
+   glRotatef(viewRotz, 0.0, 0.0, 1.0);
+   glTranslatef(-center[0], -center[1], 0);
+
+   glTranslatef(anchor[0], anchor[1], 0);
+   glBegin(GL_TRIANGLE_STRIP);
+   {
+      glColor3f(1., 0., 0.);
+      glTexCoord2f(0, 0);
+      glVertex3f(0, 0, 0);
+
+      glColor3f(0., 1., 0.);
+      glTexCoord2f(0, 1.0);
+      glVertex3f(0, texture.height, 0);
+
+      glColor3f(1., 0., 0.);
+      glTexCoord2f(1.0, 0);
+      glVertex3f(texture.width, 0, 0);
+
+      glColor3f(0., 1., 0.);
+      glTexCoord2f(1, 1);
+      glVertex3f(texture.width, texture.height, 0);
+   }
+   glEnd();
+
+   glPopMatrix();
+
+   glFlush();
+
+   glutSwapBuffers();
+}
+
+int main(int argc, char **argv)
+{
+   glutInit(&argc, argv);
+
+   glutInitWindowPosition(0, 0);
+   glutInitWindowSize(400, 400);
+   glutInitDisplayMode(GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE);
+
+   if (!glutCreateWindow("Image Convolutions")) {
+      fprintf(stderr, "Couldn't create window!\n");
+      exit(1);
+   }
+
+   init();
+
+   glutReshapeFunc(reshape);
+   glutKeyboardFunc(keyPress);
+   glutSpecialFunc(special);
+   glutDisplayFunc(draw);
+
+
+   glutMainLoop();
+   return 0;
+}
index d29ecf452b1d086e21c1abbb200c9407a565d398..3ceae14b96bb50c08cd6b7f73ab0b83dcff67f08 100644 (file)
@@ -48,6 +48,7 @@ static GLfloat TexXrot = 0, TexYrot = 0;
 static GLfloat Xrot = 20.0, Yrot = 20.0, Zrot = 0.0;
 static GLfloat EyeDist = 10;
 static GLboolean Anim = GL_TRUE;
+static int win = 0;
 
 
 struct uniform_info {
@@ -177,6 +178,7 @@ key(unsigned char k, int x, int y)
          EyeDist = 90;
       break;
    case 27:
+      glutDestroyWindow(win);
       exit(0);
    }
    glutPostRedisplay();
@@ -554,7 +556,7 @@ main(int argc, char *argv[])
    glutInit(&argc, argv);
    glutInitWindowSize(500, 400);
    glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
-   glutCreateWindow(Demo);
+   win = glutCreateWindow(Demo);
    glutReshapeFunc(Reshape);
    glutKeyboardFunc(key);
    glutSpecialFunc(specialkey);
diff --git a/progs/miniglx/.gitignore b/progs/miniglx/.gitignore
new file mode 100644 (file)
index 0000000..f630f59
--- /dev/null
@@ -0,0 +1,6 @@
+manytex
+miniglxsample
+miniglxtest
+sample_server
+sample_server2
+texline
diff --git a/progs/osdemos/.gitignore b/progs/osdemos/.gitignore
new file mode 100644 (file)
index 0000000..5c78f12
--- /dev/null
@@ -0,0 +1,8 @@
+osdemo
+osdemo16
+osdemo32
+ostest1
+readtex.c
+readtex.h
+showbuffer.c
+showbuffer.h
index 9635c7f450706f59959aa14a4d37d92ba4a4c293..f60d6e94eac8c0a54af5d493359041f53d5c2459 100644 (file)
@@ -1,24 +1,41 @@
 .cvsignore
 accum
+anywin
+bdemo
+binfo
 bitmap1
 bitmap2
 blendeq
 blendxor
+bugger
 copy
 cursor
+demo
 depth
 eval
+ffset
 fog
 font
+font
+incopy
 line
 logo
+lthreads
+lxdemo
+lxgears
+lxheads
+lxinfo
+lxpixmap
 nurb
 oglinfo
 olympic
 overlay
+pend
 point
 prim
 quad
+readtex.c
+readtex.h
 select
 shape
 sphere
@@ -28,20 +45,3 @@ stretch
 texture
 tri
 wave
-bugger
-pend
-lthreads
-lxdemo
-lxgears
-lxheads
-lxinfo
-lxpixmap
-anywin
-ffset
-bdemo
-binfo
-incopy
-demo
-font
-readtex.c
-readtex.h
diff --git a/progs/slang/.gitignore b/progs/slang/.gitignore
new file mode 100644 (file)
index 0000000..8a42b01
--- /dev/null
@@ -0,0 +1,3 @@
+cltest
+sotest
+vstest
index 2c0e16c35ec2992ef7683e73f987233b6cda32c6..a72f552f10bbe9ce016be287d302959d1006361f 100644 (file)
@@ -1,48 +1,75 @@
 .cvsignore
-getproclist.h
+afsmultiarb
 antialias
 arbfpspec
 arbfptest1
 arbfptexture
 arbfptrig
+arbnpot
+arbnpot-mipmap
 arbvptest1
 arbvptest3
 arbvptorus
 arbvpwarpmesh
+arraytexture
 blendminmax
 blendsquare
 bufferobj
+bug_3050
 bug_3101
 bug_3195
+calibrate_rast
+copypixrate
 crossbar
 cva
 dinoshade
+drawbuffers
+extfuncs.h
 fbotest1
+fbotest2
 fbotexture
+fillrate
 floattex
 fog
 fogcoord
 fptest1
 fptexture
 getprocaddress
+getproclist.h
+interleave
 invert
+jkrahntest
 manytex
+minmag
+mipmap_limits
+mipmap_view
 multipal
 no_s3tc
 packedpixels
 pbo
+prog_parameter
 projtex
+random
+readrate
+readtex.c
+readtex.h
 seccolor
 sharedtex
-stencil_wrap
 stencilwrap
+stencil_wrap
+subtex
+subtexrate
 tex1d
 texcmp
+texcompress2
+texfilt
 texgenmix
 texline
 texobjshare
 texrect
 texwrap
+vao-01
+vao-02
 vparray
 vptest1
 vptest2
@@ -51,4 +78,6 @@ vptorus
 vpwarpmesh
 yuvrect
 yuvsquare
+zcomp
+zdrawpix
 zreaddraw
diff --git a/progs/tools/trace/.gitignore b/progs/tools/trace/.gitignore
new file mode 100644 (file)
index 0000000..afe0c58
--- /dev/null
@@ -0,0 +1 @@
+gltrace.cc
index aafc4a72919f7a4fca9e317a3b48b20f73171ea1..30f03e9103209cb7d5792da9a777dea6c8398bed 100644 (file)
@@ -14,6 +14,7 @@ fs-tri
 line
 line-clip
 line-cull
+line-smooth
 line-stipple-wide
 line-userclip
 line-userclip-clip
@@ -33,6 +34,7 @@ point-clip
 point-param
 point-sprite
 point-wide
+point-wide-smooth
 poly
 poly-flat
 poly-unfilled
@@ -77,6 +79,7 @@ tri-flat
 tri-flat-clip
 tri-fog
 tri-mask-tri
+tri-orig
 tri-query
 tri-scissor-tri
 tri-stencil
@@ -84,6 +87,7 @@ tri-tex-3d
 tri-tri
 tri-unfilled
 tri-unfilled-clip
+tri-unfilled-edgeflag
 tri-unfilled-smooth
 tri-unfilled-userclip
 tri-unfilled-userclip-stip
index 3a6e5237ed50fc4251550cf474b80081a9653890..97c9fc54d866d2ff62c657a4ad498c7903d8be5c 100644 (file)
@@ -31,6 +31,7 @@ static GLenum Target = GL_TEXTURE_2D;
 static GLenum Filter = GL_NEAREST;
 GLenum doubleBuffer;
 static float Rot = 0;
+static int win = 0;
 
 static void Init(void)
 {
@@ -88,6 +89,7 @@ static void Reshape(int width, int height)
    glFrustum(-1, 1, -1, 1, 10, 20);
 #endif
    glMatrixMode(GL_MODELVIEW);
+   glLoadIdentity();
    glTranslatef(0, 0, -15);
 }
 
@@ -101,6 +103,7 @@ static void Key(unsigned char key, int x, int y)
       Rot -= 10.0;
       break;
    case 27:
+      glutDestroyWindow(win);
       exit(0);
    default:
       return;
@@ -170,7 +173,8 @@ int main(int argc, char **argv)
     type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
     glutInitDisplayMode(type);
 
-    if (glutCreateWindow("First Tri") == GL_FALSE) {
+    win = glutCreateWindow("First Tri");
+    if (!win) {
        exit(1);
     }
 
diff --git a/progs/vp/.gitignore b/progs/vp/.gitignore
new file mode 100644 (file)
index 0000000..a5ff993
--- /dev/null
@@ -0,0 +1 @@
+vp-tris
index 250bc17d984d8b2ea8e1a076d1ae6f8eab9ed357..34551101cb9080222ca38ebae575031d1e45665d 100644 (file)
@@ -13,6 +13,7 @@ offset
 overlay
 pbdemo
 pbinfo
+sharedtex
 texture_from_pixmap
 wincopy
 xdemo
index f501b2aed411c0d3705bf54647c67d1e1b5d71df..346a96e37fdec3c5ce04f5f0e0a2c6306668c54c 100644 (file)
@@ -713,6 +713,11 @@ static void
 aaline_destroy(struct draw_stage *stage)
 {
    struct aaline_stage *aaline = aaline_stage(stage);
+   uint i;
+
+   for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
+      pipe_texture_reference(&aaline->state.texture[i], NULL);
+   }
 
    if (aaline->sampler_cso)
       aaline->pipe->delete_sampler_state(aaline->pipe, aaline->sampler_cso);
@@ -836,6 +841,9 @@ aaline_set_sampler_textures(struct pipe_context *pipe,
    for (i = 0; i < num; i++) {
       pipe_texture_reference(&aaline->state.texture[i], texture[i]);
    }
+   for ( ; i < PIPE_MAX_SAMPLERS; i++) {
+      pipe_texture_reference(&aaline->state.texture[i], NULL);
+   }
    aaline->num_textures = num;
 
    /* pass-through */
index 73ee41985802ba82d43906c44b75c30fde2da56a..2dfd1800d550455251603dba959be29ff8b6489d 100644 (file)
@@ -559,6 +559,11 @@ static void
 pstip_destroy(struct draw_stage *stage)
 {
    struct pstip_stage *pstip = pstip_stage(stage);
+   uint i;
+
+   for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
+      pipe_texture_reference(&pstip->state.textures[i], NULL);
+   }
 
    pstip->pipe->delete_sampler_state(pstip->pipe, pstip->sampler_cso);
 
index 54a2b2ab040fd3acf6f9b80d9ef6459a691f8181..7a02f6334b139a9ed51bf19354f8a293c6d628d2 100644 (file)
@@ -39,6 +39,7 @@
 #include "draw_vs.h"
 
 #include "tgsi/util/tgsi_parse.h"
+#include "tgsi/util/tgsi_scan.h"
 
 
 struct exec_vertex_shader {
@@ -165,21 +166,23 @@ draw_create_vs_exec(struct draw_context *draw,
                    const struct pipe_shader_state *state)
 {
    struct exec_vertex_shader *vs = CALLOC_STRUCT( exec_vertex_shader );
-   uint nt = tgsi_num_tokens(state->tokens);
 
    if (vs == NULL) 
       return NULL;
 
    /* we make a private copy of the tokens */
-   vs->base.state.tokens = mem_dup(state->tokens, nt * sizeof(state->tokens[0]));
-   tgsi_scan_shader(state->tokens, &vs->base.info);
+   vs->base.state.tokens = tgsi_dup_tokens(state->tokens);
+   if (!vs->base.state.tokens) {
+      FREE(vs);
+      return NULL;
+   }
 
+   tgsi_scan_shader(state->tokens, &vs->base.info);
 
    vs->base.prepare = vs_exec_prepare;
    vs->base.run_linear = vs_exec_run_linear;
    vs->base.delete = vs_exec_delete;
    vs->machine = &draw->machine;
 
-
    return &vs->base;
 }
index dcada665143d496901d0d51556ee2c531a7ecb5c..171da51dd5646558af02516c19dcddf1ec3bc01e 100644 (file)
@@ -1,8 +1,8 @@
 /**************************************************************************
- * 
+ *
  * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
  * All Rights Reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the
  * "Software"), to deal in the Software without restriction, including
  * distribute, sub license, and/or sell copies of the Software, and to
  * permit persons to whom the Software is furnished to do so, subject to
  * the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice (including the
  * next paragraph) shall be included in all copies or substantial portions
  * of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@@ -22,7 +22,7 @@
  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- * 
+ *
  **************************************************************************/
 
  /*
@@ -72,47 +72,9 @@ vs_llvm_run_linear( struct draw_vertex_shader *base,
    struct draw_llvm_vertex_shader *shader =
       (struct draw_llvm_vertex_shader *)base;
 
-   struct tgsi_exec_machine *machine = shader->machine;
-   unsigned int i, j;
-   unsigned slot;
-
-
-   for (i = 0; i < count; i += MAX_TGSI_VERTICES) {
-      unsigned int max_vertices = MIN2(MAX_TGSI_VERTICES, count - i);
-
-      /* Swizzle inputs.
-       */
-      for (j = 0; j < max_vertices; j++) {
-        for (slot = 0; slot < base->info.num_inputs; slot++) {
-           machine->Inputs[slot].xyzw[0].f[j] = input[slot][0];
-           machine->Inputs[slot].xyzw[1].f[j] = input[slot][1];
-           machine->Inputs[slot].xyzw[2].f[j] = input[slot][2];
-           machine->Inputs[slot].xyzw[3].f[j] = input[slot][3];
-        }
-
-        input = (const float (*)[4])((const char *)input + input_stride);
-      } 
-
-      /* run shader */
-      gallivm_cpu_vs_exec(shader->llvm_prog,
-                          machine->Inputs,
-                          machine->Outputs,
-                         (float (*)[4]) constants,
-                          machine->Temps);
-
-
-      /* Unswizzle all output results
-       */
-      for (j = 0; j < max_vertices; j++) {
-         for (slot = 0; slot < base->info.num_outputs; slot++) {
-            output[slot][0] = machine->Outputs[slot].xyzw[0].f[j];
-            output[slot][1] = machine->Outputs[slot].xyzw[1].f[j];
-            output[slot][2] = machine->Outputs[slot].xyzw[2].f[j];
-            output[slot][3] = machine->Outputs[slot].xyzw[3].f[j];
-         }
-         output = (float (*)[4])((char *)output + output_stride);
-      }
-   }
+   gallivm_cpu_vs_exec(shader->llvm_prog, shader->machine,
+                       input, base->info.num_inputs, output, base->info.num_outputs,
+                       constants, count, input_stride, output_stride);
 }
 
 
@@ -120,7 +82,7 @@ vs_llvm_run_linear( struct draw_vertex_shader *base,
 static void
 vs_llvm_delete( struct draw_vertex_shader *base )
 {
-   struct draw_llvm_vertex_shader *shader = 
+   struct draw_llvm_vertex_shader *shader =
       (struct draw_llvm_vertex_shader *)base;
 
    /* Do something to free compiled shader:
@@ -138,14 +100,17 @@ draw_create_vs_llvm(struct draw_context *draw,
                    const struct pipe_shader_state *templ)
 {
    struct draw_llvm_vertex_shader *vs;
-   uint nt = tgsi_num_tokens(templ->tokens);
 
    vs = CALLOC_STRUCT( draw_llvm_vertex_shader );
-   if (vs == NULL) 
+   if (vs == NULL)
       return NULL;
 
    /* we make a private copy of the tokens */
-   vs->base.state.tokens = mem_dup(templ->tokens, nt * sizeof(templ->tokens[0]));
+   vs->base.state.tokens = tgsi_dup_tokens(templ->tokens);
+   if (!vs->base.state.tokens) {
+      FREE(vs);
+      return NULL;
+   }
 
    tgsi_scan_shader(vs->base.state.tokens, &vs->base.info);
 
index a57c938fbf1fa07a7ca5f7907037addf857e59d5..e3f4e67472ac3d2c7f28eca43967b527c062112c 100644 (file)
@@ -188,7 +188,6 @@ draw_create_vs_sse(struct draw_context *draw,
                           const struct pipe_shader_state *templ)
 {
    struct draw_sse_vertex_shader *vs;
-   uint nt = tgsi_num_tokens(templ->tokens);
 
    if (!rtasm_cpu_has_sse2())
       return NULL;
@@ -198,7 +197,9 @@ draw_create_vs_sse(struct draw_context *draw,
       return NULL;
 
    /* we make a private copy of the tokens */
-   vs->base.state.tokens = mem_dup(templ->tokens, nt * sizeof(templ->tokens[0]));
+   vs->base.state.tokens = tgsi_dup_tokens(templ->tokens);
+   if (!vs->base.state.tokens)
+      goto fail;
 
    tgsi_scan_shader(templ->tokens, &vs->base.info);
 
@@ -214,6 +215,9 @@ draw_create_vs_sse(struct draw_context *draw,
       goto fail;
       
    vs->func = (codegen_function) x86_get_func( &vs->sse2_program );
+   if (!vs->func) {
+      goto fail;
+   }
    
    return &vs->base;
 
index b6f641a3f86d197db53e32936c1587a0299116fb..77900e342b1fcb4a2331621003e3f6c97356e5d4 100644 (file)
@@ -288,10 +288,7 @@ void gallivm_ir_fill_from_tgsi(struct gallivm_ir *ir,
    std::cout << "Creating llvm from: " <<std::endl;
    tgsi_dump(tokens, 0);
 
-
    llvm::Module *mod = tgsi_to_llvmir(ir, tokens);
-
-   //llvm::Module *mod = tgsi_to_llvm(ir, tokens);
    ir->module = mod;
    gallivm_ir_dump(ir, 0);
 }
@@ -306,11 +303,11 @@ struct gallivm_prog * gallivm_ir_compile(struct gallivm_ir *ir)
 {
    struct gallivm_prog *prog =
       (struct gallivm_prog *)calloc(1, sizeof(struct gallivm_prog));
-   
+
    std::cout << "Before optimizations:"<<std::endl;
    ir->module->dump();
    std::cout<<"-------------------------------"<<std::endl;
-   
+
    PassManager veri;
    veri.add(createVerifierPass());
    veri.run(*ir->module);
@@ -318,7 +315,7 @@ struct gallivm_prog * gallivm_ir_compile(struct gallivm_ir *ir)
    prog->num_consts = ir->num_consts;
    memcpy(prog->interpolators, ir->interpolators, sizeof(prog->interpolators));
    prog->num_interp = ir->num_interp;
-   
+
    /* Run optimization passes over it */
    PassManager passes;
    passes.add(new TargetData(mod));
index b4d6555d2fc5ed7bb59c5b41eba0d04fa261e548..36a64a7747133df9ffd2ee453c8640a8e5400fc0 100644 (file)
@@ -90,10 +90,15 @@ void gallivm_prog_dump(struct gallivm_prog *prog, const char *file_prefix);
 struct gallivm_cpu_engine *gallivm_cpu_engine_create(struct gallivm_prog *prog);
 struct gallivm_cpu_engine *gallivm_global_cpu_engine();
 int gallivm_cpu_vs_exec(struct gallivm_prog *prog,
-                        struct tgsi_exec_vector       *inputs,
-                        struct tgsi_exec_vector       *dests,
-                        float (*consts)[4],
-                        struct tgsi_exec_vector       *temps);
+                        struct tgsi_exec_machine *machine,
+                        const float (*input)[4],
+                        unsigned num_inputs,
+                        float (*output)[4],
+                        unsigned num_outputs,
+                        const float (*constants)[4],
+                        unsigned count,
+                        unsigned input_stride,
+                        unsigned output_stride);
 int gallivm_cpu_fs_exec(struct gallivm_prog *prog,
                         float x, float y,
                         float (*dests)[PIPE_MAX_SHADER_INPUTS][4],
index a6f8cd043bcd892b24d051f76335bcbaa625dc00..0fc5c4ec5cad15bb6b8ac5e6cf4b7b3c6e5a7886 100644 (file)
 static const unsigned char llvm_builtins_data[] = {
-0x42,0x43,0xc0,0xde,0x21,0x0c,0x00,0x00,0x2b,0x02,0x00,0x00,0x01,0x10,0x00,0x00,
+0x42,0x43,0xc0,0xde,0x21,0x0c,0x00,0x00,0x29,0x02,0x00,0x00,0x01,0x10,0x00,0x00,
 0x10,0x00,0x00,0x00,0x07,0x81,0x23,0x91,0x41,0xc8,0x04,0x49,0x06,0x10,0x32,0x39,
 0x92,0x01,0x84,0x0c,0x25,0x05,0x08,0x19,0x1e,0x04,0x8b,0x62,0x80,0x14,0x45,0x02,
 0x42,0x92,0x0b,0x42,0xa4,0x10,0x32,0x14,0x38,0x08,0x18,0x49,0x0a,0x32,0x44,0x24,
 0x48,0x0a,0x90,0x21,0x23,0x44,0x72,0x80,0x8c,0x14,0x21,0x86,0x0a,0x8a,0x0a,0x64,
 0x0c,0x1f,0x00,0x00,0x49,0x18,0x00,0x00,0x02,0x00,0x00,0x00,0x0b,0x04,0x00,0x0c,
-0x00,0x00,0x00,0x00,0x51,0x20,0x00,0x00,0x13,0x00,0x00,0x00,0x32,0x22,0x48,0x09,
+0x00,0x00,0x00,0x00,0x51,0x20,0x00,0x00,0x12,0x00,0x00,0x00,0x32,0x22,0x48,0x09,
 0x20,0x65,0x82,0x84,0x00,0x26,0x45,0x48,0x05,0x09,0x26,0x45,0xc6,0x05,0x42,0x52,
-0x26,0x08,0xb0,0x19,0x80,0x61,0x04,0x02,0x98,0x23,0x00,0x83,0x21,0x80,0x39,0x82,
-0x60,0x0a,0x80,0x2e,0xd5,0x61,0x04,0x42,0x20,0x49,0x90,0x22,0x4d,0xa2,0x73,0x04,
-0x08,0xb9,0x32,0x00,0x00,0x8a,0x10,0xc2,0x65,0xb8,0x42,0x84,0x10,0x42,0x0d,0x44,
-0x11,0x00,0x18,0x01,0x28,0x82,0x08,0x00,0x13,0xa2,0x74,0xb0,0x03,0x3c,0xb0,0x83,
-0x36,0x80,0x87,0x71,0x68,0x03,0x76,0x48,0x07,0x77,0xa8,0x07,0x7c,0x68,0x83,0x73,
-0x70,0x87,0x7a,0xd8,0x70,0x0f,0xe5,0xd0,0x06,0xf0,0xa0,0x07,0x73,0x20,0x07,0x7a,
-0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x90,0x0e,0x71,0xa0,0x07,0x78,0xa0,
-0x07,0x78,0xd0,0x06,0xe9,0x80,0x07,0x7a,0x80,0x07,0x7a,0x80,0x07,0x6d,0x90,0x0e,
-0x71,0x60,0x07,0x7a,0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x6d,0x90,0x0e,0x73,
-0x20,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x90,0x0e,0x76,0x40,
-0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0e,0x73,0x20,0x07,
-0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x60,0x0e,0x76,0x40,0x07,0x7a,
-0x30,0x07,0x72,0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0f,0x76,0x40,0x07,0x7a,0x60,
-0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0f,0x71,0x20,0x07,0x78,0xa0,0x07,
-0x71,0x20,0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xd0,0x06,0xe1,0x00,0x07,0x7a,
-0x00,0x07,0x7a,0x60,0x07,0x74,0xd0,0x06,0xe6,0x80,0x07,0x70,0xa0,0x07,0x71,0x20,
-0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xa0,0xf3,0x40,0x88,0x04,0x32,0x32,0x02,
-0x04,0x60,0x76,0xc6,0xfc,0x6c,0x48,0xa2,0x00,0x40,0x00,0x00,0x00,0x00,0x0c,0x49,
-0x14,0x20,0x00,0x00,0x00,0x00,0x80,0x21,0xc9,0x02,0x00,0x01,0x00,0x00,0x00,0x30,
-0x24,0x61,0x00,0x20,0x08,0x00,0x00,0x00,0x86,0x24,0x0b,0x00,0x04,0x00,0x00,0x00,
-0xc0,0x90,0xa4,0x01,0x02,0x00,0x00,0x00,0x00,0x18,0x92,0x1c,0x40,0x00,0x00,0x00,
-0x00,0x00,0x43,0x92,0x05,0x00,0x02,0x00,0x00,0x00,0x60,0x48,0x72,0x00,0x01,0x00,
-0x00,0x00,0x00,0x0c,0x49,0x16,0x00,0x08,0x00,0x00,0x00,0x80,0x21,0x89,0x01,0x00,
-0x41,0x00,0x00,0x00,0x90,0x05,0x02,0x00,0x10,0x00,0x00,0x00,0x32,0x1e,0x98,0x10,
-0x19,0x11,0x4c,0x90,0x8c,0x09,0x26,0x47,0xc6,0x04,0x43,0x92,0x8a,0x59,0x8b,0x43,
-0x50,0xd2,0x09,0x02,0x81,0xd2,0x73,0x50,0xc9,0x0c,0x2a,0x99,0x41,0x25,0x33,0xa8,
-0x64,0x56,0x28,0x66,0x2d,0x0e,0x41,0xcf,0x2a,0x15,0x04,0x4a,0xcf,0x41,0x25,0x33,
-0xa8,0x64,0x06,0x95,0xcc,0xa0,0x92,0x59,0x01,0x00,0x00,0x00,0x53,0x82,0x26,0x0c,
-0x04,0x00,0x00,0x00,0x22,0x00,0x00,0x00,0x13,0x04,0x41,0x2c,0x10,0x00,0x00,0x00,
-0x05,0x00,0x00,0x00,0x04,0xc6,0x08,0x40,0x10,0x04,0xe1,0x70,0x18,0x23,0x00,0x41,
-0x10,0x84,0xc3,0x60,0x04,0x00,0x00,0x00,0x93,0x0c,0xce,0x43,0x4c,0x31,0x3c,0x8e,
-0x34,0xc9,0x30,0x41,0xc2,0x14,0x03,0x34,0x51,0x93,0x0c,0x4d,0x44,0x4c,0x31,0x44,
-0x8d,0x35,0x56,0x01,0x04,0xc3,0x55,0x21,0x16,0x0e,0x04,0x00,0x0f,0x00,0x00,0x00,
-0x46,0x41,0x08,0xcc,0x73,0x9b,0x05,0x21,0x30,0xcf,0x6e,0x18,0x84,0x00,0x2c,0x8b,
-0x35,0x04,0x80,0x39,0x04,0x81,0x5d,0x20,0x80,0x0f,0x0c,0x43,0xe4,0xd3,0x36,0x81,
-0x04,0x3e,0x30,0x0c,0x91,0x4f,0x5b,0x05,0x12,0xf8,0xc0,0x30,0x44,0x7e,0x7d,0x00,
-0x05,0xd1,0x4c,0x11,0x66,0x12,0x83,0xc0,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x61,0x20,0x00,0x00,0x2a,0x00,0x00,0x00,0x13,0x04,0x43,0x2c,0x10,0x00,0x00,0x00,
-0x08,0x00,0x00,0x00,0x24,0x8a,0xa0,0x0c,0x46,0x00,0x4a,0x80,0xc2,0x1c,0x84,0x55,
-0x55,0xd6,0x1c,0x84,0x45,0x51,0x16,0x81,0x19,0x80,0x11,0x80,0x31,0x02,0x10,0x04,
-0x41,0xfc,0x03,0x00,0x63,0x08,0x0d,0x34,0xc9,0x70,0x55,0xc2,0x2c,0x43,0x20,0x60,
-0x73,0x0c,0xd3,0x15,0x8d,0x21,0x34,0xd1,0x18,0x42,0xf3,0x8c,0x55,0x00,0x81,0xa0,
-0x6d,0x73,0x0c,0x19,0xe7,0x60,0x87,0x52,0x38,0x10,0x00,0x00,0x13,0x00,0x00,0x00,
-0x17,0x60,0x20,0xc5,0x74,0x10,0x8d,0x65,0x14,0x13,0xf3,0xd4,0xb4,0x6d,0x14,0x13,
-0xf3,0xd4,0xb8,0x69,0x14,0x13,0xf3,0xd4,0xb6,0x75,0x14,0x13,0xf3,0xd4,0xba,0x35,
-0x0c,0x13,0xf3,0x9c,0x80,0xe4,0x36,0x48,0x81,0x10,0xc3,0x4a,0x4c,0x54,0xd4,0x6c,
-0x8b,0x23,0x28,0x76,0x41,0x4c,0xcc,0xa3,0x1b,0x07,0x21,0x00,0xcb,0x72,0x00,0x05,
-0xd1,0x4c,0x11,0x66,0x18,0x83,0xc0,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x61,0x20,0x00,0x00,0x82,0x00,0x00,0x00,0x13,0x04,0x47,0x2c,0x10,0x00,0x00,0x00,
-0x08,0x00,0x00,0x00,0x24,0x46,0x00,0x8a,0xa0,0x0c,0x4a,0xa0,0x14,0x8a,0xa1,0x1c,
-0x68,0x8c,0x00,0x10,0x9a,0x83,0x80,0xa8,0x48,0x9a,0x83,0x80,0xa6,0x4a,0x9a,0x83,
-0x80,0xa6,0xc8,0x02,0x63,0x08,0x0d,0x64,0xdb,0xc0,0x49,0x06,0xee,0x22,0xc6,0x10,
-0x9a,0xc9,0xbc,0x81,0x93,0x0c,0xdf,0x45,0x4c,0x31,0x38,0x4f,0x37,0xcb,0x10,0x08,
-0x60,0x30,0xc8,0x10,0x06,0x0e,0x36,0x86,0xd0,0x44,0x36,0x06,0x03,0x27,0x19,0xc8,
-0xe0,0x22,0x66,0x19,0x06,0xa2,0x0c,0x06,0x19,0xc2,0xe0,0xc1,0xc6,0x10,0x9a,0xc8,
-0xce,0x60,0xe0,0x24,0x03,0x1a,0x5c,0xc4,0x2c,0xc3,0x40,0xa4,0xc1,0x40,0x45,0x20,
-0x06,0x81,0x19,0x08,0x83,0x0c,0x6a,0xe0,0x64,0x63,0x08,0x8d,0x64,0x6c,0x30,0x70,
-0x92,0xa1,0x0d,0x2e,0x62,0x96,0xa1,0x30,0xdc,0x60,0xa0,0x22,0x10,0x83,0xc0,0x0c,
-0x84,0x41,0x86,0x37,0x78,0xb2,0x31,0x84,0x46,0xb2,0x38,0x18,0x38,0xc9,0x20,0x07,
-0x17,0x31,0xcb,0x50,0x18,0x73,0x30,0x50,0x11,0xac,0xc1,0x00,0x07,0xc4,0x20,0x03,
-0x1d,0x38,0x1a,0xd6,0xc1,0x40,0x45,0xb0,0x06,0x03,0x1c,0x10,0x83,0x0c,0x76,0xf0,
-0x68,0x78,0x07,0xe1,0x40,0x00,0x00,0x00,0x4c,0x00,0x00,0x00,0x56,0x62,0x08,0xcc,
-0x63,0xef,0x3a,0xa9,0x00,0x19,0x7b,0x73,0x23,0x73,0xf9,0xa1,0x91,0x31,0x98,0x62,
-0x62,0x9e,0x7b,0xb7,0x06,0x62,0x62,0x1e,0xda,0x1c,0x88,0x89,0x79,0x6a,0x7b,0x20,
-0x26,0xe6,0xb1,0x6d,0x83,0x98,0x98,0xe7,0x36,0x92,0x43,0x70,0x9a,0xca,0xd6,0x73,
-0xa3,0x79,0x26,0xe6,0xb9,0x77,0x3f,0x22,0x0c,0x9b,0x21,0x18,0x9f,0xb6,0x90,0x64,
-0x62,0x9e,0xda,0x9f,0x98,0xc7,0x36,0x9b,0x67,0x62,0x9e,0x7b,0xf7,0x23,0xc2,0xb0,
-0x19,0x82,0xf1,0x6b,0x53,0x79,0x26,0xe6,0xb1,0x6f,0x3f,0x22,0x0c,0x9b,0x21,0x18,
-0x9f,0xb6,0x98,0x62,0x62,0x9e,0xbb,0xb7,0x97,0x67,0x62,0x1e,0xfb,0xf6,0x23,0xc2,
-0xb0,0x19,0x82,0xf1,0x6b,0x43,0x31,0x04,0xa7,0xa9,0x6c,0xdd,0x66,0x0a,0x81,0x79,
-0xf0,0xfa,0x08,0x16,0xc1,0x69,0x06,0x5f,0x70,0x9a,0xe9,0xc6,0x49,0x01,0xc8,0xd8,
-0x9b,0x1b,0x99,0xcb,0x4f,0x0c,0x8d,0xad,0x18,0x13,0xf3,0xdc,0x3b,0x6f,0x35,0xc7,
-0xc4,0x3c,0x79,0x5d,0xdf,0x06,0x52,0x08,0xcc,0x53,0xdf,0x26,0x62,0x4c,0xcc,0x63,
-0xdf,0xb7,0xb9,0x1c,0x02,0xf3,0xe0,0x75,0x5d,0x5b,0xc7,0x20,0x30,0x8f,0x79,0x14,
-0x13,0xf3,0xd4,0xf5,0x19,0x2c,0x82,0xd3,0x0c,0xbe,0xe0,0x34,0x13,0xce,0x5b,0x0b,
-0x22,0x38,0x4d,0x85,0xd3,0x35,0x6d,0x37,0xc5,0xc4,0x3c,0x79,0x4d,0x1a,0x40,0xc6,
-0xde,0xdc,0xc8,0x5c,0x7e,0x64,0x70,0x8c,0x83,0x10,0x9c,0xa6,0xb2,0x94,0x42,0x60,
-0x1e,0x7b,0x37,0x19,0x43,0x70,0x9a,0x0a,0xa7,0xcd,0xa4,0x98,0x98,0xc7,0xbe,0x8d,
-0xc5,0x98,0x98,0xe7,0xee,0x7b,0x3b,0x29,0x26,0xe6,0xb1,0xf3,0x13,0x58,0x04,0xa7,
-0x19,0x7c,0xc1,0x69,0x26,0x9b,0xb6,0x0f,0x43,0x70,0x9a,0xaa,0xb6,0x6d,0xc4,0x98,
-0x98,0xc7,0xce,0xf1,0x03,0x28,0x88,0x66,0x8a,0x30,0x00,0x00,0x00,0x00,0x00,0x00,
-0x61,0x20,0x00,0x00,0x4a,0x00,0x00,0x00,0x13,0x04,0x41,0x2c,0x10,0x00,0x00,0x00,
-0x07,0x00,0x00,0x00,0x24,0xca,0x60,0x04,0xa0,0x04,0x8a,0x80,0xc2,0x0c,0x00,0xbd,
-0x61,0x8c,0x04,0x10,0x1e,0xe1,0x19,0xc6,0x48,0x02,0xe1,0x11,0x1e,0x00,0x00,0x00,
-0x63,0x08,0xcd,0x63,0xd5,0xc0,0x31,0x84,0x06,0xb2,0x6b,0xe0,0x18,0x42,0x13,0x59,
-0x36,0x70,0x0c,0xa1,0x71,0x6c,0x1b,0x38,0x16,0x02,0x04,0xc7,0x64,0x61,0x1a,0x37,
-0x16,0x01,0x04,0x48,0x35,0xc7,0x20,0x79,0xcf,0x58,0x04,0x10,0x20,0xd5,0x1c,0xc3,
-0x07,0x06,0xd0,0x58,0x04,0x10,0x20,0xd5,0x1c,0x43,0x18,0x88,0x41,0x34,0x16,0x01,
-0x04,0x48,0x35,0xc7,0x30,0x06,0x64,0xe0,0x98,0x37,0xd0,0xc0,0x60,0xa0,0x89,0xc1,
-0x40,0x23,0x83,0x81,0x63,0x21,0x40,0x70,0x50,0x66,0x70,0x06,0x68,0x90,0x06,0x58,
-0x06,0xe1,0x40,0x00,0x25,0x00,0x00,0x00,0x56,0x52,0x4c,0xcc,0x73,0xd3,0x56,0x41,
-0x4c,0xcc,0x53,0xdb,0x05,0x31,0x31,0xcf,0x6d,0x19,0xc4,0xc4,0x3c,0xba,0x6d,0x10,
-0x13,0xf3,0xf4,0xd6,0x41,0x08,0xc0,0xb2,0x18,0x46,0x21,0x38,0x4d,0x85,0x9b,0x46,
-0x21,0x38,0x4d,0xb5,0x9b,0x8a,0x21,0x00,0xcb,0x82,0xdf,0x66,0x62,0x08,0x4e,0x53,
-0xdd,0xb7,0x9d,0x18,0x82,0xd3,0x54,0xb7,0x6e,0x28,0x86,0xe0,0x34,0xd5,0xdd,0xdb,
-0x47,0x31,0x31,0x4f,0x9d,0x9b,0x87,0x21,0x00,0xcb,0x52,0xdf,0x06,0x62,0x08,0xc0,
-0xb2,0xd4,0xbc,0x59,0x10,0x82,0xd3,0x54,0x96,0x62,0x08,0x4e,0x53,0xe1,0xb6,0x85,
-0x14,0x13,0xf3,0xd8,0xb4,0x8d,0x14,0x13,0xf3,0xd8,0xb9,0x89,0x18,0x02,0xb0,0x2c,
-0xf6,0x6d,0x24,0x86,0x00,0x2c,0x8b,0xcd,0x1b,0x87,0x21,0x38,0x4d,0x55,0xd3,0xd6,
-0x30,0x54,0xc0,0x72,0x00,0x05,0xd1,0x4c,0x11,0x06,0x00,0x00,0x00,0x00,0x00,0x00,
-0x61,0x20,0x00,0x00,0x19,0x00,0x00,0x00,0x13,0x04,0x41,0x2c,0x10,0x00,0x00,0x00,
-0x03,0x00,0x00,0x00,0x24,0x4a,0x60,0x04,0x80,0xc2,0x0c,0x00,0x00,0x00,0x00,0x00,
-0x63,0x08,0xcd,0x33,0x16,0x01,0x04,0x48,0x34,0xc7,0x00,0x49,0xcf,0x58,0x04,0x10,
-0x28,0xd1,0x1c,0xc3,0x44,0x39,0x58,0x85,0x03,0x01,0x00,0x00,0x0a,0x00,0x00,0x00,
-0x16,0x41,0x4c,0xcc,0x63,0xdb,0x04,0x31,0x31,0x4f,0x6e,0x0d,0x43,0x05,0x2c,0x07,
-0x50,0x10,0xcd,0x14,0x61,0x56,0x41,0x4c,0xcc,0xd3,0x1b,0x45,0x21,0x00,0xcb,0xb2,
-0x9b,0x04,0x21,0x00,0xcb,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x20,0x00,0x00,
-0x1b,0x00,0x00,0x00,0x13,0x04,0x41,0x2c,0x10,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
-0x24,0xca,0x60,0x04,0xa0,0x04,0x8a,0x80,0xc2,0x0c,0x00,0x00,0x63,0x08,0xcd,0x33,
-0x16,0x01,0x04,0xca,0x34,0xc7,0x20,0x51,0xcf,0x1c,0x43,0x45,0x41,0x73,0x0c,0x16,
-0x15,0xcd,0x31,0x5c,0x94,0x83,0x58,0x38,0x10,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,
-0x86,0x51,0x4c,0xcc,0x53,0xe7,0x76,0x51,0x4c,0xcc,0x53,0xdb,0x36,0x41,0x4c,0xcc,
-0x63,0x5b,0x05,0x31,0x31,0x8f,0x6e,0x0d,0x43,0x05,0x2c,0x66,0x41,0x4c,0xcc,0xd3,
-0x1f,0x40,0x41,0x34,0x53,0x84,0x19,0x05,0x21,0x00,0xcb,0x02,0x00,0x00,0x00,0x00,
-0x61,0x20,0x00,0x00,0x2f,0x00,0x00,0x00,0x13,0x04,0x45,0x2c,0x10,0x00,0x00,0x00,
-0x03,0x00,0x00,0x00,0x24,0xca,0xa0,0x04,0x46,0x00,0x8a,0x80,0xc0,0x08,0x00,0x00,
-0x63,0x08,0x0d,0x34,0xc9,0x30,0x49,0xc4,0x2c,0x03,0x11,0x50,0x63,0x08,0xcd,0x33,
-0xc9,0x50,0x49,0xc4,0x2c,0x03,0x21,0x58,0x63,0x08,0x4d,0x34,0xc9,0x70,0x49,0xc4,
-0x2c,0x03,0x31,0x60,0x63,0x08,0x8d,0x33,0xc9,0x90,0x49,0x84,0x69,0x22,0x70,0xc3,
-0x27,0x1c,0x08,0x00,0x1a,0x00,0x00,0x00,0x96,0x51,0x4c,0xcc,0x53,0xdf,0x66,0x41,
-0x08,0xcc,0x83,0xdb,0x04,0x31,0x31,0x4f,0x6d,0x15,0xc4,0xc4,0x3c,0xb7,0x61,0x10,
-0x02,0xf3,0xf0,0x47,0x20,0xb9,0x0d,0x52,0x20,0xc4,0xb0,0x12,0x13,0x15,0x35,0xdb,
-0xe2,0x08,0x8a,0x5d,0x10,0x13,0xf3,0xec,0x37,0x90,0x2c,0x4e,0xf4,0x47,0x87,0x54,
-0xd7,0x17,0x70,0x2c,0x4e,0xf4,0x47,0x87,0x74,0x02,0xc8,0xe2,0x44,0x7f,0x74,0x48,
-0xb9,0x69,0x14,0x02,0xf3,0xd4,0xb8,0x6d,0x18,0x11,0x31,0x55,0xc0,0x62,0x0d,0x43,
-0x05,0x2c,0x07,0x50,0x10,0xcd,0x14,0x61,0x46,0x31,0x08,0xcc,0x03,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x71,0x20,0x00,0x00,0x12,0x00,0x00,0x00,0x66,0x40,0x54,0x82,
-0x23,0x59,0xc2,0x20,0x09,0x92,0x1d,0x18,0x4f,0x84,0x34,0x53,0x61,0x03,0xc4,0xe3,
-0x58,0x85,0x05,0x14,0xbe,0x34,0x45,0xb5,0x21,0x10,0x82,0x23,0x15,0x46,0x30,0x2c,
-0xc8,0x64,0x02,0x06,0xf0,0x3c,0x91,0x73,0x19,0x00,0xe1,0x4b,0x53,0x64,0x0a,0x84,
-0x84,0x34,0x85,0x31,0x10,0x0a,0xb2,0x3c,0x56,0x30,0x08,0xcc,0x63,0x0b,0x44,0x25,
-0x21,0x0d,0x00,0x00,0x00,0x00,0x00,0x00};
+0x26,0x08,0xae,0x19,0x80,0x61,0x04,0x02,0x98,0x23,0x00,0x83,0x29,0x80,0x21,0x00,
+0xb2,0x73,0x04,0x01,0x51,0x8a,0xf4,0x08,0x92,0xa4,0x39,0x47,0x80,0x50,0x2b,0x03,
+0x00,0xa0,0x08,0x21,0x5c,0x46,0x2b,0x44,0x08,0x21,0xd4,0x40,0x14,0x01,0x80,0x11,
+0x80,0x22,0x88,0x00,0x13,0xa2,0x74,0xb0,0x03,0x3c,0xb0,0x83,0x36,0x80,0x87,0x71,
+0x68,0x03,0x76,0x48,0x07,0x77,0xa8,0x07,0x7c,0x68,0x83,0x73,0x70,0x87,0x7a,0xd8,
+0x70,0x0f,0xe5,0xd0,0x06,0xf0,0xa0,0x07,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xa0,
+0x07,0x73,0x20,0x07,0x6d,0x90,0x0e,0x71,0xa0,0x07,0x78,0xa0,0x07,0x78,0xd0,0x06,
+0xe9,0x80,0x07,0x7a,0x80,0x07,0x7a,0x80,0x07,0x6d,0x90,0x0e,0x71,0x60,0x07,0x7a,
+0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x6d,0x90,0x0e,0x73,0x20,0x07,0x7a,0x30,
+0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x90,0x0e,0x76,0x40,0x07,0x7a,0x30,0x07,
+0x72,0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0e,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,
+0xa0,0x07,0x73,0x20,0x07,0x6d,0x60,0x0e,0x76,0x40,0x07,0x7a,0x30,0x07,0x72,0xa0,
+0x07,0x76,0x40,0x07,0x6d,0x60,0x0f,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,
+0x76,0x40,0x07,0x6d,0x60,0x0f,0x71,0x20,0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,
+0xa0,0x07,0x71,0x20,0x07,0x78,0xd0,0x06,0xe1,0x00,0x07,0x7a,0x00,0x07,0x7a,0x60,
+0x07,0x74,0xd0,0x06,0xe6,0x80,0x07,0x70,0xa0,0x07,0x71,0x20,0x07,0x78,0xa0,0x07,
+0x71,0x20,0x07,0x78,0xa0,0xf3,0x40,0x88,0x04,0x32,0x32,0x02,0x04,0x20,0x76,0x46,
+0xfc,0x6c,0x48,0x92,0x00,0x40,0x00,0x00,0x00,0x00,0x0c,0x49,0x12,0x20,0x00,0x00,
+0x00,0x00,0x80,0x21,0x89,0x02,0x00,0x01,0x00,0x00,0x00,0x30,0x24,0x59,0x00,0x20,
+0x08,0x00,0x00,0x00,0x86,0x24,0x0a,0x00,0x04,0x00,0x00,0x00,0xc0,0x90,0x84,0x01,
+0x02,0x00,0x00,0x00,0x00,0x18,0x92,0x1c,0x40,0x00,0x00,0x00,0x00,0x00,0x43,0x12,
+0x05,0x00,0x02,0x00,0x00,0x00,0x60,0x48,0x72,0x00,0x01,0x00,0x00,0x00,0x00,0x0c,
+0x49,0x14,0x00,0x08,0x00,0x00,0x00,0x80,0x21,0x49,0x01,0x00,0x41,0x00,0x00,0x00,
+0x90,0x05,0x02,0x00,0x10,0x00,0x00,0x00,0x32,0x1e,0x98,0x10,0x19,0x11,0x4c,0x90,
+0x8c,0x09,0x26,0x47,0xc6,0x04,0x43,0x8a,0x8a,0x59,0x8b,0x43,0x50,0xd2,0x09,0x02,
+0x81,0xd2,0x73,0x50,0xc9,0x0c,0x2a,0x99,0x41,0x25,0x33,0xa8,0x64,0x56,0x28,0x66,
+0x2d,0x0e,0x41,0xcf,0x2a,0x15,0x04,0x4a,0xcf,0x41,0x25,0x33,0xa8,0x64,0x06,0x95,
+0xcc,0xa0,0x92,0x59,0x01,0x00,0x00,0x00,0x53,0x82,0x26,0x0c,0x04,0x00,0x00,0x00,
+0x22,0x00,0x00,0x00,0x13,0x04,0x41,0x2c,0x10,0x00,0x00,0x00,0x05,0x00,0x00,0x00,
+0x04,0xc6,0x08,0x40,0x10,0x04,0xe1,0x70,0x18,0x23,0x00,0x41,0x10,0x84,0xc3,0x60,
+0x04,0x00,0x00,0x00,0x93,0x0c,0xce,0x43,0x4c,0x31,0x3c,0x8e,0x34,0xc9,0x30,0x41,
+0xc2,0x14,0x03,0x34,0x51,0x93,0x0c,0x4d,0x44,0x4c,0x31,0x44,0x8d,0x35,0x56,0x01,
+0x04,0xc3,0x55,0x21,0x16,0x0e,0x04,0x00,0x0f,0x00,0x00,0x00,0x46,0x41,0x08,0xcc,
+0x73,0x9b,0x05,0x21,0x30,0xcf,0x6e,0x18,0x84,0x00,0x2c,0x8b,0x35,0x04,0x80,0x39,
+0x04,0x81,0x5d,0x20,0x80,0x0f,0x0c,0x43,0xe4,0xd3,0x36,0x81,0x04,0x3e,0x30,0x0c,
+0x91,0x4f,0x5b,0x05,0x12,0xf8,0xc0,0x30,0x44,0x7e,0x7d,0x00,0x05,0xd1,0x4c,0x11,
+0x66,0x12,0x83,0xc0,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x20,0x00,0x00,
+0x2a,0x00,0x00,0x00,0x13,0x04,0x43,0x2c,0x10,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
+0x24,0x8a,0xa0,0x0c,0x46,0x00,0x4a,0x80,0xc2,0x1c,0x84,0x55,0x55,0xd6,0x1c,0x84,
+0x45,0x51,0x16,0x81,0x19,0x80,0x11,0x80,0x31,0x02,0x10,0x04,0x41,0xfc,0x03,0x00,
+0x63,0x08,0x0d,0x34,0xc9,0x70,0x55,0xc2,0x2c,0x43,0x20,0x60,0x73,0x0c,0xd3,0x15,
+0x8d,0x21,0x34,0xd1,0x18,0x42,0xf3,0x8c,0x55,0x00,0x81,0xa0,0x6d,0x73,0x0c,0x19,
+0xe7,0x60,0x87,0x52,0x38,0x10,0x00,0x00,0x13,0x00,0x00,0x00,0x17,0x60,0x20,0xc5,
+0x74,0x10,0x8d,0x65,0x14,0x13,0xf3,0xd4,0xb4,0x6d,0x14,0x13,0xf3,0xd4,0xb8,0x69,
+0x14,0x13,0xf3,0xd4,0xb6,0x75,0x14,0x13,0xf3,0xd4,0xba,0x35,0x0c,0x13,0xf3,0x9c,
+0x80,0xe4,0x36,0x48,0x81,0x10,0xc3,0x4a,0x4c,0x54,0xd4,0x6c,0x8b,0x23,0x28,0x76,
+0x41,0x4c,0xcc,0xa3,0x1b,0x07,0x21,0x00,0xcb,0x72,0x00,0x05,0xd1,0x4c,0x11,0x66,
+0x18,0x83,0xc0,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x20,0x00,0x00,
+0x81,0x00,0x00,0x00,0x13,0x04,0x4d,0x2c,0x10,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
+0x24,0xca,0x60,0x04,0xa0,0x04,0x8a,0x80,0xc2,0x0c,0x00,0x91,0x11,0x00,0x00,0x00,
+0x63,0x08,0x4d,0x64,0x16,0xc1,0x49,0x86,0xab,0x22,0x66,0x19,0x02,0x01,0x1b,0x43,
+0x70,0xa2,0x59,0x82,0x61,0x0c,0xe1,0x89,0x66,0x09,0x86,0x81,0x0a,0x20,0x0b,0x34,
+0x61,0x8e,0x81,0xda,0xa2,0x31,0x84,0x46,0xb2,0x8e,0xe0,0x24,0x83,0x57,0x11,0xb3,
+0x0c,0x44,0xf1,0x8d,0x21,0x38,0xd2,0x2c,0x81,0x31,0x86,0xf0,0x48,0xb3,0x04,0xc6,
+0x40,0x05,0x00,0x06,0x44,0x18,0x14,0x73,0x0c,0x9c,0x18,0x48,0x63,0x08,0xcd,0x64,
+0x64,0x40,0x70,0x92,0xa1,0x0c,0x2a,0x62,0x96,0xe1,0x40,0xcc,0x60,0x0c,0xc1,0x99,
+0x66,0x09,0x92,0x31,0x84,0x67,0x9a,0x25,0x48,0x06,0x2a,0x80,0x33,0x38,0xd0,0x00,
+0x99,0x63,0x18,0x83,0x34,0x98,0xc6,0x10,0x1a,0xc8,0xd6,0x80,0xe0,0x24,0x03,0x1b,
+0x54,0xc4,0x2c,0x83,0xb2,0xb4,0xc1,0x18,0x82,0x03,0xcd,0x12,0x30,0x63,0x08,0x0f,
+0x34,0x4b,0xc0,0x0c,0x54,0x00,0x6e,0xa0,0xbc,0xc1,0x32,0xc7,0xa0,0x06,0x70,0x00,
+0x61,0x1c,0x84,0x03,0x01,0x00,0x00,0x00,0x4e,0x00,0x00,0x00,0x76,0x52,0x4c,0xcc,
+0x73,0xd3,0x24,0x05,0x64,0xec,0xcd,0x8d,0xcc,0xe5,0x87,0x46,0xc6,0x50,0x8a,0x89,
+0x79,0xee,0xdb,0x54,0x8a,0x89,0x79,0xee,0xdd,0x1a,0x88,0x89,0x79,0x68,0x73,0x20,
+0x26,0xe6,0xa9,0xed,0x81,0x98,0x98,0xc7,0x36,0x0b,0x62,0x62,0x9e,0xdb,0x32,0x88,
+0x89,0x79,0x72,0xd3,0x20,0x26,0xe6,0xd9,0x8d,0x83,0x98,0x98,0xa7,0xb7,0x95,0x62,
+0x62,0x9e,0xbb,0x27,0x2d,0x20,0x63,0x6f,0x6e,0x64,0x2e,0x3a,0x34,0x35,0x56,0x62,
+0x08,0x4e,0x53,0xd9,0xba,0xb5,0x14,0x02,0xf3,0xe0,0xf5,0x25,0x2c,0x82,0xd3,0x0c,
+0xbe,0xe0,0x34,0xd3,0x8d,0x9b,0x88,0x21,0x38,0xcd,0x60,0xd7,0x24,0x01,0x63,0xec,
+0xcd,0x8d,0xcc,0x45,0x87,0x44,0x80,0x8c,0xbd,0xb9,0x91,0xb9,0xfc,0xc4,0xd0,0x90,
+0x02,0x8c,0xb1,0x37,0x37,0x32,0x97,0x1f,0x73,0x29,0x26,0xe6,0xc1,0x71,0x7b,0x29,
+0x26,0xe6,0xc1,0x77,0xfb,0x28,0x04,0xe6,0xa9,0x6f,0x52,0x01,0x32,0xf6,0xe6,0x46,
+0xe6,0xa2,0x13,0x73,0x63,0x18,0x83,0xc0,0x3c,0xb6,0x41,0x08,0x4e,0x33,0x58,0x47,
+0x31,0x31,0x4f,0x5d,0x1f,0xc3,0x22,0x38,0xcd,0xe0,0x0b,0x4e,0x33,0xe1,0xbc,0xa5,
+0x18,0x82,0xd3,0x0c,0x77,0x6e,0x20,0xc5,0xc4,0x3c,0xb5,0x4e,0x3a,0x40,0xc6,0xde,
+0xdc,0xc8,0x5c,0x7e,0x64,0x70,0x2c,0xa4,0x98,0x98,0xa7,0xee,0xed,0x82,0x10,0x9c,
+0xa6,0xba,0x81,0x44,0x70,0x9a,0xc1,0x17,0x9c,0x66,0x32,0x93,0x42,0x60,0x1e,0x7b,
+0xb7,0x98,0x62,0x62,0x9e,0xbc,0x36,0x16,0x43,0x70,0x9a,0x0a,0xa7,0x6d,0xa4,0x98,
+0x98,0xc7,0xbe,0x8d,0xa4,0x98,0x98,0xc7,0xce,0x0d,0xc6,0x10,0x9c,0x66,0xc0,0x7b,
+0x12,0x02,0x32,0xf6,0xe6,0x46,0xe6,0xa2,0x33,0x13,0x73,0x06,0x8b,0xe0,0x34,0x83,
+0x2f,0x38,0xcd,0x64,0xd3,0xe6,0x61,0x08,0x4e,0x53,0xd5,0xf6,0x01,0x14,0x44,0x33,
+0x45,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x20,0x00,0x00,0x4a,0x00,0x00,0x00,
+0x13,0x04,0x41,0x2c,0x10,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x24,0xca,0x60,0x04,
+0xa0,0x04,0x8a,0x80,0xc2,0x0c,0x00,0xb9,0x61,0x0c,0x04,0x10,0x1e,0xe1,0x19,0xc6,
+0x40,0x02,0xe1,0x11,0x1e,0x00,0x00,0x00,0x63,0x08,0xcd,0x63,0x15,0xc1,0x31,0x84,
+0x06,0xb2,0x8b,0xe0,0x18,0x42,0x13,0x59,0x46,0x70,0x0c,0xa1,0x71,0x6c,0x23,0x38,
+0x16,0x02,0x04,0xc7,0x64,0x61,0x1a,0x37,0x16,0x01,0x04,0x48,0x35,0xc7,0x20,0x79,
+0xcf,0x58,0x04,0x10,0x20,0xd5,0x1c,0xc3,0x07,0x06,0xd0,0x58,0x04,0x10,0x20,0xd5,
+0x1c,0x43,0x18,0x88,0x41,0x34,0x16,0x01,0x04,0x48,0x35,0xc7,0x30,0x06,0x64,0xe0,
+0x98,0x47,0xd0,0xc0,0x80,0xa0,0x89,0x01,0x41,0x23,0x03,0x82,0x63,0x21,0x40,0x70,
+0x50,0x66,0x70,0x06,0x68,0x90,0x06,0x58,0x06,0xe1,0x40,0x00,0x25,0x00,0x00,0x00,
+0x56,0x52,0x4c,0xcc,0x73,0xd3,0x56,0x41,0x4c,0xcc,0x53,0xdb,0x05,0x31,0x31,0xcf,
+0x6d,0x19,0xc4,0xc4,0x3c,0xba,0x6d,0x10,0x13,0xf3,0xf4,0xd6,0x41,0x08,0xc0,0xb2,
+0x18,0x46,0x21,0x38,0x4d,0x85,0x9b,0x46,0x21,0x38,0x4d,0xb5,0x9b,0x8a,0x21,0x00,
+0xcb,0x82,0xdf,0x66,0x62,0x08,0x4e,0x53,0xdd,0xb7,0x9d,0x18,0x82,0xd3,0x54,0xb7,
+0x6e,0x28,0x86,0xe0,0x34,0xd5,0xdd,0xdb,0x47,0x31,0x31,0x4f,0x9d,0x9b,0x87,0x21,
+0x00,0xcb,0x52,0xdf,0x06,0x62,0x08,0xc0,0xb2,0xd4,0xbc,0x59,0x10,0x82,0xd3,0x54,
+0x96,0x62,0x08,0x4e,0x53,0xe1,0xb6,0x85,0x14,0x13,0xf3,0xd8,0xb4,0x8d,0x14,0x13,
+0xf3,0xd8,0xb9,0x89,0x18,0x02,0xb0,0x2c,0xf6,0x6d,0x24,0x86,0x00,0x2c,0x8b,0xcd,
+0x1b,0x87,0x21,0x38,0x4d,0x55,0xd3,0xd6,0x30,0x54,0xc0,0x72,0x00,0x05,0xd1,0x4c,
+0x11,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x20,0x00,0x00,0x19,0x00,0x00,0x00,
+0x13,0x04,0x41,0x2c,0x10,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x24,0x4a,0x60,0x04,
+0x80,0xc2,0x0c,0x00,0x00,0x00,0x00,0x00,0x63,0x08,0xcd,0x33,0x16,0x01,0x04,0x48,
+0x34,0xc7,0x00,0x49,0xcf,0x58,0x04,0x10,0x28,0xd1,0x1c,0xc3,0x44,0x39,0x58,0x85,
+0x03,0x01,0x00,0x00,0x0a,0x00,0x00,0x00,0x16,0x41,0x4c,0xcc,0x63,0xdb,0x04,0x31,
+0x31,0x4f,0x6e,0x0d,0x43,0x05,0x2c,0x07,0x50,0x10,0xcd,0x14,0x61,0x56,0x41,0x4c,
+0xcc,0xd3,0x1b,0x45,0x21,0x00,0xcb,0xb2,0x9b,0x04,0x21,0x00,0xcb,0x02,0x00,0x00,
+0x00,0x00,0x00,0x00,0x61,0x20,0x00,0x00,0x1b,0x00,0x00,0x00,0x13,0x04,0x41,0x2c,
+0x10,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x24,0xca,0x60,0x04,0xa0,0x04,0x8a,0x80,
+0xc2,0x0c,0x00,0x00,0x63,0x08,0xcd,0x33,0x16,0x01,0x04,0xca,0x34,0xc7,0x20,0x51,
+0xcf,0x1c,0x43,0x45,0x41,0x73,0x0c,0x16,0x15,0xcd,0x31,0x5c,0x94,0x83,0x58,0x38,
+0x10,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x86,0x51,0x4c,0xcc,0x53,0xe7,0x76,0x51,
+0x4c,0xcc,0x53,0xdb,0x36,0x41,0x4c,0xcc,0x63,0x5b,0x05,0x31,0x31,0x8f,0x6e,0x0d,
+0x43,0x05,0x2c,0x66,0x41,0x4c,0xcc,0xd3,0x1f,0x40,0x41,0x34,0x53,0x84,0x19,0x05,
+0x21,0x00,0xcb,0x02,0x00,0x00,0x00,0x00,0x61,0x20,0x00,0x00,0x2f,0x00,0x00,0x00,
+0x13,0x04,0x45,0x2c,0x10,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x24,0xca,0xa0,0x04,
+0x46,0x00,0x8a,0x80,0xc0,0x08,0x00,0x00,0x63,0x08,0x0d,0x34,0xc9,0x30,0x49,0xc4,
+0x2c,0x03,0x11,0x50,0x63,0x08,0xcd,0x33,0xc9,0x50,0x49,0xc4,0x2c,0x03,0x21,0x58,
+0x63,0x08,0x4d,0x34,0xc9,0x70,0x49,0xc4,0x2c,0x03,0x31,0x60,0x63,0x08,0x8d,0x33,
+0xc9,0x90,0x49,0x84,0x69,0x22,0x70,0xc3,0x27,0x1c,0x08,0x00,0x1a,0x00,0x00,0x00,
+0x96,0x51,0x4c,0xcc,0x53,0xdf,0x66,0x41,0x08,0xcc,0x83,0xdb,0x04,0x31,0x31,0x4f,
+0x6d,0x15,0xc4,0xc4,0x3c,0xb7,0x61,0x10,0x02,0xf3,0xf0,0x47,0x20,0xb9,0x0d,0x52,
+0x20,0xc4,0xb0,0x12,0x13,0x15,0x35,0xdb,0xe2,0x08,0x8a,0x5d,0x10,0x13,0xf3,0xec,
+0x37,0x90,0x2c,0x4e,0xf4,0x47,0x87,0x54,0xd7,0x17,0x70,0x2c,0x4e,0xf4,0x47,0x87,
+0x74,0x02,0xc8,0xe2,0x44,0x7f,0x74,0x48,0xb9,0x69,0x14,0x02,0xf3,0xd4,0xb8,0x6d,
+0x18,0x11,0x31,0x55,0xc0,0x62,0x0d,0x43,0x05,0x2c,0x07,0x50,0x10,0xcd,0x14,0x61,
+0x46,0x31,0x08,0xcc,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x71,0x20,0x00,0x00,
+0x12,0x00,0x00,0x00,0x66,0x40,0x54,0x82,0x23,0x59,0xc2,0x20,0x09,0x92,0x1d,0x18,
+0x4f,0x84,0x34,0x53,0x61,0x03,0xc4,0xe3,0x58,0x85,0x05,0x14,0xbe,0x34,0x45,0xb5,
+0x21,0x10,0x82,0x23,0x15,0x46,0x30,0x2c,0xc8,0x64,0x02,0x06,0xf0,0x3c,0x91,0x73,
+0x19,0x00,0xe1,0x4b,0x53,0x64,0x0a,0x84,0x84,0x34,0x85,0x31,0x10,0x0a,0xb2,0x3c,
+0x56,0x30,0x08,0xcc,0x63,0x0b,0x44,0x25,0x21,0x0d,0x00,0x00,0x00,0x00,0x00,0x00};
index 8f9830d0b1e87a19371403cbc969fafd0f34d694..857c190f7b6544c02c62e9d1cc36630946f13bb7 100644 (file)
@@ -41,6 +41,7 @@
 
 #include "pipe/p_context.h"
 #include "pipe/p_shader_tokens.h"
+#include "pipe/p_util.h"
 
 #include "tgsi/exec/tgsi_exec.h"
 #include "tgsi/util/tgsi_dump.h"
@@ -179,22 +180,63 @@ typedef void (*vertex_shader_runner)(void *ainputs,
                                      float (*aconsts)[4],
                                      void *temps);
 
-
+#define MAX_TGSI_VERTICES 4
 /*!
   This function is used to execute the gallivm_prog in software. Before calling
   this function the gallivm_prog has to be JIT compiled with the gallivm_cpu_jit_compile
   function.
  */
 int gallivm_cpu_vs_exec(struct gallivm_prog *prog,
-                        struct tgsi_exec_vector       *inputs,
-                        struct tgsi_exec_vector       *dests,
-                        float (*consts)[4],
-                        struct tgsi_exec_vector       *temps)
+                        struct tgsi_exec_machine *machine,
+                        const float (*input)[4],
+                        unsigned num_inputs,
+                        float (*output)[4],
+                        unsigned num_outputs,
+                        const float (*constants)[4],
+                        unsigned count,
+                        unsigned input_stride,
+                        unsigned output_stride )
 {
+   unsigned int i, j;
+   unsigned slot;
    vertex_shader_runner runner = reinterpret_cast<vertex_shader_runner>(prog->function);
+
    assert(runner);
-   /*FIXME*/
-   runner(inputs, dests, consts, temps);
+
+   for (i = 0; i < count; i += MAX_TGSI_VERTICES) {
+      unsigned int max_vertices = MIN2(MAX_TGSI_VERTICES, count - i);
+
+      /* Swizzle inputs.
+       */
+      for (j = 0; j < max_vertices; j++) {
+        for (slot = 0; slot < num_inputs; slot++) {
+           machine->Inputs[slot].xyzw[0].f[j] = input[slot][0];
+           machine->Inputs[slot].xyzw[1].f[j] = input[slot][1];
+           machine->Inputs[slot].xyzw[2].f[j] = input[slot][2];
+           machine->Inputs[slot].xyzw[3].f[j] = input[slot][3];
+        }
+
+        input = (const float (*)[4])((const char *)input + input_stride);
+      }
+
+      /* run shader */
+      runner(machine->Inputs,
+             machine->Outputs,
+             (float (*)[4]) constants,
+             machine->Temps);
+
+      /* Unswizzle all output results
+       */
+      for (j = 0; j < max_vertices; j++) {
+         for (slot = 0; slot < num_outputs; slot++) {
+            output[slot][0] = machine->Outputs[slot].xyzw[0].f[j];
+            output[slot][1] = machine->Outputs[slot].xyzw[1].f[j];
+            output[slot][2] = machine->Outputs[slot].xyzw[2].f[j];
+            output[slot][3] = machine->Outputs[slot].xyzw[3].f[j];
+         }
+         output = (float (*)[4])((char *)output + output_stride);
+      }
+   }
 
    return 0;
 }
index f0122802db952c473de2ac5e7c28e6259d12f46b..76049ade7c070b39dfe6f90e13d6d9984e93cba4 100644 (file)
@@ -38,7 +38,6 @@
 #include <llvm/Instructions.h>
 #include <llvm/Transforms/Utils/Cloning.h>
 #include <llvm/ParameterAttributes.h>
-//#include <llvm/ParamAttrsList.h>
 #include <llvm/Support/MemoryBuffer.h>
 #include <llvm/Bitcode/ReaderWriter.h>
 
@@ -174,16 +173,56 @@ std::vector<llvm::Value*> InstructionsSoa::extractVector(llvm::Value *vector)
 
 void InstructionsSoa::createFunctionMap()
 {
+   m_functionsMap[TGSI_OPCODE_ABS]   = "abs";
    m_functionsMap[TGSI_OPCODE_DP3]   = "dp3";
    m_functionsMap[TGSI_OPCODE_DP4]   = "dp4";
+   m_functionsMap[TGSI_OPCODE_MIN]   = "min";
+   m_functionsMap[TGSI_OPCODE_MAX]   = "max";
    m_functionsMap[TGSI_OPCODE_POWER] = "pow";
+   m_functionsMap[TGSI_OPCODE_LIT]   = "lit";
+   m_functionsMap[TGSI_OPCODE_RSQ]   = "rsq";
 }
 
 void InstructionsSoa::createDependencies()
 {
-   std::vector<std::string> powDeps(1);
-   powDeps[0] = "powf";
-   m_builtinDependencies["pow"] = powDeps;
+   {
+      std::vector<std::string> powDeps(2);
+      powDeps[0] = "powf";
+      powDeps[1] = "powvec";
+      m_builtinDependencies["pow"] = powDeps;
+   }
+   {
+      std::vector<std::string> absDeps(2);
+      absDeps[0] = "fabsf";
+      absDeps[1] = "absvec";
+      m_builtinDependencies["abs"] = absDeps;
+   }
+   {
+      std::vector<std::string> maxDeps(1);
+      maxDeps[0] = "maxvec";
+      m_builtinDependencies["max"] = maxDeps;
+   }
+   {
+      std::vector<std::string> minDeps(1);
+      minDeps[0] = "minvec";
+      m_builtinDependencies["min"] = minDeps;
+   }
+   {
+      std::vector<std::string> litDeps(4);
+      litDeps[0] = "minvec";
+      litDeps[1] = "maxvec";
+      litDeps[2] = "powf";
+      litDeps[3] = "powvec";
+      m_builtinDependencies["lit"] = litDeps;
+   }
+   {
+      std::vector<std::string> rsqDeps(4);
+      rsqDeps[0] = "sqrtf";
+      rsqDeps[1] = "sqrtvec";
+      rsqDeps[2] = "fabsf";
+      rsqDeps[3] = "absvec";
+      m_builtinDependencies["rsq"] = rsqDeps;
+   }
 }
 
 llvm::Function * InstructionsSoa::function(int op)
@@ -193,9 +232,13 @@ llvm::Function * InstructionsSoa::function(int op)
 
     std::string name = m_functionsMap[op];
 
+    std::cout <<"For op = "<<op<<", func is '"<<name<<"'"<<std::endl;
+
     std::vector<std::string> deps = m_builtinDependencies[name];
     for (unsigned int i = 0; i < deps.size(); ++i) {
-       injectFunction(m_builtins->getFunction(deps[i]));
+       llvm::Function *func = m_builtins->getFunction(deps[i]);
+       std::cout <<"\tinjecting dep = '"<<func->getName()<<"'"<<std::endl;
+       injectFunction(func);
     }
 
     llvm::Function *originalFunc = m_builtins->getFunction(name);
@@ -216,11 +259,20 @@ void InstructionsSoa::createBuiltins()
 {
    MemoryBuffer *buffer = MemoryBuffer::getMemBuffer(
       (const char*)&soabuiltins_data[0],
-      (const char*)&soabuiltins_data[Elements(soabuiltins_data)-1]);
+      (const char*)&soabuiltins_data[Elements(soabuiltins_data)]);
    m_builtins = ParseBitcodeFile(buffer);
+   std::cout<<"Builtins created at "<<m_builtins<<std::endl;
+   assert(m_builtins);
    createDependencies();
 }
 
+
+std::vector<llvm::Value*> InstructionsSoa::abs(const std::vector<llvm::Value*> in1)
+{
+   llvm::Function *func = function(TGSI_OPCODE_ABS);
+   return callBuiltin(func, in1);
+}
+
 std::vector<llvm::Value*> InstructionsSoa::dp3(const std::vector<llvm::Value*> in1,
                                                const std::vector<llvm::Value*> in2)
 {
@@ -354,6 +406,21 @@ std::vector<llvm::Value*> InstructionsSoa::pow(const std::vector<llvm::Value*> i
    return callBuiltin(func, in1, in2);
 }
 
+std::vector<llvm::Value*> InstructionsSoa::min(const std::vector<llvm::Value*> in1,
+                                               const std::vector<llvm::Value*> in2)
+{
+   llvm::Function *func = function(TGSI_OPCODE_MIN);
+   return callBuiltin(func, in1, in2);
+}
+
+
+std::vector<llvm::Value*> InstructionsSoa::max(const std::vector<llvm::Value*> in1,
+                                               const std::vector<llvm::Value*> in2)
+{
+   llvm::Function *func = function(TGSI_OPCODE_MAX);
+   return callBuiltin(func, in1, in2);
+}
+
 void checkFunction(Function *func)
 {
    for (Function::const_iterator BI = func->begin(), BE = func->end();
@@ -388,7 +455,6 @@ void InstructionsSoa::injectFunction(llvm::Function *originalFunc, int op)
    }
    llvm::Function *func = 0;
    if (originalFunc->isDeclaration()) {
-      std::cout << "function decleration" <<std::endl;
       func = Function::Create(originalFunc->getFunctionType(), GlobalValue::ExternalLinkage,
                               originalFunc->getName(), currentModule());
       func->setCallingConv(CallingConv::C);
@@ -397,20 +463,48 @@ void InstructionsSoa::injectFunction(llvm::Function *originalFunc, int op)
       currentModule()->dump();
    } else {
       DenseMap<const Value*, Value *> val;
+      val[m_builtins->getFunction("fabsf")] = currentModule()->getFunction("fabsf");
       val[m_builtins->getFunction("powf")] = currentModule()->getFunction("powf");
+      val[m_builtins->getFunction("sqrtf")] = currentModule()->getFunction("sqrtf");
+      func = CloneFunction(originalFunc, val);
+#if 0
       std::cout <<" replacing "<<m_builtins->getFunction("powf")
                 <<", with " <<currentModule()->getFunction("powf")<<std::endl;
-      func = CloneFunction(originalFunc, val);
       std::cout<<"1111-------------------------------"<<std::endl;
       checkFunction(originalFunc);
       std::cout<<"2222-------------------------------"<<std::endl;
       checkFunction(func);
       std::cout <<"XXXX = " <<val[m_builtins->getFunction("powf")]<<std::endl;
+#endif
       currentModule()->getFunctionList().push_back(func);
-      std::cout << "Func parent is "<<func->getParent()
-                <<", cur is "<<currentModule() <<std::endl;
    }
    if (op != TGSI_OPCODE_LAST) {
       m_functions[op] = func;
    }
 }
+
+std::vector<llvm::Value*> InstructionsSoa::sub(const std::vector<llvm::Value*> in1,
+                                               const std::vector<llvm::Value*> in2)
+{
+   std::vector<llvm::Value*> res(4);
+
+   res[0] = m_builder.CreateSub(in1[0], in2[0], name("subx"));
+   res[1] = m_builder.CreateSub(in1[1], in2[1], name("suby"));
+   res[2] = m_builder.CreateSub(in1[2], in2[2], name("subz"));
+   res[3] = m_builder.CreateSub(in1[3], in2[3], name("subw"));
+
+   return res;
+}
+
+std::vector<llvm::Value*> InstructionsSoa::lit(const std::vector<llvm::Value*> in)
+{
+   llvm::Function *func = function(TGSI_OPCODE_LIT);
+   return callBuiltin(func, in);
+}
+
+std::vector<llvm::Value*> InstructionsSoa::rsq(const std::vector<llvm::Value*> in)
+{
+   llvm::Function *func = function(TGSI_OPCODE_RSQ);
+   return callBuiltin(func, in);
+}
+
index 060ee72f2e8b3d6fb3d271106d5f918189c17c8b..3e20b652dd35588c04dd72a3de84554ef06c1c9e 100644 (file)
@@ -48,6 +48,7 @@ public:
    InstructionsSoa(llvm::Module *mod, llvm::Function *func,
                    llvm::BasicBlock *block, StorageSoa *storage);
 
+   std::vector<llvm::Value*> abs(const std::vector<llvm::Value*> in1);
    std::vector<llvm::Value*> arl(const std::vector<llvm::Value*> in);
    std::vector<llvm::Value*> add(const std::vector<llvm::Value*> in1,
                                  const std::vector<llvm::Value*> in2);
@@ -55,13 +56,21 @@ public:
                                  const std::vector<llvm::Value*> in2);
    std::vector<llvm::Value*> dp4(const std::vector<llvm::Value*> in1,
                                  const std::vector<llvm::Value*> in2);
+   std::vector<llvm::Value*> lit(const std::vector<llvm::Value*> in);
    std::vector<llvm::Value*> madd(const std::vector<llvm::Value*> in1,
                                   const std::vector<llvm::Value*> in2,
                                   const std::vector<llvm::Value*> in3);
+   std::vector<llvm::Value*> max(const std::vector<llvm::Value*> in1,
+                                 const std::vector<llvm::Value*> in2);
+   std::vector<llvm::Value*> min(const std::vector<llvm::Value*> in1,
+                                 const std::vector<llvm::Value*> in2);
    std::vector<llvm::Value*> mul(const std::vector<llvm::Value*> in1,
                                  const std::vector<llvm::Value*> in2);
    std::vector<llvm::Value*> pow(const std::vector<llvm::Value*> in1,
                                  const std::vector<llvm::Value*> in2);
+   std::vector<llvm::Value*> rsq(const std::vector<llvm::Value*> in1);
+   std::vector<llvm::Value*> sub(const std::vector<llvm::Value*> in1,
+                                 const std::vector<llvm::Value*> in2);
    void         end();
 
    std::vector<llvm::Value*> extractVector(llvm::Value *vector);
index 64b5d499a8ed701a8df178766b3904853266c721..6b9d626ed4ae6756e636effc9487d7d664d85fa0 100644 (file)
@@ -1,4 +1,3 @@
-/*clang --emit-llvm llvm_builtins.c |llvm-as|opt -std-compile-opts|llvm2cpp -gen-contents -o=gallivm_builtins.cpp -f -for=shader -funcname=createGallivmBuiltins*/
 /**************************************************************************
  *
  * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
index 40addebd8cdb4a9bd81f742458a4e9c4c5ffc98e..78f84510e292e294604b751ea3c5713b0c8550aa 100644 (file)
   */
 typedef __attribute__(( ext_vector_type(4) )) float float4;
 
+
+extern float fabsf(float val);
+
+float4 absvec(float4 vec)
+{
+   float4 res;
+   res.x = fabsf(vec.x);
+   res.y = fabsf(vec.y);
+   res.z = fabsf(vec.z);
+   res.w = fabsf(vec.w);
+
+   return res;
+}
+
+void abs(float4 *res,
+         float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w)
+{
+   res[0] = absvec(tmp0x);
+   res[1] = absvec(tmp0y);
+   res[2] = absvec(tmp0z);
+   res[3] = absvec(tmp0w);
+}
+
 void dp3(float4 *res,
          float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w,
          float4 tmp1x, float4 tmp1y, float4 tmp1z, float4 tmp1w)
@@ -61,30 +84,104 @@ void dp4(float4 *res,
 }
 
 extern float powf(float num, float p);
+extern float sqrtf(float x);
+
+float4 powvec(float4 vec, float4 q)
+{
+   float4 p;
+   p.x = powf(vec.x, q.x);
+   p.y = powf(vec.y, q.y);
+   p.z = powf(vec.z, q.z);
+   p.w = powf(vec.w, q.w);
+   return p;
+}
 
 void pow(float4 *res,
          float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w,
          float4 tmp1x, float4 tmp1y, float4 tmp1z, float4 tmp1w)
 {
-   float4 p;
-   p.x = powf(tmp0x.x, tmp1x.x);
-   p.y = powf(tmp0x.y, tmp1x.y);
-   p.z = powf(tmp0x.z, tmp1x.z);
-   p.w = powf(tmp0x.w, tmp1x.w);
-
-   res[0] = p;
-   res[1] = p;
-   res[2] = p;
-   res[3] = p;
+   res[0] = powvec(tmp0x, tmp1x);
+   res[1] = res[0];
+   res[2] = res[0];
+   res[3] = res[0];
+}
+
+float4 minvec(float4 a, float4 b)
+{
+   return (float4){(a.x < b.x) ? a.x : b.x,
+         (a.y < b.y) ? a.y : b.y,
+         (a.z < b.z) ? a.z : b.z,
+         (a.w < b.w) ? a.w : b.w};
+}
+
+void min(float4 *res,
+         float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w,
+         float4 tmp1x, float4 tmp1y, float4 tmp1z, float4 tmp1w)
+{
+   res[0] = minvec(tmp0x, tmp1x);
+   res[1] = minvec(tmp0y, tmp1y);
+   res[2] = minvec(tmp0z, tmp1z);
+   res[3] = minvec(tmp0w, tmp1w);
+}
+
+
+float4 maxvec(float4 a, float4 b)
+{
+   return (float4){(a.x > b.x) ? a.x : b.x,
+         (a.y > b.y) ? a.y : b.y,
+         (a.z > b.z) ? a.z : b.z,
+         (a.w > b.w) ? a.w : b.w};
+}
+
+void max(float4 *res,
+         float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w,
+         float4 tmp1x, float4 tmp1y, float4 tmp1z, float4 tmp1w)
+{
+   res[0] = maxvec(tmp0x, tmp1x);
+   res[1] = maxvec(tmp0y, tmp1y);
+   res[2] = maxvec(tmp0z, tmp1z);
+   res[3] = maxvec(tmp0w, tmp1w);
+}
+
+
+void lit(float4 *res,
+         float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w)
+{
+   const float4 zerovec = (float4) {0.0, 0.0, 0.0, 0.0};
+   const float4 min128 = (float4) {-128.f, -128.f, -128.f, -128.f};
+   const float4 plus128 = (float4) {128.f,  128.f,  128.f,  128.f};
+
+   res[0] = (float4){1.0, 1.0, 1.0, 1.0};
+   if (tmp0x.x > 0) {
+      float4 tmpy = maxvec(tmp0y, zerovec);
+      float4 tmpw = minvec(tmp0w, plus128);
+      tmpw = maxvec(tmpw, min128);
+      res[1] = tmp0x;
+      res[2] = powvec(tmpy, tmpw);
+   } else {
+      res[1] = zerovec;
+      res[2] = zerovec;
+   }
+   res[3] = (float4){1.0, 1.0, 1.0, 1.0};
 }
 
-#if 0
-void yo(float4 *out, float4 *in)
+
+float4 sqrtvec(float4 vec)
 {
-   float4 res[4];
+   float4 p;
+   p.x = sqrtf(vec.x);
+   p.y = sqrtf(vec.y);
+   p.z = sqrtf(vec.z);
+   p.w = sqrtf(vec.w);
+   return p;
+}
 
-   dp3(res, in[0], in[1], in[2], in[3],
-       in[4], in[5], in[6], in[7]);
-   out[1] = res[1];
+void rsq(float4 *res,
+         float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w)
+{
+   const float4 onevec = (float4) {1., 1., 1., 1.};
+   res[0] = onevec/sqrtvec(absvec(tmp0x));
+   res[1] = onevec/sqrtvec(absvec(tmp0y));
+   res[2] = onevec/sqrtvec(absvec(tmp0z));
+   res[3] = onevec/sqrtvec(absvec(tmp0w));
 }
-#endif
index ab8c851f148ce67e167c193d4651e66264f239f9..9695358ab82cc9ae74628ef102927a99aa913df2 100644 (file)
@@ -692,12 +692,14 @@ translate_instructionir(llvm::Module *module,
    }
       break;
    case TGSI_OPCODE_LIT: {
+      out = instr->lit(inputs[0]);
    }
       break;
    case TGSI_OPCODE_RCP: {
    }
       break;
    case TGSI_OPCODE_RSQ: {
+      out = instr->rsq(inputs[0]);
    }
       break;
    case TGSI_OPCODE_EXP:
@@ -724,9 +726,11 @@ translate_instructionir(llvm::Module *module,
    }
       break;
    case TGSI_OPCODE_MIN: {
+      out = instr->min(inputs[0], inputs[1]);
    }
       break;
    case TGSI_OPCODE_MAX: {
+      out = instr->max(inputs[0], inputs[1]);
    }
       break;
    case TGSI_OPCODE_SLT: {
@@ -740,6 +744,7 @@ translate_instructionir(llvm::Module *module,
    }
       break;
    case TGSI_OPCODE_SUB: {
+      out = instr->sub(inputs[0], inputs[1]);
    }
       break;
    case TGSI_OPCODE_LERP: {
@@ -781,6 +786,7 @@ translate_instructionir(llvm::Module *module,
    case TGSI_OPCODE_MULTIPLYMATRIX:
       break;
    case TGSI_OPCODE_ABS: {
+      out = instr->abs(inputs[0]);
    }
       break;
    case TGSI_OPCODE_RCC:
index 5bea7738401af9ea90ad7f00e3819a0cf113dcff..5c0b0bfd61b18e077c25ae72fb29ceb9ecfc360a 100644 (file)
@@ -330,3 +330,18 @@ tgsi_num_tokens(const struct tgsi_token *tokens)
    }
    return 0;
 }
+
+
+/**
+ * Make a new copy of a token array.
+ */
+struct tgsi_token *
+tgsi_dup_tokens(const struct tgsi_token *tokens)
+{
+   unsigned n = tgsi_num_tokens(tokens);
+   unsigned bytes = n * sizeof(struct tgsi_token);
+   struct tgsi_token *new_tokens = (struct tgsi_token *) MALLOC(bytes);
+   if (new_tokens)
+      memcpy(new_tokens, tokens, bytes);
+   return new_tokens;
+}
index 15e76feb7ca3234e9008f8fc09b35d666935a976..41021010936c452f91910bee4c5bd6188fab150a 100644 (file)
@@ -1,4 +1,31 @@
-#if !defined TGSI_PARSE_H
+/**************************************************************************
+ * 
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * 
+ **************************************************************************/
+
+#ifndef TGSI_PARSE_H
 #define TGSI_PARSE_H
 
 #include "pipe/p_shader_tokens.h"
@@ -118,6 +145,8 @@ tgsi_parse_token(
 unsigned
 tgsi_num_tokens(const struct tgsi_token *tokens);
 
+struct tgsi_token *
+tgsi_dup_tokens(const struct tgsi_token *tokens);
 
 #if defined __cplusplus
 }
index fb2e940348ac131f9295d92baa42dc3b850197c5..c3a3fbd066d5055e4b3085c1b4417a1ac21ddad7 100644 (file)
 #include "pipe/p_inlines.h"
 #include "pipe/p_winsys.h"
 #include "draw/draw_context.h"
-#if 0
-#include "pipe/p_shader_tokens.h"
-#include "gallivm/gallivm.h"
-#include "tgsi/util/tgsi_dump.h"
-#include "tgsi/exec/tgsi_sse2.h"
-#endif
+#include "tgsi/util/tgsi_parse.h"
 
 #include "cell_context.h"
 #include "cell_state.h"
 
 
+
+/** cast wrapper */
+static INLINE struct cell_fragment_shader_state *
+cell_fragment_shader_state(void *shader)
+{
+   return (struct pipe_shader_state *) shader;
+}
+
+
+/** cast wrapper */
+static INLINE struct cell_vertex_shader_state *
+cell_vertex_shader_state(void *shader)
+{
+   return (struct pipe_shader_state *) shader;
+}
+
+
+
 static void *
 cell_create_fs_state(struct pipe_context *pipe,
                      const struct pipe_shader_state *templ)
 {
    /*struct cell_context *cell = cell_context(pipe);*/
-   struct cell_fragment_shader_state *state;
+   struct cell_fragment_shader_state *cfs;
 
-   state = CALLOC_STRUCT(cell_fragment_shader_state);
-   if (!state)
+   cfs = CALLOC_STRUCT(cell_fragment_shader_state);
+   if (!cfs)
       return NULL;
 
-   state->shader = *templ;
+   cfs->shader.tokens = tgsi_dup_tokens(templ->tokens);
+   if (!cfs->shader.tokens) {
+      FREE(cfs);
+      return NULL;
+   }
 
-   tgsi_scan_shader(templ->tokens, &state->info);
+   tgsi_scan_shader(templ->tokens, &cfs->info);
 
-   return state;
+   return cfs;
 }
 
 
@@ -65,7 +82,7 @@ cell_bind_fs_state(struct pipe_context *pipe, void *fs)
 {
    struct cell_context *cell = cell_context(pipe);
 
-   cell->fs = (struct cell_fragment_shader_state *) fs;
+   cell->fs = cell_fragment_shader_state(fs);
 
    cell->dirty |= CELL_NEW_FS;
 }
@@ -74,10 +91,10 @@ cell_bind_fs_state(struct pipe_context *pipe, void *fs)
 static void
 cell_delete_fs_state(struct pipe_context *pipe, void *fs)
 {
-   struct cell_fragment_shader_state *state =
-      (struct cell_fragment_shader_state *) fs;
+   struct cell_fragment_shader_state *cfs = cell_fragment_shader_state(fs);
 
-   FREE( state );
+   FREE((void *) cfs->shader.tokens);
+   FREE(cfs);
 }
 
 
@@ -86,22 +103,28 @@ cell_create_vs_state(struct pipe_context *pipe,
                      const struct pipe_shader_state *templ)
 {
    struct cell_context *cell = cell_context(pipe);
-   struct cell_vertex_shader_state *state;
+   struct cell_vertex_shader_state *cvs;
 
-   state = CALLOC_STRUCT(cell_vertex_shader_state);
-   if (!state)
+   cvs = CALLOC_STRUCT(cell_vertex_shader_state);
+   if (!cvs)
       return NULL;
 
-   state->shader = *templ;
-   tgsi_scan_shader(templ->tokens, &state->info);
+   cvs->shader.tokens = tgsi_dup_tokens(templ->tokens);
+   if (!cvs->shader.tokens) {
+      FREE(cvs);
+      return NULL;
+   }
 
-   state->draw_data = draw_create_vertex_shader(cell->draw, &state->shader);
-   if (state->draw_data == NULL) {
-      FREE( state );
+   tgsi_scan_shader(templ->tokens, &cvs->info);
+
+   cvs->draw_data = draw_create_vertex_shader(cell->draw, &cvs->shader);
+   if (cvs->draw_data == NULL) {
+      FREE( (void *) cvs->shader.tokens );
+      FREE( cvs );
       return NULL;
    }
 
-   return state;
+   return cvs;
 }
 
 
@@ -110,7 +133,7 @@ cell_bind_vs_state(struct pipe_context *pipe, void *vs)
 {
    struct cell_context *cell = cell_context(pipe);
 
-   cell->vs = (const struct cell_vertex_shader_state *) vs;
+   cell->vs = cell_vertex_shader_state(vs);
 
    draw_bind_vertex_shader(cell->draw,
                            (cell->vs ? cell->vs->draw_data : NULL));
@@ -123,12 +146,11 @@ static void
 cell_delete_vs_state(struct pipe_context *pipe, void *vs)
 {
    struct cell_context *cell = cell_context(pipe);
+   struct cell_vertex_shader_state *cvs = cell_vertex_shader_state(vs);
 
-   struct cell_vertex_shader_state *state =
-      (struct cell_vertex_shader_state *) vs;
-
-   draw_delete_vertex_shader(cell->draw, state->draw_data);
-   FREE( state );
+   draw_delete_vertex_shader(cell->draw, cvs->draw_data);
+   FREE( (void *) cvs->shader.tokens );
+   FREE( cvs );
 }
 
 
index 3d94b52366004bacccae22b951f6b19b2eeb527a..964bd7c871cc94a2b4d5f699f3c044c4880a7baa 100644 (file)
@@ -33,6 +33,7 @@
 #include "pipe/p_winsys.h"
 #include "pipe/p_util.h"
 #include "pipe/p_inlines.h"
+#include "tgsi/util/tgsi_parse.h"
 
 #include "i915_context.h"
 #include "i915_reg.h"
@@ -436,7 +437,7 @@ i915_create_fs_state(struct pipe_context *pipe,
    if (!ifs)
       return NULL;
 
-   ifs->state = *templ;
+   ifs->state.tokens = tgsi_dup_tokens(templ->tokens);
 
    tgsi_scan_shader(templ->tokens, &ifs->info);
 
@@ -465,6 +466,8 @@ void i915_delete_fs_state(struct pipe_context *pipe, void *shader)
       FREE(ifs->program);
    ifs->program_len = 0;
 
+   FREE(ifs->state.tokens);
+
    FREE(ifs);
 }
 
@@ -714,10 +717,16 @@ static void i915_set_vertex_elements(struct pipe_context *pipe,
 }
 
 
+static void i915_set_edgeflags(struct pipe_context *pipe,
+                               const unsigned *bitfield)
+{
+   /* TODO do something here */
+}
 
 void
 i915_init_state_functions( struct i915_context *i915 )
 {
+   i915->pipe.set_edgeflags = i915_set_edgeflags;
    i915->pipe.create_blend_state = i915_create_blend_state;
    i915->pipe.bind_blend_state = i915_bind_blend_state;
    i915->pipe.delete_blend_state = i915_delete_blend_state;
index 376f1487b293cba97b1c975d13a620ec81e1e5f4..ac243b7e4f9b1963e56180b8d1e8e318b4da70c1 100644 (file)
@@ -35,6 +35,7 @@
 #include "pipe/p_inlines.h"\r
 #include "pipe/p_shader_tokens.h"\r
 #include "tgsi/util/tgsi_dump.h"\r
+#include "tgsi/util/tgsi_parse.h"\r
 \r
 #include "brw_context.h"\r
 #include "brw_defines.h"\r
@@ -182,9 +183,7 @@ static void * brw_create_fs_state(struct pipe_context *pipe,
 {\r
    struct brw_fragment_program *brw_fp = CALLOC_STRUCT(brw_fragment_program);\r
 \r
-   /* XXX: Do I have to duplicate the tokens as well??\r
-    */\r
-   brw_fp->program = *shader;\r
+   brw_fp->program.tokens = tgsi_dup_tokens(shader->tokens);\r
    brw_fp->id = brw_context(pipe)->program_id++;\r
 \r
    tgsi_scan_shader(shader->tokens, &brw_fp->info);\r
@@ -210,7 +209,10 @@ static void brw_bind_fs_state(struct pipe_context *pipe, void *shader)
 \r
 static void brw_delete_fs_state(struct pipe_context *pipe, void *shader)\r
 {\r
-   FREE(shader);\r
+   struct brw_fragment_program *brw_fp = (struct brw_fragment_program *) shader;\r
+\r
+   FREE((void *) brw_fp->program.tokens);\r
+   FREE(brw_fp);\r
 }\r
 \r
 \r
@@ -223,9 +225,7 @@ static void *brw_create_vs_state(struct pipe_context *pipe,
 {\r
    struct brw_vertex_program *brw_vp = CALLOC_STRUCT(brw_vertex_program);\r
 \r
-   /* XXX: Do I have to duplicate the tokens as well??\r
-    */\r
-   brw_vp->program = *shader;\r
+   brw_vp->program.tokens = tgsi_dup_tokens(shader->tokens);\r
    brw_vp->id = brw_context(pipe)->program_id++;\r
 \r
    tgsi_scan_shader(shader->tokens, &brw_vp->info);\r
@@ -251,7 +251,10 @@ static void brw_bind_vs_state(struct pipe_context *pipe, void *vs)
 \r
 static void brw_delete_vs_state(struct pipe_context *pipe, void *shader)\r
 {\r
-   FREE(shader);\r
+   struct brw_vertex_program *brw_vp = (struct brw_vertex_program *) shader;\r
+\r
+   FREE((void *) brw_vp->program.tokens);\r
+   FREE(brw_vp);\r
 }\r
 \r
 \r
index d5bd7a702f11b96b576ef6c53d3ef55691d00760..0b199a2193e9fa579b07556c45b4b64d0ed644ce 100644 (file)
@@ -37,6 +37,7 @@
 #include "pipe/p_util.h"
 #include "pipe/p_inlines.h"
 #include "tgsi/exec/tgsi_exec.h"
+#include "tgsi/util/tgsi_parse.h"
 
 struct sp_exec_fragment_shader {
    struct sp_fragment_shader base;
@@ -116,6 +117,7 @@ exec_run( const struct sp_fragment_shader *base,
 static void 
 exec_delete( struct sp_fragment_shader *base )
 {
+   FREE((void *) base->shader.tokens);
    FREE(base);
 }
 
@@ -137,7 +139,8 @@ softpipe_create_fs_exec(struct softpipe_context *softpipe,
    if (!shader)
       return NULL;
 
-   shader->base.shader = *templ;
+   /* we need to keep a local copy of the tokens */
+   shader->base.shader.tokens = tgsi_dup_tokens(templ->tokens);
    shader->base.prepare = exec_prepare;
    shader->base.run = exec_run;
    shader->base.delete = exec_delete;
index 25fdfea4915e5388c814aef9d0f345e5d6813af6..55741cc1df89b9c88e816735603b826ee27b9493 100644 (file)
@@ -139,7 +139,11 @@ softpipe_create_fs_sse(struct softpipe_context *softpipe,
    }
 
    shader->func = (codegen_function) x86_get_func( &shader->sse2_program );
-   assert(shader->func);
+   if (!shader->func) {
+      x86_release_func( &shader->sse2_program );
+      FREE(shader);
+      return NULL;
+   }
 
    shader->base.shader = *templ;
    shader->base.prepare = fs_sse_prepare;
index 45056502b8e5c141e1e7c78cacc707f637b1720a..452e51fa7912902d7f7550435ae97971d42a9cf9 100644 (file)
 
 struct tgsi_sampler;
 struct tgsi_exec_machine;
+struct vertex_info;
 
 
-/** Subclass of pipe_shader_state (though it doesn't really need to be).
+/**
+ * Subclass of pipe_shader_state (though it doesn't really need to be).
  *
  * This is starting to look an awful lot like a quad pipeline stage...
  */
@@ -80,11 +82,10 @@ struct sp_fragment_shader {
    void (*delete)( struct sp_fragment_shader * );
 };
 
-struct vertex_info;
 
 /** Subclass of pipe_shader_state */
 struct sp_vertex_shader {
-   struct pipe_shader_state shader;
+   struct pipe_shader_state shader;  /* Note: this field not actually used */
    struct draw_vertex_shader *draw_data;
 };
 
index 9e77b7e91bc79e83d91389c376cb0e8e9606a371..24b91fbc79435aa7c390b7e65c7cde30ceb22f64 100644 (file)
@@ -102,10 +102,7 @@ softpipe_create_vs_state(struct pipe_context *pipe,
       return NULL;
    }
 
-   state->shader = *templ;
-
-   state->draw_data = draw_create_vertex_shader(softpipe->draw,
-                                                &state->shader);
+   state->draw_data = draw_create_vertex_shader(softpipe->draw, templ);
    if (state->draw_data == NULL) {
       FREE( state );
       return NULL;
index e32212d36c376a80049fd67a610681ee6b5a756e..a4bd23c302ae554f2b5dfb5147584d4cc1168e25 100644 (file)
@@ -327,14 +327,6 @@ enum pipe_format {
 };
 
 
-/** XXX remove these deprecated names */
-#define PIPE_FORMAT_U_L8     PIPE_FORMAT_L8_UNORM
-#define PIPE_FORMAT_U_A8     PIPE_FORMAT_A8_UNORM
-#define PIPE_FORMAT_U_I8     PIPE_FORMAT_I8_UNORM
-#define PIPE_FORMAT_U_A8_L8  PIPE_FORMAT_A8L8_UNORM
-#define PIPE_FORMAT_U_S8     PIPE_FORMAT_S8_UNORM
-
-
 /**
  * Builds pipe format name from format token.
  */
index 0e7e246666231bc8f3aa7b0b19d6f7167e27cd4a..a66ab765f72875ec5a12b94e048e851c0b176607 100644 (file)
@@ -204,7 +204,10 @@ mem_dup(const void *src, uint size)
 #define MIN2( A, B )   ( (A)<(B) ? (A) : (B) )
 #define MAX2( A, B )   ( (A)>(B) ? (A) : (B) )
 
+/* JB stop warnings */
+#ifndef Elements
 #define Elements(x) (sizeof(x)/sizeof((x)[0]))
+#endif
 #define Offset(TYPE, MEMBER) ((unsigned)&(((TYPE *)NULL)->MEMBER))
 
 /**
index 40654bb2ac3c3621a161085dfed8833b8cacba9f..c0ce2f927bb207a4b0be54a2878303562401ff88 100644 (file)
@@ -2,7 +2,7 @@
 TOP = ../../../../..
 include $(TOP)/configs/current
 
-LIBNAME = i915tex_dri.so
+LIBNAME = i915_dri.so
 
 MINIGLX_SOURCES = server/intel_dri.c
 
@@ -19,11 +19,14 @@ DRIVER_SOURCES = \
        intel_context.c \
        intel_lock.c \
        intel_screen.c \
-       intel_batchpool.c
+       ws_dri_bufmgr.c \
+       ws_dri_drmpool.c \
+       ws_dri_fencemgr.c \
+       ws_dri_mallocpool.c \
+       ws_dri_slabpool.c
 
 C_SOURCES = \
        $(COMMON_GALLIUM_SOURCES) \
-       $(COMMON_BM_SOURCES) \
        $(DRIVER_SOURCES)
 
 ASM_SOURCES = 
index 5830b88b37eeac8b9e076fc38a0f82326ad2d436..aa2eed53b8446e1d223db2653c47cddae8a1a987 100644 (file)
  * 
  **************************************************************************/
 
-#include <errno.h>
-#include <stdio.h>
 #include "intel_batchbuffer.h"
 #include "intel_context.h"
-#include "intel_screen.h"
-#include "intel_reg.h"
-#include "drm.h"
-
-/* Relocations in kernel space:
- *    - pass dma buffer seperately
- *    - memory manager knows how to patch
- *    - pass list of dependent buffers
- *    - pass relocation list
- *
- * Either:
- *    - get back an offset for buffer to fire
- *    - memory manager knows how to fire buffer
- *
- * Really want the buffer to be AGP and pinned.
- *
- */
-
-/* Cliprect fence: The highest fence protecting a dma buffer
- * containing explicit cliprect information.  Like the old drawable
- * lock but irq-driven.  X server must wait for this fence to expire
- * before changing cliprects [and then doing sw rendering?].  For
- * other dma buffers, the scheduler will grab current cliprect info
- * and mix into buffer.  X server must hold the lock while changing
- * cliprects???  Make per-drawable.  Need cliprects in shared memory
- * -- beats storing them with every cmd buffer in the queue.
- *
- * ==> X server must wait for this fence to expire before touching the
- * framebuffer with new cliprects.
- *
- * ==> Cliprect-dependent buffers associated with a
- * cliprect-timestamp.  All of the buffers associated with a timestamp
- * must go to hardware before any buffer with a newer timestamp.
- *
- * ==> Dma should be queued per-drawable for correct X/GL
- * synchronization.  Or can fences be used for this?
- *
- * Applies to: Blit operations, metaops, X server operations -- X
- * server automatically waits on its own dma to complete before
- * modifying cliprects ???
- */
+#include <errno.h>
 
+#if 0
 static void
-intel_dump_batchbuffer(uint offset, uint * ptr, uint count)
+intel_dump_batchbuffer(GLuint offset, GLuint * ptr, GLuint count)
 {
    int i;
-   printf("\n\n\nSTART BATCH (%d dwords):\n", count / 4);
-   for (i = 0; i < count / 4; i += 1)
-      printf("\t0x%08x\n", ptr[i]);
-   printf("END BATCH\n\n\n");
+   fprintf(stderr, "\n\n\nSTART BATCH (%d dwords):\n", count / 4);
+   for (i = 0; i < count / 4; i += 4)
+      fprintf(stderr, "0x%x:\t0x%08x 0x%08x 0x%08x 0x%08x\n",
+              offset + i * 4, ptr[i], ptr[i + 1], ptr[i + 2], ptr[i + 3]);
+   fprintf(stderr, "END BATCH\n\n\n");
+}
+#endif
+
+static void 
+intel_realloc_relocs(struct intel_batchbuffer *batch, int num_relocs)
+{
+    unsigned long size = num_relocs * I915_RELOC0_STRIDE + I915_RELOC_HEADER;
+    
+    size *= sizeof(uint32_t);
+    batch->reloc = realloc(batch->reloc, size);
+    batch->reloc_size = num_relocs;
 }
 
 
 void
 intel_batchbuffer_reset(struct intel_batchbuffer *batch)
 {
-   int i;
-
-   if (batch->map) {
-      driBOUnmap(batch->buffer);
-      batch->map = NULL;
-   }
-
    /*
     * Get a new, free batchbuffer.
     */
-   batch->size =  BATCH_SZ;
-   driBOData(batch->buffer, batch->size, NULL, 0);
+    drmBO *bo;
+    struct drm_bo_info_req *req;
+    
+   driBOUnrefUserList(batch->list);
+   driBOResetList(batch->list);
 
-   driBOResetList(&batch->list);
+   batch->size = 4 * 4096; // ZZZ JB batch->intel->intelScreen->maxBatchSize;
+   driBOData(batch->buffer, batch->size, NULL, NULL, 0);
 
    /*
-    * Unreference buffers previously on the relocation list.
+    * Add the batchbuffer to the validate list.
     */
-   for (i = 0; i < batch->nr_relocs; i++) {
-      struct buffer_reloc *r = &batch->reloc[i];
-      driBOUnReference(r->buf);
-   }
 
-   batch->list_count = 0;
-   batch->nr_relocs = 0;
-   batch->flags = 0;
+   driBOAddListItem(batch->list, batch->buffer,
+                   DRM_BO_FLAG_EXE | DRM_BO_FLAG_MEM_TT,
+                   DRM_BO_FLAG_EXE | DRM_BO_MASK_MEM,
+                   &batch->dest_location, &batch->node);
+
+   req = &batch->node->bo_arg.d.req.bo_req;
 
    /*
-    * We don't refcount the batchbuffer itself since we can't destroy it
-    * while it's on the list.
+    * Set up information needed for us to make relocations
+    * relative to the underlying drm buffer objects.
     */
 
-   driBOAddListItem(&batch->list, batch->buffer,
-                    DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_EXE,
-                    DRM_BO_MASK_MEM | DRM_BO_FLAG_EXE);
+   driReadLockKernelBO();
+   bo = driBOKernel(batch->buffer);
+   req->presumed_offset = (uint64_t) bo->offset;
+   req->hint = DRM_BO_HINT_PRESUMED_OFFSET;
+   batch->drmBOVirtual = (uint8_t *) bo->virtual;
+   driReadUnlockKernelBO();
 
+   /*
+    * Adjust the relocation buffer size.
+    */
+
+   if (batch->reloc_size > INTEL_MAX_RELOCS ||
+       batch->reloc == NULL) 
+     intel_realloc_relocs(batch, INTEL_DEFAULT_RELOCS);
+   
+   assert(batch->reloc != NULL);
+   batch->reloc[0] = 0; /* No relocs yet. */
+   batch->reloc[1] = 1; /* Reloc type 1 */
+   batch->reloc[2] = 0; /* Only a single relocation list. */
+   batch->reloc[3] = 0; /* Only a single relocation list. */
 
    batch->map = driBOMap(batch->buffer, DRM_BO_FLAG_WRITE, 0);
+   batch->poolOffset = driBOPoolOffset(batch->buffer);
    batch->ptr = batch->map;
+   batch->dirty_state = ~0;
+   batch->nr_relocs = 0;
+   batch->flags = 0;
+   batch->id = 0;//batch->intel->intelScreen->batch_id++;
 }
 
-
 /*======================================================================
  * Public functions
  */
@@ -141,121 +128,253 @@ intel_batchbuffer_alloc(struct intel_context *intel)
                  &batch->buffer, 4096,
                  DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_EXE, 0);
    batch->last_fence = NULL;
-   driBOCreateList(20, &batch->list);
+   batch->list = driBOCreateList(20);
+   batch->reloc = NULL;
    intel_batchbuffer_reset(batch);
    return batch;
 }
 
-
 void
 intel_batchbuffer_free(struct intel_batchbuffer *batch)
 {
    if (batch->last_fence) {
       driFenceFinish(batch->last_fence,
-                     DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW,
-                     GL_FALSE);
-      driFenceUnReference(batch->last_fence);
-      batch->last_fence = NULL;
+                    DRM_FENCE_TYPE_EXE, GL_FALSE);
+      driFenceUnReference(&batch->last_fence);
    }
    if (batch->map) {
       driBOUnmap(batch->buffer);
       batch->map = NULL;
    }
    driBOUnReference(batch->buffer);
+   driBOFreeList(batch->list);
+   if (batch->reloc)
+       free(batch->reloc);
    batch->buffer = NULL;
    free(batch);
 }
 
+void
+intel_offset_relocation(struct intel_batchbuffer *batch,
+                       unsigned pre_add,
+                       struct _DriBufferObject *driBO,
+                       uint64_t val_flags,
+                       uint64_t val_mask)
+{
+    int itemLoc;
+    struct _drmBONode *node;
+    uint32_t *reloc;
+    struct drm_bo_info_req *req;
+    
+    driBOAddListItem(batch->list, driBO, val_flags, val_mask,
+                    &itemLoc, &node);
+    req = &node->bo_arg.d.req.bo_req;
+
+    if (!(req->hint &  DRM_BO_HINT_PRESUMED_OFFSET)) {
+
+       /*
+        * Stop other threads from tampering with the underlying
+        * drmBO while we're reading its offset.
+        */
+
+       driReadLockKernelBO();
+       req->presumed_offset = (uint64_t) driBOKernel(driBO)->offset;
+       driReadUnlockKernelBO();
+       req->hint = DRM_BO_HINT_PRESUMED_OFFSET;
+    }
+    
+    pre_add += driBOPoolOffset(driBO);
+
+    if (batch->nr_relocs == batch->reloc_size)
+       intel_realloc_relocs(batch, batch->reloc_size * 2);
+
+    reloc = batch->reloc + 
+       (I915_RELOC_HEADER + batch->nr_relocs * I915_RELOC0_STRIDE);
+
+    reloc[0] = ((uint8_t *)batch->ptr - batch->drmBOVirtual);
+    intel_batchbuffer_emit_dword(batch, req->presumed_offset + pre_add);
+    reloc[1] = pre_add;
+    reloc[2] = itemLoc;
+    reloc[3] = batch->dest_location;
+    batch->nr_relocs++;
+}
 
 static void
-intel_batch_ioctl(struct intel_context *intel,
-                  uint start_offset, uint used, boolean allow_unlock)
+i915_drm_copy_reply(const struct drm_bo_info_rep * rep, drmBO * buf)
 {
-   drmI830BatchBuffer batch;
-
-   batch.start = start_offset;
-   batch.used = used;
-   batch.cliprects = NULL; /* unused */
-   batch.num_cliprects = 0;
-   batch.DR1 = 0;
-   batch.DR4 = 0; /* still need this ? */
-
-   DBG(IOCTL, "%s: 0x%x..0x%x DR4: %x cliprects: %d\n",
-       __FUNCTION__,
-       batch.start,
-       batch.start + batch.used * 4, batch.DR4, batch.num_cliprects);
-
-   if (drmCommandWrite(intel->driFd, DRM_I830_BATCHBUFFER, &batch,
-                       sizeof(batch))) {
-      printf("DRM_I830_BATCHBUFFER: %d\n", -errno);
-      UNLOCK_HARDWARE(intel);
-      exit(1);
-   }
+    buf->handle = rep->handle;
+    buf->flags = rep->flags;
+    buf->size = rep->size;
+    buf->offset = rep->offset;
+    buf->mapHandle = rep->arg_handle;
+    buf->proposedFlags = rep->proposed_flags;
+    buf->start = rep->buffer_start;
+    buf->fenceFlags = rep->fence_flags;
+    buf->replyFlags = rep->rep_flags;
+    buf->pageAlignment = rep->page_alignment;
 }
 
+static int 
+i915_execbuf(struct intel_batchbuffer *batch,
+            GLuint used,
+            GLboolean ignore_cliprects,
+            drmBOList *list,
+            struct drm_i915_execbuffer *ea)
+{
+   struct intel_context *intel = batch->intel;
+   drmBONode *node;
+   drmMMListHead *l;
+   struct drm_i915_op_arg *arg, *first;
+   struct drm_bo_op_req *req;
+   struct drm_bo_info_rep *rep;
+   uint64_t *prevNext = NULL;
+   drmBO *buf;
+   int ret = 0;
+   uint32_t count = 0;
+
+   first = NULL;
+   for (l = list->list.next; l != &list->list; l = l->next) {
+      node = DRMLISTENTRY(drmBONode, l, head);
+      
+      arg = &node->bo_arg;
+      req = &arg->d.req;
+      
+      if (!first)
+        first = arg;
+      
+      if (prevNext)
+        *prevNext = (unsigned long)arg;
+      
+      prevNext = &arg->next;
+      req->bo_req.handle = node->buf->handle;
+      req->op = drm_bo_validate;
+      req->bo_req.flags = node->arg0;
+      req->bo_req.mask = node->arg1;
+      req->bo_req.hint |= 0;
+      count++;
+   }
+
+   memset(ea, 0, sizeof(*ea));
+   ea->num_buffers = count;
+   ea->batch.start = batch->poolOffset;
+   ea->batch.used = used;
+#if 0 /* ZZZ JB: no cliprects used */
+   ea->batch.cliprects = intel->pClipRects;
+   ea->batch.num_cliprects = ignore_cliprects ? 0 : intel->numClipRects;
+   ea->batch.DR1 = 0;
+   ea->batch.DR4 = 0;((((GLuint) intel->drawX) & 0xffff) |
+                  (((GLuint) intel->drawY) << 16));
+#else
+   ea->batch.cliprects = NULL;
+   ea->batch.num_cliprects = 0;
+   ea->batch.DR1 = 0;
+   ea->batch.DR4 = 0;
+#endif
+   ea->fence_arg.flags = DRM_I915_FENCE_FLAG_FLUSHED;
+   ea->ops_list = (unsigned long) first;
+   first->reloc_ptr = (unsigned long) batch->reloc;
+   batch->reloc[0] = batch->nr_relocs;
+
+   //return -EFAULT;
+   do {
+      ret = drmCommandWriteRead(intel->driFd, DRM_I915_EXECBUFFER, ea,
+                               sizeof(*ea));
+   } while (ret == -EAGAIN);
+
+   if (ret != 0)
+      return ret;
+
+   for (l = list->list.next; l != &list->list; l = l->next) {
+      node = DRMLISTENTRY(drmBONode, l, head);
+      arg = &node->bo_arg;
+      rep = &arg->d.rep.bo_info;
+
+      if (!arg->handled) {
+        return -EFAULT;
+      }
+      if (arg->d.rep.ret)
+        return arg->d.rep.ret;
+
+      buf = node->buf;
+      i915_drm_copy_reply(rep, buf);
+   }
+   return 0;
+}
 
 /* TODO: Push this whole function into bufmgr.
  */
-static void
+static struct _DriFenceObject *
 do_flush_locked(struct intel_batchbuffer *batch,
-                uint used, boolean allow_unlock)
+                GLuint used,
+                GLboolean ignore_cliprects, GLboolean allow_unlock)
 {
-   uint *ptr;
-   uint i, fenceFlags;
+   struct intel_context *intel = batch->intel;
    struct _DriFenceObject *fo;
+   drmFence fence;
+   drmBOList *boList;
+   struct drm_i915_execbuffer ea;
+   int ret = 0;
+
+   driBOValidateUserList(batch->list);
+   boList = driGetdrmBOList(batch->list);
+
+#if 0 /* ZZZ JB Allways run */
+   if (!(intel->numClipRects == 0 && !ignore_cliprects)) {
+#else
+   if (1) {
+#endif
+      ret = i915_execbuf(batch, used, ignore_cliprects, boList, &ea);
+   } else {
+     driPutdrmBOList(batch->list);
+     fo = NULL;
+     goto out;
+   }
+   driPutdrmBOList(batch->list);
+   if (ret)
+      abort();
 
-   driBOValidateList(batch->intel->driFd, &batch->list);
-
-   /* Apply the relocations.  This nasty map indicates to me that the
-    * whole task should be done internally by the memory manager, and
-    * that dma buffers probably need to be pinned within agp space.
-    */
-   ptr = (uint *) driBOMap(batch->buffer, DRM_BO_FLAG_WRITE,
-                             DRM_BO_HINT_ALLOW_UNFENCED_MAP);
+   if (ea.fence_arg.error != 0) {
 
-   for (i = 0; i < batch->nr_relocs; i++) {
-      struct buffer_reloc *r = &batch->reloc[i];
+     /*
+      * The hardware has been idled by the kernel.
+      * Don't fence the driBOs.
+      */
 
-      ptr[r->offset / 4] = driBOOffset(r->buf) + r->delta;
+       if (batch->last_fence)
+          driFenceUnReference(&batch->last_fence);
+#if 0 /* ZZZ JB: no _mesa_* funcs in gallium */
+       _mesa_printf("fence error\n");
+#endif
+       batch->last_fence = NULL;
+       fo = NULL;
+       goto out;
    }
 
-   if (0)
-      intel_dump_batchbuffer(0, ptr, used);
+   fence.handle = ea.fence_arg.handle;
+   fence.fence_class = ea.fence_arg.fence_class;
+   fence.type = ea.fence_arg.type;
+   fence.flags = ea.fence_arg.flags;
+   fence.signaled = ea.fence_arg.signaled;
 
-   driBOUnmap(batch->buffer);
-   batch->map = NULL;
-
-   intel_batch_ioctl(batch->intel,
-                     driBOOffset(batch->buffer),
-                     used, allow_unlock);
-
-   /*
-    * Kernel fencing. The flags tells the kernel that we've 
-    * programmed an MI_FLUSH.
-    */
-   fenceFlags = DRM_I915_FENCE_FLAG_FLUSHED;
-   fo = driFenceBuffers(batch->intel->driFd, "Batch fence", fenceFlags);
+   fo = driBOFenceUserList(batch->intel->intelScreen->mgr, batch->list,
+                          "SuperFence", &fence);
 
+   if (driFenceType(fo) & DRM_I915_FENCE_TYPE_RW) {
+       if (batch->last_fence)
+          driFenceUnReference(&batch->last_fence);
    /*
-    * User space fencing.
-    */
-   driBOFence(batch->buffer, fo);
-
-   if (driFenceType(fo) == DRM_FENCE_TYPE_EXE) {
-     /*
-      * Oops. We only validated a batch buffer. This means we
-      * didn't do any proper rendering. Discard this fence object.
-      */
-      driFenceUnReference(fo);
-   }
-   else {
-      driFenceUnReference(batch->last_fence);
-      batch->last_fence = fo;
-      for (i = 0; i < batch->nr_relocs; i++) {
-       struct buffer_reloc *r = &batch->reloc[i];
-       driBOFence(r->buf, fo);
-      }
-   }
+       * FIXME: Context last fence??
+       */
+       batch->last_fence = fo;
+       driFenceReference(fo);
+   } 
+ out:
+#if 0 /* ZZZ JB: fix this */
+   intel->vtbl.lost_hardware(intel);
+#else
+   (void)intel;
+#endif
+   return fo;
 }
 
 
@@ -263,29 +382,43 @@ struct _DriFenceObject *
 intel_batchbuffer_flush(struct intel_batchbuffer *batch)
 {
    struct intel_context *intel = batch->intel;
-   uint used = batch->ptr - batch->map;
-   const boolean was_locked = intel->locked;
+   GLuint used = batch->ptr - batch->map;
+   GLboolean was_locked = intel->locked;
+   struct _DriFenceObject *fence;
 
-   if (used == 0)
+   if (used == 0) {
+      driFenceReference(batch->last_fence);
       return batch->last_fence;
-
-#define MI_FLUSH ((0 << 29) | (4 << 23))
+   }
 
    /* Add the MI_BATCH_BUFFER_END.  Always add an MI_FLUSH - this is a
     * performance drain that we would like to avoid.
     */
+#if 0 /* ZZZ JB: what should we do here? */
    if (used & 4) {
-      ((int *) batch->ptr)[0] = MI_FLUSH;
+      ((int *) batch->ptr)[0] = intel->vtbl.flush_cmd();
       ((int *) batch->ptr)[1] = 0;
       ((int *) batch->ptr)[2] = MI_BATCH_BUFFER_END;
       used += 12;
    }
    else {
-      ((int *) batch->ptr)[0] = MI_FLUSH;
+      ((int *) batch->ptr)[0] = intel->vtbl.flush_cmd();
       ((int *) batch->ptr)[1] = MI_BATCH_BUFFER_END;
       used += 8;
    }
-
+#else
+   if (used & 4) {
+      ((int *) batch->ptr)[0] = ((0<<29)|(4<<23)); // MI_FLUSH;
+      ((int *) batch->ptr)[1] = 0;
+      ((int *) batch->ptr)[2] = (0xA<<23); // MI_BATCH_BUFFER_END;
+      used += 12;
+   }
+   else {
+      ((int *) batch->ptr)[0] = ((0<<29)|(4<<23)); // MI_FLUSH;
+      ((int *) batch->ptr)[1] = (0xA<<23); // MI_BATCH_BUFFER_END;
+      used += 8;
+   }
+#endif
    driBOUnmap(batch->buffer);
    batch->ptr = NULL;
    batch->map = NULL;
@@ -296,7 +429,8 @@ intel_batchbuffer_flush(struct intel_batchbuffer *batch)
    if (!was_locked)
       LOCK_HARDWARE(intel);
 
-   do_flush_locked(batch, used, GL_FALSE);
+   fence = do_flush_locked(batch, used, !(batch->flags & INTEL_BATCH_CLIPRECTS),
+                          GL_FALSE);
 
    if (!was_locked)
       UNLOCK_HARDWARE(intel);
@@ -304,52 +438,20 @@ intel_batchbuffer_flush(struct intel_batchbuffer *batch)
    /* Reset the buffer:
     */
    intel_batchbuffer_reset(batch);
-   return batch->last_fence;
+   return fence;
 }
 
-
 void
 intel_batchbuffer_finish(struct intel_batchbuffer *batch)
 {
    struct _DriFenceObject *fence = intel_batchbuffer_flush(batch);
-   if (fence) {
-      driFenceReference(fence);
-      driFenceFinish(fence,
-                     DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW,
-                     GL_FALSE);
-      driFenceUnReference(fence);
-   }
+   driFenceFinish(fence, driFenceType(fence), GL_FALSE);
+   driFenceUnReference(&fence);
 }
 
-
-/*  This is the only way buffers get added to the validate list.
- */
-boolean
-intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch,
-                             struct _DriBufferObject *buffer,
-                             uint flags, uint mask, uint delta)
-{
-   assert(batch->nr_relocs < MAX_RELOCS);
-
-   driBOAddListItem(&batch->list, buffer, flags, mask);
-
-   {
-      struct buffer_reloc *r = &batch->reloc[batch->nr_relocs++];
-      driBOReference(buffer);
-      r->buf = buffer;
-      r->offset = batch->ptr - batch->map;
-      r->delta = delta;
-      *(uint *) batch->ptr = 0x12345678;
-   }
-
-   batch->ptr += 4;
-   return GL_TRUE;
-}
-
-
 void
 intel_batchbuffer_data(struct intel_batchbuffer *batch,
-                       const void *data, uint bytes, uint flags)
+                       const void *data, GLuint bytes, GLuint flags)
 {
    assert((bytes & 3) == 0);
    intel_batchbuffer_require_space(batch, bytes, flags);
index caf6870a3c0d8d373449ed858161900697d9464b..9e4b8043bfbd8540fc6fb2eb377af60409f58fab 100644 (file)
@@ -1,54 +1,20 @@
-/**************************************************************************
- * 
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- * 
- **************************************************************************/
-
 #ifndef INTEL_BATCHBUFFER_H
 #define INTEL_BATCHBUFFER_H
 
-#include "pipe/p_debug.h"
-#include "pipe/p_compiler.h"
-#include "dri_bufmgr.h"
+#include "mtypes.h"
+#include "ws_dri_bufmgr.h"
 
 struct intel_context;
 
 #define BATCH_SZ 16384
 #define BATCH_RESERVED 16
 
-#define MAX_RELOCS 4096
+#define INTEL_DEFAULT_RELOCS 100
+#define INTEL_MAX_RELOCS 400
 
 #define INTEL_BATCH_NO_CLIPRECTS 0x1
 #define INTEL_BATCH_CLIPRECTS    0x2
 
-struct buffer_reloc
-{
-   struct _DriBufferObject *buf;
-   uint offset;
-   uint delta;                /* not needed? */
-};
-
 struct intel_batchbuffer
 {
    struct bufmgr *bm;
@@ -56,19 +22,30 @@ struct intel_batchbuffer
 
    struct _DriBufferObject *buffer;
    struct _DriFenceObject *last_fence;
-   uint flags;
+   GLuint flags;
 
-   drmBOList list;
-   uint list_count;
-   ubyte *map;
-   ubyte *ptr;
+   struct _DriBufferList *list;
+   GLuint list_count;
+   GLubyte *map;
+   GLubyte *ptr;
 
-   struct buffer_reloc reloc[MAX_RELOCS];
-   uint nr_relocs;
-   uint size;
+   uint32_t *reloc;
+   GLuint reloc_size;
+   GLuint nr_relocs;
+
+   GLuint size;
+
+   GLuint dirty_state;
+   GLuint id;
+
+  uint32_t poolOffset;
+  uint8_t *drmBOVirtual;
+  struct _drmBONode *node; /* Validation list node for this buffer */
+  int dest_location;     /* Validation list sequence for this buffer */
 };
 
-struct intel_batchbuffer *intel_batchbuffer_alloc(struct intel_context *intel);
+struct intel_batchbuffer *intel_batchbuffer_alloc(struct intel_context
+                                                  *intel);
 
 void intel_batchbuffer_free(struct intel_batchbuffer *batch);
 
@@ -82,26 +59,28 @@ void intel_batchbuffer_reset(struct intel_batchbuffer *batch);
 
 
 /* Unlike bmBufferData, this currently requires the buffer be mapped.
- * Consider it a convenience function wrapping multiple
+ * Consider it a convenience function wrapping multple
  * intel_buffer_dword() calls.
  */
 void intel_batchbuffer_data(struct intel_batchbuffer *batch,
-                            const void *data, uint bytes, uint flags);
+                            const void *data, GLuint bytes, GLuint flags);
 
 void intel_batchbuffer_release_space(struct intel_batchbuffer *batch,
-                                     uint bytes);
+                                     GLuint bytes);
 
-boolean intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch,
-                                     struct _DriBufferObject *buffer,
-                                     uint flags,
-                                     uint mask, uint offset);
+void
+intel_offset_relocation(struct intel_batchbuffer *batch,
+                       unsigned pre_add,
+                       struct _DriBufferObject *driBO,
+                       uint64_t val_flags,
+                       uint64_t val_mask);
 
 /* Inline functions - might actually be better off with these
  * non-inlined.  Certainly better off switching all command packets to
  * be passed as structs rather than dwords, but that's a little bit of
  * work...
  */
-static INLINE uint
+static INLINE GLuint
 intel_batchbuffer_space(struct intel_batchbuffer *batch)
 {
    return (batch->size - BATCH_RESERVED) - (batch->ptr - batch->map);
@@ -109,22 +88,26 @@ intel_batchbuffer_space(struct intel_batchbuffer *batch)
 
 
 static INLINE void
-intel_batchbuffer_emit_dword(struct intel_batchbuffer *batch, uint dword)
+intel_batchbuffer_emit_dword(struct intel_batchbuffer *batch, GLuint dword)
 {
    assert(batch->map);
    assert(intel_batchbuffer_space(batch) >= 4);
-   *(uint *) (batch->ptr) = dword;
+   *(GLuint *) (batch->ptr) = dword;
    batch->ptr += 4;
 }
 
 static INLINE void
 intel_batchbuffer_require_space(struct intel_batchbuffer *batch,
-                                uint sz, uint flags)
+                                GLuint sz, GLuint flags)
 {
+   struct _DriFenceObject *fence;
+
    assert(sz < batch->size - 8);
    if (intel_batchbuffer_space(batch) < sz ||
-       (batch->flags != 0 && flags != 0 && batch->flags != flags))
-      intel_batchbuffer_flush(batch);
+       (batch->flags != 0 && flags != 0 && batch->flags != flags)) {
+      fence = intel_batchbuffer_flush(batch);
+      driFenceUnReference(&fence);
+   }
 
    batch->flags |= flags;
 }
@@ -134,14 +117,15 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch,
 #define BATCH_LOCALS
 
 #define BEGIN_BATCH(n, flags) do {                             \
+   assert(!intel->prim.flush);                                 \
    intel_batchbuffer_require_space(intel->batch, (n)*4, flags);        \
 } while (0)
 
 #define OUT_BATCH(d)  intel_batchbuffer_emit_dword(intel->batch, d)
 
 #define OUT_RELOC(buf,flags,mask,delta) do {                           \
-   assert((delta) >= 0);                                               \
-   intel_batchbuffer_emit_reloc(intel->batch, buf, flags, mask, delta);        \
+   assert((delta) >= 0);                                                       \
+   intel_offset_relocation(intel->batch, delta, buf, flags, mask); \
 } while (0)
 
 #define ADVANCE_BATCH() do { } while(0)
diff --git a/src/gallium/winsys/dri/intel/intel_batchpool.c b/src/gallium/winsys/dri/intel/intel_batchpool.c
deleted file mode 100644 (file)
index ce154c7..0000000
+++ /dev/null
@@ -1,427 +0,0 @@
-/**************************************************************************
- * 
- * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
- * All Rights Reserved.
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- * 
- * 
- **************************************************************************/
-/*
- * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
- */
-
-/**
- * XXX NOTE: there are no intel dependencies in this file.
- * Rename to dri_batchpool.c?
- */
-
-#include <xf86drm.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-
-#include "pipe/p_compiler.h"
-#include "pipe/p_thread.h"
-
-#include "dri_bufpool.h"
-#include "dri_bufmgr.h"
-#include "intel_batchpool.h"
-
-
-typedef struct
-{
-   drmMMListHead head;
-   struct _BPool *parent;
-   struct _DriFenceObject *fence;
-   unsigned long start;
-   int unfenced;
-   int mapped;
-} BBuf;
-
-typedef struct _BPool
-{
-   _glthread_Mutex mutex;
-   unsigned long bufSize;
-   unsigned poolSize;
-   unsigned numFree;
-   unsigned numTot;
-   unsigned numDelayed;
-   unsigned checkDelayed;
-   drmMMListHead free;
-   drmMMListHead delayed;
-   drmMMListHead head;
-   drmBO kernelBO;
-   void *virtual;
-   BBuf *bufs;
-} BPool;
-
-
-static BPool *
-createBPool(int fd, unsigned long bufSize, unsigned numBufs, unsigned flags,
-            unsigned checkDelayed)
-{
-   BPool *p = (BPool *) malloc(sizeof(*p));
-   BBuf *buf;
-   int i;
-
-   if (!p)
-      return NULL;
-
-   p->bufs = (BBuf *) malloc(numBufs * sizeof(*p->bufs));
-   if (!p->bufs) {
-      free(p);
-      return NULL;
-   }
-
-   DRMINITLISTHEAD(&p->free);
-   DRMINITLISTHEAD(&p->head);
-   DRMINITLISTHEAD(&p->delayed);
-
-   p->numTot = numBufs;
-   p->numFree = numBufs;
-   p->bufSize = bufSize;
-   p->numDelayed = 0;
-   p->checkDelayed = checkDelayed;
-
-   _glthread_INIT_MUTEX(p->mutex);
-
-   if (drmBOCreate(fd, 0, numBufs * bufSize, 0, NULL, drm_bo_type_dc,
-                   flags, DRM_BO_HINT_DONT_FENCE, &p->kernelBO)) {
-      free(p->bufs);
-      free(p);
-      return NULL;
-   }
-   if (drmBOMap(fd, &p->kernelBO, DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0,
-                &p->virtual)) {
-      drmBODestroy(fd, &p->kernelBO);
-      free(p->bufs);
-      free(p);
-      return NULL;
-   }
-
-   /*
-    * We unmap the buffer so that we can validate it later. Note that this is
-    * just a synchronizing operation. The buffer will have a virtual mapping
-    * until it is destroyed.
-    */
-
-   drmBOUnmap(fd, &p->kernelBO);
-
-   buf = p->bufs;
-   for (i = 0; i < numBufs; ++i) {
-      buf->parent = p;
-      buf->fence = NULL;
-      buf->start = i * bufSize;
-      buf->mapped = 0;
-      buf->unfenced = 0;
-      DRMLISTADDTAIL(&buf->head, &p->free);
-      buf++;
-   }
-
-   return p;
-}
-
-
-static void
-pool_checkFree(BPool * p, int wait)
-{
-   drmMMListHead *list, *prev;
-   BBuf *buf;
-   int signaled = 0;
-   int i;
-
-   list = p->delayed.next;
-
-   if (p->numDelayed > 3) {
-      for (i = 0; i < p->numDelayed; i += 3) {
-         list = list->next;
-      }
-   }
-
-   prev = list->prev;
-   for (; list != &p->delayed; list = prev, prev = list->prev) {
-
-      buf = DRMLISTENTRY(BBuf, list, head);
-
-      if (!signaled) {
-         if (wait) {
-            driFenceFinish(buf->fence, DRM_FENCE_TYPE_EXE, 1);
-            signaled = 1;
-         }
-         else {
-            signaled = driFenceSignaled(buf->fence, DRM_FENCE_TYPE_EXE);
-         }
-      }
-
-      if (!signaled)
-         break;
-
-      driFenceUnReference(buf->fence);
-      buf->fence = NULL;
-      DRMLISTDEL(list);
-      p->numDelayed--;
-      DRMLISTADD(list, &p->free);
-      p->numFree++;
-   }
-}
-
-static void *
-pool_create(struct _DriBufferPool *pool,
-            unsigned long size, unsigned flags, unsigned hint,
-            unsigned alignment)
-{
-   BPool *p = (BPool *) pool->data;
-
-   drmMMListHead *item;
-
-   if (alignment && (alignment != 4096))
-      return NULL;
-
-   _glthread_LOCK_MUTEX(p->mutex);
-
-   if (p->numFree == 0)
-      pool_checkFree(p, TRUE);
-
-   if (p->numFree == 0) {
-      fprintf(stderr, "Out of fixed size buffer objects\n");
-      BM_CKFATAL(-ENOMEM);
-   }
-
-   item = p->free.next;
-
-   if (item == &p->free) {
-      fprintf(stderr, "Fixed size buffer pool corruption\n");
-   }
-
-   DRMLISTDEL(item);
-   --p->numFree;
-
-   _glthread_UNLOCK_MUTEX(p->mutex);
-   return (void *) DRMLISTENTRY(BBuf, item, head);
-}
-
-
-static int
-pool_destroy(struct _DriBufferPool *pool, void *private)
-{
-   BBuf *buf = (BBuf *) private;
-   BPool *p = buf->parent;
-
-   _glthread_LOCK_MUTEX(p->mutex);
-
-   if (buf->fence) {
-      DRMLISTADDTAIL(&buf->head, &p->delayed);
-      p->numDelayed++;
-   }
-   else {
-      buf->unfenced = 0;
-      DRMLISTADD(&buf->head, &p->free);
-      p->numFree++;
-   }
-
-   if ((p->numDelayed % p->checkDelayed) == 0)
-      pool_checkFree(p, 0);
-
-   _glthread_UNLOCK_MUTEX(p->mutex);
-   return 0;
-}
-
-
-static int
-pool_map(struct _DriBufferPool *pool, void *private, unsigned flags,
-         int hint, void **virtual)
-{
-
-   BBuf *buf = (BBuf *) private;
-   BPool *p = buf->parent;
-
-   _glthread_LOCK_MUTEX(p->mutex);
-
-   /*
-    * Currently Mesa doesn't have any condition variables to resolve this
-    * cleanly in a multithreading environment.
-    * We bail out instead.
-    */
-
-   if (buf->mapped) {
-      fprintf(stderr, "Trying to map already mapped buffer object\n");
-      BM_CKFATAL(-EINVAL);
-   }
-
-#if 0
-   if (buf->unfenced && !(hint & DRM_BO_HINT_ALLOW_UNFENCED_MAP)) {
-      fprintf(stderr, "Trying to map an unfenced buffer object 0x%08x"
-              " 0x%08x %d\n", hint, flags, buf->start);
-      BM_CKFATAL(-EINVAL);
-   }
-
-#endif
-
-   if (buf->fence) {
-      _glthread_UNLOCK_MUTEX(p->mutex);
-      return -EBUSY;
-   }
-
-   buf->mapped = TRUE;
-   *virtual = (unsigned char *) p->virtual + buf->start;
-   _glthread_UNLOCK_MUTEX(p->mutex);
-   return 0;
-}
-
-static int
-pool_waitIdle(struct _DriBufferPool *pool, void *private, int lazy)
-{
-   BBuf *buf = (BBuf *) private;
-   driFenceFinish(buf->fence, 0x0, lazy);
-   return 0;
-}
-
-static int
-pool_unmap(struct _DriBufferPool *pool, void *private)
-{
-   BBuf *buf = (BBuf *) private;
-
-   buf->mapped = 0;
-   return 0;
-}
-
-static unsigned long
-pool_offset(struct _DriBufferPool *pool, void *private)
-{
-   BBuf *buf = (BBuf *) private;
-   BPool *p = buf->parent;
-
-   return p->kernelBO.offset + buf->start;
-}
-
-static unsigned
-pool_flags(struct _DriBufferPool *pool, void *private)
-{
-   BPool *p = (BPool *) pool->data;
-
-   return p->kernelBO.flags;
-}
-
-static unsigned long
-pool_size(struct _DriBufferPool *pool, void *private)
-{
-   BPool *p = (BPool *) pool->data;
-
-   return p->bufSize;
-}
-
-
-static int
-pool_fence(struct _DriBufferPool *pool, void *private,
-           struct _DriFenceObject *fence)
-{
-   BBuf *buf = (BBuf *) private;
-   BPool *p = buf->parent;
-
-   _glthread_LOCK_MUTEX(p->mutex);
-   if (buf->fence) {
-      driFenceUnReference(buf->fence);
-   }
-   buf->fence = fence;
-   buf->unfenced = 0;
-   driFenceReference(buf->fence);
-   _glthread_UNLOCK_MUTEX(p->mutex);
-
-   return 0;
-}
-
-static drmBO *
-pool_kernel(struct _DriBufferPool *pool, void *private)
-{
-   BBuf *buf = (BBuf *) private;
-   BPool *p = buf->parent;
-
-   return &p->kernelBO;
-}
-
-static int
-pool_validate(struct _DriBufferPool *pool, void *private)
-{
-   BBuf *buf = (BBuf *) private;
-   BPool *p = buf->parent;
-   _glthread_LOCK_MUTEX(p->mutex);
-   buf->unfenced = TRUE;
-   _glthread_UNLOCK_MUTEX(p->mutex);
-   return 0;
-}
-
-static void
-pool_takedown(struct _DriBufferPool *pool)
-{
-   BPool *p = (BPool *) pool->data;
-
-   /*
-    * Wait on outstanding fences. 
-    */
-
-   _glthread_LOCK_MUTEX(p->mutex);
-   while ((p->numFree < p->numTot) && p->numDelayed) {
-      _glthread_UNLOCK_MUTEX(p->mutex);
-      sched_yield();
-      pool_checkFree(p, TRUE);
-      _glthread_LOCK_MUTEX(p->mutex);
-   }
-
-   drmBODestroy(pool->fd, &p->kernelBO);
-   free(p->bufs);
-   _glthread_UNLOCK_MUTEX(p->mutex);
-   free(p);
-   free(pool);
-}
-
-
-struct _DriBufferPool *
-driBatchPoolInit(int fd, unsigned flags,
-                 unsigned long bufSize,
-                 unsigned numBufs, unsigned checkDelayed)
-{
-   struct _DriBufferPool *pool;
-
-   pool = (struct _DriBufferPool *) malloc(sizeof(*pool));
-   if (!pool)
-      return NULL;
-
-   pool->data = createBPool(fd, bufSize, numBufs, flags, checkDelayed);
-   if (!pool->data)
-      return NULL;
-
-   pool->fd = fd;
-   pool->map = &pool_map;
-   pool->unmap = &pool_unmap;
-   pool->destroy = &pool_destroy;
-   pool->offset = &pool_offset;
-   pool->flags = &pool_flags;
-   pool->size = &pool_size;
-   pool->create = &pool_create;
-   pool->fence = &pool_fence;
-   pool->kernel = &pool_kernel;
-   pool->validate = &pool_validate;
-   pool->waitIdle = &pool_waitIdle;
-   pool->setstatic = NULL;
-   pool->takeDown = &pool_takedown;
-   return pool;
-}
diff --git a/src/gallium/winsys/dri/intel/intel_batchpool.h b/src/gallium/winsys/dri/intel/intel_batchpool.h
deleted file mode 100644 (file)
index f6a9572..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/**************************************************************************
- * 
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- * 
- **************************************************************************/
-
-#ifndef INTEL_BATCHPOOL_H
-#define INTEL_BATCHPOOL_H
-
-extern struct _DriBufferPool *driBatchPoolInit(int fd, unsigned flags,
-                                               unsigned long bufSize,
-                                               unsigned numBufs,
-                                               unsigned checkDelayed);
-
-
-#endif /* INTEL_BATCHPOOL_H */
index 8eba33c3139a34c610e65f7016986e78c975b6f3..cc2fc11c5e705c7f42af9207490696d889acd203 100644 (file)
@@ -162,6 +162,7 @@ intelCreateContext(const __GLcontextModes * visual,
     * memory pools
     */
    DRM_LIGHT_LOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext);
+   // ZZZ JB should be per screen and not be done per context
    havePools = intelCreatePools(sPriv);
    DRM_UNLOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext);
    if (!havePools)
@@ -234,12 +235,12 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv)
 
       if (intel->last_swap_fence) {
         driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE);
-        driFenceUnReference(intel->last_swap_fence);
+        driFenceUnReference(&intel->last_swap_fence);
         intel->last_swap_fence = NULL;
       }
       if (intel->first_swap_fence) {
         driFenceFinish(intel->first_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE);
-        driFenceUnReference(intel->first_swap_fence);
+        driFenceUnReference(&intel->first_swap_fence);
         intel->first_swap_fence = NULL;
       }
 
index 45430984d8fb1e36b280572c885a49b12b086ac1..597dc13830b5d772fac5cda30f75fda74dc20ec2 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef INTEL_CONTEXT_H
 #define INTEL_CONTEXT_H
 
-
+#include <stdint.h>
 #include "drm.h"
 
 #include "pipe/p_debug.h"
index 9e31c013a9569af292d340194506099127f98c94..58bebbe9720eefabd515ed22944ecf0a14b2b8fc 100644 (file)
 #include "intel_context.h"
 #include "intel_screen.h"
 #include "intel_batchbuffer.h"
-#include "intel_batchpool.h"
+//#include "intel_batchpool.h"
 #include "intel_swapbuffers.h"
 #include "intel_winsys.h"
 
 #include "i830_dri.h"
-#include "dri_bufpool.h"
+#include "ws_dri_bufpool.h"
 
 #include "pipe/p_context.h"
 #include "state_tracker/st_public.h"
@@ -132,6 +132,7 @@ intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea)
    assert( sarea->front_size >=
           intelScreen->front.pitch * intelScreen->front.height );
 
+#if 0 /* JB not important */
    if (!sarea->front_handle)
       return;
 
@@ -142,30 +143,41 @@ intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea)
       fprintf(stderr, "drmMap(frontbuffer) failed!\n");
       return;
    }
+#endif
 
+#if 0 /* JB */
    if (intelScreen->staticPool) {
       driGenBuffers(intelScreen->staticPool, "static region", 1,
                    &intelScreen->front.buffer, 64,
                    DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_NO_MOVE |
                    DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0);
-      
+
       driBOSetStatic(intelScreen->front.buffer, 
                     intelScreen->front.offset,                   
                     intelScreen->front.pitch * intelScreen->front.height, 
                     intelScreen->front.map, 0);
    }
+#else
+   if (intelScreen->staticPool) {
+      if (intelScreen->front.buffer)
+        driBOUnReference(intelScreen->front.buffer);
+      driGenBuffers(intelScreen->staticPool, "front", 1, &intelScreen->front.buffer, 0, 0, 0);
+      driBOSetReferenced(intelScreen->front.buffer, sarea->front_bo_handle);
+   }
+#endif
 }
 
 
 boolean
 intelCreatePools(__DRIscreenPrivate * sPriv)
 {
-   unsigned batchPoolSize = 1024*1024;
+   //unsigned batchPoolSize = 1024*1024;
    struct intel_screen *intelScreen = intel_screen(sPriv);
 
    if (intelScreen->havePools)
       return GL_TRUE;
 
+#if 0 /* ZZZ JB fix this */
    intelScreen->staticPool = driDRMStaticPoolInit(sPriv->fd);
    if (!intelScreen->staticPool)
       return GL_FALSE;
@@ -181,7 +193,17 @@ intelCreatePools(__DRIscreenPrivate * sPriv)
       fprintf(stderr, "Failed to initialize batch pool - possible incorrect agpgart installed\n");
       return GL_FALSE;
    }
-   
+#else
+   intelScreen->staticPool = driDRMPoolInit(sPriv->fd);
+   intelScreen->batchPool = driSlabPoolInit(sPriv->fd,
+                                               DRM_BO_FLAG_EXE |
+                                               DRM_BO_FLAG_MEM_TT,
+                                               DRM_BO_FLAG_EXE |
+                                               DRM_BO_FLAG_MEM_TT,
+                                               4 * 4096, //intelScreen->maxBatchSize,
+                                               1, 40, 16*16384, 0,
+                                               intelScreen->fMan);
+#endif
    intelScreen->havePools = GL_TRUE;
 
    intelUpdateScreenRotation(sPriv, intelScreen->sarea);
@@ -240,7 +262,26 @@ intelInitDriver(__DRIscreenPrivate * sPriv)
       (*glx_enable_extension) (psc, "GLX_SGI_make_current_read");
    }
 
-   intelScreen->winsys = intel_create_pipe_winsys(sPriv->fd);
+
+
+#if 1 // ZZZ JB
+   intelScreen->mgr = driFenceMgrTTMInit(sPriv->fd);
+   if (!intelScreen->mgr) {
+      fprintf(stderr, "Failed to create fence manager.\n");
+      return GL_FALSE;
+   }
+
+   intelScreen->fMan = driInitFreeSlabManager(10, 10);
+   if (!intelScreen->fMan) {
+      fprintf(stderr, "Failed to create free slab manager.\n");
+      return GL_FALSE;
+   }
+
+   if (!intelCreatePools(sPriv))
+      return GL_FALSE;
+#endif
+
+   intelScreen->winsys = intel_create_pipe_winsys(sPriv->fd, intelScreen->fMan);
 
    return GL_TRUE;
 }
index 3396f9e56430130448ce6221c18790f3fb8d059c..c17f0202e4ff4c238e107f7899602a08f66a65b0 100644 (file)
@@ -31,7 +31,7 @@
 #include "dri_util.h"
 #include "i830_common.h"
 #include "xmlconfig.h"
-#include "dri_bufpool.h"
+#include "ws_dri_bufpool.h"
 
 #include "pipe/p_compiler.h"
 
@@ -74,6 +74,13 @@ struct intel_screen
     */
    struct intel_context *dummyContext;
 
+   /* 
+    * New stuff form the i915tex integration
+    */
+   struct _DriFenceMgr *mgr;
+   struct _DriFreeSlabManager *fMan;
+   unsigned batch_id;
+
    struct pipe_winsys *winsys;
 };
 
index 56b86d6a636c5c7620079a216038234d1c5d918d..923b5427714f6039a83385a175d0ccf4b3467533 100644 (file)
@@ -63,7 +63,7 @@ intelDisplaySurface(__DRIdrawablePrivate *dPriv,
 
    if (intel->last_swap_fence) {
       driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, TRUE);
-      driFenceUnReference(intel->last_swap_fence);
+      driFenceUnReference(&intel->last_swap_fence);
       intel->last_swap_fence = NULL;
    }
    intel->last_swap_fence = intel->first_swap_fence;
@@ -178,9 +178,8 @@ intelDisplaySurface(__DRIdrawablePrivate *dPriv,
       }
 
       if (intel->first_swap_fence)
-        driFenceUnReference(intel->first_swap_fence);
+        driFenceUnReference(&intel->first_swap_fence);
       intel->first_swap_fence = intel_batchbuffer_flush(intel->batch);
-      driFenceReference(intel->first_swap_fence);
    }
 
    UNLOCK_HARDWARE(intel);
index ffc40782be7082d5e7b8f98433023882d4b147e2..3d32db10a4aa00da1efd14377eb292207b730c10 100644 (file)
@@ -37,7 +37,7 @@ struct pipe_buffer;
 struct _DriBufferObject;
 
 struct pipe_winsys *
-intel_create_pipe_winsys( int fd );
+intel_create_pipe_winsys( int fd, struct _DriFreeSlabManager *fMan );
 
 void
 intel_destroy_pipe_winsys( struct pipe_winsys *winsys );
@@ -53,6 +53,7 @@ intel_create_i915simple( struct intel_context *intel,
 
 struct intel_buffer {
    struct pipe_buffer base;
+   struct _DriBufferPool *pool;
    struct _DriBufferObject *driBO;
 };
 
@@ -69,5 +70,4 @@ dri_bo( struct pipe_buffer *buf )
 }
 
 
-
 #endif
index 4d183db7c37a8da129fce3d33722665fb66d7fff..a35825d36ab2d3640b221fa621b9ab3ffa7317e0 100644 (file)
@@ -31,8 +31,8 @@
 
 #include <stdlib.h>
 #include <xf86drm.h>
-#include "dri_bufpool.h"
-#include "dri_bufmgr.h"
+#include "ws_dri_bufpool.h"
+#include "ws_dri_bufmgr.h"
 
 #include "intel_context.h"
 #include "intel_batchbuffer.h"
@@ -106,10 +106,18 @@ static void intel_i915_batch_reloc( struct i915_winsys *sws,
       mask |= DRM_BO_FLAG_READ;
    }
 
-   intel_batchbuffer_emit_reloc( intel->batch, 
+#if 0 /* JB old */
+   intel_batchbuffer_emit_reloc( intel->batch,
                                 dri_bo( buf ),
-                                flags, mask, 
+                                flags, mask,
                                 delta );
+#else /* new */
+   intel_offset_relocation( intel->batch,
+                           delta,
+                           dri_bo( buf ),
+                           flags,
+                           mask );
+#endif
 }
 
 
@@ -124,12 +132,24 @@ static void intel_i915_batch_flush( struct i915_winsys *sws,
       struct pipe_fence_handle *pipe;
    } fu;
 
+   if (fence)
+      assert(!*fence);
+
    fu.dri = intel_batchbuffer_flush( intel->batch );
 
-   if (fu.dri)
-      iws->pws->fence_reference(iws->pws, fence, fu.pipe);
+   if (!fu.dri) {
+      assert(0);
+      *fence = NULL;
+      return;
+   }
+
+   if (fu.dri) {
+      if (fence)
+        *fence = fu.pipe;
+      else
+         driFenceUnReference(&fu.dri);
+   }
 
-//   if (0) intel_i915_batch_wait_idle( sws );
 }
 
 
index 77dec9488dfaca4837de846461d39c97a5ee68d4..6a42c790337205e4aace515353b041e9e4bcd982 100644 (file)
@@ -31,8 +31,8 @@
 
 #include <stdlib.h>
 #include <xf86drm.h>
-#include "dri_bufpool.h"
-#include "dri_bufmgr.h"
+//#include "dri_bufpool.h"
+//#include "dri_bufmgr.h"
 
 #include "intel_context.h"
 #include "intel_winsys.h"
@@ -50,6 +50,9 @@
 struct intel_pipe_winsys {
    struct pipe_winsys winsys;
    struct _DriBufferPool *regionPool;
+   struct _DriBufferPool *mallocPool;
+   struct _DriBufferPool *vertexPool;
+   struct _DriFreeSlabManager *fMan; /** shared between all pipes */
 };
 
 
@@ -92,6 +95,7 @@ intel_buffer_destroy(struct pipe_winsys *winsys,
                     struct pipe_buffer *buf)
 {
    driBOUnReference( dri_bo(buf) );
+   FREE(buf);
 }
 
 
@@ -108,16 +112,23 @@ intel_buffer_create(struct pipe_winsys *winsys,
    struct intel_buffer *buffer = CALLOC_STRUCT( intel_buffer );
    struct intel_pipe_winsys *iws = intel_pipe_winsys(winsys);
    unsigned flags = 0;
+   struct _DriBufferPool *pool;
 
    buffer->base.refcount = 1;
    buffer->base.alignment = alignment;
    buffer->base.usage = usage;
    buffer->base.size = size;
 
-   if (usage & (PIPE_BUFFER_USAGE_VERTEX /*| IWS_BUFFER_USAGE_LOCAL*/)) {
+   if (usage & (PIPE_BUFFER_USAGE_VERTEX | PIPE_BUFFER_USAGE_CONSTANT)) {
       flags |= DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED;
+      pool = iws->mallocPool;
+   } else if (usage & PIPE_BUFFER_USAGE_CUSTOM) {
+      /* For vertex buffers */
+      flags |= DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_TT;
+      pool = iws->vertexPool;
    } else {
       flags |= DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_TT;
+      pool = iws->regionPool;
    }
 
    if (usage & PIPE_BUFFER_USAGE_GPU_READ)
@@ -139,10 +150,11 @@ intel_buffer_create(struct pipe_winsys *winsys,
       flags |= DRM_BO_FLAG_CACHED;
 #endif
 
-   driGenBuffers( iws->regionPool, 
+   buffer->pool = pool;
+   driGenBuffers( buffer->pool, 
                  "pipe buffer", 1, &buffer->driBO, alignment, flags, 0 );
 
-   driBOData( buffer->driBO, size, NULL, 0 );
+   driBOData( buffer->driBO, size, NULL, buffer->pool, 0 );
 
    return &buffer->base;
 }
@@ -155,7 +167,9 @@ intel_user_buffer_create(struct pipe_winsys *winsys, void *ptr, unsigned bytes)
    struct intel_pipe_winsys *iws = intel_pipe_winsys(winsys);
 
    driGenUserBuffer( iws->regionPool, 
-                     "pipe user buffer", &buffer->driBO, ptr, bytes);
+                    "pipe user buffer", &buffer->driBO, ptr, bytes );
+
+   buffer->base.refcount = 1;
 
    return &buffer->base;
 }
@@ -209,7 +223,7 @@ intel_i915_surface_alloc_storage(struct pipe_winsys *winsys,
                                  unsigned flags)
 {
    const unsigned alignment = 64;
-   int ret;
+   //int ret;
 
    surf->width = width;
    surf->height = height;
@@ -249,9 +263,36 @@ intel_get_name( struct pipe_winsys *winsys )
    return "Intel/DRI/ttm";
 }
 
+static void
+intel_fence_reference( struct pipe_winsys *sws,
+                       struct pipe_fence_handle **ptr,
+                       struct pipe_fence_handle *fence )
+{
+   if (*ptr)
+      driFenceUnReference((struct _DriFenceObject **)ptr);
+
+   if (fence)
+      *ptr = (struct pipe_fence_handle *)driFenceReference((struct _DriFenceObject *)fence);
+}
+
+static int
+intel_fence_signalled( struct pipe_winsys *sws,
+                       struct pipe_fence_handle *fence,
+                       unsigned flag )
+{
+   return driFenceSignaled((struct _DriFenceObject *)fence, flag);
+}
+
+static int
+intel_fence_finish( struct pipe_winsys *sws,
+                    struct pipe_fence_handle *fence,
+                    unsigned flag )
+{
+   return driFenceFinish((struct _DriFenceObject *)fence, flag, 0);
+}
 
 struct pipe_winsys *
-intel_create_pipe_winsys( int fd )
+intel_create_pipe_winsys( int fd, struct _DriFreeSlabManager *fMan )
 {
    struct intel_pipe_winsys *iws = CALLOC_STRUCT( intel_pipe_winsys );
    
@@ -273,8 +314,25 @@ intel_create_pipe_winsys( int fd )
    iws->winsys.surface_alloc_storage = intel_i915_surface_alloc_storage;
    iws->winsys.surface_release = intel_i915_surface_release;
 
-   if (fd)
-      iws->regionPool = driDRMPoolInit(fd);
+   iws->winsys.fence_reference = intel_fence_reference;
+   iws->winsys.fence_signalled = intel_fence_signalled;
+   iws->winsys.fence_finish = intel_fence_finish;
+
+   if (fd) {
+     iws->regionPool = driDRMPoolInit(fd);
+     iws->vertexPool = driSlabPoolInit(fd,
+                                       DRM_BO_FLAG_READ |
+                                       DRM_BO_FLAG_WRITE |
+                                       DRM_BO_FLAG_MEM_TT,
+                                       DRM_BO_FLAG_READ |
+                                       DRM_BO_FLAG_WRITE |
+                                       DRM_BO_FLAG_MEM_TT,
+                                       32 * 4096,
+                                       1, 40, 32 * 4096 * 2, 0,
+                                       fMan);
+   }
+
+   iws->mallocPool = driMallocPoolInit();
 
    return &iws->winsys;
 }
@@ -287,6 +345,9 @@ intel_destroy_pipe_winsys( struct pipe_winsys *winsys )
    if (iws->regionPool) {
       driPoolTakeDown(iws->regionPool);
    }
+   if (iws->mallocPool) {
+      driPoolTakeDown(iws->mallocPool);
+   }
    free(iws);
 }
 
index d4d58886ce07a7e99784f91406b61000ef9eba3b..f1fd3939ab9966a243f285c261bc80089ba69e66 100644 (file)
@@ -54,6 +54,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define DRM_I830_DESTROY_HEAP             0x0c
 #define DRM_I830_SET_VBLANK_PIPE          0x0d
 #define DRM_I830_GET_VBLANK_PIPE          0x0e
+#define DRM_I830_MMIO                    0x10
 
 typedef struct {
    enum {
@@ -85,6 +86,7 @@ typedef struct {
         int last_enqueue;      /* last time a buffer was enqueued */
        int last_dispatch;      /* age of the most recently dispatched buffer */
        int ctxOwner;           /* last context to upload state */
+       /** Last context that used the buffer manager. */
        int texAge;
         int pf_enabled;                /* is pageflipping allowed? */
         int pf_active;               
@@ -121,20 +123,29 @@ typedef struct {
        unsigned int rotated_tiled;
        unsigned int rotated2_tiled;
 
-       int pipeA_x;
-       int pipeA_y;
-       int pipeA_w;
-       int pipeA_h;
-       int pipeB_x;
-       int pipeB_y;
-       int pipeB_w;
-       int pipeB_h;
+       int planeA_x;
+       int planeA_y;
+       int planeA_w;
+       int planeA_h;
+       int planeB_x;
+       int planeB_y;
+       int planeB_w;
+       int planeB_h;
 
        /* Triple buffering */
        drm_handle_t third_handle;
        int third_offset;
        int third_size;
        unsigned int third_tiled;
+
+       /* buffer object handles for the static buffers.  May change
+        * over the lifetime of the client, though it doesn't in our current
+        * implementation.
+        */
+       unsigned int front_bo_handle;
+       unsigned int back_bo_handle;
+       unsigned int third_bo_handle;
+       unsigned int depth_bo_handle;
 } drmI830Sarea;
 
 /* Flags for perf_boxes
@@ -223,4 +234,23 @@ typedef struct {
         int pipe;
 } drmI830VBlankPipe;
 
+#define MMIO_READ  0
+#define MMIO_WRITE 1
+
+#define MMIO_REGS_IA_PRIMATIVES_COUNT           0
+#define MMIO_REGS_IA_VERTICES_COUNT             1
+#define MMIO_REGS_VS_INVOCATION_COUNT           2
+#define MMIO_REGS_GS_PRIMITIVES_COUNT           3
+#define MMIO_REGS_GS_INVOCATION_COUNT           4
+#define MMIO_REGS_CL_PRIMITIVES_COUNT           5
+#define MMIO_REGS_CL_INVOCATION_COUNT           6
+#define MMIO_REGS_PS_INVOCATION_COUNT           7
+#define MMIO_REGS_PS_DEPTH_COUNT                8
+
+typedef struct {
+        unsigned int read_write:1;
+        unsigned int reg:31;
+        void __user *data;
+} drmI830MMIO;
+
 #endif /* _I830_DRM_H_ */
diff --git a/src/gallium/winsys/dri/intel/ws_dri_bufmgr.c b/src/gallium/winsys/dri/intel/ws_dri_bufmgr.c
new file mode 100644 (file)
index 0000000..1bc1089
--- /dev/null
@@ -0,0 +1,953 @@
+/**************************************************************************
+ * 
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * 
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ *          Keith Whitwell <keithw-at-tungstengraphics-dot-com>
+ */
+
+#include <xf86drm.h>
+#include <stdlib.h>
+#include "glthread.h"
+#include "errno.h"
+#include "ws_dri_bufmgr.h"
+#include "string.h"
+#include "imports.h"
+#include "ws_dri_bufpool.h"
+#include "ws_dri_fencemgr.h"
+
+/*
+ * This lock is here to protect drmBO structs changing underneath us during a
+ * validate list call, since validatelist cannot take individiual locks for
+ * each drmBO. Validatelist takes this lock in write mode. Any access to an
+ * individual drmBO should take this lock in read mode, since in that case, the
+ * driBufferObject mutex will protect the access. Locking order is 
+ * driBufferObject mutex - > this rw lock.
+ */
+
+_glthread_DECLARE_STATIC_MUTEX(bmMutex);
+_glthread_DECLARE_STATIC_COND(bmCond);
+
+static int kernelReaders = 0;
+static int num_buffers = 0;
+static int num_user_buffers = 0;
+
+static drmBO *drmBOListBuf(void *iterator)
+{
+    drmBONode *node;
+    drmMMListHead *l = (drmMMListHead *) iterator;
+    node = DRMLISTENTRY(drmBONode, l, head);
+    return node->buf;
+}
+
+static void *drmBOListIterator(drmBOList *list)
+{
+    void *ret = list->list.next;
+
+    if (ret == &list->list)
+       return NULL;
+    return ret;
+}
+
+static void *drmBOListNext(drmBOList *list, void *iterator)
+{
+    void *ret;
+
+    drmMMListHead *l = (drmMMListHead *) iterator;
+    ret = l->next;
+    if (ret == &list->list)
+       return NULL;
+    return ret;
+}
+
+static drmBONode *drmAddListItem(drmBOList *list, drmBO *item, 
+                                uint64_t arg0,
+                                uint64_t arg1)
+{
+    drmBONode *node;
+    drmMMListHead *l;
+
+    l = list->free.next;
+    if (l == &list->free) {
+       node = (drmBONode *) malloc(sizeof(*node));
+       if (!node) {
+           return NULL;
+       }
+       list->numCurrent++;
+    }
+    else {
+       DRMLISTDEL(l);
+       node = DRMLISTENTRY(drmBONode, l, head);
+    }
+    node->buf = item;
+    node->arg0 = arg0;
+    node->arg1 = arg1;
+    DRMLISTADD(&node->head, &list->list);
+    list->numOnList++;
+    return node;
+}
+  
+static int drmAddValidateItem(drmBOList *list, drmBO *buf, uint64_t flags, 
+                             uint64_t mask, int *newItem)
+{
+    drmBONode *node, *cur;
+    drmMMListHead *l;
+
+    *newItem = 0;
+    cur = NULL;
+
+    for (l = list->list.next; l != &list->list; l = l->next) {
+       node = DRMLISTENTRY(drmBONode, l, head);
+       if (node->buf == buf) {
+           cur = node;
+           break;
+       }
+    }
+    if (!cur) {
+       cur = drmAddListItem(list, buf, flags, mask);
+       if (!cur) {
+           return -ENOMEM;
+       }
+       *newItem = 1;
+       cur->arg0 = flags;
+       cur->arg1 = mask;
+    }
+    else {
+        uint64_t memFlags = cur->arg0 & flags & DRM_BO_MASK_MEM;
+       uint64_t accFlags = (cur->arg0 | flags) & ~DRM_BO_MASK_MEM;
+
+       if (mask & cur->arg1 & ~DRM_BO_MASK_MEM  & (cur->arg0 ^ flags)) {
+           return -EINVAL;
+       }
+
+       cur->arg1 |= mask;
+       cur->arg0 = (cur->arg0 & ~mask) | ((memFlags | accFlags) & mask);
+
+       if (((cur->arg1 & DRM_BO_MASK_MEM) != 0) &&
+           (cur->arg0 & DRM_BO_MASK_MEM) == 0) {
+           return -EINVAL;
+       }
+    }
+    return 0;
+}
+
+static void drmBOFreeList(drmBOList *list)
+{
+    drmBONode *node;
+    drmMMListHead *l;
+
+    l = list->list.next;
+    while(l != &list->list) {
+       DRMLISTDEL(l);
+       node = DRMLISTENTRY(drmBONode, l, head);
+       free(node);
+       l = list->list.next;
+       list->numCurrent--;
+       list->numOnList--;
+    }
+
+    l = list->free.next;
+    while(l != &list->free) {
+       DRMLISTDEL(l);
+       node = DRMLISTENTRY(drmBONode, l, head);
+       free(node);
+       l = list->free.next;
+       list->numCurrent--;
+    }
+}
+
+static int drmAdjustListNodes(drmBOList *list)
+{
+    drmBONode *node;
+    drmMMListHead *l;
+    int ret = 0;
+
+    while(list->numCurrent < list->numTarget) {
+       node = (drmBONode *) malloc(sizeof(*node));
+       if (!node) {
+           ret = -ENOMEM;
+           break;
+       }
+       list->numCurrent++;
+       DRMLISTADD(&node->head, &list->free);
+    }
+
+    while(list->numCurrent > list->numTarget) {
+       l = list->free.next;
+       if (l == &list->free)
+           break;
+       DRMLISTDEL(l);
+       node = DRMLISTENTRY(drmBONode, l, head);
+       free(node);
+       list->numCurrent--;
+    }
+    return ret;
+}
+
+static int drmBOCreateList(int numTarget, drmBOList *list)
+{
+    DRMINITLISTHEAD(&list->list);
+    DRMINITLISTHEAD(&list->free);
+    list->numTarget = numTarget;
+    list->numCurrent = 0;
+    list->numOnList = 0;
+    return drmAdjustListNodes(list);
+}
+
+static int drmBOResetList(drmBOList *list)
+{
+    drmMMListHead *l;
+    int ret;
+
+    ret = drmAdjustListNodes(list);
+    if (ret)
+       return ret;
+
+    l = list->list.next;
+    while (l != &list->list) {
+       DRMLISTDEL(l);
+       DRMLISTADD(l, &list->free);
+       list->numOnList--;
+       l = list->list.next;
+    }
+    return drmAdjustListNodes(list);
+}
+
+void driWriteLockKernelBO(void)
+{
+    _glthread_LOCK_MUTEX(bmMutex);
+    while(kernelReaders != 0)
+       _glthread_COND_WAIT(bmCond, bmMutex);
+}
+    
+void driWriteUnlockKernelBO(void)
+{
+    _glthread_UNLOCK_MUTEX(bmMutex);
+}    
+
+void driReadLockKernelBO(void)
+{
+    _glthread_LOCK_MUTEX(bmMutex);
+    kernelReaders++;
+    _glthread_UNLOCK_MUTEX(bmMutex);
+}
+
+void driReadUnlockKernelBO(void)
+{
+    _glthread_LOCK_MUTEX(bmMutex);
+    if (--kernelReaders == 0)
+        _glthread_COND_BROADCAST(bmCond);
+    _glthread_UNLOCK_MUTEX(bmMutex);
+}
+
+
+
+
+/*
+ * TODO: Introduce fence pools in the same way as 
+ * buffer object pools.
+ */
+
+typedef struct _DriBufferObject
+{
+   DriBufferPool *pool;
+   _glthread_Mutex mutex;
+   int refCount;
+   const char *name;
+   uint64_t flags;
+   unsigned hint;
+   unsigned alignment;
+   unsigned createdByReference;
+   void *private;
+   /* user-space buffer: */
+   unsigned userBuffer;
+   void *userData;
+   unsigned userSize;
+} DriBufferObject;
+
+typedef struct _DriBufferList {
+    drmBOList drmBuffers;  /* List of kernel buffers needing validation */
+    drmBOList driBuffers;  /* List of user-space buffers needing validation */
+} DriBufferList;
+
+
+void
+bmError(int val, const char *file, const char *function, int line)
+{
+   _mesa_printf("Fatal video memory manager error \"%s\".\n"
+                "Check kernel logs or set the LIBGL_DEBUG\n"
+                "environment variable to \"verbose\" for more info.\n"
+                "Detected in file %s, line %d, function %s.\n",
+                strerror(-val), file, line, function);
+#ifndef NDEBUG
+   abort();
+#else
+   abort();
+#endif
+}
+
+extern drmBO *
+driBOKernel(struct _DriBufferObject *buf)
+{
+   drmBO *ret;
+
+   driReadLockKernelBO();
+   _glthread_LOCK_MUTEX(buf->mutex);
+   assert(buf->private != NULL);
+   ret = buf->pool->kernel(buf->pool, buf->private);
+   if (!ret)
+      BM_CKFATAL(-EINVAL);
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+   driReadUnlockKernelBO();
+
+   return ret;
+}
+
+void
+driBOWaitIdle(struct _DriBufferObject *buf, int lazy)
+{
+
+  /*
+   * This function may block. Is it sane to keep the mutex held during
+   * that time??
+   */
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   BM_CKFATAL(buf->pool->waitIdle(buf->pool, buf->private, &buf->mutex, lazy));
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+void *
+driBOMap(struct _DriBufferObject *buf, unsigned flags, unsigned hint)
+{
+   void *virtual;
+   int retval;
+
+   if (buf->userBuffer) {
+      return buf->userData;
+   }
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   assert(buf->private != NULL);
+   retval = buf->pool->map(buf->pool, buf->private, flags, hint, 
+                          &buf->mutex, &virtual);
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+
+   return retval == 0 ? virtual : NULL;
+}
+
+void
+driBOUnmap(struct _DriBufferObject *buf)
+{
+   if (buf->userBuffer)
+      return;
+
+   assert(buf->private != NULL);
+   _glthread_LOCK_MUTEX(buf->mutex);
+   BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private));
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+unsigned long
+driBOOffset(struct _DriBufferObject *buf)
+{
+   unsigned long ret;
+
+   assert(buf->private != NULL);
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   ret = buf->pool->offset(buf->pool, buf->private);
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+   return ret;
+}
+
+unsigned long
+driBOPoolOffset(struct _DriBufferObject *buf)
+{
+   unsigned long ret;
+
+   assert(buf->private != NULL);
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   ret = buf->pool->poolOffset(buf->pool, buf->private);
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+   return ret;
+}
+
+uint64_t 
+driBOFlags(struct _DriBufferObject *buf)
+{
+   uint64_t ret;
+
+   assert(buf->private != NULL);
+
+   driReadLockKernelBO();
+   _glthread_LOCK_MUTEX(buf->mutex);
+   ret = buf->pool->flags(buf->pool, buf->private);
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+   driReadUnlockKernelBO();
+   return ret;
+}
+
+struct _DriBufferObject *
+driBOReference(struct _DriBufferObject *buf)
+{
+   _glthread_LOCK_MUTEX(buf->mutex);
+   if (++buf->refCount == 1) {
+      _glthread_UNLOCK_MUTEX(buf->mutex);
+      BM_CKFATAL(-EINVAL);
+   }
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+   return buf;
+}
+
+void
+driBOUnReference(struct _DriBufferObject *buf)
+{
+   int tmp;
+
+   if (!buf)
+      return;
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   tmp = --buf->refCount;
+   if (!tmp) {
+      _glthread_UNLOCK_MUTEX(buf->mutex);
+      if (buf->private) {
+        if (buf->createdByReference)
+           buf->pool->unreference(buf->pool, buf->private);
+        else
+           buf->pool->destroy(buf->pool, buf->private);
+      }
+      if (buf->userBuffer)
+        num_user_buffers--;
+      else
+        num_buffers--;
+      free(buf);
+   } else 
+     _glthread_UNLOCK_MUTEX(buf->mutex);
+
+}
+
+
+int
+driBOData(struct _DriBufferObject *buf,
+          unsigned size, const void *data, 
+         DriBufferPool *newPool, 
+         uint64_t flags)
+{
+   void *virtual = NULL;
+   int newBuffer;
+   int retval = 0;
+   struct _DriBufferPool *pool;
+
+   assert(!buf->userBuffer); /* XXX just do a memcpy? */
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   pool = buf->pool;
+
+   if (pool == NULL && newPool != NULL) {
+       buf->pool = newPool;
+       pool = newPool;
+   }
+   if (newPool == NULL)
+       newPool = pool;
+
+   if (!pool->create) {
+      _mesa_error(NULL, GL_INVALID_OPERATION,
+                  "driBOData called on invalid buffer\n");
+      BM_CKFATAL(-EINVAL);
+   }
+
+   newBuffer = (!buf->private || pool != newPool ||
+               pool->size(pool, buf->private) < size);
+
+   if (!flags)
+       flags = buf->flags;
+
+   if (newBuffer) {
+
+       if (buf->createdByReference) {
+         _mesa_error(NULL, GL_INVALID_OPERATION,
+                    "driBOData requiring resizing called on "
+                    "shared buffer.\n");
+         BM_CKFATAL(-EINVAL);
+       }
+
+       if (buf->private)
+          buf->pool->destroy(buf->pool, buf->private);
+
+       pool = newPool;
+       buf->pool = newPool;
+       buf->private = pool->create(pool, size, flags, DRM_BO_HINT_DONT_FENCE,
+                                 buf->alignment);
+      if (!buf->private)
+         retval = -ENOMEM;
+
+      if (retval == 0)
+         retval = pool->map(pool, buf->private,
+                            DRM_BO_FLAG_WRITE,
+                            DRM_BO_HINT_DONT_BLOCK, &buf->mutex, &virtual);
+   } else if (pool->map(pool, buf->private, DRM_BO_FLAG_WRITE,
+                       DRM_BO_HINT_DONT_BLOCK, &buf->mutex, &virtual)) {
+       /*
+       * Buffer is busy. need to create a new one.
+       */
+
+       void *newBuf;
+
+       newBuf = pool->create(pool, size, flags, DRM_BO_HINT_DONT_FENCE,
+                            buf->alignment);
+       if (newBuf) {
+          buf->pool->destroy(buf->pool, buf->private);
+          buf->private = newBuf;
+       }
+
+       retval = pool->map(pool, buf->private,
+                         DRM_BO_FLAG_WRITE, 0, &buf->mutex, &virtual);
+   } else {
+       uint64_t flag_diff = flags ^ buf->flags;
+       
+       /*
+       * We might need to change buffer flags.
+       */
+
+       if (flag_diff){
+          assert(pool->setStatus != NULL);
+          BM_CKFATAL(pool->unmap(pool, buf->private));
+          BM_CKFATAL(pool->setStatus(pool, buf->private, flag_diff,
+                                     buf->flags));
+          if (!data)
+            goto out;
+
+          retval = pool->map(pool, buf->private,
+                             DRM_BO_FLAG_WRITE, 0, &buf->mutex, &virtual);
+       }
+   }
+
+   if (retval == 0) {
+      if (data)
+        memcpy(virtual, data, size);
+
+      BM_CKFATAL(pool->unmap(pool, buf->private));
+   }
+
+ out:
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+   
+   return retval;
+}
+
+void
+driBOSubData(struct _DriBufferObject *buf,
+             unsigned long offset, unsigned long size, const void *data)
+{
+   void *virtual;
+
+   assert(!buf->userBuffer); /* XXX just do a memcpy? */
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   if (size && data) {
+      BM_CKFATAL(buf->pool->map(buf->pool, buf->private,
+                                DRM_BO_FLAG_WRITE, 0, &buf->mutex,
+                               &virtual));
+      memcpy((unsigned char *) virtual + offset, data, size);
+      BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private));
+   }
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+void
+driBOGetSubData(struct _DriBufferObject *buf,
+                unsigned long offset, unsigned long size, void *data)
+{
+   void *virtual;
+
+   assert(!buf->userBuffer); /* XXX just do a memcpy? */
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   if (size && data) {
+      BM_CKFATAL(buf->pool->map(buf->pool, buf->private,
+                                DRM_BO_FLAG_READ, 0, &buf->mutex, &virtual));
+      memcpy(data, (unsigned char *) virtual + offset, size);
+      BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private));
+   }
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+void
+driBOSetReferenced(struct _DriBufferObject *buf,
+                  unsigned long handle)
+{
+   _glthread_LOCK_MUTEX(buf->mutex);
+   if (buf->private != NULL) {
+      _mesa_error(NULL, GL_INVALID_OPERATION,
+                  "Invalid buffer for setReferenced\n");
+      BM_CKFATAL(-EINVAL);
+   
+   }
+   if (buf->pool->reference == NULL) {
+      _mesa_error(NULL, GL_INVALID_OPERATION,
+                  "Invalid buffer pool for setReferenced\n");
+      BM_CKFATAL(-EINVAL);
+   }
+   buf->private = buf->pool->reference(buf->pool, handle);
+   if (!buf->private) {
+      _mesa_error(NULL, GL_OUT_OF_MEMORY,
+                  "Invalid buffer pool for setStatic\n");
+      BM_CKFATAL(-ENOMEM);
+   }
+   buf->createdByReference = GL_TRUE;
+   buf->flags = buf->pool->kernel(buf->pool, buf->private)->flags;
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+int
+driGenBuffers(struct _DriBufferPool *pool,
+              const char *name,
+              unsigned n,
+              struct _DriBufferObject *buffers[],
+              unsigned alignment, uint64_t flags, unsigned hint)
+{
+   struct _DriBufferObject *buf;
+   int i;
+
+   flags = (flags) ? flags : DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_MEM_VRAM |
+      DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE;
+
+   ++num_buffers;
+
+   assert(pool);
+
+   for (i = 0; i < n; ++i) {
+      buf = (struct _DriBufferObject *) calloc(1, sizeof(*buf));
+      if (!buf)
+        return -ENOMEM;
+
+      _glthread_INIT_MUTEX(buf->mutex);
+      _glthread_LOCK_MUTEX(buf->mutex);
+      buf->refCount = 1;
+      buf->flags = flags;
+      buf->hint = hint;
+      buf->name = name;
+      buf->alignment = alignment;
+      buf->pool = pool;
+      buf->createdByReference = 0;
+      _glthread_UNLOCK_MUTEX(buf->mutex);
+      buffers[i] = buf;
+   }
+   return 0;
+}
+
+void
+driGenUserBuffer(struct _DriBufferPool *pool,
+                 const char *name,
+                 struct _DriBufferObject **buffers,
+                 void *ptr, unsigned bytes)
+{
+   const unsigned alignment = 1, flags = 0, hint = 0;
+
+   --num_buffers; /* JB: is inced in GenBuffes */
+   driGenBuffers(pool, name, 1, buffers, alignment, flags, hint);
+   ++num_user_buffers;
+
+   (*buffers)->userBuffer = 1;
+   (*buffers)->userData = ptr;
+   (*buffers)->userSize = bytes;
+}
+
+void
+driDeleteBuffers(unsigned n, struct _DriBufferObject *buffers[])
+{
+   int i;
+
+   for (i = 0; i < n; ++i) {
+      driBOUnReference(buffers[i]);
+   }
+}
+
+
+void
+driInitBufMgr(int fd)
+{
+   ;
+}
+
+/*
+ * Note that lists are per-context and don't need mutex protection.
+ */
+
+struct _DriBufferList *
+driBOCreateList(int target)
+{
+    struct _DriBufferList *list = calloc(sizeof(*list), 1);
+
+    BM_CKFATAL(drmBOCreateList(target, &list->drmBuffers));
+    BM_CKFATAL(drmBOCreateList(target, &list->driBuffers));
+    return list;
+}
+
+int
+driBOResetList(struct _DriBufferList * list)
+{
+    int ret;
+    ret = drmBOResetList(&list->drmBuffers);
+    if (ret)
+       return ret;
+    ret = drmBOResetList(&list->driBuffers);
+    return ret;
+}
+
+void
+driBOFreeList(struct _DriBufferList * list)
+{
+   drmBOFreeList(&list->drmBuffers);
+   drmBOFreeList(&list->driBuffers);
+   free(list);
+}
+
+
+/*
+ * Copied from libdrm, because it is needed by driAddValidateItem.
+ */
+
+static drmBONode *
+driAddListItem(drmBOList * list, drmBO * item,
+              uint64_t arg0, uint64_t arg1)
+{
+    drmBONode *node;
+    drmMMListHead *l;
+
+    l = list->free.next;
+    if (l == &list->free) {
+       node = (drmBONode *) malloc(sizeof(*node));
+       if (!node) {
+           return NULL;
+       }
+       list->numCurrent++;
+    } else {
+       DRMLISTDEL(l);
+       node = DRMLISTENTRY(drmBONode, l, head);
+    }
+    memset(&node->bo_arg, 0, sizeof(node->bo_arg));
+    node->buf = item;
+    node->arg0 = arg0;
+    node->arg1 = arg1;
+    DRMLISTADDTAIL(&node->head, &list->list);
+    list->numOnList++;
+    return node;
+}
+
+/*
+ * Slightly modified version compared to the libdrm version.
+ * This one returns the list index of the buffer put on the list.
+ */
+
+static int
+driAddValidateItem(drmBOList * list, drmBO * buf, uint64_t flags,
+                  uint64_t mask, int *itemLoc, 
+                  struct _drmBONode **pnode)
+{
+    drmBONode *node, *cur;
+    drmMMListHead *l;
+    int count = 0;
+
+    cur = NULL;
+
+    for (l = list->list.next; l != &list->list; l = l->next) {
+       node = DRMLISTENTRY(drmBONode, l, head);
+       if (node->buf == buf) {
+           cur = node;
+           break;
+       }
+       count++;
+    }
+    if (!cur) {
+       cur = driAddListItem(list, buf, flags, mask);
+       if (!cur)
+           return -ENOMEM;
+
+       cur->arg0 = flags;
+       cur->arg1 = mask;
+    } else {
+        uint64_t memFlags = cur->arg0 & flags & DRM_BO_MASK_MEM;
+       uint64_t accFlags = (cur->arg0 | flags) & ~DRM_BO_MASK_MEM;
+
+       if (mask & cur->arg1 & ~DRM_BO_MASK_MEM  & (cur->arg0 ^ flags)) {
+           return -EINVAL;
+       }
+
+       cur->arg1 |= mask;
+       cur->arg0 = (cur->arg0 & ~mask) | ((memFlags | accFlags) & mask);
+
+       if (((cur->arg1 & DRM_BO_MASK_MEM) != 0) &&
+           (cur->arg0 & DRM_BO_MASK_MEM) == 0) {
+           return -EINVAL;
+       }
+    }
+    *itemLoc = count;
+    *pnode = cur;
+    return 0;
+}
+
+
+void
+driBOAddListItem(struct _DriBufferList * list, struct _DriBufferObject *buf,
+                 uint64_t flags, uint64_t mask, int *itemLoc, 
+                struct _drmBONode **node)
+{
+   int newItem;
+   
+   _glthread_LOCK_MUTEX(buf->mutex);
+   BM_CKFATAL(driAddValidateItem(&list->drmBuffers,
+                                buf->pool->kernel(buf->pool, buf->private),
+                                 flags, mask, itemLoc, node));
+   BM_CKFATAL(drmAddValidateItem(&list->driBuffers, (drmBO *) buf,
+                                flags, mask, &newItem));
+   if (newItem) 
+     buf->refCount++;
+
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+drmBOList *driGetdrmBOList(struct _DriBufferList *list)
+{
+       driWriteLockKernelBO();
+       return &list->drmBuffers;
+}
+
+void driPutdrmBOList(struct _DriBufferList *list)
+{
+       driWriteUnlockKernelBO();
+}
+
+
+void
+driBOFence(struct _DriBufferObject *buf, struct _DriFenceObject *fence)
+{
+   _glthread_LOCK_MUTEX(buf->mutex);
+   if (buf->pool->fence)
+       BM_CKFATAL(buf->pool->fence(buf->pool, buf->private, fence));
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+
+}
+
+void
+driBOUnrefUserList(struct _DriBufferList *list)
+{
+    struct _DriBufferObject *buf;
+    void *curBuf;
+
+    curBuf = drmBOListIterator(&list->driBuffers);
+    while (curBuf) {
+       buf = (struct _DriBufferObject *)drmBOListBuf(curBuf);
+       driBOUnReference(buf);
+       curBuf = drmBOListNext(&list->driBuffers, curBuf);
+    }
+}
+
+struct _DriFenceObject *
+driBOFenceUserList(struct _DriFenceMgr *mgr,
+                  struct _DriBufferList *list, const char *name,
+                  drmFence *kFence)
+{
+    struct _DriFenceObject *fence;
+    struct _DriBufferObject *buf;
+    void *curBuf;
+
+    fence = driFenceCreate(mgr, kFence->fence_class, kFence->type,
+                          kFence, sizeof(*kFence));
+    curBuf = drmBOListIterator(&list->driBuffers);
+
+   /*
+    * User-space fencing callbacks.
+    */
+
+   while (curBuf) {
+        buf = (struct _DriBufferObject *) drmBOListBuf(curBuf);
+       driBOFence(buf, fence);
+       driBOUnReference(buf);
+       curBuf = drmBOListNext(&list->driBuffers, curBuf);
+   }
+
+   driBOResetList(list);
+   return fence;
+}
+   
+void
+driBOValidateUserList(struct _DriBufferList * list)
+{
+    void *curBuf;
+    struct _DriBufferObject *buf;
+
+    curBuf = drmBOListIterator(&list->driBuffers);
+
+    /*
+     * User-space validation callbacks.
+     */
+
+    while (curBuf) {
+       buf = (struct _DriBufferObject *) drmBOListBuf(curBuf);
+       _glthread_LOCK_MUTEX(buf->mutex);
+       if (buf->pool->validate)
+           BM_CKFATAL(buf->pool->validate(buf->pool, buf->private, &buf->mutex));
+       _glthread_UNLOCK_MUTEX(buf->mutex);
+       curBuf = drmBOListNext(&list->driBuffers, curBuf);
+    }
+}
+
+
+void
+driPoolTakeDown(struct _DriBufferPool *pool)
+{
+   pool->takeDown(pool);
+
+}
+
+unsigned long 
+driBOSize(struct _DriBufferObject *buf)
+{
+  unsigned long size;
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   size = buf->pool->size(buf->pool, buf->private);
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+
+  return size;
+
+}
+
+drmBOList *driBOGetDRMBuffers(struct _DriBufferList *list)
+{
+    return &list->drmBuffers;
+}
+
+drmBOList *driBOGetDRIBuffers(struct _DriBufferList *list)
+{
+    return &list->driBuffers;
+}
+    
diff --git a/src/gallium/winsys/dri/intel/ws_dri_bufmgr.h b/src/gallium/winsys/dri/intel/ws_dri_bufmgr.h
new file mode 100644 (file)
index 0000000..fdaf5ee
--- /dev/null
@@ -0,0 +1,138 @@
+/**************************************************************************
+ * 
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * 
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ *          Keith Whitwell <keithw-at-tungstengraphics-dot-com>
+ */
+
+#ifndef _PSB_BUFMGR_H_
+#define _PSB_BUFMGR_H_
+#include <xf86mm.h>
+#include "i915_drm.h"
+#include "ws_dri_fencemgr.h"
+
+typedef struct _drmBONode
+{
+    drmMMListHead head;
+    drmBO *buf;
+    struct drm_i915_op_arg bo_arg;
+    uint64_t arg0;
+    uint64_t arg1;
+} drmBONode;
+
+typedef struct _drmBOList {
+    unsigned numTarget;
+    unsigned numCurrent;
+    unsigned numOnList;
+    drmMMListHead list;
+    drmMMListHead free;
+} drmBOList;
+
+
+struct _DriFenceObject;
+struct _DriBufferObject;
+struct _DriBufferPool;
+struct _DriBufferList;
+
+/*
+ * Return a pointer to the libdrm buffer object this DriBufferObject
+ * uses.
+ */
+
+extern drmBO *driBOKernel(struct _DriBufferObject *buf);
+extern void *driBOMap(struct _DriBufferObject *buf, unsigned flags,
+                      unsigned hint);
+extern void driBOUnmap(struct _DriBufferObject *buf);
+extern unsigned long driBOOffset(struct _DriBufferObject *buf);
+extern unsigned long driBOPoolOffset(struct _DriBufferObject *buf);
+
+extern uint64_t driBOFlags(struct _DriBufferObject *buf);
+extern struct _DriBufferObject *driBOReference(struct _DriBufferObject *buf);
+extern void driBOUnReference(struct _DriBufferObject *buf);
+
+extern int driBOData(struct _DriBufferObject *r_buf,
+                    unsigned size, const void *data, 
+                    struct _DriBufferPool *pool, uint64_t flags);
+
+extern void driBOSubData(struct _DriBufferObject *buf,
+                         unsigned long offset, unsigned long size,
+                         const void *data);
+extern void driBOGetSubData(struct _DriBufferObject *buf,
+                            unsigned long offset, unsigned long size,
+                            void *data);
+extern int driGenBuffers(struct _DriBufferPool *pool,
+                        const char *name,
+                        unsigned n,
+                        struct _DriBufferObject *buffers[],
+                        unsigned alignment, uint64_t flags, unsigned hint);
+extern void driGenUserBuffer(struct _DriBufferPool *pool,
+                             const char *name,
+                             struct _DriBufferObject *buffers[],
+                             void *ptr, unsigned bytes);
+extern void driDeleteBuffers(unsigned n, struct _DriBufferObject *buffers[]);
+extern void driInitBufMgr(int fd);
+extern struct _DriBufferList *driBOCreateList(int target);
+extern int driBOResetList(struct _DriBufferList * list);
+extern void driBOAddListItem(struct _DriBufferList * list, 
+                            struct _DriBufferObject *buf,
+                             uint64_t flags, uint64_t mask, int *itemLoc,
+                            struct _drmBONode **node);
+
+extern void driBOValidateList(int fd, struct _DriBufferList * list);
+extern void driBOFreeList(struct _DriBufferList * list);
+extern struct _DriFenceObject *driBOFenceUserList(struct _DriFenceMgr *mgr,
+                                                 struct _DriBufferList *list,
+                                                 const char *name,
+                                                 drmFence *kFence);
+extern void driBOUnrefUserList(struct _DriBufferList *list);
+extern void driBOValidateUserList(struct _DriBufferList * list);
+extern drmBOList *driGetdrmBOList(struct _DriBufferList *list);
+extern void driPutdrmBOList(struct _DriBufferList *list);
+
+extern void driBOFence(struct _DriBufferObject *buf,
+                       struct _DriFenceObject *fence);
+
+extern void driPoolTakeDown(struct _DriBufferPool *pool);
+extern void driBOSetReferenced(struct _DriBufferObject *buf,
+                              unsigned long handle);
+unsigned long driBOSize(struct _DriBufferObject *buf);
+extern void driBOWaitIdle(struct _DriBufferObject *buf, int lazy);
+extern void driPoolTakeDown(struct _DriBufferPool *pool);
+
+extern void driReadLockKernelBO(void);
+extern void driReadUnlockKernelBO(void);
+extern void driWriteLockKernelBO(void);
+extern void driWriteUnlockKernelBO(void);
+
+/*
+ * For debugging purposes.
+ */
+
+extern drmBOList *driBOGetDRMBuffers(struct _DriBufferList *list);
+extern drmBOList *driBOGetDRIBuffers(struct _DriBufferList *list);
+#endif
diff --git a/src/gallium/winsys/dri/intel/ws_dri_bufpool.h b/src/gallium/winsys/dri/intel/ws_dri_bufpool.h
new file mode 100644 (file)
index 0000000..3a302e1
--- /dev/null
@@ -0,0 +1,102 @@
+/**************************************************************************
+ * 
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * 
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ */
+
+#ifndef _PSB_BUFPOOL_H_
+#define _PSB_BUFPOOL_H_
+
+#include <xf86drm.h>
+#include <glthread.h>
+struct _DriFenceObject;
+
+typedef struct _DriBufferPool
+{
+   int fd;
+   int (*map) (struct _DriBufferPool * pool, void *private,
+               unsigned flags, int hint, _glthread_Mutex *mutex, 
+              void **virtual);
+   int (*unmap) (struct _DriBufferPool * pool, void *private);
+   int (*destroy) (struct _DriBufferPool * pool, void *private);
+   unsigned long (*offset) (struct _DriBufferPool * pool, void *private);
+   unsigned long (*poolOffset) (struct _DriBufferPool * pool, void *private);
+   uint64_t (*flags) (struct _DriBufferPool * pool, void *private);
+   unsigned long (*size) (struct _DriBufferPool * pool, void *private);
+   void *(*create) (struct _DriBufferPool * pool, unsigned long size,
+                    uint64_t flags, unsigned hint, unsigned alignment);
+   void *(*reference) (struct _DriBufferPool * pool, unsigned handle);
+   int (*unreference) (struct _DriBufferPool * pool, void *private);
+   int (*fence) (struct _DriBufferPool * pool, void *private,
+                 struct _DriFenceObject * fence);
+   drmBO *(*kernel) (struct _DriBufferPool * pool, void *private);
+   int (*validate) (struct _DriBufferPool * pool, void *private, _glthread_Mutex *mutex);
+   int (*waitIdle) (struct _DriBufferPool *pool, void *private, _glthread_Mutex *mutex,
+                   int lazy);
+   int (*setStatus)  (struct _DriBufferPool *pool, void *private,
+                     uint64_t flag_diff, uint64_t old_flags);
+   void (*takeDown) (struct _DriBufferPool * pool);
+   void *data;
+} DriBufferPool;
+
+extern void bmError(int val, const char *file, const char *function,
+                    int line);
+#define BM_CKFATAL(val)                                               \
+  do{                                                         \
+    int tstVal = (val);                                               \
+    if (tstVal)                                               \
+      bmError(tstVal, __FILE__, __FUNCTION__, __LINE__);       \
+  } while(0);
+
+
+/*
+ * Builtin pools.
+ */
+
+/*
+ * Kernel buffer objects. Size in multiples of page size. Page size aligned.
+ */
+
+extern struct _DriBufferPool *driDRMPoolInit(int fd);
+extern struct _DriBufferPool *driMallocPoolInit(void);
+
+struct _DriFreeSlabManager;
+extern struct _DriBufferPool * driSlabPoolInit(int fd, uint64_t flags,
+                                              uint64_t validMask,
+                                              uint32_t smallestSize,
+                                              uint32_t numSizes,
+                                              uint32_t desiredNumBuffers,
+                                              uint32_t maxSlabSize,
+                                              uint32_t pageAlignment,
+                                              struct _DriFreeSlabManager *fMan);
+extern void driFinishFreeSlabManager(struct _DriFreeSlabManager *fMan);
+extern struct _DriFreeSlabManager *
+driInitFreeSlabManager(uint32_t checkIntervalMsec, uint32_t slabTimeoutMsec);
+
+
+#endif
diff --git a/src/gallium/winsys/dri/intel/ws_dri_drmpool.c b/src/gallium/winsys/dri/intel/ws_dri_drmpool.c
new file mode 100644 (file)
index 0000000..7c55dbc
--- /dev/null
@@ -0,0 +1,268 @@
+/**************************************************************************
+ * 
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * 
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ */
+
+#include <xf86drm.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "ws_dri_bufpool.h"
+#include "ws_dri_bufmgr.h"
+#include "assert.h"
+
+/*
+ * Buffer pool implementation using DRM buffer objects as DRI buffer objects.
+ */
+
+static void *
+pool_create(struct _DriBufferPool *pool,
+            unsigned long size, uint64_t flags, unsigned hint,
+            unsigned alignment)
+{
+   drmBO *buf = (drmBO *) malloc(sizeof(*buf));
+   int ret;
+   unsigned pageSize = getpagesize();
+
+   if (!buf)
+      return NULL;
+
+   if ((alignment > pageSize) && (alignment % pageSize)) {
+      free(buf);
+      return NULL;
+   }
+
+   ret = drmBOCreate(pool->fd, size, alignment / pageSize,
+                    NULL,
+                     flags, hint, buf);
+   if (ret) {
+      free(buf);
+      return NULL;
+   }
+
+   return (void *) buf;
+}
+
+static void *
+pool_reference(struct _DriBufferPool *pool, unsigned handle)
+{
+   drmBO *buf = (drmBO *) malloc(sizeof(*buf));
+   int ret;
+
+   if (!buf)
+      return NULL;
+
+   ret = drmBOReference(pool->fd, handle, buf);
+
+   if (ret) {
+      free(buf);
+      return NULL;
+   }
+
+   return (void *) buf;
+}
+
+static int
+pool_destroy(struct _DriBufferPool *pool, void *private)
+{
+   int ret;
+   drmBO *buf = (drmBO *) private;
+   driReadLockKernelBO();
+   ret = drmBOUnreference(pool->fd, buf);
+   free(buf);
+   driReadUnlockKernelBO();
+   return ret;
+}
+
+static int
+pool_unreference(struct _DriBufferPool *pool, void *private)
+{
+   int ret;
+   drmBO *buf = (drmBO *) private;
+   driReadLockKernelBO();
+   ret = drmBOUnreference(pool->fd, buf);
+   free(buf);
+   driReadUnlockKernelBO();
+   return ret;
+}
+
+static int
+pool_map(struct _DriBufferPool *pool, void *private, unsigned flags,
+         int hint, _glthread_Mutex *mutex, void **virtual)
+{
+   drmBO *buf = (drmBO *) private;
+   int ret;
+   
+   driReadLockKernelBO();
+   ret = drmBOMap(pool->fd, buf, flags, hint, virtual);
+   driReadUnlockKernelBO();
+   return ret;
+}
+
+static int
+pool_unmap(struct _DriBufferPool *pool, void *private)
+{
+   drmBO *buf = (drmBO *) private;
+   int ret;
+
+   driReadLockKernelBO();
+   ret = drmBOUnmap(pool->fd, buf);
+   driReadUnlockKernelBO();
+   
+   return ret;
+}
+
+static unsigned long
+pool_offset(struct _DriBufferPool *pool, void *private)
+{
+   drmBO *buf = (drmBO *) private;
+   unsigned long offset;
+
+   driReadLockKernelBO();
+   assert(buf->flags & DRM_BO_FLAG_NO_MOVE);   
+   offset = buf->offset;
+   driReadUnlockKernelBO();
+
+   return buf->offset;
+}
+
+static unsigned long
+pool_poolOffset(struct _DriBufferPool *pool, void *private)
+{
+   return 0;
+}
+
+static uint64_t
+pool_flags(struct _DriBufferPool *pool, void *private)
+{
+   drmBO *buf = (drmBO *) private;
+   uint64_t flags;
+
+   driReadLockKernelBO();
+   flags = buf->flags;
+   driReadUnlockKernelBO();
+
+   return flags;
+}
+
+
+static unsigned long
+pool_size(struct _DriBufferPool *pool, void *private)
+{
+   drmBO *buf = (drmBO *) private;
+   unsigned long size;
+
+   driReadLockKernelBO();
+   size = buf->size;
+   driReadUnlockKernelBO();
+
+   return buf->size;
+}
+
+static int
+pool_fence(struct _DriBufferPool *pool, void *private,
+           struct _DriFenceObject *fence)
+{
+   /*
+    * Noop. The kernel handles all fencing.
+    */
+
+   return 0;
+}
+
+static drmBO *
+pool_kernel(struct _DriBufferPool *pool, void *private)
+{
+   return (drmBO *) private;
+}
+
+static int
+pool_waitIdle(struct _DriBufferPool *pool, void *private, _glthread_Mutex *mutex, 
+             int lazy)
+{
+   drmBO *buf = (drmBO *) private;
+   int ret;
+
+   driReadLockKernelBO();
+   ret = drmBOWaitIdle(pool->fd, buf, (lazy) ? DRM_BO_HINT_WAIT_LAZY:0);
+   driReadUnlockKernelBO();
+
+   return ret;
+}
+
+   
+static void
+pool_takedown(struct _DriBufferPool *pool)
+{
+   free(pool);
+}
+
+/*static int
+pool_setStatus(struct _DriBufferPool *pool, void *private, 
+              uint64_t flag_diff, uint64_t old_flags)
+{
+   drmBO *buf = (drmBO *) private;
+   uint64_t new_flags = old_flags ^ flag_diff;
+   int ret;
+
+   driReadLockKernelBO();
+   ret = drmBOSetStatus(pool->fd, buf, new_flags, flag_diff,
+                       0, 0, 0);
+   driReadUnlockKernelBO();
+   return ret;
+}*/
+
+struct _DriBufferPool *
+driDRMPoolInit(int fd)
+{
+   struct _DriBufferPool *pool;
+
+   pool = (struct _DriBufferPool *) malloc(sizeof(*pool));
+
+   if (!pool)
+      return NULL;
+
+   pool->fd = fd;
+   pool->map = &pool_map;
+   pool->unmap = &pool_unmap;
+   pool->destroy = &pool_destroy;
+   pool->offset = &pool_offset;
+   pool->poolOffset = &pool_poolOffset;
+   pool->flags = &pool_flags;
+   pool->size = &pool_size;
+   pool->create = &pool_create;
+   pool->fence = &pool_fence;
+   pool->kernel = &pool_kernel;
+   pool->validate = NULL;
+   pool->waitIdle = &pool_waitIdle;
+   pool->takeDown = &pool_takedown;
+   pool->reference = &pool_reference;
+   pool->unreference = &pool_unreference;
+   pool->data = NULL;
+   return pool;
+}
diff --git a/src/gallium/winsys/dri/intel/ws_dri_fencemgr.c b/src/gallium/winsys/dri/intel/ws_dri_fencemgr.c
new file mode 100644 (file)
index 0000000..1f893b4
--- /dev/null
@@ -0,0 +1,377 @@
+#include "ws_dri_fencemgr.h"
+#include "glthread.h"
+#include <xf86mm.h>
+#include <string.h>
+#include <unistd.h>
+
+/*
+ * Note: Locking order is
+ * _DriFenceObject::mutex
+ * _DriFenceMgr::mutex
+ */
+
+struct _DriFenceMgr {
+    /*
+     * Constant members. Need no mutex protection.
+     */
+    struct _DriFenceMgrCreateInfo info;
+    void *private;
+
+    /*
+     * These members are protected by this->mutex
+     */
+    _glthread_Mutex mutex;
+    int refCount;
+    drmMMListHead *heads;
+    int num_fences;
+};
+
+struct _DriFenceObject {
+
+    /*
+     * These members are constant and need no mutex protection.
+     */
+    struct _DriFenceMgr *mgr;
+    uint32_t fence_class;
+    uint32_t fence_type;
+
+    /*
+     * These members are protected by mgr->mutex.
+     */
+    drmMMListHead head;
+    int refCount;
+
+    /*
+     * These members are protected by this->mutex.
+     */
+    _glthread_Mutex mutex;
+    uint32_t signaled_type;
+    void *private;
+};
+
+uint32_t
+driFenceType(struct _DriFenceObject *fence)
+{
+  return fence->fence_type;
+}
+
+struct _DriFenceMgr *
+driFenceMgrCreate(const struct _DriFenceMgrCreateInfo *info)
+{
+  struct _DriFenceMgr *tmp;
+  uint32_t i;
+
+  tmp = calloc(1, sizeof(*tmp));
+  if (!tmp)
+      return NULL;
+
+  _glthread_INIT_MUTEX(tmp->mutex);
+  _glthread_LOCK_MUTEX(tmp->mutex);
+  tmp->refCount = 1;
+  tmp->info = *info;
+  tmp->num_fences = 0;
+  tmp->heads = calloc(tmp->info.num_classes, sizeof(*tmp->heads));
+  if (!tmp->heads)
+      goto out_err;
+
+  for (i=0; i<tmp->info.num_classes; ++i) {
+      DRMINITLISTHEAD(&tmp->heads[i]);
+  }
+  _glthread_UNLOCK_MUTEX(tmp->mutex);
+  return tmp;
+
+  out_err:
+  if (tmp)
+      free(tmp);
+  return NULL;
+}
+
+static void
+driFenceMgrUnrefUnlock(struct _DriFenceMgr **pMgr)
+{
+    struct _DriFenceMgr *mgr = *pMgr;
+
+    *pMgr = NULL;
+    if (--mgr->refCount == 0)
+       free(mgr);
+    else
+       _glthread_UNLOCK_MUTEX(mgr->mutex);
+}
+
+void
+driFenceMgrUnReference(struct _DriFenceMgr **pMgr)
+{
+    _glthread_LOCK_MUTEX((*pMgr)->mutex);
+    driFenceMgrUnrefUnlock(pMgr);
+}
+
+static void
+driFenceUnReferenceLocked(struct _DriFenceObject **pFence)
+{
+    struct _DriFenceObject *fence = *pFence;
+    struct _DriFenceMgr *mgr = fence->mgr;
+
+    *pFence = NULL;
+    if (--fence->refCount == 0) {
+       DRMLISTDELINIT(&fence->head);
+       if (fence->private)
+           mgr->info.unreference(mgr, &fence->private);
+    --mgr->num_fences;
+       fence->mgr = NULL;
+       --mgr->refCount;
+       free(fence);
+
+    }
+}
+
+
+static void
+driSignalPreviousFencesLocked(struct _DriFenceMgr *mgr,
+                             drmMMListHead *list,
+                             uint32_t fence_class,
+                             uint32_t fence_type)
+{
+    struct _DriFenceObject *entry;
+    drmMMListHead *prev;
+
+    while(list != &mgr->heads[fence_class]) {
+       entry = DRMLISTENTRY(struct _DriFenceObject, list, head);
+
+       /*
+        * Up refcount so that entry doesn't disappear from under us
+        * when we unlock-relock mgr to get the correct locking order.
+        */
+
+       ++entry->refCount;
+       _glthread_UNLOCK_MUTEX(mgr->mutex);
+       _glthread_LOCK_MUTEX(entry->mutex);
+       _glthread_LOCK_MUTEX(mgr->mutex);
+
+       prev = list->prev;
+
+
+
+       if (list->prev == list) {
+
+               /*
+                * Somebody else removed the entry from the list.
+                */
+
+               _glthread_UNLOCK_MUTEX(entry->mutex);
+               driFenceUnReferenceLocked(&entry);
+               return;
+       }
+
+       entry->signaled_type |= (fence_type & entry->fence_type);
+       if (entry->signaled_type == entry->fence_type) {
+           DRMLISTDELINIT(list);
+           mgr->info.unreference(mgr, &entry->private);
+       }
+       _glthread_UNLOCK_MUTEX(entry->mutex);
+       driFenceUnReferenceLocked(&entry);
+       list = prev;
+    }
+}
+
+
+int
+driFenceFinish(struct _DriFenceObject *fence, uint32_t fence_type,
+              int lazy_hint)
+{
+    struct _DriFenceMgr *mgr = fence->mgr;
+    int ret = 0;
+
+    _glthread_LOCK_MUTEX(fence->mutex);
+
+    if ((fence->signaled_type & fence_type) == fence_type)
+       goto out0;
+
+    ret = mgr->info.finish(mgr, fence->private, fence_type, lazy_hint);
+    if (ret)
+       goto out0;
+
+    _glthread_LOCK_MUTEX(mgr->mutex);
+    _glthread_UNLOCK_MUTEX(fence->mutex);
+
+    driSignalPreviousFencesLocked(mgr, &fence->head, fence->fence_class,
+                                 fence_type);
+    _glthread_UNLOCK_MUTEX(mgr->mutex);
+    return 0;
+
+  out0:
+    _glthread_UNLOCK_MUTEX(fence->mutex);
+    return ret;
+}
+
+uint32_t driFenceSignaledTypeCached(struct _DriFenceObject *fence)
+{
+    uint32_t ret;
+
+    _glthread_LOCK_MUTEX(fence->mutex);
+    ret = fence->signaled_type;
+    _glthread_UNLOCK_MUTEX(fence->mutex);
+
+    return ret;
+}
+
+int
+driFenceSignaledType(struct _DriFenceObject *fence, uint32_t flush_type,
+                uint32_t *signaled)
+{
+    int ret = 0;
+    struct _DriFenceMgr *mgr;
+
+    _glthread_LOCK_MUTEX(fence->mutex);
+    mgr = fence->mgr;
+    *signaled = fence->signaled_type;
+    if ((fence->signaled_type & flush_type) == flush_type)
+       goto out0;
+
+    ret = mgr->info.signaled(mgr, fence->private, flush_type, signaled);
+    if (ret) {
+       *signaled = fence->signaled_type;
+       goto out0;
+    }
+
+    if ((fence->signaled_type | *signaled) == fence->signaled_type)
+       goto out0;
+
+    _glthread_LOCK_MUTEX(mgr->mutex);
+    _glthread_UNLOCK_MUTEX(fence->mutex);
+
+    driSignalPreviousFencesLocked(mgr, &fence->head, fence->fence_class,
+                                 *signaled);
+
+    _glthread_UNLOCK_MUTEX(mgr->mutex);
+    return 0;
+  out0:
+    _glthread_UNLOCK_MUTEX(fence->mutex);
+    return ret;
+}
+
+struct _DriFenceObject *
+driFenceReference(struct _DriFenceObject *fence)
+{
+    _glthread_LOCK_MUTEX(fence->mgr->mutex);
+    ++fence->refCount;
+    _glthread_UNLOCK_MUTEX(fence->mgr->mutex);
+    return fence;
+}
+
+void
+driFenceUnReference(struct _DriFenceObject **pFence)
+{
+    struct _DriFenceMgr *mgr; 
+
+    if (*pFence == NULL)
+       return;
+
+    mgr = (*pFence)->mgr;
+    _glthread_LOCK_MUTEX(mgr->mutex);
+    ++mgr->refCount;
+    driFenceUnReferenceLocked(pFence);
+    driFenceMgrUnrefUnlock(&mgr);
+}
+
+struct _DriFenceObject
+*driFenceCreate(struct _DriFenceMgr *mgr, uint32_t fence_class,
+               uint32_t fence_type, void *private, size_t private_size)
+{
+    struct _DriFenceObject *fence;
+    size_t fence_size = sizeof(*fence);
+
+    if (private_size)
+       fence_size = ((fence_size + 15) & ~15);
+
+    fence = calloc(1, fence_size + private_size);
+
+    if (!fence) {
+       int ret = mgr->info.finish(mgr, private, fence_type, 0);
+
+       if (ret)
+           usleep(10000000);
+
+       return NULL;
+    }
+
+    _glthread_INIT_MUTEX(fence->mutex);
+    _glthread_LOCK_MUTEX(fence->mutex);
+    _glthread_LOCK_MUTEX(mgr->mutex);
+    fence->refCount = 1;
+    DRMLISTADDTAIL(&fence->head, &mgr->heads[fence_class]);
+    fence->mgr = mgr;
+    ++mgr->refCount;
+    ++mgr->num_fences;
+    _glthread_UNLOCK_MUTEX(mgr->mutex);
+    fence->fence_class = fence_class;
+    fence->fence_type = fence_type;
+    fence->signaled_type = 0;
+    fence->private = private;
+    if (private_size) {
+        fence->private = (void *)(((uint8_t *) fence) + fence_size);
+       memcpy(fence->private, private, private_size);
+    }
+
+    _glthread_UNLOCK_MUTEX(fence->mutex);
+    return fence;
+}
+
+
+static int
+tSignaled(struct _DriFenceMgr *mgr, void *private, uint32_t flush_type,
+         uint32_t *signaled_type)
+{
+  long fd = (long) mgr->private;
+  int dummy;
+  drmFence *fence = (drmFence *) private;
+  int ret;
+
+  *signaled_type = 0;
+  ret = drmFenceSignaled((int) fd, fence, flush_type, &dummy);
+  if (ret)
+    return ret;
+
+  *signaled_type = fence->signaled;
+
+  return 0;
+}
+
+static int
+tFinish(struct _DriFenceMgr *mgr, void *private, uint32_t fence_type,
+       int lazy_hint)
+{
+  long fd = (long) mgr->private;
+  unsigned flags = lazy_hint ? DRM_FENCE_FLAG_WAIT_LAZY : 0;
+
+  return drmFenceWait((int)fd, flags, (drmFence *) private, fence_type);
+}
+
+static int
+tUnref(struct _DriFenceMgr *mgr, void **private)
+{
+  long fd = (long) mgr->private;
+  drmFence *fence = (drmFence *) *private;
+  *private = NULL;
+
+  return drmFenceUnreference(fd, fence);
+}
+
+struct _DriFenceMgr *driFenceMgrTTMInit(int fd)
+{
+  struct _DriFenceMgrCreateInfo info;
+  struct _DriFenceMgr *mgr;
+
+  info.flags = DRI_FENCE_CLASS_ORDERED;
+  info.num_classes = 4;
+  info.signaled = tSignaled;
+  info.finish = tFinish;
+  info.unreference = tUnref;
+
+  mgr = driFenceMgrCreate(&info);
+  if (mgr == NULL)
+    return NULL;
+
+  mgr->private = (void *) (long) fd;
+  return mgr;
+}
+
diff --git a/src/gallium/winsys/dri/intel/ws_dri_fencemgr.h b/src/gallium/winsys/dri/intel/ws_dri_fencemgr.h
new file mode 100644 (file)
index 0000000..4ea58df
--- /dev/null
@@ -0,0 +1,115 @@
+#ifndef DRI_FENCEMGR_H
+#define DRI_FENCEMGR_H
+
+#include <stdint.h>
+#include <stdlib.h>
+
+struct _DriFenceObject;
+struct _DriFenceMgr;
+
+/*
+ * Do a quick check to see if the fence manager has registered the fence
+ * object as signaled. Note that this function may return a false negative
+ * answer.
+ */
+extern uint32_t driFenceSignaledTypeCached(struct _DriFenceObject *fence);
+
+/*
+ * Check if the fence object is signaled. This function can be substantially
+ * more expensive to call than the above function, but will not return a false
+ * negative answer. The argument "flush_type" sets the types that the
+ * underlying mechanism must make sure will eventually signal.
+ */
+extern int driFenceSignaledType(struct _DriFenceObject *fence,
+                               uint32_t flush_type, uint32_t *signaled);
+
+/*
+ * Convenience functions.
+ */
+
+static inline int driFenceSignaled(struct _DriFenceObject *fence,
+                                  uint32_t flush_type)
+{
+    uint32_t signaled_types;
+    int ret = driFenceSignaledType(fence, flush_type, &signaled_types);
+    if (ret)
+       return 0;
+    return ((signaled_types & flush_type) == flush_type);
+}
+
+static inline int driFenceSignaledCached(struct _DriFenceObject *fence,
+                                        uint32_t flush_type)
+{
+    uint32_t signaled_types =
+       driFenceSignaledTypeCached(fence);
+
+    return ((signaled_types & flush_type) == flush_type);
+}
+
+/*
+ * Reference a fence object.
+ */
+extern struct _DriFenceObject *driFenceReference(struct _DriFenceObject *fence);
+
+/*
+ * Unreference a fence object. The fence object pointer will be reset to NULL.
+ */
+
+extern void driFenceUnReference(struct _DriFenceObject **pFence);
+
+
+/*
+ * Wait for a fence to signal the indicated fence_type.
+ * If "lazy_hint" is true, it indicates that the wait may sleep to avoid
+ * busy-wait polling.
+ */
+extern int driFenceFinish(struct _DriFenceObject *fence, uint32_t fence_type,
+                         int lazy_hint);
+
+/*
+ * Create a DriFenceObject for manager "mgr".
+ *
+ * "private" is a pointer that should be used for the callbacks in
+ * struct _DriFenceMgrCreateInfo.
+ *
+ * if private_size is nonzero, then the info stored at *private, with size
+ * private size will be copied and the fence manager will instead use a
+ * pointer to the copied data for the callbacks in
+ * struct _DriFenceMgrCreateInfo. In that case, the object pointed to by
+ * "private" may be destroyed after the call to driFenceCreate.
+ */
+extern struct _DriFenceObject *driFenceCreate(struct _DriFenceMgr *mgr,
+                                             uint32_t fence_class,
+                                             uint32_t fence_type,
+                                             void *private,
+                                             size_t private_size);
+
+extern uint32_t driFenceType(struct _DriFenceObject *fence);
+
+/*
+ * Fence creations are ordered. If a fence signals a fence_type,
+ * it is safe to assume that all fences of the same class that was
+ * created before that fence has signaled the same type.
+ */
+
+#define DRI_FENCE_CLASS_ORDERED (1 << 0)
+
+struct _DriFenceMgrCreateInfo {
+    uint32_t flags;
+    uint32_t num_classes;
+    int (*signaled) (struct _DriFenceMgr *mgr, void *private, uint32_t flush_type,
+                    uint32_t *signaled_type);
+    int (*finish) (struct _DriFenceMgr *mgr, void *private, uint32_t fence_type, int lazy_hint);
+    int (*unreference) (struct _DriFenceMgr *mgr, void **private);
+};
+
+extern struct _DriFenceMgr *
+driFenceMgrCreate(const struct _DriFenceMgrCreateInfo *info);
+
+void
+driFenceMgrUnReference(struct _DriFenceMgr **pMgr);
+
+extern struct _DriFenceMgr *
+driFenceMgrTTMInit(int fd);
+
+#endif
diff --git a/src/gallium/winsys/dri/intel/ws_dri_mallocpool.c b/src/gallium/winsys/dri/intel/ws_dri_mallocpool.c
new file mode 100644 (file)
index 0000000..bf97d7e
--- /dev/null
@@ -0,0 +1,162 @@
+/**************************************************************************
+ * 
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, TX., USA
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * 
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ */
+
+#include <xf86drm.h>
+#include <stdlib.h>
+#include <errno.h>
+#include "imports.h"
+#include "glthread.h"
+#include "ws_dri_bufpool.h"
+#include "ws_dri_bufmgr.h"
+#include "intel_screen.h"
+
+static void *
+pool_create(struct _DriBufferPool *pool,
+            unsigned long size, uint64_t flags, unsigned hint,
+            unsigned alignment)
+{
+    unsigned long *private = malloc(size + 2*sizeof(unsigned long));
+    if ((flags & DRM_BO_MASK_MEM) != DRM_BO_FLAG_MEM_LOCAL)
+      abort();
+
+    *private = size;
+    return (void *)private;
+}
+
+
+static int
+pool_destroy(struct _DriBufferPool *pool, void *private)
+{
+    free(private);
+    return 0;
+}
+
+static int
+pool_waitIdle(struct _DriBufferPool *pool, void *private, 
+             _glthread_Mutex *mutex, int lazy)
+{
+    return 0;
+}
+
+static int
+pool_map(struct _DriBufferPool *pool, void *private, unsigned flags,
+         int hint, _glthread_Mutex *mutex, void **virtual)
+{
+    *virtual = (void *)((unsigned long *)private + 2);
+    return 0;
+}
+
+static int
+pool_unmap(struct _DriBufferPool *pool, void *private)
+{
+    return 0;
+}
+
+static unsigned long
+pool_offset(struct _DriBufferPool *pool, void *private)
+{
+    /*
+     * BUG
+     */
+    abort();
+    return 0UL;
+}
+
+static unsigned long
+pool_poolOffset(struct _DriBufferPool *pool, void *private)
+{
+    /*
+     * BUG
+     */
+    abort();
+}
+
+static uint64_t
+pool_flags(struct _DriBufferPool *pool, void *private)
+{
+    return DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED;
+}
+
+static unsigned long
+pool_size(struct _DriBufferPool *pool, void *private)
+{
+    return *(unsigned long *) private;
+}
+
+
+static int
+pool_fence(struct _DriBufferPool *pool, void *private,
+           struct _DriFenceObject *fence)
+{
+    abort();
+    return 0UL;
+}
+
+static drmBO *
+pool_kernel(struct _DriBufferPool *pool, void *private)
+{
+    abort();
+    return NULL;
+}
+
+static void
+pool_takedown(struct _DriBufferPool *pool)
+{
+    free(pool);
+}
+
+
+struct _DriBufferPool *
+driMallocPoolInit(void)
+{
+   struct _DriBufferPool *pool;
+
+   pool = (struct _DriBufferPool *) malloc(sizeof(*pool));
+   if (!pool)
+       return NULL;
+
+   pool->data = NULL;
+   pool->fd = -1;
+   pool->map = &pool_map;
+   pool->unmap = &pool_unmap;
+   pool->destroy = &pool_destroy;
+   pool->offset = &pool_offset;
+   pool->poolOffset = &pool_poolOffset;
+   pool->flags = &pool_flags;
+   pool->size = &pool_size;
+   pool->create = &pool_create;
+   pool->fence = &pool_fence;
+   pool->kernel = &pool_kernel;
+   pool->validate = NULL;
+   pool->waitIdle = &pool_waitIdle;
+   pool->takeDown = &pool_takedown;
+   return pool;
+}
diff --git a/src/gallium/winsys/dri/intel/ws_dri_slabpool.c b/src/gallium/winsys/dri/intel/ws_dri_slabpool.c
new file mode 100644 (file)
index 0000000..62d82bb
--- /dev/null
@@ -0,0 +1,968 @@
+/**************************************************************************
+ *
+ * Copyright 2006-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ *
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
+ */
+
+#include <stdint.h>
+#include <sys/time.h>
+#include <errno.h>
+#include <unistd.h>
+#include <assert.h>
+#include "ws_dri_bufpool.h"
+#include "ws_dri_fencemgr.h"
+#include "ws_dri_bufmgr.h"
+#include "glthread.h"
+
+#define DRI_SLABPOOL_ALLOC_RETRIES 100
+
+struct _DriSlab;
+
+struct _DriSlabBuffer {
+    int isSlabBuffer;
+    drmBO *bo;
+    struct _DriFenceObject *fence;
+    struct _DriSlab *parent;
+    drmMMListHead head;
+    uint32_t mapCount;
+    uint32_t start;
+    uint32_t fenceType;
+    int unFenced;
+    _glthread_Cond event;
+};
+
+struct _DriKernelBO {
+    int fd;
+    drmBO bo;
+    drmMMListHead timeoutHead;
+    drmMMListHead head;
+    struct timeval timeFreed;
+    uint32_t pageAlignment;
+    void *virtual;
+};
+
+struct _DriSlab{
+    drmMMListHead head;
+    drmMMListHead freeBuffers;
+    uint32_t numBuffers;
+    uint32_t numFree;
+    struct _DriSlabBuffer *buffers;
+    struct _DriSlabSizeHeader *header;
+    struct _DriKernelBO *kbo;
+};
+
+
+struct _DriSlabSizeHeader {
+    drmMMListHead slabs;
+    drmMMListHead freeSlabs;
+    drmMMListHead delayedBuffers;
+    uint32_t numDelayed;
+    struct _DriSlabPool *slabPool;
+    uint32_t bufSize;
+    _glthread_Mutex mutex;
+};
+
+struct _DriFreeSlabManager {
+    struct timeval slabTimeout;
+    struct timeval checkInterval;
+    struct timeval nextCheck;
+    drmMMListHead timeoutList;
+    drmMMListHead unCached;
+    drmMMListHead cached;
+    _glthread_Mutex mutex;
+};
+
+
+struct _DriSlabPool {
+
+    /*
+     * The data of this structure remains constant after
+     * initialization and thus needs no mutex protection.
+     */
+
+    struct _DriFreeSlabManager *fMan;
+    uint64_t proposedFlags;
+    uint64_t validMask;
+    uint32_t *bucketSizes;
+    uint32_t numBuckets;
+    uint32_t pageSize;
+    int fd;
+    int pageAlignment;
+    int maxSlabSize;
+    int desiredNumBuffers;
+    struct _DriSlabSizeHeader *headers;
+};
+
+/*
+ * FIXME: Perhaps arrange timeout slabs in size buckets for fast
+ * retreival??
+ */
+
+
+static inline int
+driTimeAfterEq(struct timeval *arg1, struct timeval *arg2)
+{
+    return ((arg1->tv_sec > arg2->tv_sec) ||
+           ((arg1->tv_sec == arg2->tv_sec) &&
+            (arg1->tv_usec > arg2->tv_usec)));
+}
+
+static inline void
+driTimeAdd(struct timeval *arg, struct timeval *add)
+{
+    unsigned int sec;
+
+    arg->tv_sec += add->tv_sec;
+    arg->tv_usec += add->tv_usec;
+    sec = arg->tv_usec / 1000000;
+    arg->tv_sec += sec;
+    arg->tv_usec -= sec*1000000;
+}
+
+static void
+driFreeKernelBO(struct _DriKernelBO *kbo)
+{
+    if (!kbo)
+       return;
+
+    (void) drmBOUnreference(kbo->fd, &kbo->bo);
+    free(kbo);
+}
+
+
+static void
+driFreeTimeoutKBOsLocked(struct _DriFreeSlabManager *fMan,
+                        struct timeval *time)
+{
+    drmMMListHead *list, *next;
+    struct _DriKernelBO *kbo;
+
+    if (!driTimeAfterEq(time, &fMan->nextCheck))
+       return;
+
+    for (list = fMan->timeoutList.next, next = list->next;
+        list != &fMan->timeoutList;
+        list = next, next = list->next) {
+
+       kbo = DRMLISTENTRY(struct _DriKernelBO, list, timeoutHead);
+
+       if (!driTimeAfterEq(time, &kbo->timeFreed))
+           break;
+
+       DRMLISTDELINIT(&kbo->timeoutHead);
+       DRMLISTDELINIT(&kbo->head);
+       driFreeKernelBO(kbo);
+    }
+
+    fMan->nextCheck = *time;
+    driTimeAdd(&fMan->nextCheck, &fMan->checkInterval);
+}
+
+
+/*
+ * Add a _DriKernelBO to the free slab manager.
+ * This means that it is available for reuse, but if it's not
+ * reused in a while, it will be freed.
+ */
+
+static void
+driSetKernelBOFree(struct _DriFreeSlabManager *fMan,
+                  struct _DriKernelBO *kbo)
+{
+    struct timeval time;
+
+    _glthread_LOCK_MUTEX(fMan->mutex);
+    gettimeofday(&time, NULL);
+    driTimeAdd(&time, &fMan->slabTimeout);
+
+    kbo->timeFreed = time;
+
+    if (kbo->bo.flags & DRM_BO_FLAG_CACHED)
+       DRMLISTADD(&kbo->head, &fMan->cached);
+    else
+       DRMLISTADD(&kbo->head, &fMan->unCached);
+
+    DRMLISTADDTAIL(&kbo->timeoutHead, &fMan->timeoutList);
+    driFreeTimeoutKBOsLocked(fMan, &time);
+
+    _glthread_UNLOCK_MUTEX(fMan->mutex);
+}
+
+/*
+ * Get a _DriKernelBO for us to use as storage for a slab.
+ *
+ */
+
+static struct _DriKernelBO *
+driAllocKernelBO(struct _DriSlabSizeHeader *header)
+
+{
+    struct _DriSlabPool *slabPool = header->slabPool;
+    struct _DriFreeSlabManager *fMan = slabPool->fMan;
+    drmMMListHead *list, *next, *head;
+    uint32_t size = header->bufSize * slabPool->desiredNumBuffers;
+    struct _DriKernelBO *kbo;
+    struct _DriKernelBO *kboTmp;
+    int ret;
+
+    /*
+     * FIXME: We should perhaps allow some variation in slabsize in order
+     * to efficiently reuse slabs.
+     */
+
+    size = (size <= slabPool->maxSlabSize) ? size : slabPool->maxSlabSize;
+    size = (size + slabPool->pageSize - 1) & ~(slabPool->pageSize - 1);
+    _glthread_LOCK_MUTEX(fMan->mutex);
+
+    kbo = NULL;
+
+  retry:
+    head = (slabPool->proposedFlags & DRM_BO_FLAG_CACHED) ?
+       &fMan->cached : &fMan->unCached;
+
+    for (list = head->next, next = list->next;
+        list != head;
+        list = next, next = list->next) {
+
+       kboTmp = DRMLISTENTRY(struct _DriKernelBO, list, head);
+
+       if ((kboTmp->bo.size == size) &&
+           (slabPool->pageAlignment == 0 ||
+            (kboTmp->pageAlignment % slabPool->pageAlignment) == 0)) {
+
+           if (!kbo)
+               kbo = kboTmp;
+
+           if ((kbo->bo.proposedFlags ^ slabPool->proposedFlags) == 0)
+               break;
+
+       }
+    }
+
+    if (kbo) {
+       DRMLISTDELINIT(&kbo->head);
+       DRMLISTDELINIT(&kbo->timeoutHead);
+    }
+
+    _glthread_UNLOCK_MUTEX(fMan->mutex);
+
+    if (kbo) {
+        uint64_t new_mask = kbo->bo.proposedFlags ^ slabPool->proposedFlags;
+
+       ret = 0;
+       if (new_mask) {
+           ret = drmBOSetStatus(kbo->fd, &kbo->bo, slabPool->proposedFlags,
+                                new_mask, DRM_BO_HINT_DONT_FENCE, 0, 0);
+       }
+       if (ret == 0)
+           return kbo;
+
+       driFreeKernelBO(kbo);
+       kbo = NULL;
+       goto retry;
+    }
+
+    kbo = calloc(1, sizeof(struct _DriKernelBO));
+    if (!kbo)
+       return NULL;
+
+    kbo->fd = slabPool->fd;
+    DRMINITLISTHEAD(&kbo->head);
+    DRMINITLISTHEAD(&kbo->timeoutHead);
+    ret = drmBOCreate(kbo->fd, size, slabPool->pageAlignment, NULL,
+                     slabPool->proposedFlags,
+                     DRM_BO_HINT_DONT_FENCE, &kbo->bo);
+    if (ret)
+       goto out_err0;
+
+    ret = drmBOMap(kbo->fd, &kbo->bo,
+                  DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE,
+                  0, &kbo->virtual);
+
+    if (ret)
+       goto out_err1;
+
+    ret = drmBOUnmap(kbo->fd, &kbo->bo);
+    if (ret)
+       goto out_err1;
+
+    return kbo;
+
+  out_err1:
+    drmBOUnreference(kbo->fd, &kbo->bo);
+  out_err0:
+    free(kbo);
+    return NULL;
+}
+
+
+static int
+driAllocSlab(struct _DriSlabSizeHeader *header)
+{
+    struct _DriSlab *slab;
+    struct _DriSlabBuffer *buf;
+    uint32_t numBuffers;
+    int ret;
+    int i;
+
+    slab = calloc(1, sizeof(*slab));
+    if (!slab)
+       return -ENOMEM;
+
+    slab->kbo = driAllocKernelBO(header);
+    if (!slab->kbo) {
+       ret = -ENOMEM;
+       goto out_err0;
+    }
+
+    numBuffers = slab->kbo->bo.size / header->bufSize;
+
+    slab->buffers = calloc(numBuffers, sizeof(*slab->buffers));
+    if (!slab->buffers) {
+       ret = -ENOMEM;
+       goto out_err1;
+    }
+
+    DRMINITLISTHEAD(&slab->head);
+    DRMINITLISTHEAD(&slab->freeBuffers);
+    slab->numBuffers = numBuffers;
+    slab->numFree = 0;
+    slab->header = header;
+
+    buf = slab->buffers;
+    for (i=0; i < numBuffers; ++i) {
+       buf->parent = slab;
+       buf->start = i* header->bufSize;
+       buf->mapCount = 0;
+       buf->isSlabBuffer = 1;
+       _glthread_INIT_COND(buf->event);
+       DRMLISTADDTAIL(&buf->head, &slab->freeBuffers);
+       slab->numFree++;
+       buf++;
+    }
+
+    DRMLISTADDTAIL(&slab->head, &header->slabs);
+
+    return 0;
+
+  out_err1:
+    driSetKernelBOFree(header->slabPool->fMan, slab->kbo);
+    free(slab->buffers);
+  out_err0:
+    free(slab);
+    return ret;
+}
+
+/*
+ * Delete a buffer from the slab header delayed list and put
+ * it on the slab free list.
+ */
+
+static void
+driSlabFreeBufferLocked(struct _DriSlabBuffer *buf)
+{
+    struct _DriSlab *slab = buf->parent;
+    struct _DriSlabSizeHeader *header = slab->header;
+    drmMMListHead *list = &buf->head;
+
+    DRMLISTDEL(list);
+    DRMLISTADDTAIL(list, &slab->freeBuffers);
+    slab->numFree++;
+
+    if (slab->head.next == &slab->head)
+       DRMLISTADDTAIL(&slab->head, &header->slabs);
+
+    if (slab->numFree == slab->numBuffers) {
+       list = &slab->head;
+       DRMLISTDEL(list);
+       DRMLISTADDTAIL(list, &header->freeSlabs);
+    }
+
+    if (header->slabs.next == &header->slabs ||
+       slab->numFree != slab->numBuffers) {
+
+       drmMMListHead *next;
+       struct _DriFreeSlabManager *fMan = header->slabPool->fMan;
+
+       for (list = header->freeSlabs.next, next = list->next;
+            list != &header->freeSlabs;
+            list = next, next = list->next) {
+
+           slab = DRMLISTENTRY(struct _DriSlab, list, head);
+
+           DRMLISTDELINIT(list);
+           driSetKernelBOFree(fMan, slab->kbo);
+           free(slab->buffers);
+           free(slab);
+       }
+    }
+}
+
+static void
+driSlabCheckFreeLocked(struct _DriSlabSizeHeader *header, int wait)
+{
+  drmMMListHead *list, *prev, *first;
+   struct _DriSlabBuffer *buf;
+   struct _DriSlab *slab;
+   int firstWasSignaled = 1;
+   int signaled;
+   int i;
+   int ret;
+
+   /*
+    * Rerun the freeing test if the youngest tested buffer
+    * was signaled, since there might be more idle buffers
+    * in the delay list.
+    */
+
+   while (firstWasSignaled) {
+       firstWasSignaled = 0;
+       signaled = 0;
+       first = header->delayedBuffers.next;
+
+       /* Only examine the oldest 1/3 of delayed buffers:
+       */
+       if (header->numDelayed > 3) {
+          for (i = 0; i < header->numDelayed; i += 3) {
+              first = first->next;
+          }
+       }
+
+       for (list = first, prev = list->prev;
+           list != &header->delayedBuffers;
+           list = prev, prev = list->prev) {
+          buf = DRMLISTENTRY(struct _DriSlabBuffer, list, head);
+          slab = buf->parent;
+
+          if (!signaled) {
+              if (wait) {
+                  ret = driFenceFinish(buf->fence, buf->fenceType, 0);
+                  if (ret)
+                      break;
+                  signaled = 1;
+                  wait = 0;
+              } else {
+                  signaled = driFenceSignaled(buf->fence, buf->fenceType);
+              }
+              if (signaled) {
+                  if (list == first)
+                      firstWasSignaled = 1;
+                  driFenceUnReference(&buf->fence);
+                  header->numDelayed--;
+                  driSlabFreeBufferLocked(buf);
+              }
+          } else if (driFenceSignaledCached(buf->fence, buf->fenceType)) {
+              driFenceUnReference(&buf->fence);
+              header->numDelayed--;
+              driSlabFreeBufferLocked(buf);
+          }
+       }
+   }
+}
+
+
+static struct _DriSlabBuffer *
+driSlabAllocBuffer(struct _DriSlabSizeHeader *header)
+{
+    static struct _DriSlabBuffer *buf;
+    struct _DriSlab *slab;
+    drmMMListHead *list;
+    int count = DRI_SLABPOOL_ALLOC_RETRIES;
+
+    _glthread_LOCK_MUTEX(header->mutex);
+    while(header->slabs.next == &header->slabs && count > 0) {
+        driSlabCheckFreeLocked(header, 0);
+       if (header->slabs.next != &header->slabs)
+         break;
+
+       _glthread_UNLOCK_MUTEX(header->mutex);
+       if (count != DRI_SLABPOOL_ALLOC_RETRIES)
+           usleep(1);
+       _glthread_LOCK_MUTEX(header->mutex);
+       (void) driAllocSlab(header);
+       count--;
+    }
+
+    list = header->slabs.next;
+    if (list == &header->slabs) {
+       _glthread_UNLOCK_MUTEX(header->mutex);
+       return NULL;
+    }
+    slab = DRMLISTENTRY(struct _DriSlab, list, head);
+    if (--slab->numFree == 0)
+       DRMLISTDELINIT(list);
+
+    list = slab->freeBuffers.next;
+    DRMLISTDELINIT(list);
+
+    _glthread_UNLOCK_MUTEX(header->mutex);
+    buf = DRMLISTENTRY(struct _DriSlabBuffer, list, head);
+    return buf;
+}
+
+static void *
+pool_create(struct _DriBufferPool *driPool, unsigned long size,
+           uint64_t flags, unsigned hint, unsigned alignment)
+{
+    struct _DriSlabPool *pool = (struct _DriSlabPool *) driPool->data;
+    struct _DriSlabSizeHeader *header;
+    struct _DriSlabBuffer *buf;
+    void *dummy;
+    int i;
+    int ret;
+
+    /*
+     * FIXME: Check for compatibility.
+     */
+
+    header = pool->headers;
+    for (i=0; i<pool->numBuckets; ++i) {
+      if (header->bufSize >= size)
+       break;
+      header++;
+    }
+
+    if (i < pool->numBuckets)
+       return driSlabAllocBuffer(header);
+
+
+    /*
+     * Fall back to allocate a buffer object directly from DRM.
+     * and wrap it in a driBO structure.
+     */
+
+
+    buf = calloc(1, sizeof(*buf));
+
+    if (!buf)
+       return NULL;
+
+    buf->bo = calloc(1, sizeof(*buf->bo));
+    if (!buf->bo)
+       goto out_err0;
+
+    if (alignment) {
+       if ((alignment < pool->pageSize) && (pool->pageSize % alignment))
+           goto out_err1;
+       if ((alignment > pool->pageSize) && (alignment % pool->pageSize))
+           goto out_err1;
+    }
+
+    ret = drmBOCreate(pool->fd, size, alignment / pool->pageSize, NULL,
+                       flags, hint, buf->bo);
+    if (ret)
+       goto out_err1;
+
+    ret  = drmBOMap(pool->fd, buf->bo, DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE,
+                   0, &dummy);
+    if (ret)
+       goto out_err2;
+
+    ret = drmBOUnmap(pool->fd, buf->bo);
+    if (ret)
+       goto out_err2;
+
+    return buf;
+  out_err2:
+    drmBOUnreference(pool->fd, buf->bo);
+  out_err1:
+    free(buf->bo);
+  out_err0:
+    free(buf);
+    return NULL;
+}
+
+static int
+pool_destroy(struct _DriBufferPool *driPool, void *private)
+{
+    struct _DriSlabBuffer *buf =
+       (struct _DriSlabBuffer *) private;
+    struct _DriSlab *slab;
+    struct _DriSlabSizeHeader *header;
+
+    if (!buf->isSlabBuffer) {
+       struct _DriSlabPool *pool = (struct _DriSlabPool *) driPool->data;
+       int ret;
+
+       ret = drmBOUnreference(pool->fd, buf->bo);
+       free(buf->bo);
+       free(buf);
+       return ret;
+    }
+
+    slab = buf->parent;
+    header = slab->header;
+
+    _glthread_LOCK_MUTEX(header->mutex);
+    buf->unFenced = 0;
+    buf->mapCount = 0;
+
+    if (buf->fence && !driFenceSignaledCached(buf->fence, buf->fenceType)) {
+       DRMLISTADDTAIL(&buf->head, &header->delayedBuffers);
+       header->numDelayed++;
+    } else {
+       if (buf->fence)
+           driFenceUnReference(&buf->fence);
+       driSlabFreeBufferLocked(buf);
+    }
+
+    _glthread_UNLOCK_MUTEX(header->mutex);
+    return 0;
+}
+
+static int
+pool_waitIdle(struct _DriBufferPool *driPool, void *private, 
+             _glthread_Mutex *mutex, int lazy)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+
+   while(buf->unFenced)
+       _glthread_COND_WAIT(buf->event, *mutex);
+
+   if (!buf->fence)
+     return 0;
+
+   driFenceFinish(buf->fence, buf->fenceType, lazy);
+   driFenceUnReference(&buf->fence);
+
+   return 0;
+}
+
+static int
+pool_map(struct _DriBufferPool *pool, void *private, unsigned flags,
+         int hint, _glthread_Mutex *mutex, void **virtual)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+   int busy;
+
+   if (buf->isSlabBuffer)
+       busy = buf->unFenced || (buf->fence && !driFenceSignaledCached(buf->fence, buf->fenceType));
+   else
+       busy = buf->fence && !driFenceSignaled(buf->fence, buf->fenceType);
+
+
+   if (busy) {
+       if (hint & DRM_BO_HINT_DONT_BLOCK)
+          return -EBUSY;
+       else {
+          (void) pool_waitIdle(pool, private, mutex, 0);
+       }
+   }
+
+   ++buf->mapCount;
+   *virtual = (buf->isSlabBuffer) ?
+       (void *) ((uint8_t *) buf->parent->kbo->virtual + buf->start) :
+       (void *) buf->bo->virtual;
+
+   return 0;
+}
+
+static int
+pool_unmap(struct _DriBufferPool *pool, void *private)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+
+   --buf->mapCount;
+   if (buf->mapCount == 0 && buf->isSlabBuffer) 
+       _glthread_COND_BROADCAST(buf->event);
+
+   return 0;
+}
+
+static unsigned long
+pool_offset(struct _DriBufferPool *pool, void *private)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+   struct _DriSlab *slab;
+   struct _DriSlabSizeHeader *header;
+
+   if (!buf->isSlabBuffer) {
+       assert(buf->bo->proposedFlags & DRM_BO_FLAG_NO_MOVE);
+       return buf->bo->offset;
+   }
+
+   slab = buf->parent;
+   header = slab->header;
+
+   (void) header;
+   assert(header->slabPool->proposedFlags & DRM_BO_FLAG_NO_MOVE);
+   return slab->kbo->bo.offset + buf->start;
+}
+
+static unsigned long
+pool_poolOffset(struct _DriBufferPool *pool, void *private)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+
+   return buf->start;
+}
+
+static uint64_t
+pool_flags(struct _DriBufferPool *pool, void *private)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+
+   if (!buf->isSlabBuffer)
+       return buf->bo->flags;
+
+   return buf->parent->kbo->bo.flags;
+}
+
+static unsigned long
+pool_size(struct _DriBufferPool *pool, void *private)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+   if (!buf->isSlabBuffer)
+       return buf->bo->size;
+
+   return buf->parent->header->bufSize;
+}
+
+static int
+pool_fence(struct _DriBufferPool *pool, void *private,
+           struct _DriFenceObject *fence)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+   drmBO *bo;
+
+   if (buf->fence)
+      driFenceUnReference(&buf->fence);
+
+   buf->fence = driFenceReference(fence);
+   bo = (buf->isSlabBuffer) ?
+     &buf->parent->kbo->bo:
+     buf->bo;
+   buf->fenceType = bo->fenceFlags;
+
+   buf->unFenced = 0;
+   _glthread_COND_BROADCAST(buf->event);
+
+   return 0;
+}
+
+static drmBO *
+pool_kernel(struct _DriBufferPool *pool, void *private)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+
+   return (buf->isSlabBuffer) ? &buf->parent->kbo->bo : buf->bo;
+}
+
+static int
+pool_validate(struct _DriBufferPool *pool, void *private, 
+             _glthread_Mutex *mutex)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+
+   if (!buf->isSlabBuffer) 
+       return 0;
+   
+   while(buf->mapCount != 0)
+       _glthread_COND_WAIT(buf->event, *mutex);
+
+   buf->unFenced = 1;
+   return 0;
+}
+
+
+struct _DriFreeSlabManager *
+driInitFreeSlabManager(uint32_t checkIntervalMsec, uint32_t slabTimeoutMsec)
+{
+    struct _DriFreeSlabManager *tmp;
+
+    tmp = calloc(1, sizeof(*tmp));
+    if (!tmp)
+       return NULL;
+
+    _glthread_INIT_MUTEX(tmp->mutex);
+    _glthread_LOCK_MUTEX(tmp->mutex);
+    tmp->slabTimeout.tv_usec = slabTimeoutMsec*1000;
+    tmp->slabTimeout.tv_sec = tmp->slabTimeout.tv_usec / 1000000;
+    tmp->slabTimeout.tv_usec -=  tmp->slabTimeout.tv_sec*1000000;
+
+    tmp->checkInterval.tv_usec = checkIntervalMsec*1000;
+    tmp->checkInterval.tv_sec = tmp->checkInterval.tv_usec / 1000000;
+    tmp->checkInterval.tv_usec -=  tmp->checkInterval.tv_sec*1000000;
+
+    gettimeofday(&tmp->nextCheck, NULL);
+    driTimeAdd(&tmp->nextCheck, &tmp->checkInterval);
+    DRMINITLISTHEAD(&tmp->timeoutList);
+    DRMINITLISTHEAD(&tmp->unCached);
+    DRMINITLISTHEAD(&tmp->cached);
+    _glthread_UNLOCK_MUTEX(tmp->mutex);
+
+    return tmp;
+}
+
+void
+driFinishFreeSlabManager(struct _DriFreeSlabManager *fMan)
+{
+    struct timeval time;
+
+    time = fMan->nextCheck;
+    driTimeAdd(&time, &fMan->checkInterval);
+
+    _glthread_LOCK_MUTEX(fMan->mutex);
+    driFreeTimeoutKBOsLocked(fMan, &time);
+    _glthread_UNLOCK_MUTEX(fMan->mutex);
+
+    assert(fMan->timeoutList.next == &fMan->timeoutList);
+    assert(fMan->unCached.next == &fMan->unCached);
+    assert(fMan->cached.next == &fMan->cached);
+
+    free(fMan);
+}
+
+static void
+driInitSizeHeader(struct _DriSlabPool *pool, uint32_t size,
+                 struct _DriSlabSizeHeader *header)
+{
+    _glthread_INIT_MUTEX(header->mutex);
+    _glthread_LOCK_MUTEX(header->mutex);
+
+    DRMINITLISTHEAD(&header->slabs);
+    DRMINITLISTHEAD(&header->freeSlabs);
+    DRMINITLISTHEAD(&header->delayedBuffers);
+
+    header->numDelayed = 0;
+    header->slabPool = pool;
+    header->bufSize = size;
+
+    _glthread_UNLOCK_MUTEX(header->mutex);
+}
+
+static void
+driFinishSizeHeader(struct _DriSlabSizeHeader *header)
+{
+    drmMMListHead *list, *next;
+    struct _DriSlabBuffer *buf;
+
+    _glthread_LOCK_MUTEX(header->mutex);
+    for (list = header->delayedBuffers.next, next = list->next;
+        list != &header->delayedBuffers;
+        list = next, next = list->next) {
+
+       buf = DRMLISTENTRY(struct _DriSlabBuffer, list , head);
+       if (buf->fence) {
+           (void) driFenceFinish(buf->fence, buf->fenceType, 0);
+           driFenceUnReference(&buf->fence);
+       }
+       header->numDelayed--;
+       driSlabFreeBufferLocked(buf);
+    }
+    _glthread_UNLOCK_MUTEX(header->mutex);
+}
+
+static void
+pool_takedown(struct _DriBufferPool *driPool)
+{
+   struct _DriSlabPool *pool = driPool->data;
+   int i;
+
+   for (i=0; i<pool->numBuckets; ++i) {
+     driFinishSizeHeader(&pool->headers[i]);
+   }
+
+   free(pool->headers);
+   free(pool->bucketSizes);
+   free(pool);
+   free(driPool);
+}
+
+struct _DriBufferPool *
+driSlabPoolInit(int fd, uint64_t flags,
+               uint64_t validMask,
+               uint32_t smallestSize,
+               uint32_t numSizes,
+               uint32_t desiredNumBuffers,
+               uint32_t maxSlabSize,
+               uint32_t pageAlignment,
+               struct _DriFreeSlabManager *fMan)
+{
+    struct _DriBufferPool *driPool;
+    struct _DriSlabPool *pool;
+    uint32_t i;
+
+    driPool = calloc(1, sizeof(*driPool));
+    if (!driPool)
+       return NULL;
+
+    pool = calloc(1, sizeof(*pool));
+    if (!pool)
+       goto out_err0;
+
+    pool->bucketSizes = calloc(numSizes, sizeof(*pool->bucketSizes));
+    if (!pool->bucketSizes)
+       goto out_err1;
+
+    pool->headers = calloc(numSizes, sizeof(*pool->headers));
+    if (!pool->headers)
+       goto out_err2;
+
+    pool->fMan = fMan;
+    pool->proposedFlags = flags;
+    pool->validMask = validMask;
+    pool->numBuckets = numSizes;
+    pool->pageSize = getpagesize();
+    pool->fd = fd;
+    pool->pageAlignment = pageAlignment;
+    pool->maxSlabSize = maxSlabSize;
+    pool->desiredNumBuffers = desiredNumBuffers;
+
+    for (i=0; i<pool->numBuckets; ++i) {
+       pool->bucketSizes[i] = (smallestSize << i);
+       driInitSizeHeader(pool, pool->bucketSizes[i],
+                         &pool->headers[i]);
+    }
+
+    driPool->data = (void *) pool;
+    driPool->map = &pool_map;
+    driPool->unmap = &pool_unmap;
+    driPool->destroy = &pool_destroy;
+    driPool->offset = &pool_offset;
+    driPool->poolOffset = &pool_poolOffset;
+    driPool->flags = &pool_flags;
+    driPool->size = &pool_size;
+    driPool->create = &pool_create;
+    driPool->fence = &pool_fence;
+    driPool->kernel = &pool_kernel;
+    driPool->validate = &pool_validate;
+    driPool->waitIdle = &pool_waitIdle;
+    driPool->takeDown = &pool_takedown;
+
+    return driPool;
+
+  out_err2:
+    free(pool->bucketSizes);
+  out_err1:
+    free(pool);
+  out_err0:
+    free(driPool);
+
+    return NULL;
+}
diff --git a/src/gallium/winsys/egl_drm/Makefile b/src/gallium/winsys/egl_drm/Makefile
new file mode 100644 (file)
index 0000000..4139d9e
--- /dev/null
@@ -0,0 +1,38 @@
+# src/mesa/drivers/egl_drm/Makefile
+
+TOP = ../../../..
+
+include $(TOP)/configs/current
+
+
+
+default: $(TOP)/$(LIB_DIR) subdirs
+
+
+$(TOP)/$(LIB_DIR):
+       -mkdir $(TOP)/$(LIB_DIR)
+
+
+subdirs:
+       @for dir in $(DRI_DIRS) ; do \
+               if [ -d $$dir ] ; then \
+                       (cd $$dir && $(MAKE)) || exit 1 ; \
+               fi \
+       done
+
+
+install:
+       @for dir in $(DRI_DIRS) ; do \
+               if [ -d $$dir ] ; then \
+                       (cd $$dir && $(MAKE) install) || exit 1 ; \
+               fi \
+       done
+
+
+clean:
+       @for dir in $(DRI_DIRS) ; do \
+               if [ -d $$dir ] ; then \
+                       (cd $$dir && $(MAKE) clean) ; \
+               fi \
+       done
+       -rm -f common/*.o
diff --git a/src/gallium/winsys/egl_drm/Makefile.template b/src/gallium/winsys/egl_drm/Makefile.template
new file mode 100644 (file)
index 0000000..3bc1fdd
--- /dev/null
@@ -0,0 +1,116 @@
+# -*-makefile-*-
+
+MESA_MODULES = \
+       $(TOP)/src/mesa/libmesa.a \
+       $(GALLIUM_AUXILIARIES)
+       
+COMMON_GALLIUM_SOURCES = \
+        $(TOP)/src/mesa/drivers/dri/common/utils.c \
+        $(TOP)/src/mesa/drivers/dri/common/vblank.c \
+        $(TOP)/src/mesa/drivers/dri/common/dri_util.c \
+        $(TOP)/src/mesa/drivers/dri/common/xmlconfig.c
+
+COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \
+        $(TOP)/src/mesa/drivers/common/driverfuncs.c \
+        $(TOP)/src/mesa/drivers/dri/common/texmem.c \
+        $(TOP)/src/mesa/drivers/dri/common/drirenderbuffer.c
+
+COMMON_BM_SOURCES = \
+       $(TOP)/src/mesa/drivers/dri/common/dri_bufmgr.c \
+       $(TOP)/src/mesa/drivers/dri/common/dri_drmpool.c
+
+
+ifeq ($(WINDOW_SYSTEM),dri)
+WINOBJ=
+WINLIB=
+INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES)
+
+OBJECTS = \
+       $(C_SOURCES:.c=.o) \
+       $(ASM_SOURCES:.S=.o) 
+
+else
+# miniglx
+WINOBJ=
+WINLIB=-L$(MESA)/src/glx/mini
+MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
+INCLUDES = $(MINIGLX_INCLUDES) \
+          $(SHARED_INCLUDES) \
+          $(PCIACCESS_CFLAGS)
+
+OBJECTS = $(C_SOURCES:.c=.o) \
+         $(MINIGLX_SOURCES:.c=.o) \
+         $(ASM_SOURCES:.S=.o) 
+endif
+
+
+### Include directories
+SHARED_INCLUDES = \
+       -I. \
+       -I$(TOP)/src/mesa/drivers/dri/common \
+       -Iserver \
+       -I$(TOP)/include \
+       -I$(TOP)/include/GL/internal \
+       -I$(TOP)/src/gallium/include \
+       -I$(TOP)/src/gallium/auxiliary \
+       -I$(TOP)/src/gallium/drivers \
+       -I$(TOP)/src/mesa \
+       -I$(TOP)/src/mesa/main \
+       -I$(TOP)/src/mesa/glapi \
+       -I$(TOP)/src/mesa/math \
+       -I$(TOP)/src/mesa/transform \
+       -I$(TOP)/src/mesa/shader \
+       -I$(TOP)/src/mesa/swrast \
+       -I$(TOP)/src/mesa/swrast_setup \
+       -I$(TOP)/src/egl/main \
+       -I$(TOP)/src/egl/drivers/dri \
+       $(LIBDRM_CFLAGS)
+
+
+##### RULES #####
+
+.c.o:
+       $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
+
+.S.o:
+       $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES)  $< -o $@
+
+
+##### TARGETS #####
+
+default: depend symlinks $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME)
+
+
+$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
+       $(TOP)/bin/mklib -noprefix -o $@ \
+               $(OBJECTS) $(PIPE_DRIVERS) $(MESA_MODULES)  $(WINOBJ) $(DRI_LIB_DEPS)
+
+
+$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
+       $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR) 
+
+
+depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
+       rm -f depend
+       touch depend
+       $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) \
+               $(ASM_SOURCES) 2> /dev/null
+
+
+# Emacs tags
+tags:
+       etags `find . -name \*.[ch]` `find ../include`
+
+
+# Remove .o and backup files
+clean:
+       -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS)
+       -rm -f depend depend.bak
+
+
+install: $(LIBNAME)
+       $(INSTALL) -d $(DRI_DRIVER_INSTALL_DIR)
+       $(INSTALL) -m 755 $(LIBNAME) $(DRI_DRIVER_INSTALL_DIR)
+
+
+include depend
diff --git a/src/gallium/winsys/egl_drm/intel/Makefile b/src/gallium/winsys/egl_drm/intel/Makefile
new file mode 100644 (file)
index 0000000..5778ba7
--- /dev/null
@@ -0,0 +1,40 @@
+
+TOP = ../../../../..
+include $(TOP)/configs/current
+
+LIBNAME = EGL_i915.so
+
+PIPE_DRIVERS = \
+       $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
+       $(TOP)/src/gallium/drivers/i915simple/libi915simple.a
+
+DRIVER_SOURCES = \
+       intel_winsys_pipe.c \
+       intel_winsys_softpipe.c \
+       intel_winsys_i915.c \
+       intel_batchbuffer.c \
+       intel_swapbuffers.c \
+       intel_context.c \
+       intel_lock.c \
+       intel_screen.c \
+       ws_dri_bufmgr.c \
+       ws_dri_drmpool.c \
+       ws_dri_fencemgr.c \
+       ws_dri_mallocpool.c \
+       ws_dri_slabpool.c \
+       intel_egl.c
+
+C_SOURCES = \
+       $(COMMON_GALLIUM_SOURCES) \
+       $(DRIVER_SOURCES)
+
+ASM_SOURCES = 
+
+DRIVER_DEFINES = -I$(TOP)/src/mesa/drivers/dri/intel $(shell pkg-config libdrm --atleast-version=2.3.1 \
+                               && echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP")
+
+include ../Makefile.template
+
+intel_tex_layout.o: $(TOP)/src/mesa/drivers/dri/intel/intel_tex_layout.c
+
+symlinks:
diff --git a/src/gallium/winsys/egl_drm/intel/SConscript b/src/gallium/winsys/egl_drm/intel/SConscript
new file mode 100644 (file)
index 0000000..0ad19d4
--- /dev/null
@@ -0,0 +1,39 @@
+Import('*')
+
+env = drienv.Clone()
+
+env.Append(CPPPATH = [
+       '../intel',
+       'server'
+])
+
+#MINIGLX_SOURCES = server/intel_dri.c
+
+DRIVER_SOURCES = [
+       'intel_winsys_pipe.c',
+       'intel_winsys_softpipe.c',
+       'intel_winsys_i915.c',
+       'intel_batchbuffer.c',
+       'intel_swapbuffers.c',
+       'intel_context.c',
+       'intel_lock.c',
+       'intel_screen.c',
+       'intel_batchpool.c',
+]
+
+sources = \
+       COMMON_GALLIUM_SOURCES + \
+       COMMON_BM_SOURCES + \
+       DRIVER_SOURCES
+
+drivers = [
+       softpipe,
+       i915simple
+]
+
+# TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
+env.SharedLibrary(
+       target ='i915tex_dri.so',
+       source = sources,
+       LIBS = drivers + mesa + auxiliaries + env['LIBS'],
+)
\ No newline at end of file
diff --git a/src/gallium/winsys/egl_drm/intel/intel_batchbuffer.c b/src/gallium/winsys/egl_drm/intel/intel_batchbuffer.c
new file mode 100644 (file)
index 0000000..7ffa05a
--- /dev/null
@@ -0,0 +1,465 @@
+/**************************************************************************
+ * 
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * 
+ **************************************************************************/
+
+#include "intel_batchbuffer.h"
+#include "intel_context.h"
+#include "intel_egl.h"
+
+#include <errno.h>
+
+#if 0
+static void
+intel_dump_batchbuffer(GLuint offset, GLuint * ptr, GLuint count)
+{
+   int i;
+   fprintf(stderr, "\n\n\nSTART BATCH (%d dwords):\n", count / 4);
+   for (i = 0; i < count / 4; i += 4)
+      fprintf(stderr, "0x%x:\t0x%08x 0x%08x 0x%08x 0x%08x\n",
+              offset + i * 4, ptr[i], ptr[i + 1], ptr[i + 2], ptr[i + 3]);
+   fprintf(stderr, "END BATCH\n\n\n");
+}
+#endif
+
+static void 
+intel_realloc_relocs(struct intel_batchbuffer *batch, int num_relocs)
+{
+    unsigned long size = num_relocs * I915_RELOC0_STRIDE + I915_RELOC_HEADER;
+    
+    size *= sizeof(uint32_t);
+    batch->reloc = realloc(batch->reloc, size);
+    batch->reloc_size = num_relocs;
+}
+
+
+void
+intel_batchbuffer_reset(struct intel_batchbuffer *batch)
+{
+   /*
+    * Get a new, free batchbuffer.
+    */
+   drmBO *bo;
+   struct drm_bo_info_req *req;
+   int ret;
+
+   driBOUnrefUserList(batch->list);
+   driBOResetList(batch->list);
+
+   batch->size = 4096; // ZZZ JB batch->intel->intelScreen->maxBatchSize;
+   ret = driBOData(batch->buffer, batch->size, NULL, NULL, 0);
+   assert(!ret);
+
+   /*
+    * Add the batchbuffer to the validate list.
+    */
+
+   driBOAddListItem(batch->list, batch->buffer,
+                   DRM_BO_FLAG_EXE | DRM_BO_FLAG_MEM_TT,
+                   DRM_BO_FLAG_EXE | DRM_BO_MASK_MEM,
+                   &batch->dest_location, &batch->node);
+
+   req = &batch->node->bo_arg.d.req.bo_req;
+
+   /*
+    * Set up information needed for us to make relocations
+    * relative to the underlying drm buffer objects.
+    */
+
+   driReadLockKernelBO();
+   bo = driBOKernel(batch->buffer);
+   req->presumed_offset = (uint64_t) bo->offset;
+   req->hint = DRM_BO_HINT_PRESUMED_OFFSET;
+   batch->drmBOVirtual = (uint8_t *) bo->virtual;
+   driReadUnlockKernelBO();
+
+   /*
+    * Adjust the relocation buffer size.
+    */
+
+   if (batch->reloc_size > INTEL_MAX_RELOCS ||
+       batch->reloc == NULL) 
+     intel_realloc_relocs(batch, INTEL_DEFAULT_RELOCS);
+   
+   assert(batch->reloc != NULL);
+   batch->reloc[0] = 0; /* No relocs yet. */
+   batch->reloc[1] = 1; /* Reloc type 1 */
+   batch->reloc[2] = 0; /* Only a single relocation list. */
+   batch->reloc[3] = 0; /* Only a single relocation list. */
+
+   batch->map = driBOMap(batch->buffer, DRM_BO_FLAG_WRITE, 0);
+   batch->poolOffset = driBOPoolOffset(batch->buffer);
+   batch->ptr = batch->map;
+   batch->dirty_state = ~0;
+   batch->nr_relocs = 0;
+   batch->flags = 0;
+   batch->id = 0;//batch->intel->intelScreen->batch_id++;
+}
+
+/*======================================================================
+ * Public functions
+ */
+struct intel_batchbuffer *
+intel_batchbuffer_alloc(struct intel_screen *intel_screen)
+{
+   struct intel_batchbuffer *batch = calloc(sizeof(*batch), 1);
+
+   batch->intel_screen = intel_screen;
+
+   driGenBuffers(intel_screen->batchPool, "batchbuffer", 1,
+                 &batch->buffer, 4096,
+                 DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_EXE, 0);
+   batch->last_fence = NULL;
+   batch->list = driBOCreateList(20);
+   batch->reloc = NULL;
+   intel_batchbuffer_reset(batch);
+   return batch;
+}
+
+void
+intel_batchbuffer_free(struct intel_batchbuffer *batch)
+{
+   if (batch->last_fence) {
+      driFenceFinish(batch->last_fence,
+                    DRM_FENCE_TYPE_EXE, GL_FALSE);
+      driFenceUnReference(&batch->last_fence);
+   }
+   if (batch->map) {
+      driBOUnmap(batch->buffer);
+      batch->map = NULL;
+   }
+   driBOUnReference(batch->buffer);
+   driBOFreeList(batch->list);
+   if (batch->reloc)
+       free(batch->reloc);
+   batch->buffer = NULL;
+   free(batch);
+}
+
+void
+intel_offset_relocation(struct intel_batchbuffer *batch,
+                       unsigned pre_add,
+                       struct _DriBufferObject *driBO,
+                       uint64_t val_flags,
+                       uint64_t val_mask)
+{
+    int itemLoc;
+    struct _drmBONode *node;
+    uint32_t *reloc;
+    struct drm_bo_info_req *req;
+    
+    driBOAddListItem(batch->list, driBO, val_flags, val_mask,
+                    &itemLoc, &node);
+    req = &node->bo_arg.d.req.bo_req;
+
+    if (!(req->hint &  DRM_BO_HINT_PRESUMED_OFFSET)) {
+
+       /*
+        * Stop other threads from tampering with the underlying
+        * drmBO while we're reading its offset.
+        */
+
+       driReadLockKernelBO();
+       req->presumed_offset = (uint64_t) driBOKernel(driBO)->offset;
+       driReadUnlockKernelBO();
+       req->hint = DRM_BO_HINT_PRESUMED_OFFSET;
+    }
+    
+    pre_add += driBOPoolOffset(driBO);
+
+    if (batch->nr_relocs == batch->reloc_size)
+       intel_realloc_relocs(batch, batch->reloc_size * 2);
+
+    reloc = batch->reloc + 
+       (I915_RELOC_HEADER + batch->nr_relocs * I915_RELOC0_STRIDE);
+
+    reloc[0] = ((uint8_t *)batch->ptr - batch->drmBOVirtual);
+    intel_batchbuffer_emit_dword(batch, req->presumed_offset + pre_add);
+    reloc[1] = pre_add;
+    reloc[2] = itemLoc;
+    reloc[3] = batch->dest_location;
+    batch->nr_relocs++;
+}
+
+static void
+i915_drm_copy_reply(const struct drm_bo_info_rep * rep, drmBO * buf)
+{
+    buf->handle = rep->handle;
+    buf->flags = rep->flags;
+    buf->size = rep->size;
+    buf->offset = rep->offset;
+    buf->mapHandle = rep->arg_handle;
+    buf->proposedFlags = rep->proposed_flags;
+    buf->start = rep->buffer_start;
+    buf->fenceFlags = rep->fence_flags;
+    buf->replyFlags = rep->rep_flags;
+    buf->pageAlignment = rep->page_alignment;
+}
+
+static int 
+i915_execbuf(struct intel_batchbuffer *batch,
+            GLuint used,
+            GLboolean ignore_cliprects,
+            drmBOList *list,
+            struct drm_i915_execbuffer *ea)
+{
+   struct intel_screen *intel_screen = batch->intel_screen;
+   drmBONode *node;
+   drmMMListHead *l;
+   struct drm_i915_op_arg *arg, *first;
+   struct drm_bo_op_req *req;
+   struct drm_bo_info_rep *rep;
+   uint64_t *prevNext = NULL;
+   drmBO *buf;
+   int ret = 0;
+   uint32_t count = 0;
+
+   first = NULL;
+   for (l = list->list.next; l != &list->list; l = l->next) {
+      node = DRMLISTENTRY(drmBONode, l, head);
+      
+      arg = &node->bo_arg;
+      req = &arg->d.req;
+      
+      if (!first)
+        first = arg;
+      
+      if (prevNext)
+        *prevNext = (unsigned long)arg;
+      
+      prevNext = &arg->next;
+      req->bo_req.handle = node->buf->handle;
+      req->op = drm_bo_validate;
+      req->bo_req.flags = node->arg0;
+      req->bo_req.mask = node->arg1;
+      req->bo_req.hint |= 0;
+      count++;
+   }
+
+   memset(ea, 0, sizeof(*ea));
+   ea->num_buffers = count;
+   ea->batch.start = batch->poolOffset;
+   ea->batch.used = used;
+#if 0 /* ZZZ JB: no cliprects used */
+   ea->batch.cliprects = intel->pClipRects;
+   ea->batch.num_cliprects = ignore_cliprects ? 0 : intel->numClipRects;
+   ea->batch.DR1 = 0;
+   ea->batch.DR4 = 0;((((GLuint) intel->drawX) & 0xffff) |
+                  (((GLuint) intel->drawY) << 16));
+#else
+   ea->batch.cliprects = NULL;
+   ea->batch.num_cliprects = 0;
+   ea->batch.DR1 = 0;
+   ea->batch.DR4 = 0;
+#endif
+   ea->fence_arg.flags = DRM_I915_FENCE_FLAG_FLUSHED;
+   ea->ops_list = (unsigned long) first;
+   first->reloc_ptr = (unsigned long) batch->reloc;
+   batch->reloc[0] = batch->nr_relocs;
+
+   //return -EFAULT;
+   do {
+      ret = drmCommandWriteRead(intel_screen->device->drmFD, DRM_I915_EXECBUFFER, ea,
+                               sizeof(*ea));
+   } while (ret == -EAGAIN);
+
+   if (ret != 0) {
+      printf("%s somebody set us up the bomb\n", __FUNCTION__);
+      return ret;
+   }
+
+   for (l = list->list.next; l != &list->list; l = l->next) {
+      node = DRMLISTENTRY(drmBONode, l, head);
+      arg = &node->bo_arg;
+      rep = &arg->d.rep.bo_info;
+
+      if (!arg->handled) {
+        return -EFAULT;
+      }
+      if (arg->d.rep.ret)
+        return arg->d.rep.ret;
+
+      buf = node->buf;
+      i915_drm_copy_reply(rep, buf);
+   }
+   return 0;
+}
+
+/* TODO: Push this whole function into bufmgr.
+ */
+static struct _DriFenceObject *
+do_flush_locked(struct intel_batchbuffer *batch,
+                GLuint used,
+                GLboolean ignore_cliprects, GLboolean allow_unlock)
+{
+   struct intel_screen *intel_screen = batch->intel_screen;
+   struct _DriFenceObject *fo;
+   drmFence fence;
+   drmBOList *boList;
+   struct drm_i915_execbuffer ea;
+   int ret = 0;
+
+   driBOValidateUserList(batch->list);
+   boList = driGetdrmBOList(batch->list);
+
+#if 0 /* ZZZ JB Allways run */
+   if (!(intel->numClipRects == 0 && !ignore_cliprects)) {
+#else
+   if (1) {
+#endif
+      ret = i915_execbuf(batch, used, ignore_cliprects, boList, &ea);
+   } else {
+     driPutdrmBOList(batch->list);
+     fo = NULL;
+     goto out;
+   }
+   driPutdrmBOList(batch->list);
+   if (ret)
+      abort();
+
+   if (ea.fence_arg.error != 0) {
+
+     /*
+      * The hardware has been idled by the kernel.
+      * Don't fence the driBOs.
+      */
+
+       if (batch->last_fence)
+          driFenceUnReference(&batch->last_fence);
+#if 0 /* ZZZ JB: no _mesa_* funcs in gallium */
+       _mesa_printf("fence error\n");
+#endif
+       batch->last_fence = NULL;
+       fo = NULL;
+       goto out;
+   }
+
+   fence.handle = ea.fence_arg.handle;
+   fence.fence_class = ea.fence_arg.fence_class;
+   fence.type = ea.fence_arg.type;
+   fence.flags = ea.fence_arg.flags;
+   fence.signaled = ea.fence_arg.signaled;
+
+   fo = driBOFenceUserList(intel_screen->mgr, batch->list,
+                          "SuperFence", &fence);
+
+   if (driFenceType(fo) & DRM_I915_FENCE_TYPE_RW) {
+       if (batch->last_fence)
+          driFenceUnReference(&batch->last_fence);
+   /*
+       * FIXME: Context last fence??
+       */
+       batch->last_fence = fo;
+       driFenceReference(fo);
+   } 
+ out:
+#if 0 /* ZZZ JB: fix this */
+   intel->vtbl.lost_hardware(intel);
+#else
+#endif
+   return fo;
+}
+
+
+struct _DriFenceObject *
+intel_batchbuffer_flush(struct intel_batchbuffer *batch)
+{
+   //struct intel_context *intel = batch->intel;
+   GLuint used = batch->ptr - batch->map;
+   //GLboolean was_locked = 1;
+   struct _DriFenceObject *fence;
+
+   if (used == 0) {
+      driFenceReference(batch->last_fence);
+      return batch->last_fence;
+   }
+
+   /* Add the MI_BATCH_BUFFER_END.  Always add an MI_FLUSH - this is a
+    * performance drain that we would like to avoid.
+    */
+#if 0 /* ZZZ JB: what should we do here? */
+   if (used & 4) {
+      ((int *) batch->ptr)[0] = intel->vtbl.flush_cmd();
+      ((int *) batch->ptr)[1] = 0;
+      ((int *) batch->ptr)[2] = MI_BATCH_BUFFER_END;
+      used += 12;
+   }
+   else {
+      ((int *) batch->ptr)[0] = intel->vtbl.flush_cmd();
+      ((int *) batch->ptr)[1] = MI_BATCH_BUFFER_END;
+      used += 8;
+   }
+#else
+   if (used & 4) {
+      ((int *) batch->ptr)[0] = ((0<<29)|(4<<23)); // MI_FLUSH;
+      ((int *) batch->ptr)[1] = 0;
+      ((int *) batch->ptr)[2] = (0xA<<23); // MI_BATCH_BUFFER_END;
+      used += 12;
+   }
+   else {
+      ((int *) batch->ptr)[0] = ((0<<29)|(4<<23)); // MI_FLUSH;
+      ((int *) batch->ptr)[1] = (0xA<<23); // MI_BATCH_BUFFER_END;
+      used += 8;
+   }
+#endif
+   driBOUnmap(batch->buffer);
+   batch->ptr = NULL;
+   batch->map = NULL;
+
+   /* TODO: Just pass the relocation list and dma buffer up to the
+    * kernel.
+    */
+/*   if (!was_locked)
+      LOCK_HARDWARE(intel);*/
+
+   fence = do_flush_locked(batch, used, !(batch->flags & INTEL_BATCH_CLIPRECTS),
+                          GL_FALSE);
+
+/*   if (!was_locked)
+      UNLOCK_HARDWARE(intel);*/
+
+   /* Reset the buffer:
+    */
+   intel_batchbuffer_reset(batch);
+   return fence;
+}
+
+void
+intel_batchbuffer_finish(struct intel_batchbuffer *batch)
+{
+   struct _DriFenceObject *fence = intel_batchbuffer_flush(batch);
+   driFenceFinish(fence, driFenceType(fence), GL_FALSE);
+   driFenceUnReference(&fence);
+}
+
+void
+intel_batchbuffer_data(struct intel_batchbuffer *batch,
+                       const void *data, GLuint bytes, GLuint flags)
+{
+   assert((bytes & 3) == 0);
+   intel_batchbuffer_require_space(batch, bytes, flags);
+   memcpy(batch->ptr, data, bytes);
+   batch->ptr += bytes;
+}
diff --git a/src/gallium/winsys/egl_drm/intel/intel_batchbuffer.h b/src/gallium/winsys/egl_drm/intel/intel_batchbuffer.h
new file mode 100644 (file)
index 0000000..6d35cf8
--- /dev/null
@@ -0,0 +1,133 @@
+#ifndef INTEL_BATCHBUFFER_H
+#define INTEL_BATCHBUFFER_H
+
+#include "mtypes.h"
+#include "ws_dri_bufmgr.h"
+
+struct intel_screen;
+
+#define BATCH_SZ 16384
+#define BATCH_RESERVED 16
+
+#define INTEL_DEFAULT_RELOCS 100
+#define INTEL_MAX_RELOCS 400
+
+#define INTEL_BATCH_NO_CLIPRECTS 0x1
+#define INTEL_BATCH_CLIPRECTS    0x2
+
+struct intel_batchbuffer
+{
+   struct bufmgr *bm;
+   struct intel_screen *intel_screen;
+
+   struct _DriBufferObject *buffer;
+   struct _DriFenceObject *last_fence;
+   GLuint flags;
+
+   struct _DriBufferList *list;
+   GLuint list_count;
+   GLubyte *map;
+   GLubyte *ptr;
+
+   uint32_t *reloc;
+   GLuint reloc_size;
+   GLuint nr_relocs;
+
+   GLuint size;
+
+   GLuint dirty_state;
+   GLuint id;
+
+  uint32_t poolOffset;
+  uint8_t *drmBOVirtual;
+  struct _drmBONode *node; /* Validation list node for this buffer */
+  int dest_location;     /* Validation list sequence for this buffer */
+};
+
+struct intel_batchbuffer *intel_batchbuffer_alloc(struct intel_screen
+                                                  *intel);
+
+void intel_batchbuffer_free(struct intel_batchbuffer *batch);
+
+
+void intel_batchbuffer_finish(struct intel_batchbuffer *batch);
+
+struct _DriFenceObject *intel_batchbuffer_flush(struct intel_batchbuffer
+                                                *batch);
+
+void intel_batchbuffer_reset(struct intel_batchbuffer *batch);
+
+
+/* Unlike bmBufferData, this currently requires the buffer be mapped.
+ * Consider it a convenience function wrapping multple
+ * intel_buffer_dword() calls.
+ */
+void intel_batchbuffer_data(struct intel_batchbuffer *batch,
+                            const void *data, GLuint bytes, GLuint flags);
+
+void intel_batchbuffer_release_space(struct intel_batchbuffer *batch,
+                                     GLuint bytes);
+
+void
+intel_offset_relocation(struct intel_batchbuffer *batch,
+                       unsigned pre_add,
+                       struct _DriBufferObject *driBO,
+                       uint64_t val_flags,
+                       uint64_t val_mask);
+
+/* Inline functions - might actually be better off with these
+ * non-inlined.  Certainly better off switching all command packets to
+ * be passed as structs rather than dwords, but that's a little bit of
+ * work...
+ */
+static INLINE GLuint
+intel_batchbuffer_space(struct intel_batchbuffer *batch)
+{
+   return (batch->size - BATCH_RESERVED) - (batch->ptr - batch->map);
+}
+
+
+static INLINE void
+intel_batchbuffer_emit_dword(struct intel_batchbuffer *batch, GLuint dword)
+{
+   assert(batch->map);
+   assert(intel_batchbuffer_space(batch) >= 4);
+   *(GLuint *) (batch->ptr) = dword;
+   batch->ptr += 4;
+}
+
+static INLINE void
+intel_batchbuffer_require_space(struct intel_batchbuffer *batch,
+                                GLuint sz, GLuint flags)
+{
+   struct _DriFenceObject *fence;
+
+   assert(sz < batch->size - 8);
+   if (intel_batchbuffer_space(batch) < sz ||
+       (batch->flags != 0 && flags != 0 && batch->flags != flags)) {
+      fence = intel_batchbuffer_flush(batch);
+      driFenceUnReference(&fence);
+   }
+
+   batch->flags |= flags;
+}
+
+/* Here are the crusty old macros, to be removed:
+ */
+#define BATCH_LOCALS
+
+#define BEGIN_BATCH(n, flags) do {                             \
+   assert(!intel->prim.flush);                                 \
+   intel_batchbuffer_require_space(intel->batch, (n)*4, flags);        \
+} while (0)
+
+#define OUT_BATCH(d)  intel_batchbuffer_emit_dword(intel->batch, d)
+
+#define OUT_RELOC(buf,flags,mask,delta) do {                           \
+   assert((delta) >= 0);                                                       \
+   intel_offset_relocation(intel->batch, delta, buf, flags, mask); \
+} while (0)
+
+#define ADVANCE_BATCH() do { } while(0)
+
+#endif
diff --git a/src/gallium/winsys/egl_drm/intel/intel_context.c b/src/gallium/winsys/egl_drm/intel/intel_context.c
new file mode 100644 (file)
index 0000000..394a40d
--- /dev/null
@@ -0,0 +1,366 @@
+/**************************************************************************
+ * 
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * 
+ **************************************************************************/
+
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_swapbuffers.h"
+#include "intel_winsys.h"
+#include "intel_batchbuffer.h"
+
+#include "state_tracker/st_public.h"
+#include "pipe/p_defines.h"
+#include "pipe/p_context.h"
+#include "intel_egl.h"
+#include "utils.h"
+
+#ifdef DEBUG
+int __intel_debug = 0;
+#endif
+
+
+#define need_GL_ARB_multisample
+#define need_GL_ARB_point_parameters
+#define need_GL_ARB_texture_compression
+#define need_GL_ARB_vertex_buffer_object
+#define need_GL_ARB_vertex_program
+#define need_GL_ARB_window_pos
+#define need_GL_EXT_blend_color
+#define need_GL_EXT_blend_equation_separate
+#define need_GL_EXT_blend_func_separate
+#define need_GL_EXT_blend_minmax
+#define need_GL_EXT_cull_vertex
+#define need_GL_EXT_fog_coord
+#define need_GL_EXT_framebuffer_object
+#define need_GL_EXT_multi_draw_arrays
+#define need_GL_EXT_secondary_color
+#define need_GL_NV_vertex_program
+#include "extension_helper.h"
+
+
+/**
+ * Extension strings exported by the intel driver.
+ *
+ * \note
+ * It appears that ARB_texture_env_crossbar has "disappeared" compared to the
+ * old i830-specific driver.
+ */
+const struct dri_extension card_extensions[] = {
+   {"GL_ARB_multisample", GL_ARB_multisample_functions},
+   {"GL_ARB_multitexture", NULL},
+   {"GL_ARB_point_parameters", GL_ARB_point_parameters_functions},
+   {"GL_ARB_texture_border_clamp", NULL},
+   {"GL_ARB_texture_compression", GL_ARB_texture_compression_functions},
+   {"GL_ARB_texture_cube_map", NULL},
+   {"GL_ARB_texture_env_add", NULL},
+   {"GL_ARB_texture_env_combine", NULL},
+   {"GL_ARB_texture_env_dot3", NULL},
+   {"GL_ARB_texture_mirrored_repeat", NULL},
+   {"GL_ARB_texture_rectangle", NULL},
+   {"GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions},
+   {"GL_ARB_pixel_buffer_object", NULL},
+   {"GL_ARB_vertex_program", GL_ARB_vertex_program_functions},
+   {"GL_ARB_window_pos", GL_ARB_window_pos_functions},
+   {"GL_EXT_blend_color", GL_EXT_blend_color_functions},
+   {"GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions},
+   {"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions},
+   {"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions},
+   {"GL_EXT_blend_subtract", NULL},
+   {"GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions},
+   {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions},
+   {"GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions},
+   {"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions},
+   {"GL_EXT_packed_depth_stencil", NULL},
+   {"GL_EXT_pixel_buffer_object", NULL},
+   {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions},
+   {"GL_EXT_stencil_wrap", NULL},
+   {"GL_EXT_texture_edge_clamp", NULL},
+   {"GL_EXT_texture_env_combine", NULL},
+   {"GL_EXT_texture_env_dot3", NULL},
+   {"GL_EXT_texture_filter_anisotropic", NULL},
+   {"GL_EXT_texture_lod_bias", NULL},
+   {"GL_3DFX_texture_compression_FXT1", NULL},
+   {"GL_APPLE_client_storage", NULL},
+   {"GL_MESA_pack_invert", NULL},
+   {"GL_MESA_ycbcr_texture", NULL},
+   {"GL_NV_blend_square", NULL},
+   {"GL_NV_vertex_program", GL_NV_vertex_program_functions},
+   {"GL_NV_vertex_program1_1", NULL},
+   {"GL_SGIS_generate_mipmap", NULL },
+   {NULL, NULL}
+};
+
+int
+intel_create_context(struct egl_drm_context *eglCon, const __GLcontextModes *visual, void *sharedContextPrivate)
+{
+       struct intel_context *iCon = CALLOC_STRUCT(intel_context);
+       struct intel_screen *iScrn = (struct intel_screen *)eglCon->device->priv;
+       struct pipe_context *pipe;
+       struct st_context *st_share = NULL;
+
+       eglCon->priv = iCon;
+
+       iCon->intel_screen = iScrn;
+       iCon->egl_context = eglCon;
+       iCon->egl_device = eglCon->device;
+
+       iCon->batch = intel_batchbuffer_alloc(iScrn);
+       iCon->last_swap_fence = NULL;
+       iCon->first_swap_fence = NULL;
+
+       pipe = intel_create_i915simple(iCon, iScrn->winsys);
+//     pipe = intel_create_softpipe(iCon, iScrn->winsys);
+
+       pipe->priv = iCon;
+
+       iCon->st = st_create_context(pipe, visual, st_share);
+       return TRUE;
+}
+
+void
+intel_make_current(struct egl_drm_context *context, struct egl_drm_drawable *draw, struct egl_drm_drawable *read)
+{
+       if (context) {
+               struct intel_context *intel = (struct intel_context *)context->priv;
+               struct intel_framebuffer *draw_fb = (struct intel_framebuffer *)draw->priv;
+               struct intel_framebuffer *read_fb = (struct intel_framebuffer *)read->priv;
+
+               assert(draw_fb->stfb);
+               assert(read_fb->stfb);
+
+               st_make_current(intel->st, draw_fb->stfb, read_fb->stfb);
+
+               intel->egl_drawable = draw;
+
+               st_resize_framebuffer(draw_fb->stfb, draw->w, draw->h);
+
+               if (draw != read)
+                       st_resize_framebuffer(read_fb->stfb, read->w, read->h);
+
+               //intelUpdateWindowSize(driDrawPriv);
+       } else {
+               st_make_current(NULL, NULL, NULL);
+       }
+}
+
+void
+intel_bind_frontbuffer(struct egl_drm_drawable *draw, struct egl_drm_frontbuffer *front)
+{
+       struct intel_screen *intelScreen = (struct intel_screen *)draw->device->priv;
+       struct intel_framebuffer *draw_fb = (struct intel_framebuffer *)draw->priv;
+
+       driBOUnReference(draw_fb->front_buffer);
+       draw_fb->front_buffer = NULL;
+       draw_fb->front = NULL;
+
+       /* to unbind just call this function with front == NULL */
+       if (!front)
+               return;
+
+       draw_fb->front = front;
+
+       driGenBuffers(intelScreen->staticPool, "front", 1, &draw_fb->front_buffer, 0, 0, 0);
+       driBOSetReferenced(draw_fb->front_buffer, front->handle);
+
+       st_resize_framebuffer(draw_fb->stfb, draw->w, draw->h);
+}
+
+#if 0
+GLboolean
+intelCreateContext(const __GLcontextModes * visual,
+                   __DRIcontextPrivate * driContextPriv,
+                   void *sharedContextPrivate)
+{
+   struct intel_context *intel = CALLOC_STRUCT(intel_context);
+   __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
+   struct intel_screen *intelScreen = intel_screen(sPriv);
+   drmI830Sarea *saPriv = intelScreen->sarea;
+   int fthrottle_mode;
+   GLboolean havePools;
+   struct pipe_context *pipe;
+   struct st_context *st_share = NULL;
+
+   if (sharedContextPrivate) {
+      st_share = ((struct intel_context *) sharedContextPrivate)->st;
+   }
+
+   driContextPriv->driverPrivate = intel;
+   intel->intelScreen = intelScreen;
+   intel->driScreen = sPriv;
+   intel->sarea = saPriv;
+
+   driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache,
+                       intel->driScreen->myNum, "i915");
+
+
+   /*
+    * memory pools
+    */
+   DRM_LIGHT_LOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext);
+   // ZZZ JB should be per screen and not be done per context
+   havePools = intelCreatePools(sPriv);
+   DRM_UNLOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext);
+   if (!havePools)
+      return GL_FALSE;
+
+
+   /* Dri stuff */
+   intel->hHWContext = driContextPriv->hHWContext;
+   intel->driFd = sPriv->fd;
+   intel->driHwLock = (drmLock *) & sPriv->pSAREA->lock;
+
+   fthrottle_mode = driQueryOptioni(&intel->optionCache, "fthrottle_mode");
+   intel->iw.irq_seq = -1;
+   intel->irqsEmitted = 0;
+
+   intel->batch = intel_batchbuffer_alloc(intel);
+   intel->last_swap_fence = NULL;
+   intel->first_swap_fence = NULL;
+
+#ifdef DEBUG
+   __intel_debug = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
+#endif
+
+   /*
+    * Pipe-related setup
+    */
+   if (getenv("INTEL_SP")) {
+      /* use softpipe driver instead of hw */
+      pipe = intel_create_softpipe( intel, intelScreen->winsys );
+   }
+   else {
+      switch (intel->intelScreen->deviceID) {
+      case PCI_CHIP_I945_G:
+      case PCI_CHIP_I945_GM:
+      case PCI_CHIP_I945_GME:
+      case PCI_CHIP_G33_G:
+      case PCI_CHIP_Q33_G:
+      case PCI_CHIP_Q35_G:
+      case PCI_CHIP_I915_G:
+      case PCI_CHIP_I915_GM:
+        pipe = intel_create_i915simple( intel, intelScreen->winsys );
+        break;
+      default:
+        fprintf(stderr, "Unknown PCIID %x in %s, using software driver\n", 
+                 intel->intelScreen->deviceID, __FUNCTION__);
+
+        pipe = intel_create_softpipe( intel, intelScreen->winsys );
+        break;
+      }
+   }
+
+   pipe->priv = intel;
+
+   intel->st = st_create_context(pipe, visual, st_share);
+
+   return GL_TRUE;
+}
+
+
+void
+intelDestroyContext(__DRIcontextPrivate * driContextPriv)
+{
+   struct intel_context *intel = intel_context(driContextPriv);
+
+   assert(intel);               /* should never be null */
+   if (intel) {
+      st_finish(intel->st);
+
+      intel_batchbuffer_free(intel->batch);
+
+      if (intel->last_swap_fence) {
+        driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE);
+        driFenceUnReference(&intel->last_swap_fence);
+        intel->last_swap_fence = NULL;
+      }
+      if (intel->first_swap_fence) {
+        driFenceFinish(intel->first_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE);
+        driFenceUnReference(&intel->first_swap_fence);
+        intel->first_swap_fence = NULL;
+      }
+
+      if (intel->intelScreen->dummyContext == intel)
+         intel->intelScreen->dummyContext = NULL;
+
+      st_destroy_context(intel->st);
+      free(intel);
+   }
+}
+
+
+GLboolean
+intelUnbindContext(__DRIcontextPrivate * driContextPriv)
+{
+   struct intel_context *intel = intel_context(driContextPriv);
+   st_flush(intel->st, PIPE_FLUSH_RENDER_CACHE, NULL);
+   /* XXX make_current(NULL)? */
+   return GL_TRUE;
+}
+
+
+GLboolean
+intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
+                 __DRIdrawablePrivate * driDrawPriv,
+                 __DRIdrawablePrivate * driReadPriv)
+{
+   if (driContextPriv) {
+      struct intel_context *intel = intel_context(driContextPriv);
+      struct intel_framebuffer *draw_fb = intel_framebuffer(driDrawPriv);
+      struct intel_framebuffer *read_fb = intel_framebuffer(driReadPriv);
+
+      assert(draw_fb->stfb);
+      assert(read_fb->stfb);
+
+      /* This is for situations in which we need a rendering context but
+       * there may not be any currently bound.
+       */
+      intel->intelScreen->dummyContext = intel;
+
+      st_make_current(intel->st, draw_fb->stfb, read_fb->stfb);
+
+      if ((intel->driDrawable != driDrawPriv) ||
+         (intel->lastStamp != driDrawPriv->lastStamp)) {
+         intel->driDrawable = driDrawPriv;
+         intelUpdateWindowSize(driDrawPriv);
+         intel->lastStamp = driDrawPriv->lastStamp;
+      }
+
+      /* The size of the draw buffer will have been updated above.
+       * If the readbuffer is a different window, check/update its size now.
+       */
+      if (driReadPriv != driDrawPriv) {
+         intelUpdateWindowSize(driReadPriv);
+      }
+
+   }
+   else {
+      st_make_current(NULL, NULL, NULL);
+   }
+
+   return GL_TRUE;
+}
+#endif
diff --git a/src/gallium/winsys/egl_drm/intel/intel_context.h b/src/gallium/winsys/egl_drm/intel/intel_context.h
new file mode 100644 (file)
index 0000000..aa9903f
--- /dev/null
@@ -0,0 +1,162 @@
+/**************************************************************************
+ * 
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * 
+ **************************************************************************/
+
+#ifndef INTEL_CONTEXT_H
+#define INTEL_CONTEXT_H
+
+#include <stdint.h>
+#include "drm.h"
+
+#include "pipe/p_debug.h"
+
+#include "intel_screen.h"
+#include "i915_drm.h"
+
+
+struct pipe_context;
+struct intel_context;
+struct _DriBufferObject;
+struct st_context;
+struct egl_drm_device;
+struct egl_drm_context;
+struct egl_drm_frontbuffer;
+
+
+#define INTEL_MAX_FIXUP 64
+
+/**
+ * Intel rendering context, contains a state tracker and intel-specific info.
+ */
+struct intel_context
+{
+   struct st_context *st;
+
+   struct _DriFenceObject *last_swap_fence;
+   struct _DriFenceObject *first_swap_fence;
+
+   struct intel_batchbuffer *batch;
+
+#if 0
+   boolean locked;
+   char *prevLockFile;
+   int prevLockLine;
+#endif
+
+       /* pick this up from the screen instead
+   int drmFd;
+       */
+
+   struct intel_screen *intel_screen;
+
+   uint lastStamp;
+   /* new egl stuff */
+   struct egl_drm_device *egl_device;
+   struct egl_drm_context *egl_context;
+   struct egl_drm_drawable *egl_drawable;
+};
+
+
+
+/**
+ * Intel framebuffer.
+ */
+struct intel_framebuffer
+{
+   struct st_framebuffer *stfb;
+
+   /* other fields TBD */
+   int other;
+   struct _DriBufferObject *front_buffer;
+   struct egl_drm_frontbuffer *front;
+};
+
+
+
+
+/* These are functions now:
+ */
+void LOCK_HARDWARE( struct intel_context *intel );
+void UNLOCK_HARDWARE( struct intel_context *intel );
+
+extern char *__progname;
+
+
+
+/* ================================================================
+ * Debugging:
+ */
+#ifdef DEBUG
+extern int __intel_debug;
+
+#define DEBUG_SWAP     0x1
+#define DEBUG_LOCK      0x2
+#define DEBUG_IOCTL    0x4
+#define DEBUG_BATCH     0x8
+
+#define DBG(flag, ...)  do {                   \
+   if (__intel_debug & (DEBUG_##flag))                 \
+      printf(__VA_ARGS__);             \
+} while(0)
+
+#else
+#define DBG(flag, ...) 
+#endif
+
+
+
+#define PCI_CHIP_845_G                 0x2562
+#define PCI_CHIP_I830_M                        0x3577
+#define PCI_CHIP_I855_GM               0x3582
+#define PCI_CHIP_I865_G                        0x2572
+#define PCI_CHIP_I915_G                        0x2582
+#define PCI_CHIP_I915_GM               0x2592
+#define PCI_CHIP_I945_G                        0x2772
+#define PCI_CHIP_I945_GM               0x27A2
+#define PCI_CHIP_I945_GME              0x27AE
+#define PCI_CHIP_G33_G                 0x29C2
+#define PCI_CHIP_Q35_G                 0x29B2
+#define PCI_CHIP_Q33_G                 0x29D2
+
+
+#if 0
+/** Cast wrapper */
+static INLINE struct intel_context *
+intel_context(__DRIcontextPrivate *driContextPriv)
+{
+   return (struct intel_context *) driContextPriv->driverPrivate;
+}
+
+
+/** Cast wrapper */
+static INLINE struct intel_framebuffer *
+intel_framebuffer(__DRIdrawablePrivate * driDrawPriv)
+{
+   return (struct intel_framebuffer *) driDrawPriv->driverPrivate;
+}
+#endif
+
+#endif
diff --git a/src/gallium/winsys/egl_drm/intel/intel_egl.c b/src/gallium/winsys/egl_drm/intel/intel_egl.c
new file mode 100644 (file)
index 0000000..ac18252
--- /dev/null
@@ -0,0 +1,617 @@
+
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "eglconfig.h"
+#include "eglcontext.h"
+#include "egldisplay.h"
+#include "egldriver.h"
+#include "eglglobals.h"
+#include "eglmode.h"
+#include "eglscreen.h"
+#include "eglsurface.h"
+
+#include "glapi.h"
+#include "intel_egl.h"
+
+#include "xf86drm.h"
+#include "xf86drmMode.h"
+
+#include "intel_context.h"
+
+#include "ws_dri_bufmgr.h"
+
+#include "intel_winsys.h"
+#include "state_tracker/st_public.h"
+
+struct egl_drm_device* egl_drm_create_device(int drmFD);
+
+struct egl_drm_device*
+egl_drm_create_device(int drmFD)
+{
+       struct egl_drm_device *device = malloc(sizeof(*device));
+       memset(device, 0, sizeof(*device));
+       device->drmFD = drmFD;
+
+       if (!intel_init_driver(device)) {
+               printf("EGL: failed to initalize device\n");
+               free(device);
+       }
+
+       return device;
+}
+
+__GLcontextModes* _gl_context_modes_create( unsigned count, size_t minimum_size );
+
+struct drm_driver
+{
+       _EGLDriver base;  /* base class/object */
+
+       drmModeResPtr res;
+       struct egl_drm_device *device;
+};
+
+struct drm_surface
+{
+       _EGLSurface base;  /* base class/object */
+
+       struct egl_drm_drawable *drawable;
+};
+
+struct drm_context
+{
+       _EGLContext base;  /* base class/object */
+
+       struct egl_drm_context *context;
+};
+
+struct drm_screen
+{
+       _EGLScreen base;
+
+       /* backing buffer and crtc */
+       drmBO buffer;
+       drmModeFBPtr fb;
+       uint32_t fbID;
+       drmModeCrtcPtr crtc;
+
+       /* currently only support one output */
+       drmModeOutputPtr output;
+       uint32_t outputID;
+
+       struct drm_mode_modeinfo *mode;
+
+       /* geometry of the screen */
+       struct egl_drm_frontbuffer front;
+};
+
+static void
+drm_update_res(struct drm_driver *drm_drv)
+{
+       drmModeFreeResources(drm_drv->res);
+       drm_drv->res = drmModeGetResources(drm_drv->device->drmFD);
+}
+
+static void
+drm_add_modes_from_output(_EGLScreen *screen, drmModeOutputPtr output)
+{
+       struct drm_mode_modeinfo *m;
+       int i;
+
+       for (i = 0; i < output->count_modes; i++) {
+               m = &output->modes[i];
+               _eglAddNewMode(screen, m->hdisplay, m->vdisplay, m->vrefresh, m->name);
+       }
+}
+
+static EGLBoolean
+drm_initialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor)
+{
+       _EGLDisplay *disp = _eglLookupDisplay(dpy);
+       struct drm_driver *drm_drv = (struct drm_driver *)drv;
+       struct drm_screen *screen = NULL;
+       drmModeOutputPtr output = NULL;
+       drmModeResPtr res = NULL;
+
+       EGLint i;
+       int fd;
+
+       fd = drmOpen("i915", NULL);
+       if (fd < 0) {
+               return EGL_FALSE;
+       }
+
+       drm_drv->device = egl_drm_create_device(fd);
+       if (!drm_drv->device) {
+               drmClose(fd);
+               return EGL_FALSE;
+       }
+
+       drm_update_res(drm_drv);
+       res = drm_drv->res;
+
+       for(i = 0; i < res->count_outputs; i++) {
+               output = drmModeGetOutput(fd, res->outputs[i]);
+
+               if (!output)
+                       continue;
+
+               if (output->connection == DRM_MODE_DISCONNECTED) {
+                       drmModeFreeOutput(output);
+                       continue;
+               }
+
+               screen = malloc(sizeof(struct drm_screen));
+               memset(screen, 0, sizeof(*screen));
+               screen->outputID = res->outputs[i];
+               screen->output = output;
+               _eglInitScreen(&screen->base);
+               _eglAddScreen(disp, &screen->base);
+               drm_add_modes_from_output(&screen->base, output);
+       }
+
+       /* for now we only have one config */
+       _EGLConfig config;
+       _eglInitConfig(&config, i + 1);
+       _eglSetConfigAttrib(&config, EGL_RED_SIZE, 8);
+       _eglSetConfigAttrib(&config, EGL_GREEN_SIZE, 8);
+       _eglSetConfigAttrib(&config, EGL_BLUE_SIZE, 8);
+       _eglSetConfigAttrib(&config, EGL_ALPHA_SIZE, 8);
+       _eglSetConfigAttrib(&config, EGL_BUFFER_SIZE, 32);
+       _eglSetConfigAttrib(&config, EGL_DEPTH_SIZE, 24);
+       _eglSetConfigAttrib(&config, EGL_STENCIL_SIZE, 8);
+       _eglSetConfigAttrib(&config, EGL_SURFACE_TYPE, EGL_PBUFFER_BIT);
+       _eglAddConfig(disp, &config);
+
+       drv->Initialized = EGL_TRUE;
+
+       *major = 1;
+       *minor = 0;
+
+       return EGL_TRUE;
+}
+
+
+static EGLBoolean
+drm_terminate(_EGLDriver *drv, EGLDisplay dpy)
+{
+       /* TODO: clean up */
+       free(drv);
+       return EGL_TRUE;
+}
+
+
+static struct drm_context *
+lookup_drm_context(EGLContext context)
+{
+       _EGLContext *c = _eglLookupContext(context);
+       return (struct drm_context *) c;
+}
+
+
+static struct drm_surface *
+lookup_drm_surface(EGLSurface surface)
+{
+       _EGLSurface *s = _eglLookupSurface(surface);
+       return (struct drm_surface *) s;
+}
+
+static struct drm_screen *
+lookup_drm_screen(EGLDisplay dpy, EGLScreenMESA screen)
+{
+       _EGLScreen *s = _eglLookupScreen(dpy, screen);
+       return (struct drm_screen *) s;
+}
+
+static __GLcontextModes*
+visual_from_config(_EGLConfig *conf)
+{
+       __GLcontextModes *visual;
+       (void)conf;
+
+       visual = _gl_context_modes_create(1, sizeof(*visual));
+       visual->redBits = 8;
+       visual->greenBits = 8;
+       visual->blueBits = 8;
+       visual->alphaBits = 8;
+
+       visual->rgbBits = 32;
+       visual->doubleBufferMode = 1;
+
+       visual->depthBits = 24;
+       visual->stencilBits = 8;
+
+       return visual;
+}
+
+
+
+static EGLContext
+drm_create_context(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list)
+{
+       struct drm_driver *drm_drv = (struct drm_driver *)drv;
+       struct drm_context *c;
+       struct drm_egl_context *share = NULL;
+       _EGLConfig *conf;
+       int i;
+       int ret;
+       __GLcontextModes *visual;
+       struct egl_drm_context *context;
+
+       conf = _eglLookupConfig(drv, dpy, config);
+       if (!conf) {
+               _eglError(EGL_BAD_CONFIG, "eglCreateContext");
+               return EGL_NO_CONTEXT;
+       }
+
+       for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
+               switch (attrib_list[i]) {
+                       /* no attribs defined for now */
+                       default:
+                               _eglError(EGL_BAD_ATTRIBUTE, "eglCreateContext");
+                               return EGL_NO_CONTEXT;
+               }
+       }
+
+       c = (struct drm_context *) calloc(1, sizeof(struct drm_context));
+       if (!c)
+               return EGL_NO_CONTEXT;
+
+       _eglInitContext(drv, dpy, &c->base, config, attrib_list);
+
+       context = malloc(sizeof(*context));
+       memset(context, 0, sizeof(*context));
+
+       if (!context)
+               goto err_c;
+
+       context->device = drm_drv->device;
+       visual = visual_from_config(conf);
+
+       ret = intel_create_context(context, visual, share);
+       free(visual);
+
+       if (!ret)
+               goto err_gl;
+
+       c->context = context;
+
+       /* generate handle and insert into hash table */
+       _eglSaveContext(&c->base);
+       assert(c->base.Handle);
+
+       return c->base.Handle;
+err_gl:
+       free(context);
+err_c:
+       free(c);
+       return EGL_NO_CONTEXT;
+}
+
+static EGLBoolean
+drm_destroy_context(_EGLDriver *drv, EGLDisplay dpy, EGLContext context)
+{
+       struct drm_context *fc = lookup_drm_context(context);
+       _eglRemoveContext(&fc->base);
+       if (fc->base.IsBound) {
+               fc->base.DeletePending = EGL_TRUE;
+       } else {
+               free(fc);
+       }
+       return EGL_TRUE;
+}
+
+
+static EGLSurface
+drm_create_window_surface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list)
+{
+       return EGL_NO_SURFACE;
+}
+
+
+static EGLSurface
+drm_create_pixmap_surface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list)
+{
+       return EGL_NO_SURFACE;
+}
+
+static EGLSurface
+drm_create_pbuffer_surface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
+                         const EGLint *attrib_list)
+{
+       struct drm_driver *drm_drv = (struct drm_driver *)drv;
+       int i;
+       int ret;
+       int width = -1;
+       int height = -1;
+       struct drm_surface *surf = NULL;
+       struct egl_drm_drawable *drawable = NULL;
+       __GLcontextModes *visual;
+       _EGLConfig *conf;
+
+       conf = _eglLookupConfig(drv, dpy, config);
+       if (!conf) {
+               _eglError(EGL_BAD_CONFIG, "eglCreatePbufferSurface");
+               return EGL_NO_CONTEXT;
+       }
+
+       for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
+               switch (attrib_list[i]) {
+                       case EGL_WIDTH:
+                               width = attrib_list[++i];
+                               break;
+                       case EGL_HEIGHT:
+                               height = attrib_list[++i];
+                               break;
+                       default:
+                               _eglError(EGL_BAD_ATTRIBUTE, "eglCreatePbufferSurface");
+                               return EGL_NO_SURFACE;
+               }
+       }
+
+       if (width < 1 || height < 1) {
+               _eglError(EGL_BAD_ATTRIBUTE, "eglCreatePbufferSurface");
+               return EGL_NO_SURFACE;
+       }
+
+       surf = (struct drm_surface *) calloc(1, sizeof(struct drm_surface));
+       if (!surf)
+               goto err;
+
+       if (!_eglInitSurface(drv, dpy, &surf->base, EGL_PBUFFER_BIT, config, attrib_list))
+               goto err_surf;
+
+       drawable = malloc(sizeof(*drawable));
+       memset(drawable, 0, sizeof(*drawable));
+
+       drawable->w = width;
+       drawable->h = height;
+
+       visual = visual_from_config(conf);
+
+       drawable->device = drm_drv->device;
+       ret = intel_create_drawable(drawable, visual);
+       free(visual);
+
+       if (!ret)
+               goto err_draw;
+
+       surf->drawable = drawable;
+
+       _eglSaveSurface(&surf->base);
+       return surf->base.Handle;
+
+err_draw:
+       free(drawable);
+err_surf:
+       free(surf);
+err:
+       return EGL_NO_SURFACE;
+}
+
+static EGLSurface
+drm_create_screen_surface_mesa(_EGLDriver *drv, EGLDisplay dpy, EGLConfig cfg,
+                               const EGLint *attrib_list)
+{
+       EGLSurface surf = drm_create_pbuffer_surface(drv, dpy, cfg, attrib_list);
+
+       return surf;
+}
+
+static struct drm_mode_modeinfo *
+drm_find_mode(drmModeOutputPtr output, _EGLMode *mode)
+{
+       int i;
+       struct drm_mode_modeinfo *m;
+
+       for (i = 0; i < output->count_modes; i++) {
+               m = &output->modes[i];
+               if (m->hdisplay == mode->Width && m->vdisplay == mode->Height && m->vrefresh == mode->RefreshRate)
+                       break;
+               m = NULL;
+       }
+
+       return m;
+}
+static void
+draw(size_t x, size_t y, size_t w, size_t h, size_t pitch, size_t v, unsigned int *ptr)
+{
+    int i, j;
+
+    for (i = x; i < x + w; i++)
+        for(j = y; j < y + h; j++)
+            ptr[(i * pitch / 4) + j] = v;
+
+}
+
+static void
+prettyColors(int fd, unsigned int handle, size_t pitch)
+{
+       drmBO bo;
+       unsigned int *ptr;
+       int i;
+
+       drmBOReference(fd, handle, &bo);
+       drmBOMap(fd, &bo, DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0, (void**)&ptr);
+
+       for (i = 0; i < (bo.size / 4); i++)
+               ptr[i] = 0xFFFFFFFF;
+
+       for (i = 0; i < 4; i++)
+               draw(i * 40, i * 40, 40, 40, pitch, 0, ptr);
+
+
+       draw(200, 100, 40, 40, pitch, 0xff00ff, ptr);
+       draw(100, 200, 40, 40, pitch, 0xff00ff, ptr);
+
+       drmBOUnmap(fd, &bo);
+}
+
+static EGLBoolean
+drm_show_screen_surface_mesa(_EGLDriver *drv, EGLDisplay dpy,
+                         EGLScreenMESA screen,
+                         EGLSurface surface, EGLModeMESA m)
+{
+       struct drm_driver *drm_drv = (struct drm_driver *)drv;
+       struct drm_surface *surf = lookup_drm_surface(surface);
+       struct drm_screen *scrn = lookup_drm_screen(dpy, screen);
+       //struct intel_framebuffer *intel_fb = NULL;
+       //struct pipe_surface *front_surf = NULL;
+       _EGLMode *mode = _eglLookupMode(dpy, m);
+       size_t pitch = 2048 * 4;
+       size_t size = mode->Height * pitch;
+       int ret;
+
+       /* TODO if allready shown take down */
+
+       printf("setting mode to %i x %i\n", mode->Width, mode->Height);
+
+       ret = drmBOCreate(drm_drv->device->drmFD, size, 0, 0,
+               DRM_BO_FLAG_READ |
+               DRM_BO_FLAG_WRITE |
+               DRM_BO_FLAG_MEM_TT |
+               DRM_BO_FLAG_MEM_VRAM |
+               DRM_BO_FLAG_NO_EVICT,
+               DRM_BO_HINT_DONT_FENCE, &scrn->buffer);
+
+       prettyColors(drm_drv->device->drmFD, scrn->buffer.handle, pitch);
+       if (ret) {
+               printf("failed to create framebuffer (ret %d)\n", ret);
+               return EGL_FALSE;
+       }
+
+       ret = drmModeAddFB(drm_drv->device->drmFD, mode->Width, mode->Height,
+                       32, 32, pitch,
+                       scrn->buffer.handle,
+                       &scrn->fbID);
+
+       if (ret)
+               goto err_bo;
+
+       scrn->fb = drmModeGetFB(drm_drv->device->drmFD, scrn->fbID);
+       if (!scrn->fb)
+               goto err_bo;
+
+       scrn->mode = drm_find_mode(scrn->output, mode);
+       if (!scrn->mode) {
+               printf("oh noes, no matching mode found\n");
+               goto err_fb;
+       }
+
+       ret = drmModeSetCrtc(
+                       drm_drv->device->drmFD,
+                       drm_drv->res->crtcs[1],
+                       scrn->fbID,
+                       0, 0,
+                       &scrn->outputID, 1,
+                       scrn->mode);
+
+
+       scrn->front.handle = scrn->buffer.handle;
+       scrn->front.pitch = pitch;
+       scrn->front.width = mode->Width;
+       scrn->front.height = mode->Height;
+
+       intel_bind_frontbuffer(surf->drawable, &scrn->front);
+
+       return EGL_TRUE;
+
+err_fb:
+       /* TODO remove fb */
+
+err_bo:
+       drmBOUnreference(drm_drv->device->drmFD, &scrn->buffer);
+       return EGL_FALSE;
+}
+
+static EGLBoolean
+drm_destroy_surface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface)
+{
+       struct drm_surface *fs = lookup_drm_surface(surface);
+       _eglRemoveSurface(&fs->base);
+       if (fs->base.IsBound) {
+               fs->base.DeletePending = EGL_TRUE;
+       } else {
+               free(fs);
+       }
+       return EGL_TRUE;
+}
+
+
+
+
+static EGLBoolean
+drm_make_current(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext context)
+{
+       struct drm_surface *readSurf = lookup_drm_surface(read);
+       struct drm_surface *drawSurf = lookup_drm_surface(draw);
+       struct drm_context *ctx = lookup_drm_context(context);
+       EGLBoolean b;
+
+       b = _eglMakeCurrent(drv, dpy, draw, read, context);
+       if (!b)
+               return EGL_FALSE;
+
+       /* XXX this is where we'd do the hardware context switch */
+       (void) drawSurf;
+       (void) readSurf;
+       (void) ctx;
+
+       intel_make_current(ctx->context, drawSurf->drawable, readSurf->drawable);
+       return EGL_TRUE;
+}
+
+static EGLBoolean
+drm_swap_buffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw)
+{
+       struct drm_surface *surf = lookup_drm_surface(draw);
+       if (!surf)
+               return EGL_FALSE;
+
+       /* error checking */
+       if (!_eglSwapBuffers(drv, dpy, draw))
+               return EGL_FALSE;
+
+       intel_swap_buffers(surf->drawable);
+       return EGL_TRUE;
+}
+
+
+/**
+ * The bootstrap function.  Return a new drm_driver object and
+ * plug in API functions.
+ */
+_EGLDriver *
+_eglMain(_EGLDisplay *dpy)
+{
+       struct drm_driver *drm;
+
+       drm = (struct drm_driver *) calloc(1, sizeof(struct drm_driver));
+       if (!drm) {
+               return NULL;
+       }
+
+       /* First fill in the dispatch table with defaults */
+       _eglInitDriverFallbacks(&drm->base);
+       /* then plug in our Drm-specific functions */
+       drm->base.API.Initialize = drm_initialize;
+       drm->base.API.Terminate = drm_terminate;
+       drm->base.API.CreateContext = drm_create_context;
+       drm->base.API.MakeCurrent = drm_make_current;
+       drm->base.API.CreateWindowSurface = drm_create_window_surface;
+       drm->base.API.CreatePixmapSurface = drm_create_pixmap_surface;
+       drm->base.API.CreatePbufferSurface = drm_create_pbuffer_surface;
+       drm->base.API.DestroySurface = drm_destroy_surface;
+       drm->base.API.DestroyContext = drm_destroy_context;
+       drm->base.API.CreateScreenSurfaceMESA = drm_create_screen_surface_mesa;
+       drm->base.API.ShowScreenSurfaceMESA = drm_show_screen_surface_mesa;
+       drm->base.API.SwapBuffers = drm_swap_buffers;
+
+       /* enable supported extensions */
+       drm->base.Extensions.MESA_screen_surface = EGL_TRUE;
+       drm->base.Extensions.MESA_copy_context = EGL_TRUE;
+
+       return &drm->base;
+}
diff --git a/src/gallium/winsys/egl_drm/intel/intel_egl.h b/src/gallium/winsys/egl_drm/intel/intel_egl.h
new file mode 100644 (file)
index 0000000..18e84e8
--- /dev/null
@@ -0,0 +1,42 @@
+
+#ifndef _INTEL_EGL_H_
+#define _INTEL_EGL_H_
+
+struct egl_drm_device
+{
+       void *priv;
+       int drmFD;
+};
+
+struct egl_drm_context
+{
+       void *priv;
+       struct egl_drm_device *device;
+};
+
+struct egl_drm_drawable
+{
+       void *priv;
+       struct egl_drm_device *device;
+       size_t h;
+       size_t w;
+};
+
+struct egl_drm_frontbuffer
+{
+       uint32_t handle;
+       uint32_t pitch;
+       uint32_t width;
+       uint32_t height;
+};
+
+#include "GL/internal/glcore.h"
+
+int intel_init_driver(struct egl_drm_device *device);
+int intel_create_context(struct egl_drm_context *context, const __GLcontextModes *visual, void *sharedContextPrivate);
+int intel_create_drawable(struct egl_drm_drawable *drawable, const __GLcontextModes * visual);
+void intel_make_current(struct egl_drm_context *context, struct egl_drm_drawable *draw, struct egl_drm_drawable *read);
+void intel_swap_buffers(struct egl_drm_drawable *draw);
+void intel_bind_frontbuffer(struct egl_drm_drawable *draw, struct egl_drm_frontbuffer *front);
+
+#endif
diff --git a/src/gallium/winsys/egl_drm/intel/intel_lock.c b/src/gallium/winsys/egl_drm/intel/intel_lock.c
new file mode 100644 (file)
index 0000000..cec83c7
--- /dev/null
@@ -0,0 +1,102 @@
+/**************************************************************************
+ * 
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * 
+ **************************************************************************/
+
+
+#include "main/glheader.h"
+#include "glapi/glthread.h"
+#include <GL/internal/glcore.h>
+#include "state_tracker/st_public.h"
+#include "intel_context.h"
+
+#if 0
+
+_glthread_DECLARE_STATIC_MUTEX( lockMutex );
+
+
+static void
+intelContendedLock(struct intel_context *intel, uint flags)
+{
+   __DRIdrawablePrivate *dPriv = intel->driDrawable;
+   __DRIscreenPrivate *sPriv = intel->driScreen;
+   struct intel_screen *intelScreen = intel_screen(sPriv);
+   drmI830Sarea *sarea = intel->sarea;
+
+   drmGetLock(intel->driFd, intel->hHWContext, flags);
+
+   DBG(LOCK, "%s - got contended lock\n", __progname);
+
+   /* If the window moved, may need to set a new cliprect now.
+    *
+    * NOTE: This releases and regains the hw lock, so all state
+    * checking must be done *after* this call:
+    */
+   if (dPriv)
+      DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
+
+   if (sarea->width != intelScreen->front.width ||
+       sarea->height != intelScreen->front.height) {
+
+      intelUpdateScreenRotation(sPriv, sarea);
+   }
+}
+
+
+/* Lock the hardware and validate our state.
+ */
+void LOCK_HARDWARE( struct intel_context *intel )
+{
+    char __ret = 0;
+
+    _glthread_LOCK_MUTEX(lockMutex);
+    assert(!intel->locked);
+
+    DRM_CAS(intel->driHwLock, intel->hHWContext,
+            (DRM_LOCK_HELD|intel->hHWContext), __ret);
+
+    if (__ret)
+       intelContendedLock( intel, 0 );
+
+    DBG(LOCK, "%s - locked\n", __progname);
+
+    intel->locked = 1;
+}
+
+
+/* Unlock the hardware using the global current context 
+ */
+void UNLOCK_HARDWARE( struct intel_context *intel )
+{
+   assert(intel->locked);
+   intel->locked = 0;
+
+   DRM_UNLOCK(intel->driFd, intel->driHwLock, intel->hHWContext);
+
+   _glthread_UNLOCK_MUTEX(lockMutex);
+
+   DBG(LOCK, "%s - unlocked\n", __progname);
+} 
+#endif
diff --git a/src/gallium/winsys/egl_drm/intel/intel_reg.h b/src/gallium/winsys/egl_drm/intel/intel_reg.h
new file mode 100644 (file)
index 0000000..f37c24f
--- /dev/null
@@ -0,0 +1,53 @@
+/**************************************************************************
+ * 
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * 
+ **************************************************************************/
+
+
+#ifndef _INTEL_REG_H_
+#define _INTEL_REG_H_
+
+
+#define BR00_BITBLT_CLIENT   0x40000000
+#define BR00_OP_COLOR_BLT    0x10000000
+#define BR00_OP_SRC_COPY_BLT 0x10C00000
+#define BR13_SOLID_PATTERN   0x80000000
+
+#define XY_COLOR_BLT_CMD               ((2<<29)|(0x50<<22)|0x4)
+#define XY_COLOR_BLT_WRITE_ALPHA       (1<<21)
+#define XY_COLOR_BLT_WRITE_RGB         (1<<20)
+
+#define XY_SRC_COPY_BLT_CMD             ((2<<29)|(0x53<<22)|6)
+#define XY_SRC_COPY_BLT_WRITE_ALPHA     (1<<21)
+#define XY_SRC_COPY_BLT_WRITE_RGB       (1<<20)
+
+#define MI_WAIT_FOR_EVENT               ((0x3<<23))
+#define MI_WAIT_FOR_PLANE_B_FLIP        (1<<6)
+#define MI_WAIT_FOR_PLANE_A_FLIP        (1<<2)
+
+#define MI_BATCH_BUFFER_END            (0xA<<23)
+
+
+#endif
diff --git a/src/gallium/winsys/egl_drm/intel/intel_screen.c b/src/gallium/winsys/egl_drm/intel/intel_screen.c
new file mode 100644 (file)
index 0000000..38c4098
--- /dev/null
@@ -0,0 +1,680 @@
+/**************************************************************************
+ * 
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * 
+ **************************************************************************/
+
+#include "utils.h"
+#include "vblank.h"
+#include "xmlpool.h"
+
+#include "intel_context.h"
+#include "intel_screen.h"
+#include "intel_batchbuffer.h"
+//#include "intel_batchpool.h"
+#include "intel_swapbuffers.h"
+#include "intel_winsys.h"
+
+#include "ws_dri_bufpool.h"
+
+#include "pipe/p_context.h"
+#include "state_tracker/st_public.h"
+#include "state_tracker/st_cb_fbo.h"
+#include "intel_egl.h"
+
+static boolean
+intel_create_pools(struct intel_screen *intel_screen)
+{
+       if (intel_screen->havePools)
+               return GL_TRUE;
+
+       intel_screen->mgr = driFenceMgrTTMInit(intel_screen->device->drmFD);
+       if (!intel_screen->mgr) {
+               fprintf(stderr, "Failed to create fence manager.\n");
+               return FALSE;
+       }
+
+       intel_screen->fMan = driInitFreeSlabManager(10, 10);
+       if (!intel_screen->fMan) {
+               fprintf(stderr, "Failed to create free slab manager.\n");
+               return FALSE;
+       }
+
+       intel_screen->staticPool = driDRMPoolInit(intel_screen->device->drmFD);
+       intel_screen->batchPool = driSlabPoolInit(intel_screen->device->drmFD,
+                                               DRM_BO_FLAG_EXE |
+                                               DRM_BO_FLAG_MEM_TT,
+                                               DRM_BO_FLAG_EXE |
+                                               DRM_BO_FLAG_MEM_TT,
+                                               4096, //intelScreen->maxBatchSize,
+                                               1, 40, 16*16384, 0,
+                                               intel_screen->fMan);
+
+       intel_screen->havePools = GL_TRUE;
+
+       return GL_TRUE;
+}
+
+extern const struct dri_extension card_extensions[];
+
+int
+intel_init_driver(struct egl_drm_device *device)
+{
+       struct intel_screen *intel_screen;
+
+       /* Allocate the private area */
+       intel_screen = CALLOC_STRUCT(intel_screen);
+       if (!intel_screen) 
+               return FALSE;
+
+       device->priv = (void *)intel_screen;
+       intel_screen->device = device;
+
+       if (!intel_create_pools(intel_screen))
+               return FALSE;
+
+       intel_screen->batch = intel_batchbuffer_alloc(intel_screen);
+
+       intel_screen->winsys = intel_create_pipe_winsys(device->drmFD, intel_screen->fMan);
+
+       /* hack */
+       driInitExtensions(NULL, card_extensions, GL_FALSE);
+
+       return TRUE;
+}
+
+int
+intel_create_drawable(struct egl_drm_drawable *drawable,
+                      const __GLcontextModes * visual)
+{
+       enum pipe_format colorFormat, depthFormat, stencilFormat;
+       struct intel_framebuffer *intelfb = CALLOC_STRUCT(intel_framebuffer);
+
+       if (!intelfb)
+               return GL_FALSE;
+
+       if (visual->redBits == 5)
+               colorFormat = PIPE_FORMAT_R5G6B5_UNORM;
+       else
+               colorFormat = PIPE_FORMAT_A8R8G8B8_UNORM;
+
+       if (visual->depthBits == 16)
+               depthFormat = PIPE_FORMAT_Z16_UNORM;
+       else if (visual->depthBits == 24)
+               depthFormat = PIPE_FORMAT_S8Z24_UNORM;
+       else
+               depthFormat = PIPE_FORMAT_NONE;
+
+       if (visual->stencilBits == 8)
+               stencilFormat = PIPE_FORMAT_S8Z24_UNORM;
+       else
+               stencilFormat = PIPE_FORMAT_NONE;
+
+       intelfb->stfb = st_create_framebuffer(visual,
+                       colorFormat,
+                       depthFormat,
+                       stencilFormat,
+                       drawable->w,
+                       drawable->h,
+                       (void*) intelfb);
+
+       if (!intelfb->stfb) {
+               free(intelfb);
+               return GL_FALSE;
+       }
+
+   drawable->priv = (void *) intelfb;
+   return GL_TRUE;
+}
+
+#if 0
+PUBLIC const char __driConfigOptions[] =
+   DRI_CONF_BEGIN DRI_CONF_SECTION_PERFORMANCE
+   DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
+   DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
+   DRI_CONF_SECTION_END DRI_CONF_SECTION_QUALITY
+   DRI_CONF_FORCE_S3TC_ENABLE(false)
+   DRI_CONF_ALLOW_LARGE_TEXTURES(1)
+   DRI_CONF_SECTION_END DRI_CONF_END;
+
+const uint __driNConfigOptions = 4;
+
+#ifdef USE_NEW_INTERFACE
+static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
+#endif /*USE_NEW_INTERFACE */
+
+extern const struct dri_extension card_extensions[];
+
+
+
+
+static void
+intelPrintDRIInfo(struct intel_screen * intelScreen,
+                  __DRIscreenPrivate * sPriv, I830DRIPtr gDRIPriv)
+{
+   fprintf(stderr, "*** Front size:   0x%x  offset: 0x%x  pitch: %d\n",
+           intelScreen->front.size, intelScreen->front.offset,
+           intelScreen->front.pitch);
+   fprintf(stderr, "*** Memory : 0x%x\n", gDRIPriv->mem);
+}
+
+static void
+intelPrintSAREA(const drmI830Sarea * sarea)
+{
+   fprintf(stderr, "SAREA: sarea width %d  height %d\n", sarea->width,
+           sarea->height);
+   fprintf(stderr, "SAREA: pitch: %d\n", sarea->pitch);
+   fprintf(stderr,
+           "SAREA: front offset: 0x%08x  size: 0x%x  handle: 0x%x\n",
+           sarea->front_offset, sarea->front_size,
+           (unsigned) sarea->front_handle);
+   fprintf(stderr,
+           "SAREA: back  offset: 0x%08x  size: 0x%x  handle: 0x%x\n",
+           sarea->back_offset, sarea->back_size,
+           (unsigned) sarea->back_handle);
+   fprintf(stderr, "SAREA: depth offset: 0x%08x  size: 0x%x  handle: 0x%x\n",
+           sarea->depth_offset, sarea->depth_size,
+           (unsigned) sarea->depth_handle);
+   fprintf(stderr, "SAREA: tex   offset: 0x%08x  size: 0x%x  handle: 0x%x\n",
+           sarea->tex_offset, sarea->tex_size, (unsigned) sarea->tex_handle);
+   fprintf(stderr, "SAREA: rotation: %d\n", sarea->rotation);
+   fprintf(stderr,
+           "SAREA: rotated offset: 0x%08x  size: 0x%x\n",
+           sarea->rotated_offset, sarea->rotated_size);
+   fprintf(stderr, "SAREA: rotated pitch: %d\n", sarea->rotated_pitch);
+}
+
+/**
+ * Use the information in the sarea to update the screen parameters
+ * related to screen rotation. Needs to be called locked.
+ */
+void
+intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea)
+{
+   struct intel_screen *intelScreen = intel_screen(sPriv);
+
+   if (intelScreen->front.map) {
+      drmUnmap(intelScreen->front.map, intelScreen->front.size);
+      intelScreen->front.map = NULL;
+   }
+
+   if (intelScreen->front.buffer)
+      driDeleteBuffers(1, &intelScreen->front.buffer);
+
+   intelScreen->front.width = sarea->width;
+   intelScreen->front.height = sarea->height;
+   intelScreen->front.offset = sarea->front_offset;
+   intelScreen->front.pitch = sarea->pitch * intelScreen->front.cpp;
+   intelScreen->front.size = sarea->front_size;
+   intelScreen->front.handle = sarea->front_handle;
+
+   assert( sarea->front_size >=
+          intelScreen->front.pitch * intelScreen->front.height );
+
+#if 0 /* JB not important */
+   if (!sarea->front_handle)
+      return;
+
+   if (drmMap(sPriv->fd,
+             sarea->front_handle,
+             intelScreen->front.size,
+             (drmAddress *) & intelScreen->front.map) != 0) {
+      fprintf(stderr, "drmMap(frontbuffer) failed!\n");
+      return;
+   }
+#endif
+
+#if 0 /* JB */
+   if (intelScreen->staticPool) {
+      driGenBuffers(intelScreen->staticPool, "static region", 1,
+                   &intelScreen->front.buffer, 64,
+                   DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_NO_MOVE |
+                   DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0);
+
+      driBOSetStatic(intelScreen->front.buffer, 
+                    intelScreen->front.offset,                   
+                    intelScreen->front.pitch * intelScreen->front.height, 
+                    intelScreen->front.map, 0);
+   }
+#else
+   if (intelScreen->staticPool) {
+      if (intelScreen->front.buffer)
+        driBOUnReference(intelScreen->front.buffer);
+      driGenBuffers(intelScreen->staticPool, "front", 1, &intelScreen->front.buffer, 0, 0, 0);
+      driBOSetReferenced(intelScreen->front.buffer, sarea->front_bo_handle);
+   }
+#endif
+}
+
+
+boolean
+intelCreatePools(__DRIscreenPrivate * sPriv)
+{
+   //unsigned batchPoolSize = 1024*1024;
+   struct intel_screen *intelScreen = intel_screen(sPriv);
+
+   if (intelScreen->havePools)
+      return GL_TRUE;
+
+#if 0 /* ZZZ JB fix this */
+   intelScreen->staticPool = driDRMStaticPoolInit(sPriv->fd);
+   if (!intelScreen->staticPool)
+      return GL_FALSE;
+
+   batchPoolSize /= BATCH_SZ;
+   intelScreen->batchPool = driBatchPoolInit(sPriv->fd,
+                                             DRM_BO_FLAG_EXE |
+                                             DRM_BO_FLAG_MEM_TT |
+                                             DRM_BO_FLAG_MEM_LOCAL,
+                                             BATCH_SZ, 
+                                            batchPoolSize, 5);
+   if (!intelScreen->batchPool) {
+      fprintf(stderr, "Failed to initialize batch pool - possible incorrect agpgart installed\n");
+      return GL_FALSE;
+   }
+#else
+   intelScreen->staticPool = driDRMPoolInit(sPriv->fd);
+   intelScreen->batchPool = driSlabPoolInit(sPriv->fd,
+                                               DRM_BO_FLAG_EXE |
+                                               DRM_BO_FLAG_MEM_TT,
+                                               DRM_BO_FLAG_EXE |
+                                               DRM_BO_FLAG_MEM_TT,
+                                               4096, //intelScreen->maxBatchSize,
+                                               1, 40, 16*16384, 0,
+                                               intelScreen->fMan);
+#endif
+   intelScreen->havePools = GL_TRUE;
+
+   //intelUpdateScreenRotation(sPriv, intelScreen->sarea);
+
+   return GL_TRUE;
+}
+
+
+static boolean
+intelInitDriver(__DRIscreenPrivate * sPriv)
+{
+   struct intel_screen *intelScreen;
+   I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv;
+
+   PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
+      (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->
+                                      getProcAddress("glxEnableExtension"));
+   void *const psc = sPriv->psc->screenConfigs;
+
+   if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
+      fprintf(stderr,
+              "\nERROR!  sizeof(I830DRIRec) does not match passed size from device driver\n");
+      return GL_FALSE;
+   }
+
+   /* Allocate the private area */
+   intelScreen = CALLOC_STRUCT(intel_screen);
+   if (!intelScreen) 
+      return GL_FALSE;
+
+   /* parse information in __driConfigOptions */
+   driParseOptionInfo(&intelScreen->optionCache,
+                      __driConfigOptions, __driNConfigOptions);
+
+   sPriv->private = (void *) intelScreen;
+
+   intelScreen->sarea = (drmI830Sarea *) (((GLubyte *) sPriv->pSAREA) +
+                                         gDRIPriv->sarea_priv_offset);
+   intelScreen->deviceID = gDRIPriv->deviceID;
+   intelScreen->front.cpp = gDRIPriv->cpp;
+   intelScreen->drmMinor = sPriv->drmMinor;
+
+
+   assert(gDRIPriv->bitsPerPixel == 16 ||
+         gDRIPriv->bitsPerPixel == 32);
+
+
+   intelUpdateScreenRotation(sPriv, intelScreen->sarea);
+
+   if (0)
+      intelPrintDRIInfo(intelScreen, sPriv, gDRIPriv);
+
+   if (glx_enable_extension != NULL) {
+      (*glx_enable_extension) (psc, "GLX_SGI_swap_control");
+      (*glx_enable_extension) (psc, "GLX_SGI_video_sync");
+      (*glx_enable_extension) (psc, "GLX_MESA_swap_control");
+      (*glx_enable_extension) (psc, "GLX_MESA_swap_frame_usage");
+      (*glx_enable_extension) (psc, "GLX_SGI_make_current_read");
+   }
+
+
+
+#if 1 // ZZZ JB
+   intelScreen->mgr = driFenceMgrTTMInit(sPriv->fd);
+   if (!intelScreen->mgr) {
+      fprintf(stderr, "Failed to create fence manager.\n");
+      return GL_FALSE;
+   }
+
+   intelScreen->fMan = driInitFreeSlabManager(10, 10);
+   if (!intelScreen->fMan) {
+      fprintf(stderr, "Failed to create free slab manager.\n");
+      return GL_FALSE;
+   }
+
+   if (!intelCreatePools(sPriv))
+      return GL_FALSE;
+#endif
+
+   intelScreen->winsys = intel_create_pipe_winsys(sPriv->fd, intelScreen->fMan);
+
+   return GL_TRUE;
+}
+
+
+static void
+intelDestroyScreen(__DRIscreenPrivate * sPriv)
+{
+   struct intel_screen *intelScreen = intel_screen(sPriv);
+
+   /*  intelUnmapScreenRegions(intelScreen); */
+
+   if (intelScreen->havePools) {
+      driPoolTakeDown(intelScreen->staticPool);
+      driPoolTakeDown(intelScreen->batchPool);
+   }
+   FREE(intelScreen);
+   sPriv->private = NULL;
+}
+
+
+/**
+ * This is called when we need to set up GL rendering to a new X window.
+ */
+static boolean
+intelCreateBuffer(__DRIscreenPrivate * driScrnPriv,
+                  __DRIdrawablePrivate * driDrawPriv,
+                  const __GLcontextModes * visual, boolean isPixmap)
+{
+   if (isPixmap) {
+      return GL_FALSE;          /* not implemented */
+   }
+   else {
+      enum pipe_format colorFormat, depthFormat, stencilFormat;
+      struct intel_framebuffer *intelfb = CALLOC_STRUCT(intel_framebuffer);
+
+      if (!intelfb)
+         return GL_FALSE;
+
+      if (visual->redBits == 5)
+         colorFormat = PIPE_FORMAT_R5G6B5_UNORM;
+      else
+         colorFormat = PIPE_FORMAT_A8R8G8B8_UNORM;
+
+      if (visual->depthBits == 16)
+         depthFormat = PIPE_FORMAT_Z16_UNORM;
+      else if (visual->depthBits == 24)
+         depthFormat = PIPE_FORMAT_S8Z24_UNORM;
+      else
+         depthFormat = PIPE_FORMAT_NONE;
+
+      if (visual->stencilBits == 8)
+         stencilFormat = PIPE_FORMAT_S8Z24_UNORM;
+      else
+         stencilFormat = PIPE_FORMAT_NONE;
+
+      intelfb->stfb = st_create_framebuffer(visual,
+                                            colorFormat,
+                                            depthFormat,
+                                            stencilFormat,
+                                            driDrawPriv->w,
+                                            driDrawPriv->h,
+                                            (void*) intelfb);
+      if (!intelfb->stfb) {
+         free(intelfb);
+         return GL_FALSE;
+      }
+
+      driDrawPriv->driverPrivate = (void *) intelfb;
+      return GL_TRUE;
+   }
+}
+
+static void
+intelDestroyBuffer(__DRIdrawablePrivate * driDrawPriv)
+{
+   struct intel_framebuffer *intelfb = intel_framebuffer(driDrawPriv);
+   assert(intelfb->stfb);
+   st_unreference_framebuffer(&intelfb->stfb);
+   free(intelfb);
+}
+
+
+/**
+ * Get information about previous buffer swaps.
+ */
+static int
+intelGetSwapInfo(__DRIdrawablePrivate * dPriv, __DRIswapInfo * sInfo)
+{
+   if ((dPriv == NULL) || (dPriv->driverPrivate == NULL)
+       || (sInfo == NULL)) {
+      return -1;
+   }
+
+   return 0;
+}
+
+
+static void
+intelSetTexOffset(__DRIcontext *pDRICtx, int texname,
+                 unsigned long long offset, int depth, uint pitch)
+{
+   abort();
+#if 0
+   struct intel_context *intel = (struct intel_context*)
+      ((__DRIcontextPrivate*)pDRICtx->private)->driverPrivate;
+   struct gl_texture_object *tObj = _mesa_lookup_texture(&intel->ctx, texname);
+   struct st_texture_object *stObj = st_texture_object(tObj);
+
+   if (!stObj)
+      return;
+
+   if (stObj->pt)
+      st->pipe->texture_release(intel->st->pipe, &stObj->pt);
+
+   stObj->imageOverride = GL_TRUE;
+   stObj->depthOverride = depth;
+   stObj->pitchOverride = pitch;
+
+   if (offset)
+      stObj->textureOffset = offset;
+#endif
+}
+
+
+static const struct __DriverAPIRec intelAPI = {
+   .InitDriver = intelInitDriver,
+   .DestroyScreen = intelDestroyScreen,
+   .CreateContext = intelCreateContext,
+   .DestroyContext = intelDestroyContext,
+   .CreateBuffer = intelCreateBuffer,
+   .DestroyBuffer = intelDestroyBuffer,
+   .SwapBuffers = intelSwapBuffers,
+   .MakeCurrent = intelMakeCurrent,
+   .UnbindContext = intelUnbindContext,
+   .GetSwapInfo = intelGetSwapInfo,
+   .GetMSC = driGetMSC32,
+   .WaitForMSC = driWaitForMSC32,
+   .WaitForSBC = NULL,
+   .SwapBuffersMSC = NULL,
+   .CopySubBuffer = intelCopySubBuffer,
+   .setTexOffset = intelSetTexOffset,
+};
+
+
+static __GLcontextModes *
+intelFillInModes(unsigned pixel_bits, unsigned depth_bits,
+                 unsigned stencil_bits, boolean have_back_buffer)
+{
+   __GLcontextModes *modes;
+   __GLcontextModes *m;
+   unsigned num_modes;
+   unsigned depth_buffer_factor;
+   unsigned back_buffer_factor;
+   GLenum fb_format;
+   GLenum fb_type;
+
+   /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
+    * support pageflipping at all.
+    */
+   static const GLenum back_buffer_modes[] = {
+      GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
+   };
+
+   u_int8_t depth_bits_array[3];
+   u_int8_t stencil_bits_array[3];
+
+
+   depth_bits_array[0] = 0;
+   depth_bits_array[1] = depth_bits;
+   depth_bits_array[2] = depth_bits;
+
+   /* Just like with the accumulation buffer, always provide some modes
+    * with a stencil buffer.  It will be a sw fallback, but some apps won't
+    * care about that.
+    */
+   stencil_bits_array[0] = 0;
+   stencil_bits_array[1] = 0;
+   if (depth_bits == 24)
+      stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
+
+   stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits;
+
+   depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1;
+   back_buffer_factor = (have_back_buffer) ? 3 : 1;
+
+   num_modes = depth_buffer_factor * back_buffer_factor * 4;
+
+   if (pixel_bits == 16) {
+      fb_format = GL_RGB;
+      fb_type = GL_UNSIGNED_SHORT_5_6_5;
+   }
+   else {
+      fb_format = GL_BGRA;
+      fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
+   }
+
+   modes =
+      (*dri_interface->createContextModes) (num_modes,
+                                            sizeof(__GLcontextModes));
+   m = modes;
+   if (!driFillInModes(&m, fb_format, fb_type,
+                       depth_bits_array, stencil_bits_array,
+                       depth_buffer_factor, back_buffer_modes,
+                       back_buffer_factor, GLX_TRUE_COLOR)) {
+      fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
+              __LINE__);
+      return NULL;
+   }
+   if (!driFillInModes(&m, fb_format, fb_type,
+                       depth_bits_array, stencil_bits_array,
+                       depth_buffer_factor, back_buffer_modes,
+                       back_buffer_factor, GLX_DIRECT_COLOR)) {
+      fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
+              __LINE__);
+      return NULL;
+   }
+
+   /* Mark the visual as slow if there are "fake" stencil bits.
+    */
+   for (m = modes; m != NULL; m = m->next) {
+      if ((m->stencilBits != 0) && (m->stencilBits != stencil_bits)) {
+         m->visualRating = GLX_SLOW_CONFIG;
+      }
+   }
+
+   return modes;
+}
+
+
+/**
+ * This is the bootstrap function for the driver.  libGL supplies all of the
+ * requisite information about the system, and the driver initializes itself.
+ * This routine also fills in the linked list pointed to by \c driver_modes
+ * with the \c __GLcontextModes that the driver can support for windows or
+ * pbuffers.
+ * 
+ * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on 
+ *         failure.
+ */
+PUBLIC void *
+__driCreateNewScreen_20050727(__DRInativeDisplay * dpy, int scrn,
+                              __DRIscreen * psc,
+                              const __GLcontextModes * modes,
+                              const __DRIversion * ddx_version,
+                              const __DRIversion * dri_version,
+                              const __DRIversion * drm_version,
+                              const __DRIframebuffer * frame_buffer,
+                              drmAddress pSAREA, int fd,
+                              int internal_api_version,
+                              const __DRIinterfaceMethods * interface,
+                              __GLcontextModes ** driver_modes)
+{
+   __DRIscreenPrivate *psp;
+   static const __DRIversion ddx_expected = { 1, 7, 0 };
+   static const __DRIversion dri_expected = { 4, 0, 0 };
+   static const __DRIversion drm_expected = { 1, 7, 0 };
+
+   dri_interface = interface;
+
+   if (!driCheckDriDdxDrmVersions2("i915",
+                                   dri_version, &dri_expected,
+                                   ddx_version, &ddx_expected,
+                                   drm_version, &drm_expected)) {
+      return NULL;
+   }
+
+   psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+                                  ddx_version, dri_version, drm_version,
+                                  frame_buffer, pSAREA, fd,
+                                  internal_api_version, &intelAPI);
+
+   if (psp != NULL) {
+      I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
+      *driver_modes = intelFillInModes(dri_priv->cpp * 8,
+                                       (dri_priv->cpp == 2) ? 16 : 24,
+                                       (dri_priv->cpp == 2) ? 0 : 8, 1);
+
+      /* Calling driInitExtensions here, with a NULL context pointer,
+       * does not actually enable the extensions.  It just makes sure
+       * that all the dispatch offsets for all the extensions that
+       * *might* be enables are known.  This is needed because the
+       * dispatch offsets need to be known when _mesa_context_create
+       * is called, but we can't enable the extensions until we have a
+       * context pointer.
+       *
+       * Hello chicken.  Hello egg.  How are you two today?
+       */
+      driInitExtensions(NULL, card_extensions, GL_FALSE);
+   }
+
+   return (void *) psp;
+}
+#endif
diff --git a/src/gallium/winsys/egl_drm/intel/intel_screen.h b/src/gallium/winsys/egl_drm/intel/intel_screen.h
new file mode 100644 (file)
index 0000000..e8c1cdf
--- /dev/null
@@ -0,0 +1,133 @@
+/**************************************************************************
+ * 
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * 
+ **************************************************************************/
+
+#ifndef _INTEL_SCREEN_H_
+#define _INTEL_SCREEN_H_
+
+#include "ws_dri_bufpool.h"
+
+#include "pipe/p_compiler.h"
+
+struct egl_drm_device *device;
+
+struct intel_screen
+{
+#if 0
+   struct {
+      drm_handle_t handle;
+
+      /* We create a static dri buffer for the frontbuffer.
+       */
+      struct _DriBufferObject *buffer;
+
+      char *map;                   /* memory map */
+      int offset;                  /* from start of video mem, in bytes */
+      int pitch;                   /* row stride, in bytes */
+      int width;
+      int height;
+      int size;
+      int cpp;                     /* for front and back buffers */   
+   } front;
+#endif
+
+   int drmFB;
+
+#if 0
+   int deviceID;
+   int drmMinor;
+
+
+   drmI830Sarea *sarea;*/
+
+
+   /**
+   * Configuration cache with default values for all contexts
+   */
+   driOptionCache optionCache;
+#endif
+
+   struct _DriBufferPool *batchPool;
+   struct _DriBufferPool *staticPool; /** for the X screen/framebuffer */
+   boolean havePools;
+
+#if 0
+   /**
+    * Temporary(?) context to use for SwapBuffers or other situations in
+    * which we need a rendering context, but none is currently bound.
+    */
+   struct intel_context *dummyContext;
+#endif
+
+   /* 
+    * New stuff form the i915tex integration
+    */
+   struct _DriFenceMgr *mgr;
+   struct _DriFreeSlabManager *fMan;
+   unsigned batch_id;
+
+   struct pipe_winsys *winsys;
+   struct egl_drm_device *device;
+
+   /* batch buffer used for swap buffers */
+   struct intel_batchbuffer *batch;
+};
+
+
+
+/** cast wrapper */
+#if 0
+static INLINE struct intel_screen *
+intel_screen(__DRIscreenPrivate *sPriv)
+{
+   return (struct intel_screen *) sPriv->private;
+}
+
+
+extern void
+intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea);
+
+
+extern void intelDestroyContext(__DRIcontextPrivate * driContextPriv);
+
+extern boolean intelUnbindContext(__DRIcontextPrivate * driContextPriv);
+
+extern boolean
+intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
+                 __DRIdrawablePrivate * driDrawPriv,
+                 __DRIdrawablePrivate * driReadPriv);
+
+
+extern boolean
+intelCreatePools(__DRIscreenPrivate *sPriv);
+
+extern boolean
+intelCreateContext(const __GLcontextModes * visual,
+                   __DRIcontextPrivate * driContextPriv,
+                   void *sharedContextPrivate);
+
+#endif
+#endif
diff --git a/src/gallium/winsys/egl_drm/intel/intel_swapbuffers.c b/src/gallium/winsys/egl_drm/intel/intel_swapbuffers.c
new file mode 100644 (file)
index 0000000..1ce4b27
--- /dev/null
@@ -0,0 +1,327 @@
+/**************************************************************************
+ * 
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * 
+ **************************************************************************/
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_swapbuffers.h"
+#include "intel_batchbuffer.h"
+#include "intel_reg.h"
+#include "intel_winsys.h"
+
+#include "pipe/p_context.h"
+#include "state_tracker/st_public.h"
+#include "state_tracker/st_context.h"
+#include "state_tracker/st_cb_fbo.h"
+#include "intel_egl.h"
+
+
+static void
+intel_display_surface(struct egl_drm_drawable *draw,
+                      struct pipe_surface *surf);
+
+void intel_swap_buffers(struct egl_drm_drawable *draw)
+{
+       struct intel_framebuffer *intel_fb = (struct intel_framebuffer *)draw->priv;
+       struct pipe_surface *back_surf;
+
+       assert(intel_fb);
+       assert(intel_fb->stfb);
+
+       back_surf = st_get_framebuffer_surface(intel_fb->stfb, ST_SURFACE_BACK_LEFT);
+       if (back_surf) {
+               st_notify_swapbuffers(intel_fb->stfb);
+               intel_display_surface(draw, back_surf);
+               st_notify_swapbuffers_complete(intel_fb->stfb);
+       }
+}
+
+static void
+intel_display_surface(struct egl_drm_drawable *draw,
+                      struct pipe_surface *surf)
+{
+       struct intel_screen *intel = (struct intel_screen *)draw->device->priv;
+       struct intel_framebuffer *intel_fb = (struct intel_framebuffer *)draw->priv;
+       struct _DriFenceObject *fence;
+
+       //const int srcWidth = surf->width;
+       //const int srcHeight = surf->height;
+       const int srcPitch = surf->pitch;
+
+       const int dstWidth = intel_fb->front->width;
+       const int dstHeight = intel_fb->front->height;
+       const int dstPitch = intel_fb->front->pitch / 4;//draw->front.cpp;
+
+       const int cpp = 4;//intel_fb->front->cpp;
+
+       int BR13, CMD;
+       //int i;
+
+
+       BR13 = (dstPitch * cpp) | (0xCC << 16) | (1 << 24) | (1 << 25);
+       CMD = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
+                       XY_SRC_COPY_BLT_WRITE_RGB);
+
+       printf("srcPitch: %u, dstWidth: %u, dstHeight: %u, dstPitch: %u, cpp: %u\n", srcPitch, dstWidth, dstHeight, dstPitch, cpp);
+       BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS);
+       OUT_BATCH(CMD);
+       OUT_BATCH(BR13);
+       OUT_BATCH((0 << 16) | 0);
+       OUT_BATCH((dstHeight << 16) | dstWidth);
+
+       OUT_RELOC(intel_fb->front_buffer,
+               DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
+               DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0);
+
+       OUT_BATCH((0 << 16) | 0);
+       OUT_BATCH((srcPitch * cpp) & 0xffff);
+       OUT_RELOC(dri_bo(surf->buffer),
+                       DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
+                       DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, 0);
+
+       ADVANCE_BATCH();
+
+       fence = intel_batchbuffer_flush(intel->batch);
+       driFenceUnReference(&fence);
+       intel_batchbuffer_finish(intel->batch);
+}
+
+#if 0
+/**
+ * Display a colorbuffer surface in an X window.
+ * Used for SwapBuffers and flushing front buffer rendering.
+ *
+ * \param dPriv  the window/drawable to display into
+ * \param surf  the surface to display
+ * \param rect  optional subrect of surface to display (may be NULL).
+ */
+void
+intelDisplaySurface(__DRIdrawablePrivate *dPriv,
+                    struct pipe_surface *surf,
+                    const drm_clip_rect_t *rect)
+{
+   struct intel_screen *intelScreen = intel_screen(dPriv->driScreenPriv);
+   //struct intel_context *intel = intelScreen->dummyContext;
+
+   DBG(SWAP, "%s\n", __FUNCTION__);
+
+#if 0
+   if (!intel) {
+      /* XXX this is where some kind of extra/meta context could be useful */
+      return;
+   }
+#endif
+
+   if (intel->last_swap_fence) {
+      driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, TRUE);
+      driFenceUnReference(&intel->last_swap_fence);
+      intel->last_swap_fence = NULL;
+   }
+   intel->last_swap_fence = intel->first_swap_fence;
+   intel->first_swap_fence = NULL;
+
+   /* The LOCK_HARDWARE is required for the cliprects.  Buffer offsets
+    * should work regardless.
+    */
+   LOCK_HARDWARE(intel);
+   /* if this drawable isn't currently bound the LOCK_HARDWARE done on the
+    * current context (which is what intelScreenContext should return) might
+    * not get a contended lock and thus cliprects not updated (tests/manywin)
+    */
+   if (intel_context(dPriv->driContextPriv) != intel)
+      DRI_VALIDATE_DRAWABLE_INFO(intel->driScreen, dPriv);
+
+
+   if (dPriv && dPriv->numClipRects) {
+      const int srcWidth = surf->width;
+      const int srcHeight = surf->height;
+      const int nbox = dPriv->numClipRects;
+      const drm_clip_rect_t *pbox = dPriv->pClipRects;
+      const int pitch = intelScreen->front.pitch / intelScreen->front.cpp;
+      const int cpp = intelScreen->front.cpp;
+      const int srcpitch = surf->pitch;
+      int BR13, CMD;
+      int i;
+
+      ASSERT(surf->buffer);
+      ASSERT(surf->cpp == cpp);
+
+      DBG(SWAP, "screen pitch %d  src surface pitch %d\n",
+         pitch, surf->pitch);
+
+      if (cpp == 2) {
+        BR13 = (pitch * cpp) | (0xCC << 16) | (1 << 24);
+        CMD = XY_SRC_COPY_BLT_CMD;
+      }
+      else {
+        BR13 = (pitch * cpp) | (0xCC << 16) | (1 << 24) | (1 << 25);
+        CMD = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
+               XY_SRC_COPY_BLT_WRITE_RGB);
+      }
+
+      for (i = 0; i < nbox; i++, pbox++) {
+        drm_clip_rect_t box;
+        drm_clip_rect_t sbox;
+
+        if (pbox->x1 > pbox->x2 ||
+            pbox->y1 > pbox->y2 ||
+            pbox->x2 > intelScreen->front.width || 
+            pbox->y2 > intelScreen->front.height) {
+            /* invalid cliprect, skip it */
+           continue;
+         }
+
+        box = *pbox;
+
+        if (rect) {
+            /* intersect cliprect with user-provided src rect */
+           drm_clip_rect_t rrect;
+
+           rrect.x1 = dPriv->x + rect->x1;
+           rrect.y1 = (dPriv->h - rect->y1 - rect->y2) + dPriv->y;
+           rrect.x2 = rect->x2 + rrect.x1;
+           rrect.y2 = rect->y2 + rrect.y1;
+           if (rrect.x1 > box.x1)
+              box.x1 = rrect.x1;
+           if (rrect.y1 > box.y1)
+              box.y1 = rrect.y1;
+           if (rrect.x2 < box.x2)
+              box.x2 = rrect.x2;
+           if (rrect.y2 < box.y2)
+              box.y2 = rrect.y2;
+
+           if (box.x1 > box.x2 || box.y1 > box.y2)
+              continue;
+        }
+
+        /* restrict blit to size of actually rendered area */
+        if (box.x2 - box.x1 > srcWidth)
+           box.x2 = srcWidth + box.x1;
+        if (box.y2 - box.y1 > srcHeight)
+           box.y2 = srcHeight + box.y1;
+
+        DBG(SWAP, "box x1 x2 y1 y2 %d %d %d %d\n",
+            box.x1, box.x2, box.y1, box.y2);
+
+        sbox.x1 = box.x1 - dPriv->x;
+        sbox.y1 = box.y1 - dPriv->y;
+
+         assert(box.x1 < box.x2);
+         assert(box.y1 < box.y2);
+
+         /* XXX this could be done with pipe->surface_copy() */
+        BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS);
+        OUT_BATCH(CMD);
+        OUT_BATCH(BR13);
+        OUT_BATCH((box.y1 << 16) | box.x1);
+        OUT_BATCH((box.y2 << 16) | box.x2);
+
+        OUT_RELOC(intelScreen->front.buffer, 
+                  DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
+                  DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0);
+        OUT_BATCH((sbox.y1 << 16) | sbox.x1);
+        OUT_BATCH((srcpitch * cpp) & 0xffff);
+        OUT_RELOC(dri_bo(surf->buffer),
+                   DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
+                  DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, 0);
+
+        ADVANCE_BATCH();
+      }
+
+      if (intel->first_swap_fence)
+        driFenceUnReference(&intel->first_swap_fence);
+      intel->first_swap_fence = intel_batchbuffer_flush(intel->batch);
+   }
+
+   UNLOCK_HARDWARE(intel);
+
+   if (intel->lastStamp != dPriv->lastStamp) {
+      intelUpdateWindowSize(dPriv);
+      intel->lastStamp = dPriv->lastStamp;
+   }
+}
+
+
+
+/**
+ * This will be called whenever the currently bound window is moved/resized.
+ */
+void
+intelUpdateWindowSize(__DRIdrawablePrivate *dPriv)
+{
+   struct intel_framebuffer *intelfb = intel_framebuffer(dPriv);
+   assert(intelfb->stfb);
+   st_resize_framebuffer(intelfb->stfb, dPriv->w, dPriv->h);
+}
+
+
+
+void
+intelSwapBuffers(__DRIdrawablePrivate * dPriv)
+{
+   struct intel_framebuffer *intel_fb = intel_framebuffer(dPriv);
+   struct pipe_surface *back_surf;
+
+   assert(intel_fb);
+   assert(intel_fb->stfb);
+
+   back_surf = st_get_framebuffer_surface(intel_fb->stfb,
+                                          ST_SURFACE_BACK_LEFT);
+   if (back_surf) {
+      st_notify_swapbuffers(intel_fb->stfb);
+      intelDisplaySurface(dPriv, back_surf, NULL);
+      st_notify_swapbuffers_complete(intel_fb->stfb);
+   }
+}
+
+
+/**
+ * Called via glXCopySubBufferMESA() to copy a subrect of the back
+ * buffer to the front buffer/screen.
+ */
+void
+intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h)
+{
+   struct intel_framebuffer *intel_fb = intel_framebuffer(dPriv);
+   struct pipe_surface *back_surf;
+
+   assert(intel_fb);
+   assert(intel_fb->stfb);
+
+   back_surf = st_get_framebuffer_surface(intel_fb->stfb,
+                                          ST_SURFACE_BACK_LEFT);
+   if (back_surf) {
+      drm_clip_rect_t rect;
+      rect.x1 = x;
+      rect.y1 = y;
+      rect.x2 = w;
+      rect.y2 = h;
+
+      st_notify_swapbuffers(intel_fb->stfb);
+      intelDisplaySurface(dPriv, back_surf, &rect);
+   }
+}
+#endif
diff --git a/src/gallium/winsys/egl_drm/intel/intel_swapbuffers.h b/src/gallium/winsys/egl_drm/intel/intel_swapbuffers.h
new file mode 100644 (file)
index 0000000..904f267
--- /dev/null
@@ -0,0 +1,47 @@
+/**************************************************************************
+ * 
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * 
+ **************************************************************************/
+
+#ifndef INTEL_SWAPBUFFERS_H
+#define INTEL_SWAPBUFFERS_H
+
+
+struct pipe_surface;
+
+#if 0
+extern void intelDisplaySurface(__DRIdrawablePrivate * dPriv,
+                                struct pipe_surface *surf,
+                                const drm_clip_rect_t * rect);
+
+extern void intelSwapBuffers(__DRIdrawablePrivate * dPriv);
+
+extern void intelCopySubBuffer(__DRIdrawablePrivate * dPriv,
+                               int x, int y, int w, int h);
+
+extern void intelUpdateWindowSize(__DRIdrawablePrivate *dPriv);
+#endif
+
+#endif /* INTEL_SWAPBUFFERS_H */
diff --git a/src/gallium/winsys/egl_drm/intel/intel_winsys.h b/src/gallium/winsys/egl_drm/intel/intel_winsys.h
new file mode 100644 (file)
index 0000000..d0a319f
--- /dev/null
@@ -0,0 +1,73 @@
+/**************************************************************************
+ * 
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * 
+ **************************************************************************/
+
+#ifndef INTEL_WINSYS_H
+#define INTEL_WINSYS_H
+
+#include "pipe/p_state.h"
+
+struct intel_context;
+struct pipe_context;
+struct pipe_winsys;
+struct pipe_buffer;
+struct _DriBufferObject;
+
+struct pipe_winsys *
+intel_create_pipe_winsys( int fd, struct _DriFreeSlabManager *fMan );
+
+void
+intel_destroy_pipe_winsys( struct pipe_winsys *winsys );
+
+struct pipe_context *
+intel_create_softpipe( struct intel_context *intel,
+                       struct pipe_winsys *winsys );
+
+struct pipe_context *
+intel_create_i915simple( struct intel_context *intel,
+                       struct pipe_winsys *winsys );
+
+
+struct intel_buffer {
+   struct pipe_buffer base;
+   struct _DriBufferObject *driBO;
+};
+
+static INLINE struct intel_buffer *
+intel_buffer( struct pipe_buffer *buf )
+{
+   return (struct intel_buffer *)buf;
+}
+
+static INLINE struct _DriBufferObject *
+dri_bo( struct pipe_buffer *buf )
+{
+   return intel_buffer(buf)->driBO;
+}
+
+
+
+#endif
diff --git a/src/gallium/winsys/egl_drm/intel/intel_winsys_i915.c b/src/gallium/winsys/egl_drm/intel/intel_winsys_i915.c
new file mode 100644 (file)
index 0000000..8ec5c7e
--- /dev/null
@@ -0,0 +1,184 @@
+/**************************************************************************
+ * 
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * 
+ **************************************************************************/
+/*
+ * Authors: Keith Whitwell <keithw-at-tungstengraphics-dot-com>
+ */
+
+#include <stdlib.h>
+#include <xf86drm.h>
+#include "ws_dri_bufpool.h"
+#include "ws_dri_bufmgr.h"
+
+#include "intel_context.h"
+#include "intel_batchbuffer.h"
+#include "intel_winsys.h"
+
+#include "pipe/p_util.h"
+#include "pipe/p_winsys.h"
+#include "i915simple/i915_winsys.h"
+#include "i915simple/i915_screen.h"
+
+
+struct intel_i915_winsys {
+   struct i915_winsys winsys;   /**< batch buffer funcs */
+   struct pipe_winsys *pws;
+   struct intel_context *intel;
+};
+
+
+/* Turn a i915simple winsys into an intel/i915simple winsys:
+ */
+static inline struct intel_i915_winsys *
+intel_i915_winsys( struct i915_winsys *sws )
+{
+   return (struct intel_i915_winsys *)sws;
+}
+
+
+/* Simple batchbuffer interface:
+ */
+
+static unsigned *intel_i915_batch_start( struct i915_winsys *sws,
+                                        unsigned dwords,
+                                        unsigned relocs )
+{
+   struct intel_context *intel = intel_i915_winsys(sws)->intel;
+
+   /* XXX: check relocs. 
+    */
+   if (intel_batchbuffer_space( intel->batch ) >= dwords * 4) {
+      /* XXX: Hmm, the driver can't really do much with this pointer: 
+       */
+      return (unsigned *)intel->batch->ptr;    
+   }
+   else 
+      return NULL;
+}
+
+static void intel_i915_batch_dword( struct i915_winsys *sws,
+                                   unsigned dword )
+{
+   struct intel_context *intel = intel_i915_winsys(sws)->intel;
+   intel_batchbuffer_emit_dword( intel->batch, dword );
+}
+
+static void intel_i915_batch_reloc( struct i915_winsys *sws,
+                            struct pipe_buffer *buf,
+                            unsigned access_flags,
+                            unsigned delta )
+{
+   struct intel_context *intel = intel_i915_winsys(sws)->intel;
+   unsigned flags = DRM_BO_FLAG_MEM_TT;
+   unsigned mask = DRM_BO_MASK_MEM;
+
+   if (access_flags & I915_BUFFER_ACCESS_WRITE) {
+      flags |= DRM_BO_FLAG_WRITE;
+      mask |= DRM_BO_FLAG_WRITE;
+   }
+
+   if (access_flags & I915_BUFFER_ACCESS_READ) {
+      flags |= DRM_BO_FLAG_READ;
+      mask |= DRM_BO_FLAG_READ;
+   }
+
+#if 0 /* JB old */
+   intel_batchbuffer_emit_reloc( intel->batch,
+                                dri_bo( buf ),
+                                flags, mask,
+                                delta );
+#else /* new */
+   intel_offset_relocation( intel->batch,
+                           delta,
+                           dri_bo( buf ),
+                           flags,
+                           mask );
+#endif
+}
+
+
+
+static void intel_i915_batch_flush( struct i915_winsys *sws,
+                                    struct pipe_fence_handle **fence )
+{
+   struct intel_i915_winsys *iws = intel_i915_winsys(sws);
+   struct intel_context *intel = iws->intel;
+   union {
+      struct _DriFenceObject *dri;
+      struct pipe_fence_handle *pipe;
+   } fu;
+
+   if (fence)
+      assert(!*fence);
+
+   fu.dri = intel_batchbuffer_flush( intel->batch );
+
+   if (!fu.dri) {
+      assert(0);
+      *fence = NULL;
+      return;
+   }
+
+   if (fu.dri) {
+      if (fence)
+        *fence = fu.pipe;
+      else
+        driFenceUnReference(&fu.dri);
+   }
+
+}
+
+
+/**
+ * Create i915 hardware rendering context.
+ */
+struct pipe_context *
+intel_create_i915simple( struct intel_context *intel,
+                         struct pipe_winsys *winsys )
+{
+   struct intel_i915_winsys *iws = CALLOC_STRUCT( intel_i915_winsys );
+   struct pipe_screen *screen;
+   
+   /* Fill in this struct with callbacks that i915simple will need to
+    * communicate with the window system, buffer manager, etc. 
+    */
+   iws->winsys.batch_start = intel_i915_batch_start;
+   iws->winsys.batch_dword = intel_i915_batch_dword;
+   iws->winsys.batch_reloc = intel_i915_batch_reloc;
+   iws->winsys.batch_flush = intel_i915_batch_flush;
+   iws->pws = winsys;
+   iws->intel = intel;
+
+   screen = i915_create_screen(winsys, PCI_CHIP_I945_GM);
+   assert(screen);
+
+   /* Create the i915simple context:
+    */
+   return i915_create_context( screen,
+                               winsys,
+                               &iws->winsys );
+}
diff --git a/src/gallium/winsys/egl_drm/intel/intel_winsys_pipe.c b/src/gallium/winsys/egl_drm/intel/intel_winsys_pipe.c
new file mode 100644 (file)
index 0000000..8bf8c21
--- /dev/null
@@ -0,0 +1,338 @@
+/**************************************************************************
+ * 
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * 
+ **************************************************************************/
+/*
+ * Authors: Keith Whitwell <keithw-at-tungstengraphics-dot-com>
+ */
+
+#include <stdlib.h>
+#include <xf86drm.h>
+//#include "dri_bufpool.h"
+//#include "dri_bufmgr.h"
+
+#include "intel_context.h"
+#include "intel_winsys.h"
+#include "intel_swapbuffers.h"
+#include "intel_batchbuffer.h"
+
+#include "pipe/p_winsys.h"
+#include "pipe/p_defines.h"
+#include "pipe/p_state.h"
+#include "pipe/p_util.h"
+#include "pipe/p_inlines.h"
+
+
+
+struct intel_pipe_winsys {
+   struct pipe_winsys winsys;
+   struct _DriBufferPool *regionPool;
+   struct _DriFreeSlabManager *fMan;
+};
+
+
+
+/* Turn a pipe winsys into an intel/pipe winsys:
+ */
+static inline struct intel_pipe_winsys *
+intel_pipe_winsys( struct pipe_winsys *winsys )
+{
+   return (struct intel_pipe_winsys *)winsys;
+}
+
+
+/* Most callbacks map direcly onto dri_bufmgr operations:
+ */
+static void *intel_buffer_map(struct pipe_winsys *winsys, 
+                             struct pipe_buffer *buf,
+                             unsigned flags )
+{
+   unsigned drm_flags = 0;
+   
+   if (flags & PIPE_BUFFER_USAGE_CPU_WRITE)
+      drm_flags |= DRM_BO_FLAG_WRITE;
+
+   if (flags & PIPE_BUFFER_USAGE_CPU_READ)
+      drm_flags |= DRM_BO_FLAG_READ;
+
+   return driBOMap( dri_bo(buf), drm_flags, 0 );
+}
+
+static void intel_buffer_unmap(struct pipe_winsys *winsys, 
+                              struct pipe_buffer *buf)
+{
+   driBOUnmap( dri_bo(buf) );
+}
+
+
+static void
+intel_buffer_destroy(struct pipe_winsys *winsys,
+                    struct pipe_buffer *buf)
+{
+   driBOUnReference( dri_bo(buf) );
+   FREE(buf);
+}
+
+
+/* Pipe has no concept of pools.  We choose the tex/region pool
+ * for all buffers.
+ * Grabs the hardware lock!
+ */
+static struct pipe_buffer *
+intel_buffer_create(struct pipe_winsys *winsys, 
+                    unsigned alignment, 
+                    unsigned usage, 
+                    unsigned size )
+{
+   struct intel_buffer *buffer = CALLOC_STRUCT( intel_buffer );
+   struct intel_pipe_winsys *iws = intel_pipe_winsys(winsys);
+   unsigned flags = 0;
+
+   buffer->base.refcount = 1;
+   buffer->base.alignment = alignment;
+   buffer->base.usage = usage;
+   buffer->base.size = size;
+
+   if (usage & (PIPE_BUFFER_USAGE_VERTEX /*| IWS_BUFFER_USAGE_LOCAL*/)) {
+      flags |= DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED;
+   } else {
+      flags |= DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_TT;
+   }
+
+   if (usage & PIPE_BUFFER_USAGE_GPU_READ)
+      flags |= DRM_BO_FLAG_READ;
+
+   if (usage & PIPE_BUFFER_USAGE_GPU_WRITE)
+      flags |= DRM_BO_FLAG_WRITE;
+
+   /* drm complains if we don't set any read/write flags.
+    */
+   if ((flags & (DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE)) == 0)
+      flags |= DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE;
+
+#if 0
+   if (flags & IWS_BUFFER_USAGE_EXE)
+      flags |= DRM_BO_FLAG_EXE;
+
+   if (usage & IWS_BUFFER_USAGE_CACHED)
+      flags |= DRM_BO_FLAG_CACHED;
+#endif
+
+   driGenBuffers( iws->regionPool, 
+                 "pipe buffer", 1, &buffer->driBO, alignment, flags, 0 );
+
+   driBOData( buffer->driBO, size, NULL, iws->regionPool, 0 );
+
+   return &buffer->base;
+}
+
+
+static struct pipe_buffer *
+intel_user_buffer_create(struct pipe_winsys *winsys, void *ptr, unsigned bytes)
+{
+   struct intel_buffer *buffer = CALLOC_STRUCT( intel_buffer );
+   struct intel_pipe_winsys *iws = intel_pipe_winsys(winsys);
+
+   driGenUserBuffer( iws->regionPool, 
+                    "pipe user buffer", &buffer->driBO, ptr, bytes );
+
+   buffer->base.refcount = 1;
+
+   return &buffer->base;
+}
+
+
+/* The state tracker (should!) keep track of whether the fake
+ * frontbuffer has been touched by any rendering since the last time
+ * we copied its contents to the real frontbuffer.  Our task is easy:
+ */
+static void
+intel_flush_frontbuffer( struct pipe_winsys *winsys,
+                         struct pipe_surface *surf,
+                         void *context_private)
+{
+#if 0
+   struct intel_context *intel = (struct intel_context *) context_private;
+   __DRIdrawablePrivate *dPriv = intel->driDrawable;
+
+   intelDisplaySurface(dPriv, surf, NULL);
+#endif
+}
+
+
+static struct pipe_surface *
+intel_i915_surface_alloc(struct pipe_winsys *winsys)
+{
+   struct pipe_surface *surf = CALLOC_STRUCT(pipe_surface);
+   if (surf) {
+      surf->refcount = 1;
+      surf->winsys = winsys;
+   }
+   return surf;
+}
+
+
+/**
+ * Round n up to next multiple.
+ */
+static INLINE unsigned
+round_up(unsigned n, unsigned multiple)
+{
+   return (n + multiple - 1) & ~(multiple - 1);
+}
+
+/**
+ * Copied from xm_winsys.c
+ */
+static int
+intel_i915_surface_alloc_storage(struct pipe_winsys *winsys,
+                                 struct pipe_surface *surf,
+                                 unsigned width, unsigned height,
+                                 enum pipe_format format, 
+                                 unsigned flags)
+{
+   const unsigned alignment = 64;
+   //int ret;
+
+   surf->width = width;
+   surf->height = height;
+   surf->format = format;
+   surf->cpp = pf_get_size(format);
+   surf->pitch = round_up(width, alignment / surf->cpp);
+
+   assert(!surf->buffer);
+   surf->buffer = winsys->buffer_create(winsys, alignment,
+                                        PIPE_BUFFER_USAGE_PIXEL,
+                                        surf->pitch * surf->cpp * height);
+   if(!surf->buffer)
+      return -1;
+
+   return 0;
+}
+
+
+static void
+intel_i915_surface_release(struct pipe_winsys *winsys, struct pipe_surface **s)
+{
+   struct pipe_surface *surf = *s;
+   surf->refcount--;
+   if (surf->refcount == 0) {
+      if (surf->buffer)
+        pipe_buffer_reference(winsys, &surf->buffer, NULL);
+      free(surf);
+   }
+   *s = NULL;
+}
+
+
+
+static const char *
+intel_get_name( struct pipe_winsys *winsys )
+{
+   return "Intel/EGL/ttm";
+}
+
+static void
+intel_fence_reference( struct pipe_winsys *sws,
+                       struct pipe_fence_handle **ptr,
+                       struct pipe_fence_handle *fence )
+{
+   if (*ptr)
+      driFenceUnReference((struct _DriFenceObject **)ptr);
+
+   if (fence)
+      *ptr = (struct pipe_fence_handle *)driFenceReference((struct _DriFenceObject *)fence);
+}
+
+static int
+intel_fence_signalled( struct pipe_winsys *sws,
+                       struct pipe_fence_handle *fence,
+                       unsigned flag )
+{
+   return driFenceSignaled((struct _DriFenceObject *)fence, flag);
+}
+
+static int
+intel_fence_finish( struct pipe_winsys *sws,
+                    struct pipe_fence_handle *fence,
+                    unsigned flag )
+{
+   /* JB: Lets allways lazy wait */
+   return driFenceFinish((struct _DriFenceObject *)fence, flag, 1);
+}
+
+struct pipe_winsys *
+intel_create_pipe_winsys( int fd, struct _DriFreeSlabManager *fMan )
+{
+   struct intel_pipe_winsys *iws = CALLOC_STRUCT( intel_pipe_winsys );
+   
+   /* Fill in this struct with callbacks that pipe will need to
+    * communicate with the window system, buffer manager, etc. 
+    *
+    * Pipe would be happy with a malloc based memory manager, but
+    * the SwapBuffers implementation in this winsys driver requires
+    * that rendering be done to an appropriate _DriBufferObject.  
+    */
+   iws->winsys.buffer_create = intel_buffer_create;
+   iws->winsys.user_buffer_create = intel_user_buffer_create;
+   iws->winsys.buffer_map = intel_buffer_map;
+   iws->winsys.buffer_unmap = intel_buffer_unmap;
+   iws->winsys.buffer_destroy = intel_buffer_destroy;
+   iws->winsys.flush_frontbuffer = intel_flush_frontbuffer;
+   iws->winsys.get_name = intel_get_name;
+   iws->winsys.surface_alloc = intel_i915_surface_alloc;
+   iws->winsys.surface_alloc_storage = intel_i915_surface_alloc_storage;
+   iws->winsys.surface_release = intel_i915_surface_release;
+
+   iws->winsys.fence_reference = intel_fence_reference;
+   iws->winsys.fence_signalled = intel_fence_signalled;
+   iws->winsys.fence_finish = intel_fence_finish;
+
+   if (fd)
+      iws->regionPool = driSlabPoolInit(fd,
+                       DRM_BO_FLAG_READ |
+                       DRM_BO_FLAG_WRITE |
+                       DRM_BO_FLAG_MEM_TT,
+                       DRM_BO_FLAG_READ |
+                       DRM_BO_FLAG_WRITE |
+                       DRM_BO_FLAG_MEM_TT,
+                       64, 6, 16, 4096, 0,
+                       fMan);
+
+   return &iws->winsys;
+}
+
+
+void
+intel_destroy_pipe_winsys( struct pipe_winsys *winsys )
+{
+   struct intel_pipe_winsys *iws = intel_pipe_winsys(winsys);
+   if (iws->regionPool) {
+      driPoolTakeDown(iws->regionPool);
+   }
+   free(iws);
+}
+
diff --git a/src/gallium/winsys/egl_drm/intel/intel_winsys_softpipe.c b/src/gallium/winsys/egl_drm/intel/intel_winsys_softpipe.c
new file mode 100644 (file)
index 0000000..0bc2dc4
--- /dev/null
@@ -0,0 +1,82 @@
+/**************************************************************************
+ * 
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * 
+ **************************************************************************/
+/*
+ * Authors: Keith Whitwell <keithw-at-tungstengraphics-dot-com>
+ */
+
+#include "intel_context.h"
+#include "intel_winsys.h"
+#include "pipe/p_defines.h"
+#include "pipe/p_util.h"
+#include "pipe/p_format.h"
+#include "softpipe/sp_winsys.h"
+
+
+struct intel_softpipe_winsys {
+   struct softpipe_winsys sws;
+   struct intel_context *intel;
+};
+
+/**
+ * Return list of surface formats supported by this driver.
+ */
+static boolean
+intel_is_format_supported(struct softpipe_winsys *sws,
+                          enum pipe_format format)
+{
+   switch(format) {
+   case PIPE_FORMAT_A8R8G8B8_UNORM:
+   case PIPE_FORMAT_R5G6B5_UNORM:
+   case PIPE_FORMAT_S8Z24_UNORM:
+      return TRUE;
+   default:
+      return FALSE;
+   }
+}
+
+
+/**
+ * Create rendering context which uses software rendering.
+ */
+struct pipe_context *
+intel_create_softpipe( struct intel_context *intel,
+                       struct pipe_winsys *winsys )
+{
+   struct intel_softpipe_winsys *isws = CALLOC_STRUCT( intel_softpipe_winsys );
+   struct pipe_screen *screen = softpipe_create_screen(winsys);
+   
+   /* Fill in this struct with callbacks that softpipe will need to
+    * communicate with the window system, buffer manager, etc. 
+    */
+   isws->sws.is_format_supported = intel_is_format_supported;
+   isws->intel = intel;
+
+   /* Create the softpipe context:
+    */
+   return softpipe_create( screen, winsys, &isws->sws );
+}
diff --git a/src/gallium/winsys/egl_drm/intel/ws_dri_bufmgr.c b/src/gallium/winsys/egl_drm/intel/ws_dri_bufmgr.c
new file mode 100644 (file)
index 0000000..1bc1089
--- /dev/null
@@ -0,0 +1,953 @@
+/**************************************************************************
+ * 
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * 
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ *          Keith Whitwell <keithw-at-tungstengraphics-dot-com>
+ */
+
+#include <xf86drm.h>
+#include <stdlib.h>
+#include "glthread.h"
+#include "errno.h"
+#include "ws_dri_bufmgr.h"
+#include "string.h"
+#include "imports.h"
+#include "ws_dri_bufpool.h"
+#include "ws_dri_fencemgr.h"
+
+/*
+ * This lock is here to protect drmBO structs changing underneath us during a
+ * validate list call, since validatelist cannot take individiual locks for
+ * each drmBO. Validatelist takes this lock in write mode. Any access to an
+ * individual drmBO should take this lock in read mode, since in that case, the
+ * driBufferObject mutex will protect the access. Locking order is 
+ * driBufferObject mutex - > this rw lock.
+ */
+
+_glthread_DECLARE_STATIC_MUTEX(bmMutex);
+_glthread_DECLARE_STATIC_COND(bmCond);
+
+static int kernelReaders = 0;
+static int num_buffers = 0;
+static int num_user_buffers = 0;
+
+static drmBO *drmBOListBuf(void *iterator)
+{
+    drmBONode *node;
+    drmMMListHead *l = (drmMMListHead *) iterator;
+    node = DRMLISTENTRY(drmBONode, l, head);
+    return node->buf;
+}
+
+static void *drmBOListIterator(drmBOList *list)
+{
+    void *ret = list->list.next;
+
+    if (ret == &list->list)
+       return NULL;
+    return ret;
+}
+
+static void *drmBOListNext(drmBOList *list, void *iterator)
+{
+    void *ret;
+
+    drmMMListHead *l = (drmMMListHead *) iterator;
+    ret = l->next;
+    if (ret == &list->list)
+       return NULL;
+    return ret;
+}
+
+static drmBONode *drmAddListItem(drmBOList *list, drmBO *item, 
+                                uint64_t arg0,
+                                uint64_t arg1)
+{
+    drmBONode *node;
+    drmMMListHead *l;
+
+    l = list->free.next;
+    if (l == &list->free) {
+       node = (drmBONode *) malloc(sizeof(*node));
+       if (!node) {
+           return NULL;
+       }
+       list->numCurrent++;
+    }
+    else {
+       DRMLISTDEL(l);
+       node = DRMLISTENTRY(drmBONode, l, head);
+    }
+    node->buf = item;
+    node->arg0 = arg0;
+    node->arg1 = arg1;
+    DRMLISTADD(&node->head, &list->list);
+    list->numOnList++;
+    return node;
+}
+  
+static int drmAddValidateItem(drmBOList *list, drmBO *buf, uint64_t flags, 
+                             uint64_t mask, int *newItem)
+{
+    drmBONode *node, *cur;
+    drmMMListHead *l;
+
+    *newItem = 0;
+    cur = NULL;
+
+    for (l = list->list.next; l != &list->list; l = l->next) {
+       node = DRMLISTENTRY(drmBONode, l, head);
+       if (node->buf == buf) {
+           cur = node;
+           break;
+       }
+    }
+    if (!cur) {
+       cur = drmAddListItem(list, buf, flags, mask);
+       if (!cur) {
+           return -ENOMEM;
+       }
+       *newItem = 1;
+       cur->arg0 = flags;
+       cur->arg1 = mask;
+    }
+    else {
+        uint64_t memFlags = cur->arg0 & flags & DRM_BO_MASK_MEM;
+       uint64_t accFlags = (cur->arg0 | flags) & ~DRM_BO_MASK_MEM;
+
+       if (mask & cur->arg1 & ~DRM_BO_MASK_MEM  & (cur->arg0 ^ flags)) {
+           return -EINVAL;
+       }
+
+       cur->arg1 |= mask;
+       cur->arg0 = (cur->arg0 & ~mask) | ((memFlags | accFlags) & mask);
+
+       if (((cur->arg1 & DRM_BO_MASK_MEM) != 0) &&
+           (cur->arg0 & DRM_BO_MASK_MEM) == 0) {
+           return -EINVAL;
+       }
+    }
+    return 0;
+}
+
+static void drmBOFreeList(drmBOList *list)
+{
+    drmBONode *node;
+    drmMMListHead *l;
+
+    l = list->list.next;
+    while(l != &list->list) {
+       DRMLISTDEL(l);
+       node = DRMLISTENTRY(drmBONode, l, head);
+       free(node);
+       l = list->list.next;
+       list->numCurrent--;
+       list->numOnList--;
+    }
+
+    l = list->free.next;
+    while(l != &list->free) {
+       DRMLISTDEL(l);
+       node = DRMLISTENTRY(drmBONode, l, head);
+       free(node);
+       l = list->free.next;
+       list->numCurrent--;
+    }
+}
+
+static int drmAdjustListNodes(drmBOList *list)
+{
+    drmBONode *node;
+    drmMMListHead *l;
+    int ret = 0;
+
+    while(list->numCurrent < list->numTarget) {
+       node = (drmBONode *) malloc(sizeof(*node));
+       if (!node) {
+           ret = -ENOMEM;
+           break;
+       }
+       list->numCurrent++;
+       DRMLISTADD(&node->head, &list->free);
+    }
+
+    while(list->numCurrent > list->numTarget) {
+       l = list->free.next;
+       if (l == &list->free)
+           break;
+       DRMLISTDEL(l);
+       node = DRMLISTENTRY(drmBONode, l, head);
+       free(node);
+       list->numCurrent--;
+    }
+    return ret;
+}
+
+static int drmBOCreateList(int numTarget, drmBOList *list)
+{
+    DRMINITLISTHEAD(&list->list);
+    DRMINITLISTHEAD(&list->free);
+    list->numTarget = numTarget;
+    list->numCurrent = 0;
+    list->numOnList = 0;
+    return drmAdjustListNodes(list);
+}
+
+static int drmBOResetList(drmBOList *list)
+{
+    drmMMListHead *l;
+    int ret;
+
+    ret = drmAdjustListNodes(list);
+    if (ret)
+       return ret;
+
+    l = list->list.next;
+    while (l != &list->list) {
+       DRMLISTDEL(l);
+       DRMLISTADD(l, &list->free);
+       list->numOnList--;
+       l = list->list.next;
+    }
+    return drmAdjustListNodes(list);
+}
+
+void driWriteLockKernelBO(void)
+{
+    _glthread_LOCK_MUTEX(bmMutex);
+    while(kernelReaders != 0)
+       _glthread_COND_WAIT(bmCond, bmMutex);
+}
+    
+void driWriteUnlockKernelBO(void)
+{
+    _glthread_UNLOCK_MUTEX(bmMutex);
+}    
+
+void driReadLockKernelBO(void)
+{
+    _glthread_LOCK_MUTEX(bmMutex);
+    kernelReaders++;
+    _glthread_UNLOCK_MUTEX(bmMutex);
+}
+
+void driReadUnlockKernelBO(void)
+{
+    _glthread_LOCK_MUTEX(bmMutex);
+    if (--kernelReaders == 0)
+        _glthread_COND_BROADCAST(bmCond);
+    _glthread_UNLOCK_MUTEX(bmMutex);
+}
+
+
+
+
+/*
+ * TODO: Introduce fence pools in the same way as 
+ * buffer object pools.
+ */
+
+typedef struct _DriBufferObject
+{
+   DriBufferPool *pool;
+   _glthread_Mutex mutex;
+   int refCount;
+   const char *name;
+   uint64_t flags;
+   unsigned hint;
+   unsigned alignment;
+   unsigned createdByReference;
+   void *private;
+   /* user-space buffer: */
+   unsigned userBuffer;
+   void *userData;
+   unsigned userSize;
+} DriBufferObject;
+
+typedef struct _DriBufferList {
+    drmBOList drmBuffers;  /* List of kernel buffers needing validation */
+    drmBOList driBuffers;  /* List of user-space buffers needing validation */
+} DriBufferList;
+
+
+void
+bmError(int val, const char *file, const char *function, int line)
+{
+   _mesa_printf("Fatal video memory manager error \"%s\".\n"
+                "Check kernel logs or set the LIBGL_DEBUG\n"
+                "environment variable to \"verbose\" for more info.\n"
+                "Detected in file %s, line %d, function %s.\n",
+                strerror(-val), file, line, function);
+#ifndef NDEBUG
+   abort();
+#else
+   abort();
+#endif
+}
+
+extern drmBO *
+driBOKernel(struct _DriBufferObject *buf)
+{
+   drmBO *ret;
+
+   driReadLockKernelBO();
+   _glthread_LOCK_MUTEX(buf->mutex);
+   assert(buf->private != NULL);
+   ret = buf->pool->kernel(buf->pool, buf->private);
+   if (!ret)
+      BM_CKFATAL(-EINVAL);
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+   driReadUnlockKernelBO();
+
+   return ret;
+}
+
+void
+driBOWaitIdle(struct _DriBufferObject *buf, int lazy)
+{
+
+  /*
+   * This function may block. Is it sane to keep the mutex held during
+   * that time??
+   */
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   BM_CKFATAL(buf->pool->waitIdle(buf->pool, buf->private, &buf->mutex, lazy));
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+void *
+driBOMap(struct _DriBufferObject *buf, unsigned flags, unsigned hint)
+{
+   void *virtual;
+   int retval;
+
+   if (buf->userBuffer) {
+      return buf->userData;
+   }
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   assert(buf->private != NULL);
+   retval = buf->pool->map(buf->pool, buf->private, flags, hint, 
+                          &buf->mutex, &virtual);
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+
+   return retval == 0 ? virtual : NULL;
+}
+
+void
+driBOUnmap(struct _DriBufferObject *buf)
+{
+   if (buf->userBuffer)
+      return;
+
+   assert(buf->private != NULL);
+   _glthread_LOCK_MUTEX(buf->mutex);
+   BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private));
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+unsigned long
+driBOOffset(struct _DriBufferObject *buf)
+{
+   unsigned long ret;
+
+   assert(buf->private != NULL);
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   ret = buf->pool->offset(buf->pool, buf->private);
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+   return ret;
+}
+
+unsigned long
+driBOPoolOffset(struct _DriBufferObject *buf)
+{
+   unsigned long ret;
+
+   assert(buf->private != NULL);
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   ret = buf->pool->poolOffset(buf->pool, buf->private);
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+   return ret;
+}
+
+uint64_t 
+driBOFlags(struct _DriBufferObject *buf)
+{
+   uint64_t ret;
+
+   assert(buf->private != NULL);
+
+   driReadLockKernelBO();
+   _glthread_LOCK_MUTEX(buf->mutex);
+   ret = buf->pool->flags(buf->pool, buf->private);
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+   driReadUnlockKernelBO();
+   return ret;
+}
+
+struct _DriBufferObject *
+driBOReference(struct _DriBufferObject *buf)
+{
+   _glthread_LOCK_MUTEX(buf->mutex);
+   if (++buf->refCount == 1) {
+      _glthread_UNLOCK_MUTEX(buf->mutex);
+      BM_CKFATAL(-EINVAL);
+   }
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+   return buf;
+}
+
+void
+driBOUnReference(struct _DriBufferObject *buf)
+{
+   int tmp;
+
+   if (!buf)
+      return;
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   tmp = --buf->refCount;
+   if (!tmp) {
+      _glthread_UNLOCK_MUTEX(buf->mutex);
+      if (buf->private) {
+        if (buf->createdByReference)
+           buf->pool->unreference(buf->pool, buf->private);
+        else
+           buf->pool->destroy(buf->pool, buf->private);
+      }
+      if (buf->userBuffer)
+        num_user_buffers--;
+      else
+        num_buffers--;
+      free(buf);
+   } else 
+     _glthread_UNLOCK_MUTEX(buf->mutex);
+
+}
+
+
+int
+driBOData(struct _DriBufferObject *buf,
+          unsigned size, const void *data, 
+         DriBufferPool *newPool, 
+         uint64_t flags)
+{
+   void *virtual = NULL;
+   int newBuffer;
+   int retval = 0;
+   struct _DriBufferPool *pool;
+
+   assert(!buf->userBuffer); /* XXX just do a memcpy? */
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   pool = buf->pool;
+
+   if (pool == NULL && newPool != NULL) {
+       buf->pool = newPool;
+       pool = newPool;
+   }
+   if (newPool == NULL)
+       newPool = pool;
+
+   if (!pool->create) {
+      _mesa_error(NULL, GL_INVALID_OPERATION,
+                  "driBOData called on invalid buffer\n");
+      BM_CKFATAL(-EINVAL);
+   }
+
+   newBuffer = (!buf->private || pool != newPool ||
+               pool->size(pool, buf->private) < size);
+
+   if (!flags)
+       flags = buf->flags;
+
+   if (newBuffer) {
+
+       if (buf->createdByReference) {
+         _mesa_error(NULL, GL_INVALID_OPERATION,
+                    "driBOData requiring resizing called on "
+                    "shared buffer.\n");
+         BM_CKFATAL(-EINVAL);
+       }
+
+       if (buf->private)
+          buf->pool->destroy(buf->pool, buf->private);
+
+       pool = newPool;
+       buf->pool = newPool;
+       buf->private = pool->create(pool, size, flags, DRM_BO_HINT_DONT_FENCE,
+                                 buf->alignment);
+      if (!buf->private)
+         retval = -ENOMEM;
+
+      if (retval == 0)
+         retval = pool->map(pool, buf->private,
+                            DRM_BO_FLAG_WRITE,
+                            DRM_BO_HINT_DONT_BLOCK, &buf->mutex, &virtual);
+   } else if (pool->map(pool, buf->private, DRM_BO_FLAG_WRITE,
+                       DRM_BO_HINT_DONT_BLOCK, &buf->mutex, &virtual)) {
+       /*
+       * Buffer is busy. need to create a new one.
+       */
+
+       void *newBuf;
+
+       newBuf = pool->create(pool, size, flags, DRM_BO_HINT_DONT_FENCE,
+                            buf->alignment);
+       if (newBuf) {
+          buf->pool->destroy(buf->pool, buf->private);
+          buf->private = newBuf;
+       }
+
+       retval = pool->map(pool, buf->private,
+                         DRM_BO_FLAG_WRITE, 0, &buf->mutex, &virtual);
+   } else {
+       uint64_t flag_diff = flags ^ buf->flags;
+       
+       /*
+       * We might need to change buffer flags.
+       */
+
+       if (flag_diff){
+          assert(pool->setStatus != NULL);
+          BM_CKFATAL(pool->unmap(pool, buf->private));
+          BM_CKFATAL(pool->setStatus(pool, buf->private, flag_diff,
+                                     buf->flags));
+          if (!data)
+            goto out;
+
+          retval = pool->map(pool, buf->private,
+                             DRM_BO_FLAG_WRITE, 0, &buf->mutex, &virtual);
+       }
+   }
+
+   if (retval == 0) {
+      if (data)
+        memcpy(virtual, data, size);
+
+      BM_CKFATAL(pool->unmap(pool, buf->private));
+   }
+
+ out:
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+   
+   return retval;
+}
+
+void
+driBOSubData(struct _DriBufferObject *buf,
+             unsigned long offset, unsigned long size, const void *data)
+{
+   void *virtual;
+
+   assert(!buf->userBuffer); /* XXX just do a memcpy? */
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   if (size && data) {
+      BM_CKFATAL(buf->pool->map(buf->pool, buf->private,
+                                DRM_BO_FLAG_WRITE, 0, &buf->mutex,
+                               &virtual));
+      memcpy((unsigned char *) virtual + offset, data, size);
+      BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private));
+   }
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+void
+driBOGetSubData(struct _DriBufferObject *buf,
+                unsigned long offset, unsigned long size, void *data)
+{
+   void *virtual;
+
+   assert(!buf->userBuffer); /* XXX just do a memcpy? */
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   if (size && data) {
+      BM_CKFATAL(buf->pool->map(buf->pool, buf->private,
+                                DRM_BO_FLAG_READ, 0, &buf->mutex, &virtual));
+      memcpy(data, (unsigned char *) virtual + offset, size);
+      BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private));
+   }
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+void
+driBOSetReferenced(struct _DriBufferObject *buf,
+                  unsigned long handle)
+{
+   _glthread_LOCK_MUTEX(buf->mutex);
+   if (buf->private != NULL) {
+      _mesa_error(NULL, GL_INVALID_OPERATION,
+                  "Invalid buffer for setReferenced\n");
+      BM_CKFATAL(-EINVAL);
+   
+   }
+   if (buf->pool->reference == NULL) {
+      _mesa_error(NULL, GL_INVALID_OPERATION,
+                  "Invalid buffer pool for setReferenced\n");
+      BM_CKFATAL(-EINVAL);
+   }
+   buf->private = buf->pool->reference(buf->pool, handle);
+   if (!buf->private) {
+      _mesa_error(NULL, GL_OUT_OF_MEMORY,
+                  "Invalid buffer pool for setStatic\n");
+      BM_CKFATAL(-ENOMEM);
+   }
+   buf->createdByReference = GL_TRUE;
+   buf->flags = buf->pool->kernel(buf->pool, buf->private)->flags;
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+int
+driGenBuffers(struct _DriBufferPool *pool,
+              const char *name,
+              unsigned n,
+              struct _DriBufferObject *buffers[],
+              unsigned alignment, uint64_t flags, unsigned hint)
+{
+   struct _DriBufferObject *buf;
+   int i;
+
+   flags = (flags) ? flags : DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_MEM_VRAM |
+      DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE;
+
+   ++num_buffers;
+
+   assert(pool);
+
+   for (i = 0; i < n; ++i) {
+      buf = (struct _DriBufferObject *) calloc(1, sizeof(*buf));
+      if (!buf)
+        return -ENOMEM;
+
+      _glthread_INIT_MUTEX(buf->mutex);
+      _glthread_LOCK_MUTEX(buf->mutex);
+      buf->refCount = 1;
+      buf->flags = flags;
+      buf->hint = hint;
+      buf->name = name;
+      buf->alignment = alignment;
+      buf->pool = pool;
+      buf->createdByReference = 0;
+      _glthread_UNLOCK_MUTEX(buf->mutex);
+      buffers[i] = buf;
+   }
+   return 0;
+}
+
+void
+driGenUserBuffer(struct _DriBufferPool *pool,
+                 const char *name,
+                 struct _DriBufferObject **buffers,
+                 void *ptr, unsigned bytes)
+{
+   const unsigned alignment = 1, flags = 0, hint = 0;
+
+   --num_buffers; /* JB: is inced in GenBuffes */
+   driGenBuffers(pool, name, 1, buffers, alignment, flags, hint);
+   ++num_user_buffers;
+
+   (*buffers)->userBuffer = 1;
+   (*buffers)->userData = ptr;
+   (*buffers)->userSize = bytes;
+}
+
+void
+driDeleteBuffers(unsigned n, struct _DriBufferObject *buffers[])
+{
+   int i;
+
+   for (i = 0; i < n; ++i) {
+      driBOUnReference(buffers[i]);
+   }
+}
+
+
+void
+driInitBufMgr(int fd)
+{
+   ;
+}
+
+/*
+ * Note that lists are per-context and don't need mutex protection.
+ */
+
+struct _DriBufferList *
+driBOCreateList(int target)
+{
+    struct _DriBufferList *list = calloc(sizeof(*list), 1);
+
+    BM_CKFATAL(drmBOCreateList(target, &list->drmBuffers));
+    BM_CKFATAL(drmBOCreateList(target, &list->driBuffers));
+    return list;
+}
+
+int
+driBOResetList(struct _DriBufferList * list)
+{
+    int ret;
+    ret = drmBOResetList(&list->drmBuffers);
+    if (ret)
+       return ret;
+    ret = drmBOResetList(&list->driBuffers);
+    return ret;
+}
+
+void
+driBOFreeList(struct _DriBufferList * list)
+{
+   drmBOFreeList(&list->drmBuffers);
+   drmBOFreeList(&list->driBuffers);
+   free(list);
+}
+
+
+/*
+ * Copied from libdrm, because it is needed by driAddValidateItem.
+ */
+
+static drmBONode *
+driAddListItem(drmBOList * list, drmBO * item,
+              uint64_t arg0, uint64_t arg1)
+{
+    drmBONode *node;
+    drmMMListHead *l;
+
+    l = list->free.next;
+    if (l == &list->free) {
+       node = (drmBONode *) malloc(sizeof(*node));
+       if (!node) {
+           return NULL;
+       }
+       list->numCurrent++;
+    } else {
+       DRMLISTDEL(l);
+       node = DRMLISTENTRY(drmBONode, l, head);
+    }
+    memset(&node->bo_arg, 0, sizeof(node->bo_arg));
+    node->buf = item;
+    node->arg0 = arg0;
+    node->arg1 = arg1;
+    DRMLISTADDTAIL(&node->head, &list->list);
+    list->numOnList++;
+    return node;
+}
+
+/*
+ * Slightly modified version compared to the libdrm version.
+ * This one returns the list index of the buffer put on the list.
+ */
+
+static int
+driAddValidateItem(drmBOList * list, drmBO * buf, uint64_t flags,
+                  uint64_t mask, int *itemLoc, 
+                  struct _drmBONode **pnode)
+{
+    drmBONode *node, *cur;
+    drmMMListHead *l;
+    int count = 0;
+
+    cur = NULL;
+
+    for (l = list->list.next; l != &list->list; l = l->next) {
+       node = DRMLISTENTRY(drmBONode, l, head);
+       if (node->buf == buf) {
+           cur = node;
+           break;
+       }
+       count++;
+    }
+    if (!cur) {
+       cur = driAddListItem(list, buf, flags, mask);
+       if (!cur)
+           return -ENOMEM;
+
+       cur->arg0 = flags;
+       cur->arg1 = mask;
+    } else {
+        uint64_t memFlags = cur->arg0 & flags & DRM_BO_MASK_MEM;
+       uint64_t accFlags = (cur->arg0 | flags) & ~DRM_BO_MASK_MEM;
+
+       if (mask & cur->arg1 & ~DRM_BO_MASK_MEM  & (cur->arg0 ^ flags)) {
+           return -EINVAL;
+       }
+
+       cur->arg1 |= mask;
+       cur->arg0 = (cur->arg0 & ~mask) | ((memFlags | accFlags) & mask);
+
+       if (((cur->arg1 & DRM_BO_MASK_MEM) != 0) &&
+           (cur->arg0 & DRM_BO_MASK_MEM) == 0) {
+           return -EINVAL;
+       }
+    }
+    *itemLoc = count;
+    *pnode = cur;
+    return 0;
+}
+
+
+void
+driBOAddListItem(struct _DriBufferList * list, struct _DriBufferObject *buf,
+                 uint64_t flags, uint64_t mask, int *itemLoc, 
+                struct _drmBONode **node)
+{
+   int newItem;
+   
+   _glthread_LOCK_MUTEX(buf->mutex);
+   BM_CKFATAL(driAddValidateItem(&list->drmBuffers,
+                                buf->pool->kernel(buf->pool, buf->private),
+                                 flags, mask, itemLoc, node));
+   BM_CKFATAL(drmAddValidateItem(&list->driBuffers, (drmBO *) buf,
+                                flags, mask, &newItem));
+   if (newItem) 
+     buf->refCount++;
+
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+}
+
+drmBOList *driGetdrmBOList(struct _DriBufferList *list)
+{
+       driWriteLockKernelBO();
+       return &list->drmBuffers;
+}
+
+void driPutdrmBOList(struct _DriBufferList *list)
+{
+       driWriteUnlockKernelBO();
+}
+
+
+void
+driBOFence(struct _DriBufferObject *buf, struct _DriFenceObject *fence)
+{
+   _glthread_LOCK_MUTEX(buf->mutex);
+   if (buf->pool->fence)
+       BM_CKFATAL(buf->pool->fence(buf->pool, buf->private, fence));
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+
+}
+
+void
+driBOUnrefUserList(struct _DriBufferList *list)
+{
+    struct _DriBufferObject *buf;
+    void *curBuf;
+
+    curBuf = drmBOListIterator(&list->driBuffers);
+    while (curBuf) {
+       buf = (struct _DriBufferObject *)drmBOListBuf(curBuf);
+       driBOUnReference(buf);
+       curBuf = drmBOListNext(&list->driBuffers, curBuf);
+    }
+}
+
+struct _DriFenceObject *
+driBOFenceUserList(struct _DriFenceMgr *mgr,
+                  struct _DriBufferList *list, const char *name,
+                  drmFence *kFence)
+{
+    struct _DriFenceObject *fence;
+    struct _DriBufferObject *buf;
+    void *curBuf;
+
+    fence = driFenceCreate(mgr, kFence->fence_class, kFence->type,
+                          kFence, sizeof(*kFence));
+    curBuf = drmBOListIterator(&list->driBuffers);
+
+   /*
+    * User-space fencing callbacks.
+    */
+
+   while (curBuf) {
+        buf = (struct _DriBufferObject *) drmBOListBuf(curBuf);
+       driBOFence(buf, fence);
+       driBOUnReference(buf);
+       curBuf = drmBOListNext(&list->driBuffers, curBuf);
+   }
+
+   driBOResetList(list);
+   return fence;
+}
+   
+void
+driBOValidateUserList(struct _DriBufferList * list)
+{
+    void *curBuf;
+    struct _DriBufferObject *buf;
+
+    curBuf = drmBOListIterator(&list->driBuffers);
+
+    /*
+     * User-space validation callbacks.
+     */
+
+    while (curBuf) {
+       buf = (struct _DriBufferObject *) drmBOListBuf(curBuf);
+       _glthread_LOCK_MUTEX(buf->mutex);
+       if (buf->pool->validate)
+           BM_CKFATAL(buf->pool->validate(buf->pool, buf->private, &buf->mutex));
+       _glthread_UNLOCK_MUTEX(buf->mutex);
+       curBuf = drmBOListNext(&list->driBuffers, curBuf);
+    }
+}
+
+
+void
+driPoolTakeDown(struct _DriBufferPool *pool)
+{
+   pool->takeDown(pool);
+
+}
+
+unsigned long 
+driBOSize(struct _DriBufferObject *buf)
+{
+  unsigned long size;
+
+   _glthread_LOCK_MUTEX(buf->mutex);
+   size = buf->pool->size(buf->pool, buf->private);
+   _glthread_UNLOCK_MUTEX(buf->mutex);
+
+  return size;
+
+}
+
+drmBOList *driBOGetDRMBuffers(struct _DriBufferList *list)
+{
+    return &list->drmBuffers;
+}
+
+drmBOList *driBOGetDRIBuffers(struct _DriBufferList *list)
+{
+    return &list->driBuffers;
+}
+    
diff --git a/src/gallium/winsys/egl_drm/intel/ws_dri_bufmgr.h b/src/gallium/winsys/egl_drm/intel/ws_dri_bufmgr.h
new file mode 100644 (file)
index 0000000..fdaf5ee
--- /dev/null
@@ -0,0 +1,138 @@
+/**************************************************************************
+ * 
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * 
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ *          Keith Whitwell <keithw-at-tungstengraphics-dot-com>
+ */
+
+#ifndef _PSB_BUFMGR_H_
+#define _PSB_BUFMGR_H_
+#include <xf86mm.h>
+#include "i915_drm.h"
+#include "ws_dri_fencemgr.h"
+
+typedef struct _drmBONode
+{
+    drmMMListHead head;
+    drmBO *buf;
+    struct drm_i915_op_arg bo_arg;
+    uint64_t arg0;
+    uint64_t arg1;
+} drmBONode;
+
+typedef struct _drmBOList {
+    unsigned numTarget;
+    unsigned numCurrent;
+    unsigned numOnList;
+    drmMMListHead list;
+    drmMMListHead free;
+} drmBOList;
+
+
+struct _DriFenceObject;
+struct _DriBufferObject;
+struct _DriBufferPool;
+struct _DriBufferList;
+
+/*
+ * Return a pointer to the libdrm buffer object this DriBufferObject
+ * uses.
+ */
+
+extern drmBO *driBOKernel(struct _DriBufferObject *buf);
+extern void *driBOMap(struct _DriBufferObject *buf, unsigned flags,
+                      unsigned hint);
+extern void driBOUnmap(struct _DriBufferObject *buf);
+extern unsigned long driBOOffset(struct _DriBufferObject *buf);
+extern unsigned long driBOPoolOffset(struct _DriBufferObject *buf);
+
+extern uint64_t driBOFlags(struct _DriBufferObject *buf);
+extern struct _DriBufferObject *driBOReference(struct _DriBufferObject *buf);
+extern void driBOUnReference(struct _DriBufferObject *buf);
+
+extern int driBOData(struct _DriBufferObject *r_buf,
+                    unsigned size, const void *data, 
+                    struct _DriBufferPool *pool, uint64_t flags);
+
+extern void driBOSubData(struct _DriBufferObject *buf,
+                         unsigned long offset, unsigned long size,
+                         const void *data);
+extern void driBOGetSubData(struct _DriBufferObject *buf,
+                            unsigned long offset, unsigned long size,
+                            void *data);
+extern int driGenBuffers(struct _DriBufferPool *pool,
+                        const char *name,
+                        unsigned n,
+                        struct _DriBufferObject *buffers[],
+                        unsigned alignment, uint64_t flags, unsigned hint);
+extern void driGenUserBuffer(struct _DriBufferPool *pool,
+                             const char *name,
+                             struct _DriBufferObject *buffers[],
+                             void *ptr, unsigned bytes);
+extern void driDeleteBuffers(unsigned n, struct _DriBufferObject *buffers[]);
+extern void driInitBufMgr(int fd);
+extern struct _DriBufferList *driBOCreateList(int target);
+extern int driBOResetList(struct _DriBufferList * list);
+extern void driBOAddListItem(struct _DriBufferList * list, 
+                            struct _DriBufferObject *buf,
+                             uint64_t flags, uint64_t mask, int *itemLoc,
+                            struct _drmBONode **node);
+
+extern void driBOValidateList(int fd, struct _DriBufferList * list);
+extern void driBOFreeList(struct _DriBufferList * list);
+extern struct _DriFenceObject *driBOFenceUserList(struct _DriFenceMgr *mgr,
+                                                 struct _DriBufferList *list,
+                                                 const char *name,
+                                                 drmFence *kFence);
+extern void driBOUnrefUserList(struct _DriBufferList *list);
+extern void driBOValidateUserList(struct _DriBufferList * list);
+extern drmBOList *driGetdrmBOList(struct _DriBufferList *list);
+extern void driPutdrmBOList(struct _DriBufferList *list);
+
+extern void driBOFence(struct _DriBufferObject *buf,
+                       struct _DriFenceObject *fence);
+
+extern void driPoolTakeDown(struct _DriBufferPool *pool);
+extern void driBOSetReferenced(struct _DriBufferObject *buf,
+                              unsigned long handle);
+unsigned long driBOSize(struct _DriBufferObject *buf);
+extern void driBOWaitIdle(struct _DriBufferObject *buf, int lazy);
+extern void driPoolTakeDown(struct _DriBufferPool *pool);
+
+extern void driReadLockKernelBO(void);
+extern void driReadUnlockKernelBO(void);
+extern void driWriteLockKernelBO(void);
+extern void driWriteUnlockKernelBO(void);
+
+/*
+ * For debugging purposes.
+ */
+
+extern drmBOList *driBOGetDRMBuffers(struct _DriBufferList *list);
+extern drmBOList *driBOGetDRIBuffers(struct _DriBufferList *list);
+#endif
diff --git a/src/gallium/winsys/egl_drm/intel/ws_dri_bufpool.h b/src/gallium/winsys/egl_drm/intel/ws_dri_bufpool.h
new file mode 100644 (file)
index 0000000..3a302e1
--- /dev/null
@@ -0,0 +1,102 @@
+/**************************************************************************
+ * 
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * 
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ */
+
+#ifndef _PSB_BUFPOOL_H_
+#define _PSB_BUFPOOL_H_
+
+#include <xf86drm.h>
+#include <glthread.h>
+struct _DriFenceObject;
+
+typedef struct _DriBufferPool
+{
+   int fd;
+   int (*map) (struct _DriBufferPool * pool, void *private,
+               unsigned flags, int hint, _glthread_Mutex *mutex, 
+              void **virtual);
+   int (*unmap) (struct _DriBufferPool * pool, void *private);
+   int (*destroy) (struct _DriBufferPool * pool, void *private);
+   unsigned long (*offset) (struct _DriBufferPool * pool, void *private);
+   unsigned long (*poolOffset) (struct _DriBufferPool * pool, void *private);
+   uint64_t (*flags) (struct _DriBufferPool * pool, void *private);
+   unsigned long (*size) (struct _DriBufferPool * pool, void *private);
+   void *(*create) (struct _DriBufferPool * pool, unsigned long size,
+                    uint64_t flags, unsigned hint, unsigned alignment);
+   void *(*reference) (struct _DriBufferPool * pool, unsigned handle);
+   int (*unreference) (struct _DriBufferPool * pool, void *private);
+   int (*fence) (struct _DriBufferPool * pool, void *private,
+                 struct _DriFenceObject * fence);
+   drmBO *(*kernel) (struct _DriBufferPool * pool, void *private);
+   int (*validate) (struct _DriBufferPool * pool, void *private, _glthread_Mutex *mutex);
+   int (*waitIdle) (struct _DriBufferPool *pool, void *private, _glthread_Mutex *mutex,
+                   int lazy);
+   int (*setStatus)  (struct _DriBufferPool *pool, void *private,
+                     uint64_t flag_diff, uint64_t old_flags);
+   void (*takeDown) (struct _DriBufferPool * pool);
+   void *data;
+} DriBufferPool;
+
+extern void bmError(int val, const char *file, const char *function,
+                    int line);
+#define BM_CKFATAL(val)                                               \
+  do{                                                         \
+    int tstVal = (val);                                               \
+    if (tstVal)                                               \
+      bmError(tstVal, __FILE__, __FUNCTION__, __LINE__);       \
+  } while(0);
+
+
+/*
+ * Builtin pools.
+ */
+
+/*
+ * Kernel buffer objects. Size in multiples of page size. Page size aligned.
+ */
+
+extern struct _DriBufferPool *driDRMPoolInit(int fd);
+extern struct _DriBufferPool *driMallocPoolInit(void);
+
+struct _DriFreeSlabManager;
+extern struct _DriBufferPool * driSlabPoolInit(int fd, uint64_t flags,
+                                              uint64_t validMask,
+                                              uint32_t smallestSize,
+                                              uint32_t numSizes,
+                                              uint32_t desiredNumBuffers,
+                                              uint32_t maxSlabSize,
+                                              uint32_t pageAlignment,
+                                              struct _DriFreeSlabManager *fMan);
+extern void driFinishFreeSlabManager(struct _DriFreeSlabManager *fMan);
+extern struct _DriFreeSlabManager *
+driInitFreeSlabManager(uint32_t checkIntervalMsec, uint32_t slabTimeoutMsec);
+
+
+#endif
diff --git a/src/gallium/winsys/egl_drm/intel/ws_dri_drmpool.c b/src/gallium/winsys/egl_drm/intel/ws_dri_drmpool.c
new file mode 100644 (file)
index 0000000..7c55dbc
--- /dev/null
@@ -0,0 +1,268 @@
+/**************************************************************************
+ * 
+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * 
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ */
+
+#include <xf86drm.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "ws_dri_bufpool.h"
+#include "ws_dri_bufmgr.h"
+#include "assert.h"
+
+/*
+ * Buffer pool implementation using DRM buffer objects as DRI buffer objects.
+ */
+
+static void *
+pool_create(struct _DriBufferPool *pool,
+            unsigned long size, uint64_t flags, unsigned hint,
+            unsigned alignment)
+{
+   drmBO *buf = (drmBO *) malloc(sizeof(*buf));
+   int ret;
+   unsigned pageSize = getpagesize();
+
+   if (!buf)
+      return NULL;
+
+   if ((alignment > pageSize) && (alignment % pageSize)) {
+      free(buf);
+      return NULL;
+   }
+
+   ret = drmBOCreate(pool->fd, size, alignment / pageSize,
+                    NULL,
+                     flags, hint, buf);
+   if (ret) {
+      free(buf);
+      return NULL;
+   }
+
+   return (void *) buf;
+}
+
+static void *
+pool_reference(struct _DriBufferPool *pool, unsigned handle)
+{
+   drmBO *buf = (drmBO *) malloc(sizeof(*buf));
+   int ret;
+
+   if (!buf)
+      return NULL;
+
+   ret = drmBOReference(pool->fd, handle, buf);
+
+   if (ret) {
+      free(buf);
+      return NULL;
+   }
+
+   return (void *) buf;
+}
+
+static int
+pool_destroy(struct _DriBufferPool *pool, void *private)
+{
+   int ret;
+   drmBO *buf = (drmBO *) private;
+   driReadLockKernelBO();
+   ret = drmBOUnreference(pool->fd, buf);
+   free(buf);
+   driReadUnlockKernelBO();
+   return ret;
+}
+
+static int
+pool_unreference(struct _DriBufferPool *pool, void *private)
+{
+   int ret;
+   drmBO *buf = (drmBO *) private;
+   driReadLockKernelBO();
+   ret = drmBOUnreference(pool->fd, buf);
+   free(buf);
+   driReadUnlockKernelBO();
+   return ret;
+}
+
+static int
+pool_map(struct _DriBufferPool *pool, void *private, unsigned flags,
+         int hint, _glthread_Mutex *mutex, void **virtual)
+{
+   drmBO *buf = (drmBO *) private;
+   int ret;
+   
+   driReadLockKernelBO();
+   ret = drmBOMap(pool->fd, buf, flags, hint, virtual);
+   driReadUnlockKernelBO();
+   return ret;
+}
+
+static int
+pool_unmap(struct _DriBufferPool *pool, void *private)
+{
+   drmBO *buf = (drmBO *) private;
+   int ret;
+
+   driReadLockKernelBO();
+   ret = drmBOUnmap(pool->fd, buf);
+   driReadUnlockKernelBO();
+   
+   return ret;
+}
+
+static unsigned long
+pool_offset(struct _DriBufferPool *pool, void *private)
+{
+   drmBO *buf = (drmBO *) private;
+   unsigned long offset;
+
+   driReadLockKernelBO();
+   assert(buf->flags & DRM_BO_FLAG_NO_MOVE);   
+   offset = buf->offset;
+   driReadUnlockKernelBO();
+
+   return buf->offset;
+}
+
+static unsigned long
+pool_poolOffset(struct _DriBufferPool *pool, void *private)
+{
+   return 0;
+}
+
+static uint64_t
+pool_flags(struct _DriBufferPool *pool, void *private)
+{
+   drmBO *buf = (drmBO *) private;
+   uint64_t flags;
+
+   driReadLockKernelBO();
+   flags = buf->flags;
+   driReadUnlockKernelBO();
+
+   return flags;
+}
+
+
+static unsigned long
+pool_size(struct _DriBufferPool *pool, void *private)
+{
+   drmBO *buf = (drmBO *) private;
+   unsigned long size;
+
+   driReadLockKernelBO();
+   size = buf->size;
+   driReadUnlockKernelBO();
+
+   return buf->size;
+}
+
+static int
+pool_fence(struct _DriBufferPool *pool, void *private,
+           struct _DriFenceObject *fence)
+{
+   /*
+    * Noop. The kernel handles all fencing.
+    */
+
+   return 0;
+}
+
+static drmBO *
+pool_kernel(struct _DriBufferPool *pool, void *private)
+{
+   return (drmBO *) private;
+}
+
+static int
+pool_waitIdle(struct _DriBufferPool *pool, void *private, _glthread_Mutex *mutex, 
+             int lazy)
+{
+   drmBO *buf = (drmBO *) private;
+   int ret;
+
+   driReadLockKernelBO();
+   ret = drmBOWaitIdle(pool->fd, buf, (lazy) ? DRM_BO_HINT_WAIT_LAZY:0);
+   driReadUnlockKernelBO();
+
+   return ret;
+}
+
+   
+static void
+pool_takedown(struct _DriBufferPool *pool)
+{
+   free(pool);
+}
+
+/*static int
+pool_setStatus(struct _DriBufferPool *pool, void *private, 
+              uint64_t flag_diff, uint64_t old_flags)
+{
+   drmBO *buf = (drmBO *) private;
+   uint64_t new_flags = old_flags ^ flag_diff;
+   int ret;
+
+   driReadLockKernelBO();
+   ret = drmBOSetStatus(pool->fd, buf, new_flags, flag_diff,
+                       0, 0, 0);
+   driReadUnlockKernelBO();
+   return ret;
+}*/
+
+struct _DriBufferPool *
+driDRMPoolInit(int fd)
+{
+   struct _DriBufferPool *pool;
+
+   pool = (struct _DriBufferPool *) malloc(sizeof(*pool));
+
+   if (!pool)
+      return NULL;
+
+   pool->fd = fd;
+   pool->map = &pool_map;
+   pool->unmap = &pool_unmap;
+   pool->destroy = &pool_destroy;
+   pool->offset = &pool_offset;
+   pool->poolOffset = &pool_poolOffset;
+   pool->flags = &pool_flags;
+   pool->size = &pool_size;
+   pool->create = &pool_create;
+   pool->fence = &pool_fence;
+   pool->kernel = &pool_kernel;
+   pool->validate = NULL;
+   pool->waitIdle = &pool_waitIdle;
+   pool->takeDown = &pool_takedown;
+   pool->reference = &pool_reference;
+   pool->unreference = &pool_unreference;
+   pool->data = NULL;
+   return pool;
+}
diff --git a/src/gallium/winsys/egl_drm/intel/ws_dri_fencemgr.c b/src/gallium/winsys/egl_drm/intel/ws_dri_fencemgr.c
new file mode 100644 (file)
index 0000000..1f893b4
--- /dev/null
@@ -0,0 +1,377 @@
+#include "ws_dri_fencemgr.h"
+#include "glthread.h"
+#include <xf86mm.h>
+#include <string.h>
+#include <unistd.h>
+
+/*
+ * Note: Locking order is
+ * _DriFenceObject::mutex
+ * _DriFenceMgr::mutex
+ */
+
+struct _DriFenceMgr {
+    /*
+     * Constant members. Need no mutex protection.
+     */
+    struct _DriFenceMgrCreateInfo info;
+    void *private;
+
+    /*
+     * These members are protected by this->mutex
+     */
+    _glthread_Mutex mutex;
+    int refCount;
+    drmMMListHead *heads;
+    int num_fences;
+};
+
+struct _DriFenceObject {
+
+    /*
+     * These members are constant and need no mutex protection.
+     */
+    struct _DriFenceMgr *mgr;
+    uint32_t fence_class;
+    uint32_t fence_type;
+
+    /*
+     * These members are protected by mgr->mutex.
+     */
+    drmMMListHead head;
+    int refCount;
+
+    /*
+     * These members are protected by this->mutex.
+     */
+    _glthread_Mutex mutex;
+    uint32_t signaled_type;
+    void *private;
+};
+
+uint32_t
+driFenceType(struct _DriFenceObject *fence)
+{
+  return fence->fence_type;
+}
+
+struct _DriFenceMgr *
+driFenceMgrCreate(const struct _DriFenceMgrCreateInfo *info)
+{
+  struct _DriFenceMgr *tmp;
+  uint32_t i;
+
+  tmp = calloc(1, sizeof(*tmp));
+  if (!tmp)
+      return NULL;
+
+  _glthread_INIT_MUTEX(tmp->mutex);
+  _glthread_LOCK_MUTEX(tmp->mutex);
+  tmp->refCount = 1;
+  tmp->info = *info;
+  tmp->num_fences = 0;
+  tmp->heads = calloc(tmp->info.num_classes, sizeof(*tmp->heads));
+  if (!tmp->heads)
+      goto out_err;
+
+  for (i=0; i<tmp->info.num_classes; ++i) {
+      DRMINITLISTHEAD(&tmp->heads[i]);
+  }
+  _glthread_UNLOCK_MUTEX(tmp->mutex);
+  return tmp;
+
+  out_err:
+  if (tmp)
+      free(tmp);
+  return NULL;
+}
+
+static void
+driFenceMgrUnrefUnlock(struct _DriFenceMgr **pMgr)
+{
+    struct _DriFenceMgr *mgr = *pMgr;
+
+    *pMgr = NULL;
+    if (--mgr->refCount == 0)
+       free(mgr);
+    else
+       _glthread_UNLOCK_MUTEX(mgr->mutex);
+}
+
+void
+driFenceMgrUnReference(struct _DriFenceMgr **pMgr)
+{
+    _glthread_LOCK_MUTEX((*pMgr)->mutex);
+    driFenceMgrUnrefUnlock(pMgr);
+}
+
+static void
+driFenceUnReferenceLocked(struct _DriFenceObject **pFence)
+{
+    struct _DriFenceObject *fence = *pFence;
+    struct _DriFenceMgr *mgr = fence->mgr;
+
+    *pFence = NULL;
+    if (--fence->refCount == 0) {
+       DRMLISTDELINIT(&fence->head);
+       if (fence->private)
+           mgr->info.unreference(mgr, &fence->private);
+    --mgr->num_fences;
+       fence->mgr = NULL;
+       --mgr->refCount;
+       free(fence);
+
+    }
+}
+
+
+static void
+driSignalPreviousFencesLocked(struct _DriFenceMgr *mgr,
+                             drmMMListHead *list,
+                             uint32_t fence_class,
+                             uint32_t fence_type)
+{
+    struct _DriFenceObject *entry;
+    drmMMListHead *prev;
+
+    while(list != &mgr->heads[fence_class]) {
+       entry = DRMLISTENTRY(struct _DriFenceObject, list, head);
+
+       /*
+        * Up refcount so that entry doesn't disappear from under us
+        * when we unlock-relock mgr to get the correct locking order.
+        */
+
+       ++entry->refCount;
+       _glthread_UNLOCK_MUTEX(mgr->mutex);
+       _glthread_LOCK_MUTEX(entry->mutex);
+       _glthread_LOCK_MUTEX(mgr->mutex);
+
+       prev = list->prev;
+
+
+
+       if (list->prev == list) {
+
+               /*
+                * Somebody else removed the entry from the list.
+                */
+
+               _glthread_UNLOCK_MUTEX(entry->mutex);
+               driFenceUnReferenceLocked(&entry);
+               return;
+       }
+
+       entry->signaled_type |= (fence_type & entry->fence_type);
+       if (entry->signaled_type == entry->fence_type) {
+           DRMLISTDELINIT(list);
+           mgr->info.unreference(mgr, &entry->private);
+       }
+       _glthread_UNLOCK_MUTEX(entry->mutex);
+       driFenceUnReferenceLocked(&entry);
+       list = prev;
+    }
+}
+
+
+int
+driFenceFinish(struct _DriFenceObject *fence, uint32_t fence_type,
+              int lazy_hint)
+{
+    struct _DriFenceMgr *mgr = fence->mgr;
+    int ret = 0;
+
+    _glthread_LOCK_MUTEX(fence->mutex);
+
+    if ((fence->signaled_type & fence_type) == fence_type)
+       goto out0;
+
+    ret = mgr->info.finish(mgr, fence->private, fence_type, lazy_hint);
+    if (ret)
+       goto out0;
+
+    _glthread_LOCK_MUTEX(mgr->mutex);
+    _glthread_UNLOCK_MUTEX(fence->mutex);
+
+    driSignalPreviousFencesLocked(mgr, &fence->head, fence->fence_class,
+                                 fence_type);
+    _glthread_UNLOCK_MUTEX(mgr->mutex);
+    return 0;
+
+  out0:
+    _glthread_UNLOCK_MUTEX(fence->mutex);
+    return ret;
+}
+
+uint32_t driFenceSignaledTypeCached(struct _DriFenceObject *fence)
+{
+    uint32_t ret;
+
+    _glthread_LOCK_MUTEX(fence->mutex);
+    ret = fence->signaled_type;
+    _glthread_UNLOCK_MUTEX(fence->mutex);
+
+    return ret;
+}
+
+int
+driFenceSignaledType(struct _DriFenceObject *fence, uint32_t flush_type,
+                uint32_t *signaled)
+{
+    int ret = 0;
+    struct _DriFenceMgr *mgr;
+
+    _glthread_LOCK_MUTEX(fence->mutex);
+    mgr = fence->mgr;
+    *signaled = fence->signaled_type;
+    if ((fence->signaled_type & flush_type) == flush_type)
+       goto out0;
+
+    ret = mgr->info.signaled(mgr, fence->private, flush_type, signaled);
+    if (ret) {
+       *signaled = fence->signaled_type;
+       goto out0;
+    }
+
+    if ((fence->signaled_type | *signaled) == fence->signaled_type)
+       goto out0;
+
+    _glthread_LOCK_MUTEX(mgr->mutex);
+    _glthread_UNLOCK_MUTEX(fence->mutex);
+
+    driSignalPreviousFencesLocked(mgr, &fence->head, fence->fence_class,
+                                 *signaled);
+
+    _glthread_UNLOCK_MUTEX(mgr->mutex);
+    return 0;
+  out0:
+    _glthread_UNLOCK_MUTEX(fence->mutex);
+    return ret;
+}
+
+struct _DriFenceObject *
+driFenceReference(struct _DriFenceObject *fence)
+{
+    _glthread_LOCK_MUTEX(fence->mgr->mutex);
+    ++fence->refCount;
+    _glthread_UNLOCK_MUTEX(fence->mgr->mutex);
+    return fence;
+}
+
+void
+driFenceUnReference(struct _DriFenceObject **pFence)
+{
+    struct _DriFenceMgr *mgr; 
+
+    if (*pFence == NULL)
+       return;
+
+    mgr = (*pFence)->mgr;
+    _glthread_LOCK_MUTEX(mgr->mutex);
+    ++mgr->refCount;
+    driFenceUnReferenceLocked(pFence);
+    driFenceMgrUnrefUnlock(&mgr);
+}
+
+struct _DriFenceObject
+*driFenceCreate(struct _DriFenceMgr *mgr, uint32_t fence_class,
+               uint32_t fence_type, void *private, size_t private_size)
+{
+    struct _DriFenceObject *fence;
+    size_t fence_size = sizeof(*fence);
+
+    if (private_size)
+       fence_size = ((fence_size + 15) & ~15);
+
+    fence = calloc(1, fence_size + private_size);
+
+    if (!fence) {
+       int ret = mgr->info.finish(mgr, private, fence_type, 0);
+
+       if (ret)
+           usleep(10000000);
+
+       return NULL;
+    }
+
+    _glthread_INIT_MUTEX(fence->mutex);
+    _glthread_LOCK_MUTEX(fence->mutex);
+    _glthread_LOCK_MUTEX(mgr->mutex);
+    fence->refCount = 1;
+    DRMLISTADDTAIL(&fence->head, &mgr->heads[fence_class]);
+    fence->mgr = mgr;
+    ++mgr->refCount;
+    ++mgr->num_fences;
+    _glthread_UNLOCK_MUTEX(mgr->mutex);
+    fence->fence_class = fence_class;
+    fence->fence_type = fence_type;
+    fence->signaled_type = 0;
+    fence->private = private;
+    if (private_size) {
+        fence->private = (void *)(((uint8_t *) fence) + fence_size);
+       memcpy(fence->private, private, private_size);
+    }
+
+    _glthread_UNLOCK_MUTEX(fence->mutex);
+    return fence;
+}
+
+
+static int
+tSignaled(struct _DriFenceMgr *mgr, void *private, uint32_t flush_type,
+         uint32_t *signaled_type)
+{
+  long fd = (long) mgr->private;
+  int dummy;
+  drmFence *fence = (drmFence *) private;
+  int ret;
+
+  *signaled_type = 0;
+  ret = drmFenceSignaled((int) fd, fence, flush_type, &dummy);
+  if (ret)
+    return ret;
+
+  *signaled_type = fence->signaled;
+
+  return 0;
+}
+
+static int
+tFinish(struct _DriFenceMgr *mgr, void *private, uint32_t fence_type,
+       int lazy_hint)
+{
+  long fd = (long) mgr->private;
+  unsigned flags = lazy_hint ? DRM_FENCE_FLAG_WAIT_LAZY : 0;
+
+  return drmFenceWait((int)fd, flags, (drmFence *) private, fence_type);
+}
+
+static int
+tUnref(struct _DriFenceMgr *mgr, void **private)
+{
+  long fd = (long) mgr->private;
+  drmFence *fence = (drmFence *) *private;
+  *private = NULL;
+
+  return drmFenceUnreference(fd, fence);
+}
+
+struct _DriFenceMgr *driFenceMgrTTMInit(int fd)
+{
+  struct _DriFenceMgrCreateInfo info;
+  struct _DriFenceMgr *mgr;
+
+  info.flags = DRI_FENCE_CLASS_ORDERED;
+  info.num_classes = 4;
+  info.signaled = tSignaled;
+  info.finish = tFinish;
+  info.unreference = tUnref;
+
+  mgr = driFenceMgrCreate(&info);
+  if (mgr == NULL)
+    return NULL;
+
+  mgr->private = (void *) (long) fd;
+  return mgr;
+}
+
diff --git a/src/gallium/winsys/egl_drm/intel/ws_dri_fencemgr.h b/src/gallium/winsys/egl_drm/intel/ws_dri_fencemgr.h
new file mode 100644 (file)
index 0000000..4ea58df
--- /dev/null
@@ -0,0 +1,115 @@
+#ifndef DRI_FENCEMGR_H
+#define DRI_FENCEMGR_H
+
+#include <stdint.h>
+#include <stdlib.h>
+
+struct _DriFenceObject;
+struct _DriFenceMgr;
+
+/*
+ * Do a quick check to see if the fence manager has registered the fence
+ * object as signaled. Note that this function may return a false negative
+ * answer.
+ */
+extern uint32_t driFenceSignaledTypeCached(struct _DriFenceObject *fence);
+
+/*
+ * Check if the fence object is signaled. This function can be substantially
+ * more expensive to call than the above function, but will not return a false
+ * negative answer. The argument "flush_type" sets the types that the
+ * underlying mechanism must make sure will eventually signal.
+ */
+extern int driFenceSignaledType(struct _DriFenceObject *fence,
+                               uint32_t flush_type, uint32_t *signaled);
+
+/*
+ * Convenience functions.
+ */
+
+static inline int driFenceSignaled(struct _DriFenceObject *fence,
+                                  uint32_t flush_type)
+{
+    uint32_t signaled_types;
+    int ret = driFenceSignaledType(fence, flush_type, &signaled_types);
+    if (ret)
+       return 0;
+    return ((signaled_types & flush_type) == flush_type);
+}
+
+static inline int driFenceSignaledCached(struct _DriFenceObject *fence,
+                                        uint32_t flush_type)
+{
+    uint32_t signaled_types =
+       driFenceSignaledTypeCached(fence);
+
+    return ((signaled_types & flush_type) == flush_type);
+}
+
+/*
+ * Reference a fence object.
+ */
+extern struct _DriFenceObject *driFenceReference(struct _DriFenceObject *fence);
+
+/*
+ * Unreference a fence object. The fence object pointer will be reset to NULL.
+ */
+
+extern void driFenceUnReference(struct _DriFenceObject **pFence);
+
+
+/*
+ * Wait for a fence to signal the indicated fence_type.
+ * If "lazy_hint" is true, it indicates that the wait may sleep to avoid
+ * busy-wait polling.
+ */
+extern int driFenceFinish(struct _DriFenceObject *fence, uint32_t fence_type,
+                         int lazy_hint);
+
+/*
+ * Create a DriFenceObject for manager "mgr".
+ *
+ * "private" is a pointer that should be used for the callbacks in
+ * struct _DriFenceMgrCreateInfo.
+ *
+ * if private_size is nonzero, then the info stored at *private, with size
+ * private size will be copied and the fence manager will instead use a
+ * pointer to the copied data for the callbacks in
+ * struct _DriFenceMgrCreateInfo. In that case, the object pointed to by
+ * "private" may be destroyed after the call to driFenceCreate.
+ */
+extern struct _DriFenceObject *driFenceCreate(struct _DriFenceMgr *mgr,
+                                             uint32_t fence_class,
+                                             uint32_t fence_type,
+                                             void *private,
+                                             size_t private_size);
+
+extern uint32_t driFenceType(struct _DriFenceObject *fence);
+
+/*
+ * Fence creations are ordered. If a fence signals a fence_type,
+ * it is safe to assume that all fences of the same class that was
+ * created before that fence has signaled the same type.
+ */
+
+#define DRI_FENCE_CLASS_ORDERED (1 << 0)
+
+struct _DriFenceMgrCreateInfo {
+    uint32_t flags;
+    uint32_t num_classes;
+    int (*signaled) (struct _DriFenceMgr *mgr, void *private, uint32_t flush_type,
+                    uint32_t *signaled_type);
+    int (*finish) (struct _DriFenceMgr *mgr, void *private, uint32_t fence_type, int lazy_hint);
+    int (*unreference) (struct _DriFenceMgr *mgr, void **private);
+};
+
+extern struct _DriFenceMgr *
+driFenceMgrCreate(const struct _DriFenceMgrCreateInfo *info);
+
+void
+driFenceMgrUnReference(struct _DriFenceMgr **pMgr);
+
+extern struct _DriFenceMgr *
+driFenceMgrTTMInit(int fd);
+
+#endif
diff --git a/src/gallium/winsys/egl_drm/intel/ws_dri_mallocpool.c b/src/gallium/winsys/egl_drm/intel/ws_dri_mallocpool.c
new file mode 100644 (file)
index 0000000..bf97d7e
--- /dev/null
@@ -0,0 +1,162 @@
+/**************************************************************************
+ * 
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, TX., USA
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * 
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ */
+
+#include <xf86drm.h>
+#include <stdlib.h>
+#include <errno.h>
+#include "imports.h"
+#include "glthread.h"
+#include "ws_dri_bufpool.h"
+#include "ws_dri_bufmgr.h"
+#include "intel_screen.h"
+
+static void *
+pool_create(struct _DriBufferPool *pool,
+            unsigned long size, uint64_t flags, unsigned hint,
+            unsigned alignment)
+{
+    unsigned long *private = malloc(size + 2*sizeof(unsigned long));
+    if ((flags & DRM_BO_MASK_MEM) != DRM_BO_FLAG_MEM_LOCAL)
+      abort();
+
+    *private = size;
+    return (void *)private;
+}
+
+
+static int
+pool_destroy(struct _DriBufferPool *pool, void *private)
+{
+    free(private);
+    return 0;
+}
+
+static int
+pool_waitIdle(struct _DriBufferPool *pool, void *private, 
+             _glthread_Mutex *mutex, int lazy)
+{
+    return 0;
+}
+
+static int
+pool_map(struct _DriBufferPool *pool, void *private, unsigned flags,
+         int hint, _glthread_Mutex *mutex, void **virtual)
+{
+    *virtual = (void *)((unsigned long *)private + 2);
+    return 0;
+}
+
+static int
+pool_unmap(struct _DriBufferPool *pool, void *private)
+{
+    return 0;
+}
+
+static unsigned long
+pool_offset(struct _DriBufferPool *pool, void *private)
+{
+    /*
+     * BUG
+     */
+    abort();
+    return 0UL;
+}
+
+static unsigned long
+pool_poolOffset(struct _DriBufferPool *pool, void *private)
+{
+    /*
+     * BUG
+     */
+    abort();
+}
+
+static uint64_t
+pool_flags(struct _DriBufferPool *pool, void *private)
+{
+    return DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED;
+}
+
+static unsigned long
+pool_size(struct _DriBufferPool *pool, void *private)
+{
+    return *(unsigned long *) private;
+}
+
+
+static int
+pool_fence(struct _DriBufferPool *pool, void *private,
+           struct _DriFenceObject *fence)
+{
+    abort();
+    return 0UL;
+}
+
+static drmBO *
+pool_kernel(struct _DriBufferPool *pool, void *private)
+{
+    abort();
+    return NULL;
+}
+
+static void
+pool_takedown(struct _DriBufferPool *pool)
+{
+    free(pool);
+}
+
+
+struct _DriBufferPool *
+driMallocPoolInit(void)
+{
+   struct _DriBufferPool *pool;
+
+   pool = (struct _DriBufferPool *) malloc(sizeof(*pool));
+   if (!pool)
+       return NULL;
+
+   pool->data = NULL;
+   pool->fd = -1;
+   pool->map = &pool_map;
+   pool->unmap = &pool_unmap;
+   pool->destroy = &pool_destroy;
+   pool->offset = &pool_offset;
+   pool->poolOffset = &pool_poolOffset;
+   pool->flags = &pool_flags;
+   pool->size = &pool_size;
+   pool->create = &pool_create;
+   pool->fence = &pool_fence;
+   pool->kernel = &pool_kernel;
+   pool->validate = NULL;
+   pool->waitIdle = &pool_waitIdle;
+   pool->takeDown = &pool_takedown;
+   return pool;
+}
diff --git a/src/gallium/winsys/egl_drm/intel/ws_dri_slabpool.c b/src/gallium/winsys/egl_drm/intel/ws_dri_slabpool.c
new file mode 100644 (file)
index 0000000..e69519a
--- /dev/null
@@ -0,0 +1,970 @@
+/**************************************************************************
+ *
+ * Copyright 2006-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ *
+ **************************************************************************/
+/*
+ * Authors: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
+ */
+
+#include <stdint.h>
+#include <sys/time.h>
+#include <errno.h>
+#include <unistd.h>
+#include <assert.h>
+#include "ws_dri_bufpool.h"
+#include "ws_dri_fencemgr.h"
+#include "ws_dri_bufmgr.h"
+#include "glthread.h"
+
+#define DRI_SLABPOOL_ALLOC_RETRIES 100
+
+struct _DriSlab;
+
+struct _DriSlabBuffer {
+    int isSlabBuffer;
+    drmBO *bo;
+    struct _DriFenceObject *fence;
+    struct _DriSlab *parent;
+    drmMMListHead head;
+    uint32_t mapCount;
+    uint32_t start;
+    uint32_t fenceType;
+    int unFenced;
+    _glthread_Cond event;
+};
+
+struct _DriKernelBO {
+    int fd;
+    drmBO bo;
+    drmMMListHead timeoutHead;
+    drmMMListHead head;
+    struct timeval timeFreed;
+    uint32_t pageAlignment;
+    void *virtual;
+};
+
+struct _DriSlab{
+    drmMMListHead head;
+    drmMMListHead freeBuffers;
+    uint32_t numBuffers;
+    uint32_t numFree;
+    struct _DriSlabBuffer *buffers;
+    struct _DriSlabSizeHeader *header;
+    struct _DriKernelBO *kbo;
+};
+
+
+struct _DriSlabSizeHeader {
+    drmMMListHead slabs;
+    drmMMListHead freeSlabs;
+    drmMMListHead delayedBuffers;
+    uint32_t numDelayed;
+    struct _DriSlabPool *slabPool;
+    uint32_t bufSize;
+    _glthread_Mutex mutex;
+};
+
+struct _DriFreeSlabManager {
+    struct timeval slabTimeout;
+    struct timeval checkInterval;
+    struct timeval nextCheck;
+    drmMMListHead timeoutList;
+    drmMMListHead unCached;
+    drmMMListHead cached;
+    _glthread_Mutex mutex;
+};
+
+
+struct _DriSlabPool {
+
+    /*
+     * The data of this structure remains constant after
+     * initialization and thus needs no mutex protection.
+     */
+
+    struct _DriFreeSlabManager *fMan;
+    uint64_t proposedFlags;
+    uint64_t validMask;
+    uint32_t *bucketSizes;
+    uint32_t numBuckets;
+    uint32_t pageSize;
+    int fd;
+    int pageAlignment;
+    int maxSlabSize;
+    int desiredNumBuffers;
+    struct _DriSlabSizeHeader *headers;
+};
+
+/*
+ * FIXME: Perhaps arrange timeout slabs in size buckets for fast
+ * retreival??
+ */
+
+
+static inline int
+driTimeAfterEq(struct timeval *arg1, struct timeval *arg2)
+{
+    return ((arg1->tv_sec > arg2->tv_sec) ||
+           ((arg1->tv_sec == arg2->tv_sec) &&
+            (arg1->tv_usec > arg2->tv_usec)));
+}
+
+static inline void
+driTimeAdd(struct timeval *arg, struct timeval *add)
+{
+    unsigned int sec;
+
+    arg->tv_sec += add->tv_sec;
+    arg->tv_usec += add->tv_usec;
+    sec = arg->tv_usec / 1000000;
+    arg->tv_sec += sec;
+    arg->tv_usec -= sec*1000000;
+}
+
+static void
+driFreeKernelBO(struct _DriKernelBO *kbo)
+{
+    if (!kbo)
+       return;
+
+    (void) drmBOUnreference(kbo->fd, &kbo->bo);
+    free(kbo);
+}
+
+
+static void
+driFreeTimeoutKBOsLocked(struct _DriFreeSlabManager *fMan,
+                        struct timeval *time)
+{
+    drmMMListHead *list, *next;
+    struct _DriKernelBO *kbo;
+
+    if (!driTimeAfterEq(time, &fMan->nextCheck))
+       return;
+
+    for (list = fMan->timeoutList.next, next = list->next;
+        list != &fMan->timeoutList;
+        list = next, next = list->next) {
+
+       kbo = DRMLISTENTRY(struct _DriKernelBO, list, timeoutHead);
+
+       if (!driTimeAfterEq(time, &kbo->timeFreed))
+           break;
+
+       DRMLISTDELINIT(&kbo->timeoutHead);
+       DRMLISTDELINIT(&kbo->head);
+       driFreeKernelBO(kbo);
+    }
+
+    fMan->nextCheck = *time;
+    driTimeAdd(&fMan->nextCheck, &fMan->checkInterval);
+}
+
+
+/*
+ * Add a _DriKernelBO to the free slab manager.
+ * This means that it is available for reuse, but if it's not
+ * reused in a while, it will be freed.
+ */
+
+static void
+driSetKernelBOFree(struct _DriFreeSlabManager *fMan,
+                  struct _DriKernelBO *kbo)
+{
+    struct timeval time;
+
+    _glthread_LOCK_MUTEX(fMan->mutex);
+    gettimeofday(&time, NULL);
+    driTimeAdd(&time, &fMan->slabTimeout);
+
+    kbo->timeFreed = time;
+
+    if (kbo->bo.flags & DRM_BO_FLAG_CACHED)
+       DRMLISTADD(&kbo->head, &fMan->cached);
+    else
+       DRMLISTADD(&kbo->head, &fMan->unCached);
+
+    DRMLISTADDTAIL(&kbo->timeoutHead, &fMan->timeoutList);
+    driFreeTimeoutKBOsLocked(fMan, &time);
+
+    _glthread_UNLOCK_MUTEX(fMan->mutex);
+}
+
+/*
+ * Get a _DriKernelBO for us to use as storage for a slab.
+ *
+ */
+
+static struct _DriKernelBO *
+driAllocKernelBO(struct _DriSlabSizeHeader *header)
+
+{
+    struct _DriSlabPool *slabPool = header->slabPool;
+    struct _DriFreeSlabManager *fMan = slabPool->fMan;
+    drmMMListHead *list, *next, *head;
+    uint32_t size = header->bufSize * slabPool->desiredNumBuffers;
+    struct _DriKernelBO *kbo;
+    struct _DriKernelBO *kboTmp;
+    int ret;
+
+    /*
+     * FIXME: We should perhaps allow some variation in slabsize in order
+     * to efficiently reuse slabs.
+     */
+
+    size = (size <= slabPool->maxSlabSize) ? size : slabPool->maxSlabSize;
+    size = (size + slabPool->pageSize - 1) & ~(slabPool->pageSize - 1);
+    _glthread_LOCK_MUTEX(fMan->mutex);
+
+    kbo = NULL;
+
+  retry:
+    head = (slabPool->proposedFlags & DRM_BO_FLAG_CACHED) ?
+       &fMan->cached : &fMan->unCached;
+
+    for (list = head->next, next = list->next;
+        list != head;
+        list = next, next = list->next) {
+
+       kboTmp = DRMLISTENTRY(struct _DriKernelBO, list, head);
+
+       if ((kboTmp->bo.size == size) &&
+           (slabPool->pageAlignment == 0 ||
+            (kboTmp->pageAlignment % slabPool->pageAlignment) == 0)) {
+
+           if (!kbo)
+               kbo = kboTmp;
+
+           if ((kbo->bo.proposedFlags ^ slabPool->proposedFlags) == 0)
+               break;
+
+       }
+    }
+
+    if (kbo) {
+       DRMLISTDELINIT(&kbo->head);
+       DRMLISTDELINIT(&kbo->timeoutHead);
+    }
+
+    _glthread_UNLOCK_MUTEX(fMan->mutex);
+
+    if (kbo) {
+        uint64_t new_mask = kbo->bo.proposedFlags ^ slabPool->proposedFlags;
+
+       ret = 0;
+       if (new_mask) {
+           ret = drmBOSetStatus(kbo->fd, &kbo->bo, slabPool->proposedFlags,
+                                new_mask, DRM_BO_HINT_DONT_FENCE, 0, 0);
+       }
+       if (ret == 0)
+           return kbo;
+
+       driFreeKernelBO(kbo);
+       kbo = NULL;
+       goto retry;
+    }
+
+    kbo = calloc(1, sizeof(struct _DriKernelBO));
+    if (!kbo)
+       return NULL;
+
+    kbo->fd = slabPool->fd;
+    DRMINITLISTHEAD(&kbo->head);
+    DRMINITLISTHEAD(&kbo->timeoutHead);
+    ret = drmBOCreate(kbo->fd, size, slabPool->pageAlignment, NULL,
+                     slabPool->proposedFlags,
+                     DRM_BO_HINT_DONT_FENCE, &kbo->bo);
+    if (ret)
+       goto out_err0;
+
+    ret = drmBOMap(kbo->fd, &kbo->bo,
+                  DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE,
+                  0, &kbo->virtual);
+
+    if (ret)
+       goto out_err1;
+
+    ret = drmBOUnmap(kbo->fd, &kbo->bo);
+    if (ret)
+       goto out_err1;
+
+    return kbo;
+
+  out_err1:
+    drmBOUnreference(kbo->fd, &kbo->bo);
+  out_err0:
+    free(kbo);
+    return NULL;
+}
+
+
+static int
+driAllocSlab(struct _DriSlabSizeHeader *header)
+{
+    struct _DriSlab *slab;
+    struct _DriSlabBuffer *buf;
+    uint32_t numBuffers;
+    int ret;
+    int i;
+
+    slab = calloc(1, sizeof(*slab));
+    if (!slab)
+       return -ENOMEM;
+
+    slab->kbo = driAllocKernelBO(header);
+    if (!slab->kbo) {
+       ret = -ENOMEM;
+       goto out_err0;
+    }
+
+    numBuffers = slab->kbo->bo.size / header->bufSize;
+
+    slab->buffers = calloc(numBuffers, sizeof(*slab->buffers));
+    if (!slab->buffers) {
+       ret = -ENOMEM;
+       goto out_err1;
+    }
+
+    DRMINITLISTHEAD(&slab->head);
+    DRMINITLISTHEAD(&slab->freeBuffers);
+    slab->numBuffers = numBuffers;
+    slab->numFree = 0;
+    slab->header = header;
+
+    buf = slab->buffers;
+    for (i=0; i < numBuffers; ++i) {
+       buf->parent = slab;
+       buf->start = i* header->bufSize;
+       buf->mapCount = 0;
+       buf->isSlabBuffer = 1;
+       _glthread_INIT_COND(buf->event);
+       DRMLISTADDTAIL(&buf->head, &slab->freeBuffers);
+       slab->numFree++;
+       buf++;
+    }
+
+    DRMLISTADDTAIL(&slab->head, &header->slabs);
+
+    return 0;
+
+  out_err1:
+    driSetKernelBOFree(header->slabPool->fMan, slab->kbo);
+    free(slab->buffers);
+  out_err0:
+    free(slab);
+    return ret;
+}
+
+/*
+ * Delete a buffer from the slab header delayed list and put
+ * it on the slab free list.
+ */
+
+static void
+driSlabFreeBufferLocked(struct _DriSlabBuffer *buf)
+{
+    struct _DriSlab *slab = buf->parent;
+    struct _DriSlabSizeHeader *header = slab->header;
+    drmMMListHead *list = &buf->head;
+
+    DRMLISTDEL(list);
+    DRMLISTADDTAIL(list, &slab->freeBuffers);
+    slab->numFree++;
+
+    if (slab->head.next == &slab->head)
+       DRMLISTADDTAIL(&slab->head, &header->slabs);
+
+    if (slab->numFree == slab->numBuffers) {
+       list = &slab->head;
+       DRMLISTDEL(list);
+       DRMLISTADDTAIL(list, &header->freeSlabs);
+    }
+
+    if (header->slabs.next == &header->slabs ||
+       slab->numFree != slab->numBuffers) {
+
+       drmMMListHead *next;
+       struct _DriFreeSlabManager *fMan = header->slabPool->fMan;
+
+       for (list = header->freeSlabs.next, next = list->next;
+            list != &header->freeSlabs;
+            list = next, next = list->next) {
+
+           slab = DRMLISTENTRY(struct _DriSlab, list, head);
+
+           DRMLISTDELINIT(list);
+           driSetKernelBOFree(fMan, slab->kbo);
+           free(slab->buffers);
+           free(slab);
+       }
+    }
+}
+
+static void
+driSlabCheckFreeLocked(struct _DriSlabSizeHeader *header, int wait)
+{
+  drmMMListHead *list, *prev, *first;
+   struct _DriSlabBuffer *buf;
+   struct _DriSlab *slab;
+   int firstWasSignaled = 1;
+   int signaled;
+   int i;
+   int ret;
+
+   /*
+    * Rerun the freeing test if the youngest tested buffer
+    * was signaled, since there might be more idle buffers
+    * in the delay list.
+    */
+
+   while (firstWasSignaled) {
+       firstWasSignaled = 0;
+       signaled = 0;
+       first = header->delayedBuffers.next;
+
+       /* Only examine the oldest 1/3 of delayed buffers:
+       */
+       if (header->numDelayed > 3) {
+          for (i = 0; i < header->numDelayed; i += 3) {
+              first = first->next;
+          }
+       }
+
+       for (list = first, prev = list->prev;
+           list != &header->delayedBuffers;
+           list = prev, prev = list->prev) {
+          buf = DRMLISTENTRY(struct _DriSlabBuffer, list, head);
+          slab = buf->parent;
+
+          if (!signaled) {
+              if (wait) {
+                  ret = driFenceFinish(buf->fence, buf->fenceType, 0);
+                  if (ret)
+                      break;
+                  signaled = 1;
+                  wait = 0;
+              } else {
+                  signaled = driFenceSignaled(buf->fence, buf->fenceType);
+              }
+              if (signaled) {
+                  if (list == first)
+                      firstWasSignaled = 1;
+                  driFenceUnReference(&buf->fence);
+                  header->numDelayed--;
+                  driSlabFreeBufferLocked(buf);
+              }
+          } else if (driFenceSignaledCached(buf->fence, buf->fenceType)) {
+              driFenceUnReference(&buf->fence);
+              header->numDelayed--;
+              driSlabFreeBufferLocked(buf);
+          }
+       }
+   }
+}
+
+
+static struct _DriSlabBuffer *
+driSlabAllocBuffer(struct _DriSlabSizeHeader *header)
+{
+    static struct _DriSlabBuffer *buf;
+    struct _DriSlab *slab;
+    drmMMListHead *list;
+    int count = DRI_SLABPOOL_ALLOC_RETRIES;
+
+    _glthread_LOCK_MUTEX(header->mutex);
+    while(header->slabs.next == &header->slabs && count > 0) {
+        driSlabCheckFreeLocked(header, 0);
+       if (header->slabs.next != &header->slabs)
+         break;
+
+       _glthread_UNLOCK_MUTEX(header->mutex);
+       if (count != DRI_SLABPOOL_ALLOC_RETRIES)
+           usleep(1);
+       _glthread_LOCK_MUTEX(header->mutex);
+       (void) driAllocSlab(header);
+       count--;
+    }
+
+    list = header->slabs.next;
+    if (list == &header->slabs) {
+       _glthread_UNLOCK_MUTEX(header->mutex);
+       return NULL;
+    }
+    slab = DRMLISTENTRY(struct _DriSlab, list, head);
+    if (--slab->numFree == 0)
+       DRMLISTDELINIT(list);
+
+    list = slab->freeBuffers.next;
+    DRMLISTDELINIT(list);
+
+    _glthread_UNLOCK_MUTEX(header->mutex);
+    buf = DRMLISTENTRY(struct _DriSlabBuffer, list, head);
+    return buf;
+}
+
+static void *
+pool_create(struct _DriBufferPool *driPool, unsigned long size,
+           uint64_t flags, unsigned hint, unsigned alignment)
+{
+    struct _DriSlabPool *pool = (struct _DriSlabPool *) driPool->data;
+    struct _DriSlabSizeHeader *header;
+    struct _DriSlabBuffer *buf;
+    void *dummy;
+    int i;
+    int ret;
+
+    /*
+     * FIXME: Check for compatibility.
+     */
+    header = pool->headers;
+    for (i=0; i<pool->numBuckets; ++i) {
+      if (header->bufSize >= size)
+       break;
+      header++;
+    }
+
+    if (i < pool->numBuckets)
+       return driSlabAllocBuffer(header);
+
+
+    /*
+     * Fall back to allocate a buffer object directly from DRM.
+     * and wrap it in a driBO structure.
+     */
+
+
+    buf = calloc(1, sizeof(*buf));
+
+    if (!buf)
+       return NULL;
+
+    buf->bo = calloc(1, sizeof(*buf->bo));
+    if (!buf->bo)
+       goto out_err0;
+
+    if (alignment) {
+       if ((alignment < pool->pageSize) && (pool->pageSize % alignment))
+           goto out_err1;
+       if ((alignment > pool->pageSize) && (alignment % pool->pageSize))
+           goto out_err1;
+    }
+
+    ret = drmBOCreate(pool->fd, size, alignment / pool->pageSize, NULL,
+                       flags, hint, buf->bo);
+    if (ret)
+       goto out_err1;
+
+    ret  = drmBOMap(pool->fd, buf->bo, DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE,
+                   0, &dummy);
+    if (ret)
+       goto out_err2;
+
+    ret = drmBOUnmap(pool->fd, buf->bo);
+    if (ret)
+       goto out_err2;
+
+    return buf;
+  out_err2:
+    drmBOUnreference(pool->fd, buf->bo);
+  out_err1:
+    free(buf->bo);
+  out_err0:
+    free(buf);
+    return NULL;
+}
+
+static int
+pool_destroy(struct _DriBufferPool *driPool, void *private)
+{
+    struct _DriSlabBuffer *buf =
+       (struct _DriSlabBuffer *) private;
+    struct _DriSlab *slab;
+    struct _DriSlabSizeHeader *header;
+
+    if (!buf->isSlabBuffer) {
+       struct _DriSlabPool *pool = (struct _DriSlabPool *) driPool->data;
+       int ret;
+
+       ret = drmBOUnreference(pool->fd, buf->bo);
+       free(buf->bo);
+       free(buf);
+       return ret;
+    }
+
+    slab = buf->parent;
+    header = slab->header;
+
+    _glthread_LOCK_MUTEX(header->mutex);
+    buf->unFenced = 0;
+    buf->mapCount = 0;
+
+    if (buf->fence && !driFenceSignaledCached(buf->fence, buf->fenceType)) {
+       DRMLISTADDTAIL(&buf->head, &header->delayedBuffers);
+       header->numDelayed++;
+    } else {
+       if (buf->fence)
+           driFenceUnReference(&buf->fence);
+       driSlabFreeBufferLocked(buf);
+    }
+
+    _glthread_UNLOCK_MUTEX(header->mutex);
+    return 0;
+}
+
+static int
+pool_waitIdle(struct _DriBufferPool *driPool, void *private, 
+             _glthread_Mutex *mutex, int lazy)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+
+   while(buf->unFenced)
+       _glthread_COND_WAIT(buf->event, *mutex);
+
+   if (!buf->fence)
+     return 0;
+
+   driFenceFinish(buf->fence, buf->fenceType, lazy);
+   driFenceUnReference(&buf->fence);
+
+   return 0;
+}
+
+static int
+pool_map(struct _DriBufferPool *pool, void *private, unsigned flags,
+         int hint, _glthread_Mutex *mutex, void **virtual)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+   int busy;
+
+   if (buf->isSlabBuffer)
+       busy = buf->unFenced || (buf->fence && !driFenceSignaledCached(buf->fence, buf->fenceType));
+   else
+       busy = buf->fence && !driFenceSignaled(buf->fence, buf->fenceType);
+
+
+   if (busy) {
+       if (hint & DRM_BO_HINT_DONT_BLOCK)
+          return -EBUSY;
+       else {
+          (void) pool_waitIdle(pool, private, mutex, 0);
+       }
+   }
+
+   ++buf->mapCount;
+   *virtual = (buf->isSlabBuffer) ?
+       (void *) ((uint8_t *) buf->parent->kbo->virtual + buf->start) :
+       (void *) buf->bo->virtual;
+
+   return 0;
+}
+
+static int
+pool_unmap(struct _DriBufferPool *pool, void *private)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+
+   --buf->mapCount;
+   if (buf->mapCount == 0 && buf->isSlabBuffer) 
+       _glthread_COND_BROADCAST(buf->event);
+
+   return 0;
+}
+
+static unsigned long
+pool_offset(struct _DriBufferPool *pool, void *private)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+   struct _DriSlab *slab;
+   struct _DriSlabSizeHeader *header;
+
+   if (!buf->isSlabBuffer) {
+       assert(buf->bo->proposedFlags & DRM_BO_FLAG_NO_MOVE);
+       return buf->bo->offset;
+   }
+
+   slab = buf->parent;
+   header = slab->header;
+
+   (void) header;
+   assert(header->slabPool->proposedFlags & DRM_BO_FLAG_NO_MOVE);
+   return slab->kbo->bo.offset + buf->start;
+}
+
+static unsigned long
+pool_poolOffset(struct _DriBufferPool *pool, void *private)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+
+   return buf->start;
+}
+
+static uint64_t
+pool_flags(struct _DriBufferPool *pool, void *private)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+
+   if (!buf->isSlabBuffer)
+       return buf->bo->flags;
+
+   return buf->parent->kbo->bo.flags;
+}
+
+static unsigned long
+pool_size(struct _DriBufferPool *pool, void *private)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+   if (!buf->isSlabBuffer)
+       return buf->bo->size;
+
+   return buf->parent->header->bufSize;
+}
+
+static int
+pool_fence(struct _DriBufferPool *pool, void *private,
+           struct _DriFenceObject *fence)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+   drmBO *bo;
+
+   if (buf->fence)
+      driFenceUnReference(&buf->fence);
+
+   buf->fence = driFenceReference(fence);
+   bo = (buf->isSlabBuffer) ?
+     &buf->parent->kbo->bo:
+     buf->bo;
+   buf->fenceType = bo->fenceFlags;
+
+   buf->unFenced = 0;
+   _glthread_COND_BROADCAST(buf->event);
+
+   return 0;
+}
+
+static drmBO *
+pool_kernel(struct _DriBufferPool *pool, void *private)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+
+   if (!buf)
+      return NULL;
+
+   return (buf->isSlabBuffer) ? &buf->parent->kbo->bo : buf->bo;
+}
+
+static int
+pool_validate(struct _DriBufferPool *pool, void *private, 
+             _glthread_Mutex *mutex)
+{
+   struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
+
+   if (!buf->isSlabBuffer) 
+       return 0;
+   
+   while(buf->mapCount != 0)
+       _glthread_COND_WAIT(buf->event, *mutex);
+
+   buf->unFenced = 1;
+   return 0;
+}
+
+
+struct _DriFreeSlabManager *
+driInitFreeSlabManager(uint32_t checkIntervalMsec, uint32_t slabTimeoutMsec)
+{
+    struct _DriFreeSlabManager *tmp;
+
+    tmp = calloc(1, sizeof(*tmp));
+    if (!tmp)
+       return NULL;
+
+    _glthread_INIT_MUTEX(tmp->mutex);
+    _glthread_LOCK_MUTEX(tmp->mutex);
+    tmp->slabTimeout.tv_usec = slabTimeoutMsec*1000;
+    tmp->slabTimeout.tv_sec = tmp->slabTimeout.tv_usec / 1000000;
+    tmp->slabTimeout.tv_usec -=  tmp->slabTimeout.tv_sec*1000000;
+
+    tmp->checkInterval.tv_usec = checkIntervalMsec*1000;
+    tmp->checkInterval.tv_sec = tmp->checkInterval.tv_usec / 1000000;
+    tmp->checkInterval.tv_usec -=  tmp->checkInterval.tv_sec*1000000;
+
+    gettimeofday(&tmp->nextCheck, NULL);
+    driTimeAdd(&tmp->nextCheck, &tmp->checkInterval);
+    DRMINITLISTHEAD(&tmp->timeoutList);
+    DRMINITLISTHEAD(&tmp->unCached);
+    DRMINITLISTHEAD(&tmp->cached);
+    _glthread_UNLOCK_MUTEX(tmp->mutex);
+
+    return tmp;
+}
+
+void
+driFinishFreeSlabManager(struct _DriFreeSlabManager *fMan)
+{
+    struct timeval time;
+
+    time = fMan->nextCheck;
+    driTimeAdd(&time, &fMan->checkInterval);
+
+    _glthread_LOCK_MUTEX(fMan->mutex);
+    driFreeTimeoutKBOsLocked(fMan, &time);
+    _glthread_UNLOCK_MUTEX(fMan->mutex);
+
+    assert(fMan->timeoutList.next == &fMan->timeoutList);
+    assert(fMan->unCached.next == &fMan->unCached);
+    assert(fMan->cached.next == &fMan->cached);
+
+    free(fMan);
+}
+
+static void
+driInitSizeHeader(struct _DriSlabPool *pool, uint32_t size,
+                 struct _DriSlabSizeHeader *header)
+{
+    _glthread_INIT_MUTEX(header->mutex);
+    _glthread_LOCK_MUTEX(header->mutex);
+
+    DRMINITLISTHEAD(&header->slabs);
+    DRMINITLISTHEAD(&header->freeSlabs);
+    DRMINITLISTHEAD(&header->delayedBuffers);
+
+    header->numDelayed = 0;
+    header->slabPool = pool;
+    header->bufSize = size;
+
+    _glthread_UNLOCK_MUTEX(header->mutex);
+}
+
+static void
+driFinishSizeHeader(struct _DriSlabSizeHeader *header)
+{
+    drmMMListHead *list, *next;
+    struct _DriSlabBuffer *buf;
+
+    _glthread_LOCK_MUTEX(header->mutex);
+    for (list = header->delayedBuffers.next, next = list->next;
+        list != &header->delayedBuffers;
+        list = next, next = list->next) {
+
+       buf = DRMLISTENTRY(struct _DriSlabBuffer, list , head);
+       if (buf->fence) {
+           (void) driFenceFinish(buf->fence, buf->fenceType, 0);
+           driFenceUnReference(&buf->fence);
+       }
+       header->numDelayed--;
+       driSlabFreeBufferLocked(buf);
+    }
+    _glthread_UNLOCK_MUTEX(header->mutex);
+}
+
+static void
+pool_takedown(struct _DriBufferPool *driPool)
+{
+   struct _DriSlabPool *pool = driPool->data;
+   int i;
+
+   for (i=0; i<pool->numBuckets; ++i) {
+     driFinishSizeHeader(&pool->headers[i]);
+   }
+
+   free(pool->headers);
+   free(pool->bucketSizes);
+   free(pool);
+   free(driPool);
+}
+
+struct _DriBufferPool *
+driSlabPoolInit(int fd, uint64_t flags,
+               uint64_t validMask,
+               uint32_t smallestSize,
+               uint32_t numSizes,
+               uint32_t desiredNumBuffers,
+               uint32_t maxSlabSize,
+               uint32_t pageAlignment,
+               struct _DriFreeSlabManager *fMan)
+{
+    struct _DriBufferPool *driPool;
+    struct _DriSlabPool *pool;
+    uint32_t i;
+
+    driPool = calloc(1, sizeof(*driPool));
+    if (!driPool)
+       return NULL;
+
+    pool = calloc(1, sizeof(*pool));
+    if (!pool)
+       goto out_err0;
+
+    pool->bucketSizes = calloc(numSizes, sizeof(*pool->bucketSizes));
+    if (!pool->bucketSizes)
+       goto out_err1;
+
+    pool->headers = calloc(numSizes, sizeof(*pool->headers));
+    if (!pool->headers)
+       goto out_err2;
+
+    pool->fMan = fMan;
+    pool->proposedFlags = flags;
+    pool->validMask = validMask;
+    pool->numBuckets = numSizes;
+    pool->pageSize = getpagesize();
+    pool->fd = fd;
+    pool->pageAlignment = pageAlignment;
+    pool->maxSlabSize = maxSlabSize;
+    pool->desiredNumBuffers = desiredNumBuffers;
+
+    for (i=0; i<pool->numBuckets; ++i) {
+       pool->bucketSizes[i] = (smallestSize << i);
+       driInitSizeHeader(pool, pool->bucketSizes[i],
+                         &pool->headers[i]);
+    }
+
+    driPool->data = (void *) pool;
+    driPool->map = &pool_map;
+    driPool->unmap = &pool_unmap;
+    driPool->destroy = &pool_destroy;
+    driPool->offset = &pool_offset;
+    driPool->poolOffset = &pool_poolOffset;
+    driPool->flags = &pool_flags;
+    driPool->size = &pool_size;
+    driPool->create = &pool_create;
+    driPool->fence = &pool_fence;
+    driPool->kernel = &pool_kernel;
+    driPool->validate = &pool_validate;
+    driPool->waitIdle = &pool_waitIdle;
+    driPool->takeDown = &pool_takedown;
+
+    return driPool;
+
+  out_err2:
+    free(pool->bucketSizes);
+  out_err1:
+    free(pool);
+  out_err0:
+    free(driPool);
+
+    return NULL;
+}
index 87c523383b576822fae458db45ea9c28d64688f9..fbb2a91956c913d88b84afc39f00b557e74950a9 100644 (file)
@@ -7468,26 +7468,6 @@ __indirect_glGetProgramivARB(GLenum target, GLenum pname, GLint * params)
     return;
 }
 
-#define X_GLrop_ProgramEnvParameter4dvARB 4185
-void
-__indirect_glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x,
-                                      GLdouble y, GLdouble z, GLdouble w)
-{
-    __GLXcontext *const gc = __glXGetCurrentContext();
-    const GLuint cmdlen = 44;
-    emit_header(gc->pc, X_GLrop_ProgramEnvParameter4dvARB, cmdlen);
-    (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4);
-    (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4);
-    (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 8);
-    (void) memcpy((void *) (gc->pc + 20), (void *) (&y), 8);
-    (void) memcpy((void *) (gc->pc + 28), (void *) (&z), 8);
-    (void) memcpy((void *) (gc->pc + 36), (void *) (&w), 8);
-    gc->pc += cmdlen;
-    if (__builtin_expect(gc->pc > gc->limit, 0)) {
-        (void) __glXFlushRenderBuffer(gc, gc->pc);
-    }
-}
-
 #define X_GLrop_ProgramEnvParameter4dvARB 4185
 void
 __indirect_glProgramEnvParameter4dvARB(GLenum target, GLuint index,
@@ -7505,26 +7485,6 @@ __indirect_glProgramEnvParameter4dvARB(GLenum target, GLuint index,
     }
 }
 
-#define X_GLrop_ProgramEnvParameter4fvARB 4184
-void
-__indirect_glProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x,
-                                      GLfloat y, GLfloat z, GLfloat w)
-{
-    __GLXcontext *const gc = __glXGetCurrentContext();
-    const GLuint cmdlen = 28;
-    emit_header(gc->pc, X_GLrop_ProgramEnvParameter4fvARB, cmdlen);
-    (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4);
-    (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4);
-    (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4);
-    (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4);
-    (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 4);
-    (void) memcpy((void *) (gc->pc + 24), (void *) (&w), 4);
-    gc->pc += cmdlen;
-    if (__builtin_expect(gc->pc > gc->limit, 0)) {
-        (void) __glXFlushRenderBuffer(gc, gc->pc);
-    }
-}
-
 #define X_GLrop_ProgramEnvParameter4fvARB 4184
 void
 __indirect_glProgramEnvParameter4fvARB(GLenum target, GLuint index,
@@ -9104,80 +9064,6 @@ __indirect_glLoadProgramNV(GLenum target, GLuint id, GLsizei len,
     }
 }
 
-#define X_GLrop_ProgramParameter4dvNV 4185
-void
-__indirect_glProgramParameter4dNV(GLenum target, GLuint index, GLdouble x,
-                                  GLdouble y, GLdouble z, GLdouble w)
-{
-    __GLXcontext *const gc = __glXGetCurrentContext();
-    const GLuint cmdlen = 44;
-    emit_header(gc->pc, X_GLrop_ProgramParameter4dvNV, cmdlen);
-    (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4);
-    (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4);
-    (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 8);
-    (void) memcpy((void *) (gc->pc + 20), (void *) (&y), 8);
-    (void) memcpy((void *) (gc->pc + 28), (void *) (&z), 8);
-    (void) memcpy((void *) (gc->pc + 36), (void *) (&w), 8);
-    gc->pc += cmdlen;
-    if (__builtin_expect(gc->pc > gc->limit, 0)) {
-        (void) __glXFlushRenderBuffer(gc, gc->pc);
-    }
-}
-
-#define X_GLrop_ProgramParameter4dvNV 4185
-void
-__indirect_glProgramParameter4dvNV(GLenum target, GLuint index,
-                                   const GLdouble * params)
-{
-    __GLXcontext *const gc = __glXGetCurrentContext();
-    const GLuint cmdlen = 44;
-    emit_header(gc->pc, X_GLrop_ProgramParameter4dvNV, cmdlen);
-    (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4);
-    (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4);
-    (void) memcpy((void *) (gc->pc + 12), (void *) (params), 32);
-    gc->pc += cmdlen;
-    if (__builtin_expect(gc->pc > gc->limit, 0)) {
-        (void) __glXFlushRenderBuffer(gc, gc->pc);
-    }
-}
-
-#define X_GLrop_ProgramParameter4fvNV 4184
-void
-__indirect_glProgramParameter4fNV(GLenum target, GLuint index, GLfloat x,
-                                  GLfloat y, GLfloat z, GLfloat w)
-{
-    __GLXcontext *const gc = __glXGetCurrentContext();
-    const GLuint cmdlen = 28;
-    emit_header(gc->pc, X_GLrop_ProgramParameter4fvNV, cmdlen);
-    (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4);
-    (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4);
-    (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4);
-    (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4);
-    (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 4);
-    (void) memcpy((void *) (gc->pc + 24), (void *) (&w), 4);
-    gc->pc += cmdlen;
-    if (__builtin_expect(gc->pc > gc->limit, 0)) {
-        (void) __glXFlushRenderBuffer(gc, gc->pc);
-    }
-}
-
-#define X_GLrop_ProgramParameter4fvNV 4184
-void
-__indirect_glProgramParameter4fvNV(GLenum target, GLuint index,
-                                   const GLfloat * params)
-{
-    __GLXcontext *const gc = __glXGetCurrentContext();
-    const GLuint cmdlen = 28;
-    emit_header(gc->pc, X_GLrop_ProgramParameter4fvNV, cmdlen);
-    (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4);
-    (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4);
-    (void) memcpy((void *) (gc->pc + 12), (void *) (params), 16);
-    gc->pc += cmdlen;
-    if (__builtin_expect(gc->pc > gc->limit, 0)) {
-        (void) __glXFlushRenderBuffer(gc, gc->pc);
-    }
-}
-
 #define X_GLrop_ProgramParameters4dvNV 4187
 void
 __indirect_glProgramParameters4dvNV(GLenum target, GLuint index, GLuint num,
index 630062e2335e770256795c661c8212c5246c75ba..f8c88b36bb82f990f327697bd2ec0ac671f91b4e 100644 (file)
@@ -517,9 +517,7 @@ extern HIDDEN void __indirect_glGetProgramivARB(GLenum target, GLenum pname, GLi
 extern HIDDEN void __indirect_glGetVertexAttribdvARB(GLuint index, GLenum pname, GLdouble * params);
 extern HIDDEN void __indirect_glGetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat * params);
 extern HIDDEN void __indirect_glGetVertexAttribivARB(GLuint index, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
 extern HIDDEN void __indirect_glProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble * params);
-extern HIDDEN void __indirect_glProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
 extern HIDDEN void __indirect_glProgramEnvParameter4fvARB(GLenum target, GLuint index, const GLfloat * params);
 extern HIDDEN void __indirect_glProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
 extern HIDDEN void __indirect_glProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble * params);
@@ -639,10 +637,6 @@ extern HIDDEN void __indirect_glGetVertexAttribfvNV(GLuint index, GLenum pname,
 extern HIDDEN void __indirect_glGetVertexAttribivNV(GLuint index, GLenum pname, GLint * params);
 extern HIDDEN GLboolean __indirect_glIsProgramNV(GLuint program);
 extern HIDDEN void __indirect_glLoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte * program);
-extern HIDDEN void __indirect_glProgramParameter4dNV(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-extern HIDDEN void __indirect_glProgramParameter4dvNV(GLenum target, GLuint index, const GLdouble * params);
-extern HIDDEN void __indirect_glProgramParameter4fNV(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-extern HIDDEN void __indirect_glProgramParameter4fvNV(GLenum target, GLuint index, const GLfloat * params);
 extern HIDDEN void __indirect_glProgramParameters4dvNV(GLenum target, GLuint index, GLuint num, const GLdouble * params);
 extern HIDDEN void __indirect_glProgramParameters4fvNV(GLenum target, GLuint index, GLuint num, const GLfloat * params);
 extern HIDDEN void __indirect_glRequestResidentProgramsNV(GLsizei n, const GLuint * ids);
index aaa70c8796a2f764a29b16e1452f45a3cb4feb7e..479184337c11cf8b2276163e2fae44c0e1e7c3e9 100644 (file)
@@ -526,9 +526,7 @@ __GLapi * __glXNewIndirectAPI( void )
     glAPI->GetVertexAttribdvARB = __indirect_glGetVertexAttribdvARB;
     glAPI->GetVertexAttribfvARB = __indirect_glGetVertexAttribfvARB;
     glAPI->GetVertexAttribivARB = __indirect_glGetVertexAttribivARB;
-    glAPI->ProgramEnvParameter4dARB = __indirect_glProgramEnvParameter4dARB;
     glAPI->ProgramEnvParameter4dvARB = __indirect_glProgramEnvParameter4dvARB;
-    glAPI->ProgramEnvParameter4fARB = __indirect_glProgramEnvParameter4fARB;
     glAPI->ProgramEnvParameter4fvARB = __indirect_glProgramEnvParameter4fvARB;
     glAPI->ProgramLocalParameter4dARB = __indirect_glProgramLocalParameter4dARB;
     glAPI->ProgramLocalParameter4dvARB = __indirect_glProgramLocalParameter4dvARB;
@@ -681,10 +679,6 @@ __GLapi * __glXNewIndirectAPI( void )
     glAPI->GetVertexAttribivNV = __indirect_glGetVertexAttribivNV;
     glAPI->IsProgramNV = __indirect_glIsProgramNV;
     glAPI->LoadProgramNV = __indirect_glLoadProgramNV;
-    glAPI->ProgramParameter4dNV = __indirect_glProgramParameter4dNV;
-    glAPI->ProgramParameter4dvNV = __indirect_glProgramParameter4dvNV;
-    glAPI->ProgramParameter4fNV = __indirect_glProgramParameter4fNV;
-    glAPI->ProgramParameter4fvNV = __indirect_glProgramParameter4fvNV;
     glAPI->ProgramParameters4dvNV = __indirect_glProgramParameters4dvNV;
     glAPI->ProgramParameters4fvNV = __indirect_glProgramParameters4fvNV;
     glAPI->RequestResidentProgramsNV = __indirect_glRequestResidentProgramsNV;
index 065c5d8dae704eedc9ae6f9755cf515f0a5fab7e..65e96657b8aeea652f2daf02a76436905e537657 100644 (file)
@@ -40,13 +40,6 @@ static const char UniformMatrix3fvARB_names[] =
     "";
 #endif
 
-#if defined(need_GL_NV_vertex_program)
-static const char ProgramParameter4fNV_names[] = 
-    "iiffff\0" /* Parameter signature */
-    "glProgramParameter4fNV\0"
-    "";
-#endif
-
 #if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_multisample)
 static const char SampleCoverageARB_names[] = 
     "fi\0" /* Parameter signature */
@@ -572,13 +565,6 @@ static const char MatrixIndexusvARB_names[] =
     "";
 #endif
 
-#if defined(need_GL_NV_vertex_program)
-static const char ProgramParameter4dvNV_names[] = 
-    "iip\0" /* Parameter signature */
-    "glProgramParameter4dvNV\0"
-    "";
-#endif
-
 #if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
 static const char DisableVertexAttribArrayARB_names[] = 
     "i\0" /* Parameter signature */
@@ -967,13 +953,6 @@ static const char GenerateMipmapEXT_names[] =
     "";
 #endif
 
-#if defined(need_GL_NV_vertex_program)
-static const char ProgramParameter4dNV_names[] = 
-    "iidddd\0" /* Parameter signature */
-    "glProgramParameter4dNV\0"
-    "";
-#endif
-
 #if defined(need_GL_ATI_fragment_shader)
 static const char SetFragmentShaderConstantATI_names[] = 
     "ip\0" /* Parameter signature */
@@ -1311,10 +1290,11 @@ static const char Color3fVertex3fSUN_names[] =
     "";
 #endif
 
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program)
 static const char ProgramEnvParameter4fvARB_names[] = 
     "iip\0" /* Parameter signature */
     "glProgramEnvParameter4fvARB\0"
+    "glProgramParameter4fvNV\0"
     "";
 #endif
 
@@ -2035,13 +2015,6 @@ static const char WeightfvARB_names[] =
     "";
 #endif
 
-#if defined(need_GL_NV_vertex_program)
-static const char ProgramParameter4fvNV_names[] = 
-    "iip\0" /* Parameter signature */
-    "glProgramParameter4fvNV\0"
-    "";
-#endif
-
 #if defined(need_GL_MESA_window_pos)
 static const char WindowPos4fMESA_names[] = 
     "ffff\0" /* Parameter signature */
@@ -2432,10 +2405,11 @@ static const char GetBufferPointervARB_names[] =
     "";
 #endif
 
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program)
 static const char ProgramEnvParameter4fARB_names[] = 
     "iiffff\0" /* Parameter signature */
     "glProgramEnvParameter4fARB\0"
+    "glProgramParameter4fNV\0"
     "";
 #endif
 
@@ -2803,10 +2777,11 @@ static const char ReplacementCodePointerSUN_names[] =
     "";
 #endif
 
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program)
 static const char ProgramEnvParameter4dARB_names[] = 
     "iidddd\0" /* Parameter signature */
     "glProgramEnvParameter4dARB\0"
+    "glProgramParameter4dNV\0"
     "";
 #endif
 
@@ -3660,10 +3635,11 @@ static const char GetColorTableParameteriv_names[] =
     "";
 #endif
 
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program)
 static const char ProgramEnvParameter4dvARB_names[] = 
     "iip\0" /* Parameter signature */
     "glProgramEnvParameter4dvARB\0"
+    "glProgramParameter4dvNV\0"
     "";
 #endif
 
@@ -5748,12 +5724,10 @@ static const struct dri_extension_function GL_NV_vertex_array_range_functions[]
 
 #if defined(need_GL_NV_vertex_program)
 static const struct dri_extension_function GL_NV_vertex_program_functions[] = {
-    { ProgramParameter4fNV_names, ProgramParameter4fNV_remap_index, -1 },
     { VertexAttrib4ubvNV_names, VertexAttrib4ubvNV_remap_index, -1 },
     { VertexAttrib4svNV_names, VertexAttrib4svNV_remap_index, -1 },
     { VertexAttribs1dvNV_names, VertexAttribs1dvNV_remap_index, -1 },
     { VertexAttrib1fvNV_names, VertexAttrib1fvNV_remap_index, -1 },
-    { ProgramParameter4dvNV_names, ProgramParameter4dvNV_remap_index, -1 },
     { VertexAttrib4fNV_names, VertexAttrib4fNV_remap_index, -1 },
     { VertexAttrib2dNV_names, VertexAttrib2dNV_remap_index, -1 },
     { VertexAttrib4ubNV_names, VertexAttrib4ubNV_remap_index, -1 },
@@ -5761,7 +5735,7 @@ static const struct dri_extension_function GL_NV_vertex_program_functions[] = {
     { VertexAttribs4fvNV_names, VertexAttribs4fvNV_remap_index, -1 },
     { VertexAttrib2sNV_names, VertexAttrib2sNV_remap_index, -1 },
     { VertexAttribs3fvNV_names, VertexAttribs3fvNV_remap_index, -1 },
-    { ProgramParameter4dNV_names, ProgramParameter4dNV_remap_index, -1 },
+    { ProgramEnvParameter4fvARB_names, ProgramEnvParameter4fvARB_remap_index, -1 },
     { LoadProgramNV_names, LoadProgramNV_remap_index, -1 },
     { VertexAttrib4fvNV_names, VertexAttrib4fvNV_remap_index, -1 },
     { VertexAttrib3fNV_names, VertexAttrib3fNV_remap_index, -1 },
@@ -5771,14 +5745,15 @@ static const struct dri_extension_function GL_NV_vertex_program_functions[] = {
     { VertexAttrib2fvNV_names, VertexAttrib2fvNV_remap_index, -1 },
     { VertexAttrib2dvNV_names, VertexAttrib2dvNV_remap_index, -1 },
     { VertexAttrib1dvNV_names, VertexAttrib1dvNV_remap_index, -1 },
-    { ProgramParameter4fvNV_names, ProgramParameter4fvNV_remap_index, -1 },
     { VertexAttrib1svNV_names, VertexAttrib1svNV_remap_index, -1 },
+    { ProgramEnvParameter4fARB_names, ProgramEnvParameter4fARB_remap_index, -1 },
     { VertexAttribs2svNV_names, VertexAttribs2svNV_remap_index, -1 },
     { GetVertexAttribivNV_names, GetVertexAttribivNV_remap_index, -1 },
     { GetVertexAttribfvNV_names, GetVertexAttribfvNV_remap_index, -1 },
     { VertexAttrib2svNV_names, VertexAttrib2svNV_remap_index, -1 },
     { VertexAttribs1fvNV_names, VertexAttribs1fvNV_remap_index, -1 },
     { IsProgramNV_names, IsProgramNV_remap_index, -1 },
+    { ProgramEnvParameter4dARB_names, ProgramEnvParameter4dARB_remap_index, -1 },
     { VertexAttrib2fNV_names, VertexAttrib2fNV_remap_index, -1 },
     { RequestResidentProgramsNV_names, RequestResidentProgramsNV_remap_index, -1 },
     { ExecuteProgramNV_names, ExecuteProgramNV_remap_index, -1 },
@@ -5791,6 +5766,7 @@ static const struct dri_extension_function GL_NV_vertex_program_functions[] = {
     { GetProgramivNV_names, GetProgramivNV_remap_index, -1 },
     { GetVertexAttribdvNV_names, GetVertexAttribdvNV_remap_index, -1 },
     { VertexAttrib3fvNV_names, VertexAttrib3fvNV_remap_index, -1 },
+    { ProgramEnvParameter4dvARB_names, ProgramEnvParameter4dvARB_remap_index, -1 },
     { VertexAttribs2fvNV_names, VertexAttribs2fvNV_remap_index, -1 },
     { DeleteProgramsNV_names, DeleteProgramsNV_remap_index, -1 },
     { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 },
index db23e44396de6ff53bfe00d7029ee181da542196..712315608529e660587d66235e71df214779db37 100644 (file)
 #define CALL_LoadProgramNV(disp, parameters) (*((disp)->LoadProgramNV)) parameters
 #define GET_LoadProgramNV(disp) ((disp)->LoadProgramNV)
 #define SET_LoadProgramNV(disp, fn) ((disp)->LoadProgramNV = fn)
-#define CALL_ProgramParameter4dNV(disp, parameters) (*((disp)->ProgramParameter4dNV)) parameters
-#define GET_ProgramParameter4dNV(disp) ((disp)->ProgramParameter4dNV)
-#define SET_ProgramParameter4dNV(disp, fn) ((disp)->ProgramParameter4dNV = fn)
-#define CALL_ProgramParameter4dvNV(disp, parameters) (*((disp)->ProgramParameter4dvNV)) parameters
-#define GET_ProgramParameter4dvNV(disp) ((disp)->ProgramParameter4dvNV)
-#define SET_ProgramParameter4dvNV(disp, fn) ((disp)->ProgramParameter4dvNV = fn)
-#define CALL_ProgramParameter4fNV(disp, parameters) (*((disp)->ProgramParameter4fNV)) parameters
-#define GET_ProgramParameter4fNV(disp) ((disp)->ProgramParameter4fNV)
-#define SET_ProgramParameter4fNV(disp, fn) ((disp)->ProgramParameter4fNV = fn)
-#define CALL_ProgramParameter4fvNV(disp, parameters) (*((disp)->ProgramParameter4fvNV)) parameters
-#define GET_ProgramParameter4fvNV(disp) ((disp)->ProgramParameter4fvNV)
-#define SET_ProgramParameter4fvNV(disp, fn) ((disp)->ProgramParameter4fvNV = fn)
 #define CALL_ProgramParameters4dvNV(disp, parameters) (*((disp)->ProgramParameters4dvNV)) parameters
 #define GET_ProgramParameters4dvNV(disp) ((disp)->ProgramParameters4dvNV)
 #define SET_ProgramParameters4dvNV(disp, fn) ((disp)->ProgramParameters4dvNV = fn)
 
 #else
 
-#define driDispatchRemapTable_size 366
+#define driDispatchRemapTable_size 362
 extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
 
 #define AttachShader_remap_index 0
@@ -2651,107 +2639,103 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
 #define GetVertexAttribivNV_remap_index 262
 #define IsProgramNV_remap_index 263
 #define LoadProgramNV_remap_index 264
-#define ProgramParameter4dNV_remap_index 265
-#define ProgramParameter4dvNV_remap_index 266
-#define ProgramParameter4fNV_remap_index 267
-#define ProgramParameter4fvNV_remap_index 268
-#define ProgramParameters4dvNV_remap_index 269
-#define ProgramParameters4fvNV_remap_index 270
-#define RequestResidentProgramsNV_remap_index 271
-#define TrackMatrixNV_remap_index 272
-#define VertexAttrib1dNV_remap_index 273
-#define VertexAttrib1dvNV_remap_index 274
-#define VertexAttrib1fNV_remap_index 275
-#define VertexAttrib1fvNV_remap_index 276
-#define VertexAttrib1sNV_remap_index 277
-#define VertexAttrib1svNV_remap_index 278
-#define VertexAttrib2dNV_remap_index 279
-#define VertexAttrib2dvNV_remap_index 280
-#define VertexAttrib2fNV_remap_index 281
-#define VertexAttrib2fvNV_remap_index 282
-#define VertexAttrib2sNV_remap_index 283
-#define VertexAttrib2svNV_remap_index 284
-#define VertexAttrib3dNV_remap_index 285
-#define VertexAttrib3dvNV_remap_index 286
-#define VertexAttrib3fNV_remap_index 287
-#define VertexAttrib3fvNV_remap_index 288
-#define VertexAttrib3sNV_remap_index 289
-#define VertexAttrib3svNV_remap_index 290
-#define VertexAttrib4dNV_remap_index 291
-#define VertexAttrib4dvNV_remap_index 292
-#define VertexAttrib4fNV_remap_index 293
-#define VertexAttrib4fvNV_remap_index 294
-#define VertexAttrib4sNV_remap_index 295
-#define VertexAttrib4svNV_remap_index 296
-#define VertexAttrib4ubNV_remap_index 297
-#define VertexAttrib4ubvNV_remap_index 298
-#define VertexAttribPointerNV_remap_index 299
-#define VertexAttribs1dvNV_remap_index 300
-#define VertexAttribs1fvNV_remap_index 301
-#define VertexAttribs1svNV_remap_index 302
-#define VertexAttribs2dvNV_remap_index 303
-#define VertexAttribs2fvNV_remap_index 304
-#define VertexAttribs2svNV_remap_index 305
-#define VertexAttribs3dvNV_remap_index 306
-#define VertexAttribs3fvNV_remap_index 307
-#define VertexAttribs3svNV_remap_index 308
-#define VertexAttribs4dvNV_remap_index 309
-#define VertexAttribs4fvNV_remap_index 310
-#define VertexAttribs4svNV_remap_index 311
-#define VertexAttribs4ubvNV_remap_index 312
-#define AlphaFragmentOp1ATI_remap_index 313
-#define AlphaFragmentOp2ATI_remap_index 314
-#define AlphaFragmentOp3ATI_remap_index 315
-#define BeginFragmentShaderATI_remap_index 316
-#define BindFragmentShaderATI_remap_index 317
-#define ColorFragmentOp1ATI_remap_index 318
-#define ColorFragmentOp2ATI_remap_index 319
-#define ColorFragmentOp3ATI_remap_index 320
-#define DeleteFragmentShaderATI_remap_index 321
-#define EndFragmentShaderATI_remap_index 322
-#define GenFragmentShadersATI_remap_index 323
-#define PassTexCoordATI_remap_index 324
-#define SampleMapATI_remap_index 325
-#define SetFragmentShaderConstantATI_remap_index 326
-#define PointParameteriNV_remap_index 327
-#define PointParameterivNV_remap_index 328
-#define ActiveStencilFaceEXT_remap_index 329
-#define BindVertexArrayAPPLE_remap_index 330
-#define DeleteVertexArraysAPPLE_remap_index 331
-#define GenVertexArraysAPPLE_remap_index 332
-#define IsVertexArrayAPPLE_remap_index 333
-#define GetProgramNamedParameterdvNV_remap_index 334
-#define GetProgramNamedParameterfvNV_remap_index 335
-#define ProgramNamedParameter4dNV_remap_index 336
-#define ProgramNamedParameter4dvNV_remap_index 337
-#define ProgramNamedParameter4fNV_remap_index 338
-#define ProgramNamedParameter4fvNV_remap_index 339
-#define DepthBoundsEXT_remap_index 340
-#define BlendEquationSeparateEXT_remap_index 341
-#define BindFramebufferEXT_remap_index 342
-#define BindRenderbufferEXT_remap_index 343
-#define CheckFramebufferStatusEXT_remap_index 344
-#define DeleteFramebuffersEXT_remap_index 345
-#define DeleteRenderbuffersEXT_remap_index 346
-#define FramebufferRenderbufferEXT_remap_index 347
-#define FramebufferTexture1DEXT_remap_index 348
-#define FramebufferTexture2DEXT_remap_index 349
-#define FramebufferTexture3DEXT_remap_index 350
-#define GenFramebuffersEXT_remap_index 351
-#define GenRenderbuffersEXT_remap_index 352
-#define GenerateMipmapEXT_remap_index 353
-#define GetFramebufferAttachmentParameterivEXT_remap_index 354
-#define GetRenderbufferParameterivEXT_remap_index 355
-#define IsFramebufferEXT_remap_index 356
-#define IsRenderbufferEXT_remap_index 357
-#define RenderbufferStorageEXT_remap_index 358
-#define BlitFramebufferEXT_remap_index 359
-#define FramebufferTextureLayerEXT_remap_index 360
-#define StencilFuncSeparateATI_remap_index 361
-#define ProgramEnvParameters4fvEXT_remap_index 362
-#define ProgramLocalParameters4fvEXT_remap_index 363
-#define GetQueryObjecti64vEXT_remap_index 364
-#define GetQueryObjectui64vEXT_remap_index 365
+#define ProgramParameters4dvNV_remap_index 265
+#define ProgramParameters4fvNV_remap_index 266
+#define RequestResidentProgramsNV_remap_index 267
+#define TrackMatrixNV_remap_index 268
+#define VertexAttrib1dNV_remap_index 269
+#define VertexAttrib1dvNV_remap_index 270
+#define VertexAttrib1fNV_remap_index 271
+#define VertexAttrib1fvNV_remap_index 272
+#define VertexAttrib1sNV_remap_index 273
+#define VertexAttrib1svNV_remap_index 274
+#define VertexAttrib2dNV_remap_index 275
+#define VertexAttrib2dvNV_remap_index 276
+#define VertexAttrib2fNV_remap_index 277
+#define VertexAttrib2fvNV_remap_index 278
+#define VertexAttrib2sNV_remap_index 279
+#define VertexAttrib2svNV_remap_index 280
+#define VertexAttrib3dNV_remap_index 281
+#define VertexAttrib3dvNV_remap_index 282
+#define VertexAttrib3fNV_remap_index 283
+#define VertexAttrib3fvNV_remap_index 284
+#define VertexAttrib3sNV_remap_index 285
+#define VertexAttrib3svNV_remap_index 286
+#define VertexAttrib4dNV_remap_index 287
+#define VertexAttrib4dvNV_remap_index 288
+#define VertexAttrib4fNV_remap_index 289
+#define VertexAttrib4fvNV_remap_index 290
+#define VertexAttrib4sNV_remap_index 291
+#define VertexAttrib4svNV_remap_index 292
+#define VertexAttrib4ubNV_remap_index 293
+#define VertexAttrib4ubvNV_remap_index 294
+#define VertexAttribPointerNV_remap_index 295
+#define VertexAttribs1dvNV_remap_index 296
+#define VertexAttribs1fvNV_remap_index 297
+#define VertexAttribs1svNV_remap_index 298
+#define VertexAttribs2dvNV_remap_index 299
+#define VertexAttribs2fvNV_remap_index 300
+#define VertexAttribs2svNV_remap_index 301
+#define VertexAttribs3dvNV_remap_index 302
+#define VertexAttribs3fvNV_remap_index 303
+#define VertexAttribs3svNV_remap_index 304
+#define VertexAttribs4dvNV_remap_index 305
+#define VertexAttribs4fvNV_remap_index 306
+#define VertexAttribs4svNV_remap_index 307
+#define VertexAttribs4ubvNV_remap_index 308
+#define AlphaFragmentOp1ATI_remap_index 309
+#define AlphaFragmentOp2ATI_remap_index 310
+#define AlphaFragmentOp3ATI_remap_index 311
+#define BeginFragmentShaderATI_remap_index 312
+#define BindFragmentShaderATI_remap_index 313
+#define ColorFragmentOp1ATI_remap_index 314
+#define ColorFragmentOp2ATI_remap_index 315
+#define ColorFragmentOp3ATI_remap_index 316
+#define DeleteFragmentShaderATI_remap_index 317
+#define EndFragmentShaderATI_remap_index 318
+#define GenFragmentShadersATI_remap_index 319
+#define PassTexCoordATI_remap_index 320
+#define SampleMapATI_remap_index 321
+#define SetFragmentShaderConstantATI_remap_index 322
+#define PointParameteriNV_remap_index 323
+#define PointParameterivNV_remap_index 324
+#define ActiveStencilFaceEXT_remap_index 325
+#define BindVertexArrayAPPLE_remap_index 326
+#define DeleteVertexArraysAPPLE_remap_index 327
+#define GenVertexArraysAPPLE_remap_index 328
+#define IsVertexArrayAPPLE_remap_index 329
+#define GetProgramNamedParameterdvNV_remap_index 330
+#define GetProgramNamedParameterfvNV_remap_index 331
+#define ProgramNamedParameter4dNV_remap_index 332
+#define ProgramNamedParameter4dvNV_remap_index 333
+#define ProgramNamedParameter4fNV_remap_index 334
+#define ProgramNamedParameter4fvNV_remap_index 335
+#define DepthBoundsEXT_remap_index 336
+#define BlendEquationSeparateEXT_remap_index 337
+#define BindFramebufferEXT_remap_index 338
+#define BindRenderbufferEXT_remap_index 339
+#define CheckFramebufferStatusEXT_remap_index 340
+#define DeleteFramebuffersEXT_remap_index 341
+#define DeleteRenderbuffersEXT_remap_index 342
+#define FramebufferRenderbufferEXT_remap_index 343
+#define FramebufferTexture1DEXT_remap_index 344
+#define FramebufferTexture2DEXT_remap_index 345
+#define FramebufferTexture3DEXT_remap_index 346
+#define GenFramebuffersEXT_remap_index 347
+#define GenRenderbuffersEXT_remap_index 348
+#define GenerateMipmapEXT_remap_index 349
+#define GetFramebufferAttachmentParameterivEXT_remap_index 350
+#define GetRenderbufferParameterivEXT_remap_index 351
+#define IsFramebufferEXT_remap_index 352
+#define IsRenderbufferEXT_remap_index 353
+#define RenderbufferStorageEXT_remap_index 354
+#define BlitFramebufferEXT_remap_index 355
+#define FramebufferTextureLayerEXT_remap_index 356
+#define StencilFuncSeparateATI_remap_index 357
+#define ProgramEnvParameters4fvEXT_remap_index 358
+#define ProgramLocalParameters4fvEXT_remap_index 359
+#define GetQueryObjecti64vEXT_remap_index 360
+#define GetQueryObjectui64vEXT_remap_index 361
 
 #define CALL_AttachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[AttachShader_remap_index], parameters)
 #define GET_AttachShader(disp) GET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index])
@@ -3548,18 +3532,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
 #define CALL_LoadProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLubyte *)), driDispatchRemapTable[LoadProgramNV_remap_index], parameters)
 #define GET_LoadProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[LoadProgramNV_remap_index])
 #define SET_LoadProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadProgramNV_remap_index], fn)
-#define CALL_ProgramParameter4dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramParameter4dNV_remap_index], parameters)
-#define GET_ProgramParameter4dNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameter4dNV_remap_index])
-#define SET_ProgramParameter4dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameter4dNV_remap_index], fn)
-#define CALL_ProgramParameter4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramParameter4dvNV_remap_index], parameters)
-#define GET_ProgramParameter4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameter4dvNV_remap_index])
-#define SET_ProgramParameter4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameter4dvNV_remap_index], fn)
-#define CALL_ProgramParameter4fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramParameter4fNV_remap_index], parameters)
-#define GET_ProgramParameter4fNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameter4fNV_remap_index])
-#define SET_ProgramParameter4fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameter4fNV_remap_index], fn)
-#define CALL_ProgramParameter4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramParameter4fvNV_remap_index], parameters)
-#define GET_ProgramParameter4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameter4fvNV_remap_index])
-#define SET_ProgramParameter4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameter4fvNV_remap_index], fn)
 #define CALL_ProgramParameters4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramParameters4dvNV_remap_index], parameters)
 #define GET_ProgramParameters4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameters4dvNV_remap_index])
 #define SET_ProgramParameters4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameters4dvNV_remap_index], fn)
index 3d47e6f2cef2c113c677f349ea1b8ffbb9b5c443..ef4a309cd6b7f2f2828cf67ddc869f7070fabc9a 100644 (file)
         <glx rop="4183"/>
     </function>
 
-    <function name="ProgramParameter4dNV" offset="assign" vectorequiv="ProgramParameter4dvNV">
+    <function name="ProgramParameter4dNV" alias="ProgramEnvParameter4dARB">
         <param name="target" type="GLenum"/>
         <param name="index" type="GLuint"/>
         <param name="x" type="GLdouble"/>
         <param name="w" type="GLdouble"/>
     </function>
 
-    <function name="ProgramParameter4dvNV" offset="assign">
+    <function name="ProgramParameter4dvNV" alias="ProgramEnvParameter4dvARB">
         <param name="target" type="GLenum"/>
         <param name="index" type="GLuint"/>
-        <param name="params" type="const GLdouble *" count="4"/>
-        <glx rop="4185" doubles_in_order="true"/>
+        <param name="params" type="const GLdouble *"/>
     </function>
 
-    <function name="ProgramParameter4fNV" offset="assign" vectorequiv="ProgramParameter4fvNV">
+    <function name="ProgramParameter4fNV" alias="ProgramEnvParameter4fARB">
         <param name="target" type="GLenum"/>
         <param name="index" type="GLuint"/>
         <param name="x" type="GLfloat"/>
         <param name="w" type="GLfloat"/>
     </function>
 
-    <function name="ProgramParameter4fvNV" offset="assign">
+    <function name="ProgramParameter4fvNV" alias="ProgramEnvParameter4fvARB">
         <param name="target" type="GLenum"/>
         <param name="index" type="GLuint"/>
-        <param name="params" type="const GLfloat *" count="4"/>
-        <glx rop="4184"/>
+        <param name="params" type="const GLfloat *"/>
     </function>
 
     <function name="ProgramParameters4dvNV" offset="assign">
index 403e87261b09d3b223de9d2ff90b0d214d0adc3f..651cb03f14d36e580c420ee9b3df4faaeceda248 100644 (file)
@@ -51,7 +51,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
 
        def printRealHeader(self):
                print '#include "assyntax.h"'
-               print '#include "glapioffsets.h"'
+               print '#include "glapi/glapioffsets.h"'
                print ''
                print '#if defined(STDCALL_API)'
                print '# if defined(USE_MGL_NAMESPACE)'
index 4799fd3076e37b0e270b02e295602d69f1c83c1f..43c265924b8d6325ceee8e77866f96995e11414b 100644 (file)
 #define _gloffset_GetVertexAttribivNV 670
 #define _gloffset_IsProgramNV 671
 #define _gloffset_LoadProgramNV 672
-#define _gloffset_ProgramParameter4dNV 673
-#define _gloffset_ProgramParameter4dvNV 674
-#define _gloffset_ProgramParameter4fNV 675
-#define _gloffset_ProgramParameter4fvNV 676
-#define _gloffset_ProgramParameters4dvNV 677
-#define _gloffset_ProgramParameters4fvNV 678
-#define _gloffset_RequestResidentProgramsNV 679
-#define _gloffset_TrackMatrixNV 680
-#define _gloffset_VertexAttrib1dNV 681
-#define _gloffset_VertexAttrib1dvNV 682
-#define _gloffset_VertexAttrib1fNV 683
-#define _gloffset_VertexAttrib1fvNV 684
-#define _gloffset_VertexAttrib1sNV 685
-#define _gloffset_VertexAttrib1svNV 686
-#define _gloffset_VertexAttrib2dNV 687
-#define _gloffset_VertexAttrib2dvNV 688
-#define _gloffset_VertexAttrib2fNV 689
-#define _gloffset_VertexAttrib2fvNV 690
-#define _gloffset_VertexAttrib2sNV 691
-#define _gloffset_VertexAttrib2svNV 692
-#define _gloffset_VertexAttrib3dNV 693
-#define _gloffset_VertexAttrib3dvNV 694
-#define _gloffset_VertexAttrib3fNV 695
-#define _gloffset_VertexAttrib3fvNV 696
-#define _gloffset_VertexAttrib3sNV 697
-#define _gloffset_VertexAttrib3svNV 698
-#define _gloffset_VertexAttrib4dNV 699
-#define _gloffset_VertexAttrib4dvNV 700
-#define _gloffset_VertexAttrib4fNV 701
-#define _gloffset_VertexAttrib4fvNV 702
-#define _gloffset_VertexAttrib4sNV 703
-#define _gloffset_VertexAttrib4svNV 704
-#define _gloffset_VertexAttrib4ubNV 705
-#define _gloffset_VertexAttrib4ubvNV 706
-#define _gloffset_VertexAttribPointerNV 707
-#define _gloffset_VertexAttribs1dvNV 708
-#define _gloffset_VertexAttribs1fvNV 709
-#define _gloffset_VertexAttribs1svNV 710
-#define _gloffset_VertexAttribs2dvNV 711
-#define _gloffset_VertexAttribs2fvNV 712
-#define _gloffset_VertexAttribs2svNV 713
-#define _gloffset_VertexAttribs3dvNV 714
-#define _gloffset_VertexAttribs3fvNV 715
-#define _gloffset_VertexAttribs3svNV 716
-#define _gloffset_VertexAttribs4dvNV 717
-#define _gloffset_VertexAttribs4fvNV 718
-#define _gloffset_VertexAttribs4svNV 719
-#define _gloffset_VertexAttribs4ubvNV 720
-#define _gloffset_AlphaFragmentOp1ATI 721
-#define _gloffset_AlphaFragmentOp2ATI 722
-#define _gloffset_AlphaFragmentOp3ATI 723
-#define _gloffset_BeginFragmentShaderATI 724
-#define _gloffset_BindFragmentShaderATI 725
-#define _gloffset_ColorFragmentOp1ATI 726
-#define _gloffset_ColorFragmentOp2ATI 727
-#define _gloffset_ColorFragmentOp3ATI 728
-#define _gloffset_DeleteFragmentShaderATI 729
-#define _gloffset_EndFragmentShaderATI 730
-#define _gloffset_GenFragmentShadersATI 731
-#define _gloffset_PassTexCoordATI 732
-#define _gloffset_SampleMapATI 733
-#define _gloffset_SetFragmentShaderConstantATI 734
-#define _gloffset_PointParameteriNV 735
-#define _gloffset_PointParameterivNV 736
-#define _gloffset_ActiveStencilFaceEXT 737
-#define _gloffset_BindVertexArrayAPPLE 738
-#define _gloffset_DeleteVertexArraysAPPLE 739
-#define _gloffset_GenVertexArraysAPPLE 740
-#define _gloffset_IsVertexArrayAPPLE 741
-#define _gloffset_GetProgramNamedParameterdvNV 742
-#define _gloffset_GetProgramNamedParameterfvNV 743
-#define _gloffset_ProgramNamedParameter4dNV 744
-#define _gloffset_ProgramNamedParameter4dvNV 745
-#define _gloffset_ProgramNamedParameter4fNV 746
-#define _gloffset_ProgramNamedParameter4fvNV 747
-#define _gloffset_DepthBoundsEXT 748
-#define _gloffset_BlendEquationSeparateEXT 749
-#define _gloffset_BindFramebufferEXT 750
-#define _gloffset_BindRenderbufferEXT 751
-#define _gloffset_CheckFramebufferStatusEXT 752
-#define _gloffset_DeleteFramebuffersEXT 753
-#define _gloffset_DeleteRenderbuffersEXT 754
-#define _gloffset_FramebufferRenderbufferEXT 755
-#define _gloffset_FramebufferTexture1DEXT 756
-#define _gloffset_FramebufferTexture2DEXT 757
-#define _gloffset_FramebufferTexture3DEXT 758
-#define _gloffset_GenFramebuffersEXT 759
-#define _gloffset_GenRenderbuffersEXT 760
-#define _gloffset_GenerateMipmapEXT 761
-#define _gloffset_GetFramebufferAttachmentParameterivEXT 762
-#define _gloffset_GetRenderbufferParameterivEXT 763
-#define _gloffset_IsFramebufferEXT 764
-#define _gloffset_IsRenderbufferEXT 765
-#define _gloffset_RenderbufferStorageEXT 766
-#define _gloffset_BlitFramebufferEXT 767
-#define _gloffset_FramebufferTextureLayerEXT 768
-#define _gloffset_StencilFuncSeparateATI 769
-#define _gloffset_ProgramEnvParameters4fvEXT 770
-#define _gloffset_ProgramLocalParameters4fvEXT 771
-#define _gloffset_GetQueryObjecti64vEXT 772
-#define _gloffset_GetQueryObjectui64vEXT 773
-#define _gloffset_FIRST_DYNAMIC 774
+#define _gloffset_ProgramParameters4dvNV 673
+#define _gloffset_ProgramParameters4fvNV 674
+#define _gloffset_RequestResidentProgramsNV 675
+#define _gloffset_TrackMatrixNV 676
+#define _gloffset_VertexAttrib1dNV 677
+#define _gloffset_VertexAttrib1dvNV 678
+#define _gloffset_VertexAttrib1fNV 679
+#define _gloffset_VertexAttrib1fvNV 680
+#define _gloffset_VertexAttrib1sNV 681
+#define _gloffset_VertexAttrib1svNV 682
+#define _gloffset_VertexAttrib2dNV 683
+#define _gloffset_VertexAttrib2dvNV 684
+#define _gloffset_VertexAttrib2fNV 685
+#define _gloffset_VertexAttrib2fvNV 686
+#define _gloffset_VertexAttrib2sNV 687
+#define _gloffset_VertexAttrib2svNV 688
+#define _gloffset_VertexAttrib3dNV 689
+#define _gloffset_VertexAttrib3dvNV 690
+#define _gloffset_VertexAttrib3fNV 691
+#define _gloffset_VertexAttrib3fvNV 692
+#define _gloffset_VertexAttrib3sNV 693
+#define _gloffset_VertexAttrib3svNV 694
+#define _gloffset_VertexAttrib4dNV 695
+#define _gloffset_VertexAttrib4dvNV 696
+#define _gloffset_VertexAttrib4fNV 697
+#define _gloffset_VertexAttrib4fvNV 698
+#define _gloffset_VertexAttrib4sNV 699
+#define _gloffset_VertexAttrib4svNV 700
+#define _gloffset_VertexAttrib4ubNV 701
+#define _gloffset_VertexAttrib4ubvNV 702
+#define _gloffset_VertexAttribPointerNV 703
+#define _gloffset_VertexAttribs1dvNV 704
+#define _gloffset_VertexAttribs1fvNV 705
+#define _gloffset_VertexAttribs1svNV 706
+#define _gloffset_VertexAttribs2dvNV 707
+#define _gloffset_VertexAttribs2fvNV 708
+#define _gloffset_VertexAttribs2svNV 709
+#define _gloffset_VertexAttribs3dvNV 710
+#define _gloffset_VertexAttribs3fvNV 711
+#define _gloffset_VertexAttribs3svNV 712
+#define _gloffset_VertexAttribs4dvNV 713
+#define _gloffset_VertexAttribs4fvNV 714
+#define _gloffset_VertexAttribs4svNV 715
+#define _gloffset_VertexAttribs4ubvNV 716
+#define _gloffset_AlphaFragmentOp1ATI 717
+#define _gloffset_AlphaFragmentOp2ATI 718
+#define _gloffset_AlphaFragmentOp3ATI 719
+#define _gloffset_BeginFragmentShaderATI 720
+#define _gloffset_BindFragmentShaderATI 721
+#define _gloffset_ColorFragmentOp1ATI 722
+#define _gloffset_ColorFragmentOp2ATI 723
+#define _gloffset_ColorFragmentOp3ATI 724
+#define _gloffset_DeleteFragmentShaderATI 725
+#define _gloffset_EndFragmentShaderATI 726
+#define _gloffset_GenFragmentShadersATI 727
+#define _gloffset_PassTexCoordATI 728
+#define _gloffset_SampleMapATI 729
+#define _gloffset_SetFragmentShaderConstantATI 730
+#define _gloffset_PointParameteriNV 731
+#define _gloffset_PointParameterivNV 732
+#define _gloffset_ActiveStencilFaceEXT 733
+#define _gloffset_BindVertexArrayAPPLE 734
+#define _gloffset_DeleteVertexArraysAPPLE 735
+#define _gloffset_GenVertexArraysAPPLE 736
+#define _gloffset_IsVertexArrayAPPLE 737
+#define _gloffset_GetProgramNamedParameterdvNV 738
+#define _gloffset_GetProgramNamedParameterfvNV 739
+#define _gloffset_ProgramNamedParameter4dNV 740
+#define _gloffset_ProgramNamedParameter4dvNV 741
+#define _gloffset_ProgramNamedParameter4fNV 742
+#define _gloffset_ProgramNamedParameter4fvNV 743
+#define _gloffset_DepthBoundsEXT 744
+#define _gloffset_BlendEquationSeparateEXT 745
+#define _gloffset_BindFramebufferEXT 746
+#define _gloffset_BindRenderbufferEXT 747
+#define _gloffset_CheckFramebufferStatusEXT 748
+#define _gloffset_DeleteFramebuffersEXT 749
+#define _gloffset_DeleteRenderbuffersEXT 750
+#define _gloffset_FramebufferRenderbufferEXT 751
+#define _gloffset_FramebufferTexture1DEXT 752
+#define _gloffset_FramebufferTexture2DEXT 753
+#define _gloffset_FramebufferTexture3DEXT 754
+#define _gloffset_GenFramebuffersEXT 755
+#define _gloffset_GenRenderbuffersEXT 756
+#define _gloffset_GenerateMipmapEXT 757
+#define _gloffset_GetFramebufferAttachmentParameterivEXT 758
+#define _gloffset_GetRenderbufferParameterivEXT 759
+#define _gloffset_IsFramebufferEXT 760
+#define _gloffset_IsRenderbufferEXT 761
+#define _gloffset_RenderbufferStorageEXT 762
+#define _gloffset_BlitFramebufferEXT 763
+#define _gloffset_FramebufferTextureLayerEXT 764
+#define _gloffset_StencilFuncSeparateATI 765
+#define _gloffset_ProgramEnvParameters4fvEXT 766
+#define _gloffset_ProgramLocalParameters4fvEXT 767
+#define _gloffset_GetQueryObjecti64vEXT 768
+#define _gloffset_GetQueryObjectui64vEXT 769
+#define _gloffset_FIRST_DYNAMIC 770
 
 #else
 
 #define _gloffset_GetVertexAttribivNV driDispatchRemapTable[GetVertexAttribivNV_remap_index]
 #define _gloffset_IsProgramNV driDispatchRemapTable[IsProgramNV_remap_index]
 #define _gloffset_LoadProgramNV driDispatchRemapTable[LoadProgramNV_remap_index]
-#define _gloffset_ProgramParameter4dNV driDispatchRemapTable[ProgramParameter4dNV_remap_index]
-#define _gloffset_ProgramParameter4dvNV driDispatchRemapTable[ProgramParameter4dvNV_remap_index]
-#define _gloffset_ProgramParameter4fNV driDispatchRemapTable[ProgramParameter4fNV_remap_index]
-#define _gloffset_ProgramParameter4fvNV driDispatchRemapTable[ProgramParameter4fvNV_remap_index]
 #define _gloffset_ProgramParameters4dvNV driDispatchRemapTable[ProgramParameters4dvNV_remap_index]
 #define _gloffset_ProgramParameters4fvNV driDispatchRemapTable[ProgramParameters4fvNV_remap_index]
 #define _gloffset_RequestResidentProgramsNV driDispatchRemapTable[RequestResidentProgramsNV_remap_index]
index 22c2dc2f69f51141c3b964fede74fec49db36aee..48941f5590ed4029194914859a7d819fbb11d57d 100644 (file)
@@ -714,107 +714,103 @@ struct _glapi_table
    void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 670 */
    GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 671 */
    void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 672 */
-   void (GLAPIENTRYP ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 673 */
-   void (GLAPIENTRYP ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params); /* 674 */
-   void (GLAPIENTRYP ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 675 */
-   void (GLAPIENTRYP ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params); /* 676 */
-   void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 677 */
-   void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 678 */
-   void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 679 */
-   void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 680 */
-   void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 681 */
-   void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 682 */
-   void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 683 */
-   void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 684 */
-   void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 685 */
-   void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 686 */
-   void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 687 */
-   void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 688 */
-   void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 689 */
-   void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 690 */
-   void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 691 */
-   void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 692 */
-   void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 693 */
-   void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 694 */
-   void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 695 */
-   void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 696 */
-   void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 697 */
-   void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 698 */
-   void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 699 */
-   void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 700 */
-   void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 701 */
-   void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 702 */
-   void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 703 */
-   void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 704 */
-   void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 705 */
-   void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 706 */
-   void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 707 */
-   void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 708 */
-   void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 709 */
-   void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 710 */
-   void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 711 */
-   void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 712 */
-   void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 713 */
-   void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 714 */
-   void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 715 */
-   void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 716 */
-   void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 717 */
-   void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 718 */
-   void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 719 */
-   void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 720 */
-   void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 721 */
-   void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 722 */
-   void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 723 */
-   void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 724 */
-   void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 725 */
-   void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 726 */
-   void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 727 */
-   void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 728 */
-   void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 729 */
-   void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 730 */
-   GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 731 */
-   void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 732 */
-   void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 733 */
-   void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 734 */
-   void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 735 */
-   void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 736 */
-   void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 737 */
-   void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 738 */
-   void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 739 */
-   void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 740 */
-   GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 741 */
-   void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 742 */
-   void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 743 */
-   void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 744 */
-   void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 745 */
-   void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 746 */
-   void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 747 */
-   void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 748 */
-   void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 749 */
-   void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 750 */
-   void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 751 */
-   GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 752 */
-   void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 753 */
-   void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 754 */
-   void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 755 */
-   void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 756 */
-   void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 757 */
-   void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 758 */
-   void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 759 */
-   void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 760 */
-   void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 761 */
-   void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 762 */
-   void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 763 */
-   GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 764 */
-   GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 765 */
-   void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 766 */
-   void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 767 */
-   void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 768 */
-   void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 769 */
-   void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 770 */
-   void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 771 */
-   void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 772 */
-   void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 773 */
+   void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 673 */
+   void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 674 */
+   void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 675 */
+   void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 676 */
+   void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 677 */
+   void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 678 */
+   void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 679 */
+   void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 680 */
+   void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 681 */
+   void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 682 */
+   void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 683 */
+   void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 684 */
+   void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 685 */
+   void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 686 */
+   void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 687 */
+   void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 688 */
+   void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 689 */
+   void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 690 */
+   void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 691 */
+   void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 692 */
+   void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 693 */
+   void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 694 */
+   void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 695 */
+   void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 696 */
+   void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 697 */
+   void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 698 */
+   void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 699 */
+   void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 700 */
+   void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 701 */
+   void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 702 */
+   void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 703 */
+   void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 704 */
+   void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 705 */
+   void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 706 */
+   void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 707 */
+   void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 708 */
+   void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 709 */
+   void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 710 */
+   void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 711 */
+   void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 712 */
+   void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 713 */
+   void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 714 */
+   void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 715 */
+   void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 716 */
+   void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 717 */
+   void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 718 */
+   void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 719 */
+   void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 720 */
+   void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 721 */
+   void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 722 */
+   void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 723 */
+   void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 724 */
+   void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 725 */
+   void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 726 */
+   GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 727 */
+   void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 728 */
+   void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 729 */
+   void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 730 */
+   void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 731 */
+   void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 732 */
+   void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 733 */
+   void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 734 */
+   void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 735 */
+   void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 736 */
+   GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 737 */
+   void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 738 */
+   void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 739 */
+   void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 740 */
+   void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 741 */
+   void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 742 */
+   void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 743 */
+   void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 744 */
+   void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 745 */
+   void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 746 */
+   void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 747 */
+   GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 748 */
+   void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 749 */
+   void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 750 */
+   void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 751 */
+   void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 752 */
+   void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 753 */
+   void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 754 */
+   void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 755 */
+   void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 756 */
+   void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 757 */
+   void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 758 */
+   void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 759 */
+   GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 760 */
+   GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 761 */
+   void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 762 */
+   void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 763 */
+   void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 764 */
+   void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 765 */
+   void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 766 */
+   void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 767 */
+   void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 768 */
+   void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 769 */
 };
 
 #endif /* !defined( _GLAPI_TABLE_H_ ) */
index 6ded362c0ef119eac09ff2ee1ff0bbdb484caba4..09259f4704c3614428a12b6a892b1c46b85a2cf8 100644 (file)
@@ -3001,21 +3001,41 @@ KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4dARB)(GLenum target, GLuint inde
    DISPATCH(ProgramEnvParameter4dARB, (target, index, x, y, z, w), (F, "glProgramEnvParameter4dARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
 }
 
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+   DISPATCH(ProgramEnvParameter4dARB, (target, index, x, y, z, w), (F, "glProgramParameter4dNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
+}
+
 KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params)
 {
    DISPATCH(ProgramEnvParameter4dvARB, (target, index, params), (F, "glProgramEnvParameter4dvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
 }
 
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params)
+{
+   DISPATCH(ProgramEnvParameter4dvARB, (target, index, params), (F, "glProgramParameter4dvNV(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
 KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 {
    DISPATCH(ProgramEnvParameter4fARB, (target, index, x, y, z, w), (F, "glProgramEnvParameter4fARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
 }
 
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+   DISPATCH(ProgramEnvParameter4fARB, (target, index, x, y, z, w), (F, "glProgramParameter4fNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
+}
+
 KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params)
 {
    DISPATCH(ProgramEnvParameter4fvARB, (target, index, params), (F, "glProgramEnvParameter4fvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
 }
 
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params)
+{
+   DISPATCH(ProgramEnvParameter4fvARB, (target, index, params), (F, "glProgramParameter4fvNV(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
 KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
 {
    DISPATCH(ProgramLocalParameter4dARB, (target, index, x, y, z, w), (F, "glProgramLocalParameter4dARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
@@ -4942,26 +4962,6 @@ KEYWORD1 void KEYWORD2 NAME(LoadProgramNV)(GLenum target, GLuint id, GLsizei len
    DISPATCH(LoadProgramNV, (target, id, len, program), (F, "glLoadProgramNV(0x%x, %d, %d, %p);\n", target, id, len, (const void *) program));
 }
 
-KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
-   DISPATCH(ProgramParameter4dNV, (target, index, x, y, z, w), (F, "glProgramParameter4dNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params)
-{
-   DISPATCH(ProgramParameter4dvNV, (target, index, params), (F, "glProgramParameter4dvNV(0x%x, %d, %p);\n", target, index, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
-   DISPATCH(ProgramParameter4fNV, (target, index, x, y, z, w), (F, "glProgramParameter4fNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params)
-{
-   DISPATCH(ProgramParameter4fvNV, (target, index, params), (F, "glProgramParameter4fvNV(0x%x, %d, %p);\n", target, index, (const void *) params));
-}
-
 KEYWORD1 void KEYWORD2 NAME(ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params)
 {
    DISPATCH(ProgramParameters4dvNV, (target, index, num, params), (F, "glProgramParameters4dvNV(0x%x, %d, %d, %p);\n", target, index, num, (const void *) params));
@@ -5272,37 +5272,37 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterivNV)(GLenum pname, const GLint * para
    DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameterivNV(0x%x, %p);\n", pname, (const void *) params));
 }
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLenum face);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLenum face);
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLenum face)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLenum face)
 {
    DISPATCH(ActiveStencilFaceEXT, (face), (F, "glActiveStencilFaceEXT(0x%x);\n", face));
 }
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_738)(GLuint array);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint array);
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_738)(GLuint array)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint array)
 {
    DISPATCH(BindVertexArrayAPPLE, (array), (F, "glBindVertexArrayAPPLE(%d);\n", array));
 }
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_739)(GLsizei n, const GLuint * arrays);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, const GLuint * arrays);
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_739)(GLsizei n, const GLuint * arrays)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, const GLuint * arrays)
 {
    DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays));
 }
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_740)(GLsizei n, GLuint * arrays);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, GLuint * arrays);
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_740)(GLsizei n, GLuint * arrays)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, GLuint * arrays)
 {
    DISPATCH(GenVertexArraysAPPLE, (n, arrays), (F, "glGenVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays));
 }
 
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_741)(GLuint array);
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint array);
 
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_741)(GLuint array)
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint array)
 {
    RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArrayAPPLE(%d);\n", array));
 }
@@ -5337,9 +5337,9 @@ KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len,
    DISPATCH(ProgramNamedParameter4fvNV, (id, len, name, v), (F, "glProgramNamedParameter4fvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v));
 }
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_748)(GLclampd zmin, GLclampd zmax);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_744)(GLclampd zmin, GLclampd zmax);
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_748)(GLclampd zmin, GLclampd zmax)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_744)(GLclampd zmin, GLclampd zmax)
 {
    DISPATCH(DepthBoundsEXT, (zmin, zmax), (F, "glDepthBoundsEXT(%f, %f);\n", zmin, zmax));
 }
@@ -5349,9 +5349,9 @@ KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA)
    DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparate(0x%x, 0x%x);\n", modeRGB, modeA));
 }
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_749)(GLenum modeRGB, GLenum modeA);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLenum modeRGB, GLenum modeA);
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_749)(GLenum modeRGB, GLenum modeA)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLenum modeRGB, GLenum modeA)
 {
    DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparateEXT(0x%x, 0x%x);\n", modeRGB, modeA));
 }
@@ -5441,9 +5441,9 @@ KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageEXT)(GLenum target, GLenum intern
    DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorageEXT(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height));
 }
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_763)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_763)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
 {
    DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebufferEXT(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
 }
@@ -5453,37 +5453,37 @@ KEYWORD1 void KEYWORD2 NAME(FramebufferTextureLayerEXT)(GLenum target, GLenum at
    DISPATCH(FramebufferTextureLayerEXT, (target, attachment, texture, level, layer), (F, "glFramebufferTextureLayerEXT(0x%x, 0x%x, %d, %d, %d);\n", target, attachment, texture, level, layer));
 }
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask)
 {
    DISPATCH(StencilFuncSeparateATI, (frontfunc, backfunc, ref, mask), (F, "glStencilFuncSeparateATI(0x%x, 0x%x, %d, %d);\n", frontfunc, backfunc, ref, mask));
 }
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_770)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_770)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
 {
    DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
 }
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_771)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_771)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
 {
    DISPATCH(ProgramLocalParameters4fvEXT, (target, index, count, params), (F, "glProgramLocalParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
 }
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_772)(GLuint id, GLenum pname, GLint64EXT * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLuint id, GLenum pname, GLint64EXT * params);
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_772)(GLuint id, GLenum pname, GLint64EXT * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLuint id, GLenum pname, GLint64EXT * params)
 {
    DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
 }
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_773)(GLuint id, GLenum pname, GLuint64EXT * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLuint64EXT * params);
 
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_773)(GLuint id, GLenum pname, GLuint64EXT * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLuint64EXT * params)
 {
    DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
 }
@@ -6175,10 +6175,6 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
    TABLE_ENTRY(GetVertexAttribivNV),
    TABLE_ENTRY(IsProgramNV),
    TABLE_ENTRY(LoadProgramNV),
-   TABLE_ENTRY(ProgramParameter4dNV),
-   TABLE_ENTRY(ProgramParameter4dvNV),
-   TABLE_ENTRY(ProgramParameter4fNV),
-   TABLE_ENTRY(ProgramParameter4fvNV),
    TABLE_ENTRY(ProgramParameters4dvNV),
    TABLE_ENTRY(ProgramParameters4fvNV),
    TABLE_ENTRY(RequestResidentProgramsNV),
@@ -6239,19 +6235,19 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
    TABLE_ENTRY(SetFragmentShaderConstantATI),
    TABLE_ENTRY(PointParameteriNV),
    TABLE_ENTRY(PointParameterivNV),
+   TABLE_ENTRY(_dispatch_stub_733),
+   TABLE_ENTRY(_dispatch_stub_734),
+   TABLE_ENTRY(_dispatch_stub_735),
+   TABLE_ENTRY(_dispatch_stub_736),
    TABLE_ENTRY(_dispatch_stub_737),
-   TABLE_ENTRY(_dispatch_stub_738),
-   TABLE_ENTRY(_dispatch_stub_739),
-   TABLE_ENTRY(_dispatch_stub_740),
-   TABLE_ENTRY(_dispatch_stub_741),
    TABLE_ENTRY(GetProgramNamedParameterdvNV),
    TABLE_ENTRY(GetProgramNamedParameterfvNV),
    TABLE_ENTRY(ProgramNamedParameter4dNV),
    TABLE_ENTRY(ProgramNamedParameter4dvNV),
    TABLE_ENTRY(ProgramNamedParameter4fNV),
    TABLE_ENTRY(ProgramNamedParameter4fvNV),
-   TABLE_ENTRY(_dispatch_stub_748),
-   TABLE_ENTRY(_dispatch_stub_749),
+   TABLE_ENTRY(_dispatch_stub_744),
+   TABLE_ENTRY(_dispatch_stub_745),
    TABLE_ENTRY(BindFramebufferEXT),
    TABLE_ENTRY(BindRenderbufferEXT),
    TABLE_ENTRY(CheckFramebufferStatusEXT),
@@ -6269,13 +6265,13 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
    TABLE_ENTRY(IsFramebufferEXT),
    TABLE_ENTRY(IsRenderbufferEXT),
    TABLE_ENTRY(RenderbufferStorageEXT),
-   TABLE_ENTRY(_dispatch_stub_767),
+   TABLE_ENTRY(_dispatch_stub_763),
    TABLE_ENTRY(FramebufferTextureLayerEXT),
+   TABLE_ENTRY(_dispatch_stub_765),
+   TABLE_ENTRY(_dispatch_stub_766),
+   TABLE_ENTRY(_dispatch_stub_767),
+   TABLE_ENTRY(_dispatch_stub_768),
    TABLE_ENTRY(_dispatch_stub_769),
-   TABLE_ENTRY(_dispatch_stub_770),
-   TABLE_ENTRY(_dispatch_stub_771),
-   TABLE_ENTRY(_dispatch_stub_772),
-   TABLE_ENTRY(_dispatch_stub_773),
    /* A whole bunch of no-op functions.  These might be called
     * when someone tries to call a dynamically-registered
     * extension function without a current rendering context.
@@ -6479,6 +6475,10 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {
    TABLE_ENTRY(GetVertexAttribdv),
    TABLE_ENTRY(GetVertexAttribfv),
    TABLE_ENTRY(GetVertexAttribiv),
+   TABLE_ENTRY(ProgramParameter4dNV),
+   TABLE_ENTRY(ProgramParameter4dvNV),
+   TABLE_ENTRY(ProgramParameter4fNV),
+   TABLE_ENTRY(ProgramParameter4fvNV),
    TABLE_ENTRY(VertexAttrib1d),
    TABLE_ENTRY(VertexAttrib1dv),
    TABLE_ENTRY(VertexAttrib1f),
index abc22a9a042673f6875388b455638abd9563bc1c..5a99d505ec988854f3dbb59ebba2f48277532241 100644 (file)
@@ -725,10 +725,6 @@ static const char gl_string_table[] =
     "glGetVertexAttribivNV\0"
     "glIsProgramNV\0"
     "glLoadProgramNV\0"
-    "glProgramParameter4dNV\0"
-    "glProgramParameter4dvNV\0"
-    "glProgramParameter4fNV\0"
-    "glProgramParameter4fvNV\0"
     "glProgramParameters4dvNV\0"
     "glProgramParameters4fvNV\0"
     "glRequestResidentProgramsNV\0"
@@ -935,6 +931,10 @@ static const char gl_string_table[] =
     "glGetVertexAttribdv\0"
     "glGetVertexAttribfv\0"
     "glGetVertexAttribiv\0"
+    "glProgramParameter4dNV\0"
+    "glProgramParameter4dvNV\0"
+    "glProgramParameter4fNV\0"
+    "glProgramParameter4fvNV\0"
     "glVertexAttrib1d\0"
     "glVertexAttrib1dv\0"
     "glVertexAttrib1f\0"
@@ -1138,19 +1138,19 @@ static const char gl_string_table[] =
 #define gl_dispatch_stub_654 mgl_dispatch_stub_654
 #define gl_dispatch_stub_655 mgl_dispatch_stub_655
 #define gl_dispatch_stub_656 mgl_dispatch_stub_656
+#define gl_dispatch_stub_733 mgl_dispatch_stub_733
+#define gl_dispatch_stub_734 mgl_dispatch_stub_734
+#define gl_dispatch_stub_735 mgl_dispatch_stub_735
+#define gl_dispatch_stub_736 mgl_dispatch_stub_736
 #define gl_dispatch_stub_737 mgl_dispatch_stub_737
-#define gl_dispatch_stub_738 mgl_dispatch_stub_738
-#define gl_dispatch_stub_739 mgl_dispatch_stub_739
-#define gl_dispatch_stub_740 mgl_dispatch_stub_740
-#define gl_dispatch_stub_741 mgl_dispatch_stub_741
-#define gl_dispatch_stub_748 mgl_dispatch_stub_748
-#define gl_dispatch_stub_749 mgl_dispatch_stub_749
+#define gl_dispatch_stub_744 mgl_dispatch_stub_744
+#define gl_dispatch_stub_745 mgl_dispatch_stub_745
+#define gl_dispatch_stub_763 mgl_dispatch_stub_763
+#define gl_dispatch_stub_765 mgl_dispatch_stub_765
+#define gl_dispatch_stub_766 mgl_dispatch_stub_766
 #define gl_dispatch_stub_767 mgl_dispatch_stub_767
+#define gl_dispatch_stub_768 mgl_dispatch_stub_768
 #define gl_dispatch_stub_769 mgl_dispatch_stub_769
-#define gl_dispatch_stub_770 mgl_dispatch_stub_770
-#define gl_dispatch_stub_771 mgl_dispatch_stub_771
-#define gl_dispatch_stub_772 mgl_dispatch_stub_772
-#define gl_dispatch_stub_773 mgl_dispatch_stub_773
 #endif /* USE_MGL_NAMESPACE */
 
 
@@ -1189,19 +1189,19 @@ extern void gl_dispatch_stub_653(void);
 extern void gl_dispatch_stub_654(void);
 extern void gl_dispatch_stub_655(void);
 extern void gl_dispatch_stub_656(void);
+extern void gl_dispatch_stub_733(void);
+extern void gl_dispatch_stub_734(void);
+extern void gl_dispatch_stub_735(void);
+extern void gl_dispatch_stub_736(void);
 extern void gl_dispatch_stub_737(void);
-extern void gl_dispatch_stub_738(void);
-extern void gl_dispatch_stub_739(void);
-extern void gl_dispatch_stub_740(void);
-extern void gl_dispatch_stub_741(void);
-extern void gl_dispatch_stub_748(void);
-extern void gl_dispatch_stub_749(void);
+extern void gl_dispatch_stub_744(void);
+extern void gl_dispatch_stub_745(void);
+extern void gl_dispatch_stub_763(void);
+extern void gl_dispatch_stub_765(void);
+extern void gl_dispatch_stub_766(void);
 extern void gl_dispatch_stub_767(void);
+extern void gl_dispatch_stub_768(void);
 extern void gl_dispatch_stub_769(void);
-extern void gl_dispatch_stub_770(void);
-extern void gl_dispatch_stub_771(void);
-extern void gl_dispatch_stub_772(void);
-extern void gl_dispatch_stub_773(void);
 #endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */
 
 static const glprocs_table_t static_functions[] = {
@@ -1878,216 +1878,216 @@ static const glprocs_table_t static_functions[] = {
     NAME_FUNC_OFFSET(11280, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, _gloffset_GetVertexAttribivNV),
     NAME_FUNC_OFFSET(11302, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV),
     NAME_FUNC_OFFSET(11316, glLoadProgramNV, glLoadProgramNV, NULL, _gloffset_LoadProgramNV),
-    NAME_FUNC_OFFSET(11332, glProgramParameter4dNV, glProgramParameter4dNV, NULL, _gloffset_ProgramParameter4dNV),
-    NAME_FUNC_OFFSET(11355, glProgramParameter4dvNV, glProgramParameter4dvNV, NULL, _gloffset_ProgramParameter4dvNV),
-    NAME_FUNC_OFFSET(11379, glProgramParameter4fNV, glProgramParameter4fNV, NULL, _gloffset_ProgramParameter4fNV),
-    NAME_FUNC_OFFSET(11402, glProgramParameter4fvNV, glProgramParameter4fvNV, NULL, _gloffset_ProgramParameter4fvNV),
-    NAME_FUNC_OFFSET(11426, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, _gloffset_ProgramParameters4dvNV),
-    NAME_FUNC_OFFSET(11451, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, _gloffset_ProgramParameters4fvNV),
-    NAME_FUNC_OFFSET(11476, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, _gloffset_RequestResidentProgramsNV),
-    NAME_FUNC_OFFSET(11504, glTrackMatrixNV, glTrackMatrixNV, NULL, _gloffset_TrackMatrixNV),
-    NAME_FUNC_OFFSET(11520, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, _gloffset_VertexAttrib1dNV),
-    NAME_FUNC_OFFSET(11539, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, _gloffset_VertexAttrib1dvNV),
-    NAME_FUNC_OFFSET(11559, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, _gloffset_VertexAttrib1fNV),
-    NAME_FUNC_OFFSET(11578, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, _gloffset_VertexAttrib1fvNV),
-    NAME_FUNC_OFFSET(11598, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, _gloffset_VertexAttrib1sNV),
-    NAME_FUNC_OFFSET(11617, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, _gloffset_VertexAttrib1svNV),
-    NAME_FUNC_OFFSET(11637, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, _gloffset_VertexAttrib2dNV),
-    NAME_FUNC_OFFSET(11656, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, _gloffset_VertexAttrib2dvNV),
-    NAME_FUNC_OFFSET(11676, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, _gloffset_VertexAttrib2fNV),
-    NAME_FUNC_OFFSET(11695, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, _gloffset_VertexAttrib2fvNV),
-    NAME_FUNC_OFFSET(11715, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, _gloffset_VertexAttrib2sNV),
-    NAME_FUNC_OFFSET(11734, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, _gloffset_VertexAttrib2svNV),
-    NAME_FUNC_OFFSET(11754, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, _gloffset_VertexAttrib3dNV),
-    NAME_FUNC_OFFSET(11773, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, _gloffset_VertexAttrib3dvNV),
-    NAME_FUNC_OFFSET(11793, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, _gloffset_VertexAttrib3fNV),
-    NAME_FUNC_OFFSET(11812, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, _gloffset_VertexAttrib3fvNV),
-    NAME_FUNC_OFFSET(11832, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, _gloffset_VertexAttrib3sNV),
-    NAME_FUNC_OFFSET(11851, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, _gloffset_VertexAttrib3svNV),
-    NAME_FUNC_OFFSET(11871, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, _gloffset_VertexAttrib4dNV),
-    NAME_FUNC_OFFSET(11890, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, _gloffset_VertexAttrib4dvNV),
-    NAME_FUNC_OFFSET(11910, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, _gloffset_VertexAttrib4fNV),
-    NAME_FUNC_OFFSET(11929, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, _gloffset_VertexAttrib4fvNV),
-    NAME_FUNC_OFFSET(11949, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, _gloffset_VertexAttrib4sNV),
-    NAME_FUNC_OFFSET(11968, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, _gloffset_VertexAttrib4svNV),
-    NAME_FUNC_OFFSET(11988, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, _gloffset_VertexAttrib4ubNV),
-    NAME_FUNC_OFFSET(12008, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, _gloffset_VertexAttrib4ubvNV),
-    NAME_FUNC_OFFSET(12029, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, _gloffset_VertexAttribPointerNV),
-    NAME_FUNC_OFFSET(12053, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, _gloffset_VertexAttribs1dvNV),
-    NAME_FUNC_OFFSET(12074, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, _gloffset_VertexAttribs1fvNV),
-    NAME_FUNC_OFFSET(12095, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, _gloffset_VertexAttribs1svNV),
-    NAME_FUNC_OFFSET(12116, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, _gloffset_VertexAttribs2dvNV),
-    NAME_FUNC_OFFSET(12137, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, _gloffset_VertexAttribs2fvNV),
-    NAME_FUNC_OFFSET(12158, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, _gloffset_VertexAttribs2svNV),
-    NAME_FUNC_OFFSET(12179, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, _gloffset_VertexAttribs3dvNV),
-    NAME_FUNC_OFFSET(12200, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, _gloffset_VertexAttribs3fvNV),
-    NAME_FUNC_OFFSET(12221, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, _gloffset_VertexAttribs3svNV),
-    NAME_FUNC_OFFSET(12242, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, _gloffset_VertexAttribs4dvNV),
-    NAME_FUNC_OFFSET(12263, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, _gloffset_VertexAttribs4fvNV),
-    NAME_FUNC_OFFSET(12284, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, _gloffset_VertexAttribs4svNV),
-    NAME_FUNC_OFFSET(12305, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, _gloffset_VertexAttribs4ubvNV),
-    NAME_FUNC_OFFSET(12327, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, _gloffset_AlphaFragmentOp1ATI),
-    NAME_FUNC_OFFSET(12349, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, _gloffset_AlphaFragmentOp2ATI),
-    NAME_FUNC_OFFSET(12371, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, _gloffset_AlphaFragmentOp3ATI),
-    NAME_FUNC_OFFSET(12393, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, _gloffset_BeginFragmentShaderATI),
-    NAME_FUNC_OFFSET(12418, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, _gloffset_BindFragmentShaderATI),
-    NAME_FUNC_OFFSET(12442, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, _gloffset_ColorFragmentOp1ATI),
-    NAME_FUNC_OFFSET(12464, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, _gloffset_ColorFragmentOp2ATI),
-    NAME_FUNC_OFFSET(12486, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, _gloffset_ColorFragmentOp3ATI),
-    NAME_FUNC_OFFSET(12508, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, _gloffset_DeleteFragmentShaderATI),
-    NAME_FUNC_OFFSET(12534, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, _gloffset_EndFragmentShaderATI),
-    NAME_FUNC_OFFSET(12557, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, _gloffset_GenFragmentShadersATI),
-    NAME_FUNC_OFFSET(12581, glPassTexCoordATI, glPassTexCoordATI, NULL, _gloffset_PassTexCoordATI),
-    NAME_FUNC_OFFSET(12599, glSampleMapATI, glSampleMapATI, NULL, _gloffset_SampleMapATI),
-    NAME_FUNC_OFFSET(12614, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, _gloffset_SetFragmentShaderConstantATI),
-    NAME_FUNC_OFFSET(12645, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV),
-    NAME_FUNC_OFFSET(12665, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV),
-    NAME_FUNC_OFFSET(12686, gl_dispatch_stub_737, gl_dispatch_stub_737, NULL, _gloffset_ActiveStencilFaceEXT),
-    NAME_FUNC_OFFSET(12709, gl_dispatch_stub_738, gl_dispatch_stub_738, NULL, _gloffset_BindVertexArrayAPPLE),
-    NAME_FUNC_OFFSET(12732, gl_dispatch_stub_739, gl_dispatch_stub_739, NULL, _gloffset_DeleteVertexArraysAPPLE),
-    NAME_FUNC_OFFSET(12758, gl_dispatch_stub_740, gl_dispatch_stub_740, NULL, _gloffset_GenVertexArraysAPPLE),
-    NAME_FUNC_OFFSET(12781, gl_dispatch_stub_741, gl_dispatch_stub_741, NULL, _gloffset_IsVertexArrayAPPLE),
-    NAME_FUNC_OFFSET(12802, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, _gloffset_GetProgramNamedParameterdvNV),
-    NAME_FUNC_OFFSET(12833, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, _gloffset_GetProgramNamedParameterfvNV),
-    NAME_FUNC_OFFSET(12864, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, _gloffset_ProgramNamedParameter4dNV),
-    NAME_FUNC_OFFSET(12892, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, _gloffset_ProgramNamedParameter4dvNV),
-    NAME_FUNC_OFFSET(12921, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, _gloffset_ProgramNamedParameter4fNV),
-    NAME_FUNC_OFFSET(12949, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, _gloffset_ProgramNamedParameter4fvNV),
-    NAME_FUNC_OFFSET(12978, gl_dispatch_stub_748, gl_dispatch_stub_748, NULL, _gloffset_DepthBoundsEXT),
-    NAME_FUNC_OFFSET(12995, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT),
-    NAME_FUNC_OFFSET(13022, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT),
-    NAME_FUNC_OFFSET(13043, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT),
-    NAME_FUNC_OFFSET(13065, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT),
-    NAME_FUNC_OFFSET(13093, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT),
-    NAME_FUNC_OFFSET(13117, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT),
-    NAME_FUNC_OFFSET(13142, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT),
-    NAME_FUNC_OFFSET(13171, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT),
-    NAME_FUNC_OFFSET(13197, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT),
-    NAME_FUNC_OFFSET(13223, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT),
-    NAME_FUNC_OFFSET(13249, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT),
-    NAME_FUNC_OFFSET(13270, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT),
-    NAME_FUNC_OFFSET(13292, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT),
-    NAME_FUNC_OFFSET(13312, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT),
-    NAME_FUNC_OFFSET(13353, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT),
-    NAME_FUNC_OFFSET(13385, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT),
-    NAME_FUNC_OFFSET(13404, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT),
-    NAME_FUNC_OFFSET(13424, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT),
-    NAME_FUNC_OFFSET(13449, gl_dispatch_stub_767, gl_dispatch_stub_767, NULL, _gloffset_BlitFramebufferEXT),
-    NAME_FUNC_OFFSET(13470, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT),
-    NAME_FUNC_OFFSET(13499, gl_dispatch_stub_769, gl_dispatch_stub_769, NULL, _gloffset_StencilFuncSeparateATI),
-    NAME_FUNC_OFFSET(13524, gl_dispatch_stub_770, gl_dispatch_stub_770, NULL, _gloffset_ProgramEnvParameters4fvEXT),
-    NAME_FUNC_OFFSET(13553, gl_dispatch_stub_771, gl_dispatch_stub_771, NULL, _gloffset_ProgramLocalParameters4fvEXT),
-    NAME_FUNC_OFFSET(13584, gl_dispatch_stub_772, gl_dispatch_stub_772, NULL, _gloffset_GetQueryObjecti64vEXT),
-    NAME_FUNC_OFFSET(13608, gl_dispatch_stub_773, gl_dispatch_stub_773, NULL, _gloffset_GetQueryObjectui64vEXT),
-    NAME_FUNC_OFFSET(13633, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement),
-    NAME_FUNC_OFFSET(13651, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture),
-    NAME_FUNC_OFFSET(13668, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays),
-    NAME_FUNC_OFFSET(13684, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident),
-    NAME_FUNC_OFFSET(13709, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D),
-    NAME_FUNC_OFFSET(13729, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D),
-    NAME_FUNC_OFFSET(13749, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D),
-    NAME_FUNC_OFFSET(13772, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D),
-    NAME_FUNC_OFFSET(13795, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures),
-    NAME_FUNC_OFFSET(13815, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures),
-    NAME_FUNC_OFFSET(13832, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv),
-    NAME_FUNC_OFFSET(13849, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture),
-    NAME_FUNC_OFFSET(13864, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures),
-    NAME_FUNC_OFFSET(13888, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D),
-    NAME_FUNC_OFFSET(13907, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D),
-    NAME_FUNC_OFFSET(13926, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor),
-    NAME_FUNC_OFFSET(13942, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation),
-    NAME_FUNC_OFFSET(13961, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements),
-    NAME_FUNC_OFFSET(13984, glColorTable, glColorTable, NULL, _gloffset_ColorTable),
-    NAME_FUNC_OFFSET(14000, glColorTable, glColorTable, NULL, _gloffset_ColorTable),
-    NAME_FUNC_OFFSET(14016, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv),
-    NAME_FUNC_OFFSET(14043, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv),
-    NAME_FUNC_OFFSET(14070, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable),
-    NAME_FUNC_OFFSET(14090, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable),
-    NAME_FUNC_OFFSET(14109, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable),
-    NAME_FUNC_OFFSET(14128, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv),
-    NAME_FUNC_OFFSET(14158, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv),
-    NAME_FUNC_OFFSET(14188, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv),
-    NAME_FUNC_OFFSET(14218, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv),
-    NAME_FUNC_OFFSET(14248, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable),
-    NAME_FUNC_OFFSET(14267, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable),
-    NAME_FUNC_OFFSET(14290, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D),
-    NAME_FUNC_OFFSET(14315, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D),
-    NAME_FUNC_OFFSET(14340, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf),
-    NAME_FUNC_OFFSET(14367, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv),
-    NAME_FUNC_OFFSET(14395, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri),
-    NAME_FUNC_OFFSET(14422, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv),
-    NAME_FUNC_OFFSET(14450, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D),
-    NAME_FUNC_OFFSET(14479, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D),
-    NAME_FUNC_OFFSET(14508, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter),
-    NAME_FUNC_OFFSET(14534, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv),
-    NAME_FUNC_OFFSET(14565, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv),
-    NAME_FUNC_OFFSET(14596, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter),
-    NAME_FUNC_OFFSET(14620, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D),
-    NAME_FUNC_OFFSET(14643, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram),
-    NAME_FUNC_OFFSET(14661, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv),
-    NAME_FUNC_OFFSET(14690, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv),
-    NAME_FUNC_OFFSET(14719, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax),
-    NAME_FUNC_OFFSET(14734, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv),
-    NAME_FUNC_OFFSET(14760, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv),
-    NAME_FUNC_OFFSET(14786, glHistogram, glHistogram, NULL, _gloffset_Histogram),
-    NAME_FUNC_OFFSET(14801, glMinmax, glMinmax, NULL, _gloffset_Minmax),
-    NAME_FUNC_OFFSET(14813, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram),
-    NAME_FUNC_OFFSET(14833, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax),
-    NAME_FUNC_OFFSET(14850, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D),
-    NAME_FUNC_OFFSET(14866, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D),
-    NAME_FUNC_OFFSET(14885, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D),
-    NAME_FUNC_OFFSET(14908, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB),
-    NAME_FUNC_OFFSET(14924, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB),
-    NAME_FUNC_OFFSET(14946, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB),
-    NAME_FUNC_OFFSET(14964, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB),
-    NAME_FUNC_OFFSET(14983, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB),
-    NAME_FUNC_OFFSET(15001, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB),
-    NAME_FUNC_OFFSET(15020, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB),
-    NAME_FUNC_OFFSET(15038, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB),
-    NAME_FUNC_OFFSET(15057, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB),
-    NAME_FUNC_OFFSET(15075, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB),
-    NAME_FUNC_OFFSET(15094, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB),
-    NAME_FUNC_OFFSET(15112, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB),
-    NAME_FUNC_OFFSET(15131, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB),
-    NAME_FUNC_OFFSET(15149, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB),
-    NAME_FUNC_OFFSET(15168, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB),
-    NAME_FUNC_OFFSET(15186, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB),
-    NAME_FUNC_OFFSET(15205, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB),
-    NAME_FUNC_OFFSET(15223, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB),
-    NAME_FUNC_OFFSET(15242, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB),
-    NAME_FUNC_OFFSET(15260, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB),
-    NAME_FUNC_OFFSET(15279, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB),
-    NAME_FUNC_OFFSET(15297, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB),
-    NAME_FUNC_OFFSET(15316, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB),
-    NAME_FUNC_OFFSET(15334, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB),
-    NAME_FUNC_OFFSET(15353, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB),
-    NAME_FUNC_OFFSET(15371, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB),
-    NAME_FUNC_OFFSET(15390, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB),
-    NAME_FUNC_OFFSET(15408, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB),
-    NAME_FUNC_OFFSET(15427, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB),
-    NAME_FUNC_OFFSET(15445, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB),
-    NAME_FUNC_OFFSET(15464, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB),
-    NAME_FUNC_OFFSET(15482, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB),
-    NAME_FUNC_OFFSET(15501, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB),
-    NAME_FUNC_OFFSET(15519, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB),
-    NAME_FUNC_OFFSET(15538, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate),
-    NAME_FUNC_OFFSET(15561, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB),
-    NAME_FUNC_OFFSET(15584, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB),
-    NAME_FUNC_OFFSET(15607, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB),
-    NAME_FUNC_OFFSET(15630, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB),
-    NAME_FUNC_OFFSET(15653, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB),
-    NAME_FUNC_OFFSET(15670, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB),
-    NAME_FUNC_OFFSET(15693, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB),
-    NAME_FUNC_OFFSET(15716, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB),
-    NAME_FUNC_OFFSET(15739, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB),
-    NAME_FUNC_OFFSET(15765, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB),
-    NAME_FUNC_OFFSET(15791, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB),
-    NAME_FUNC_OFFSET(15817, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB),
-    NAME_FUNC_OFFSET(15841, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB),
-    NAME_FUNC_OFFSET(15868, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB),
-    NAME_FUNC_OFFSET(15894, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB),
-    NAME_FUNC_OFFSET(15914, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB),
-    NAME_FUNC_OFFSET(15934, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB),
+    NAME_FUNC_OFFSET(11332, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, _gloffset_ProgramParameters4dvNV),
+    NAME_FUNC_OFFSET(11357, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, _gloffset_ProgramParameters4fvNV),
+    NAME_FUNC_OFFSET(11382, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, _gloffset_RequestResidentProgramsNV),
+    NAME_FUNC_OFFSET(11410, glTrackMatrixNV, glTrackMatrixNV, NULL, _gloffset_TrackMatrixNV),
+    NAME_FUNC_OFFSET(11426, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, _gloffset_VertexAttrib1dNV),
+    NAME_FUNC_OFFSET(11445, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, _gloffset_VertexAttrib1dvNV),
+    NAME_FUNC_OFFSET(11465, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, _gloffset_VertexAttrib1fNV),
+    NAME_FUNC_OFFSET(11484, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, _gloffset_VertexAttrib1fvNV),
+    NAME_FUNC_OFFSET(11504, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, _gloffset_VertexAttrib1sNV),
+    NAME_FUNC_OFFSET(11523, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, _gloffset_VertexAttrib1svNV),
+    NAME_FUNC_OFFSET(11543, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, _gloffset_VertexAttrib2dNV),
+    NAME_FUNC_OFFSET(11562, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, _gloffset_VertexAttrib2dvNV),
+    NAME_FUNC_OFFSET(11582, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, _gloffset_VertexAttrib2fNV),
+    NAME_FUNC_OFFSET(11601, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, _gloffset_VertexAttrib2fvNV),
+    NAME_FUNC_OFFSET(11621, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, _gloffset_VertexAttrib2sNV),
+    NAME_FUNC_OFFSET(11640, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, _gloffset_VertexAttrib2svNV),
+    NAME_FUNC_OFFSET(11660, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, _gloffset_VertexAttrib3dNV),
+    NAME_FUNC_OFFSET(11679, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, _gloffset_VertexAttrib3dvNV),
+    NAME_FUNC_OFFSET(11699, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, _gloffset_VertexAttrib3fNV),
+    NAME_FUNC_OFFSET(11718, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, _gloffset_VertexAttrib3fvNV),
+    NAME_FUNC_OFFSET(11738, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, _gloffset_VertexAttrib3sNV),
+    NAME_FUNC_OFFSET(11757, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, _gloffset_VertexAttrib3svNV),
+    NAME_FUNC_OFFSET(11777, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, _gloffset_VertexAttrib4dNV),
+    NAME_FUNC_OFFSET(11796, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, _gloffset_VertexAttrib4dvNV),
+    NAME_FUNC_OFFSET(11816, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, _gloffset_VertexAttrib4fNV),
+    NAME_FUNC_OFFSET(11835, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, _gloffset_VertexAttrib4fvNV),
+    NAME_FUNC_OFFSET(11855, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, _gloffset_VertexAttrib4sNV),
+    NAME_FUNC_OFFSET(11874, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, _gloffset_VertexAttrib4svNV),
+    NAME_FUNC_OFFSET(11894, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, _gloffset_VertexAttrib4ubNV),
+    NAME_FUNC_OFFSET(11914, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, _gloffset_VertexAttrib4ubvNV),
+    NAME_FUNC_OFFSET(11935, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, _gloffset_VertexAttribPointerNV),
+    NAME_FUNC_OFFSET(11959, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, _gloffset_VertexAttribs1dvNV),
+    NAME_FUNC_OFFSET(11980, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, _gloffset_VertexAttribs1fvNV),
+    NAME_FUNC_OFFSET(12001, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, _gloffset_VertexAttribs1svNV),
+    NAME_FUNC_OFFSET(12022, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, _gloffset_VertexAttribs2dvNV),
+    NAME_FUNC_OFFSET(12043, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, _gloffset_VertexAttribs2fvNV),
+    NAME_FUNC_OFFSET(12064, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, _gloffset_VertexAttribs2svNV),
+    NAME_FUNC_OFFSET(12085, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, _gloffset_VertexAttribs3dvNV),
+    NAME_FUNC_OFFSET(12106, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, _gloffset_VertexAttribs3fvNV),
+    NAME_FUNC_OFFSET(12127, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, _gloffset_VertexAttribs3svNV),
+    NAME_FUNC_OFFSET(12148, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, _gloffset_VertexAttribs4dvNV),
+    NAME_FUNC_OFFSET(12169, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, _gloffset_VertexAttribs4fvNV),
+    NAME_FUNC_OFFSET(12190, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, _gloffset_VertexAttribs4svNV),
+    NAME_FUNC_OFFSET(12211, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, _gloffset_VertexAttribs4ubvNV),
+    NAME_FUNC_OFFSET(12233, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, _gloffset_AlphaFragmentOp1ATI),
+    NAME_FUNC_OFFSET(12255, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, _gloffset_AlphaFragmentOp2ATI),
+    NAME_FUNC_OFFSET(12277, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, _gloffset_AlphaFragmentOp3ATI),
+    NAME_FUNC_OFFSET(12299, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, _gloffset_BeginFragmentShaderATI),
+    NAME_FUNC_OFFSET(12324, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, _gloffset_BindFragmentShaderATI),
+    NAME_FUNC_OFFSET(12348, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, _gloffset_ColorFragmentOp1ATI),
+    NAME_FUNC_OFFSET(12370, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, _gloffset_ColorFragmentOp2ATI),
+    NAME_FUNC_OFFSET(12392, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, _gloffset_ColorFragmentOp3ATI),
+    NAME_FUNC_OFFSET(12414, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, _gloffset_DeleteFragmentShaderATI),
+    NAME_FUNC_OFFSET(12440, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, _gloffset_EndFragmentShaderATI),
+    NAME_FUNC_OFFSET(12463, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, _gloffset_GenFragmentShadersATI),
+    NAME_FUNC_OFFSET(12487, glPassTexCoordATI, glPassTexCoordATI, NULL, _gloffset_PassTexCoordATI),
+    NAME_FUNC_OFFSET(12505, glSampleMapATI, glSampleMapATI, NULL, _gloffset_SampleMapATI),
+    NAME_FUNC_OFFSET(12520, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, _gloffset_SetFragmentShaderConstantATI),
+    NAME_FUNC_OFFSET(12551, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV),
+    NAME_FUNC_OFFSET(12571, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV),
+    NAME_FUNC_OFFSET(12592, gl_dispatch_stub_733, gl_dispatch_stub_733, NULL, _gloffset_ActiveStencilFaceEXT),
+    NAME_FUNC_OFFSET(12615, gl_dispatch_stub_734, gl_dispatch_stub_734, NULL, _gloffset_BindVertexArrayAPPLE),
+    NAME_FUNC_OFFSET(12638, gl_dispatch_stub_735, gl_dispatch_stub_735, NULL, _gloffset_DeleteVertexArraysAPPLE),
+    NAME_FUNC_OFFSET(12664, gl_dispatch_stub_736, gl_dispatch_stub_736, NULL, _gloffset_GenVertexArraysAPPLE),
+    NAME_FUNC_OFFSET(12687, gl_dispatch_stub_737, gl_dispatch_stub_737, NULL, _gloffset_IsVertexArrayAPPLE),
+    NAME_FUNC_OFFSET(12708, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, _gloffset_GetProgramNamedParameterdvNV),
+    NAME_FUNC_OFFSET(12739, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, _gloffset_GetProgramNamedParameterfvNV),
+    NAME_FUNC_OFFSET(12770, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, _gloffset_ProgramNamedParameter4dNV),
+    NAME_FUNC_OFFSET(12798, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, _gloffset_ProgramNamedParameter4dvNV),
+    NAME_FUNC_OFFSET(12827, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, _gloffset_ProgramNamedParameter4fNV),
+    NAME_FUNC_OFFSET(12855, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, _gloffset_ProgramNamedParameter4fvNV),
+    NAME_FUNC_OFFSET(12884, gl_dispatch_stub_744, gl_dispatch_stub_744, NULL, _gloffset_DepthBoundsEXT),
+    NAME_FUNC_OFFSET(12901, gl_dispatch_stub_745, gl_dispatch_stub_745, NULL, _gloffset_BlendEquationSeparateEXT),
+    NAME_FUNC_OFFSET(12928, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT),
+    NAME_FUNC_OFFSET(12949, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT),
+    NAME_FUNC_OFFSET(12971, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT),
+    NAME_FUNC_OFFSET(12999, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT),
+    NAME_FUNC_OFFSET(13023, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT),
+    NAME_FUNC_OFFSET(13048, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT),
+    NAME_FUNC_OFFSET(13077, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT),
+    NAME_FUNC_OFFSET(13103, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT),
+    NAME_FUNC_OFFSET(13129, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT),
+    NAME_FUNC_OFFSET(13155, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT),
+    NAME_FUNC_OFFSET(13176, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT),
+    NAME_FUNC_OFFSET(13198, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT),
+    NAME_FUNC_OFFSET(13218, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT),
+    NAME_FUNC_OFFSET(13259, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT),
+    NAME_FUNC_OFFSET(13291, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT),
+    NAME_FUNC_OFFSET(13310, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT),
+    NAME_FUNC_OFFSET(13330, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT),
+    NAME_FUNC_OFFSET(13355, gl_dispatch_stub_763, gl_dispatch_stub_763, NULL, _gloffset_BlitFramebufferEXT),
+    NAME_FUNC_OFFSET(13376, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT),
+    NAME_FUNC_OFFSET(13405, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_StencilFuncSeparateATI),
+    NAME_FUNC_OFFSET(13430, gl_dispatch_stub_766, gl_dispatch_stub_766, NULL, _gloffset_ProgramEnvParameters4fvEXT),
+    NAME_FUNC_OFFSET(13459, gl_dispatch_stub_767, gl_dispatch_stub_767, NULL, _gloffset_ProgramLocalParameters4fvEXT),
+    NAME_FUNC_OFFSET(13490, gl_dispatch_stub_768, gl_dispatch_stub_768, NULL, _gloffset_GetQueryObjecti64vEXT),
+    NAME_FUNC_OFFSET(13514, gl_dispatch_stub_769, gl_dispatch_stub_769, NULL, _gloffset_GetQueryObjectui64vEXT),
+    NAME_FUNC_OFFSET(13539, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement),
+    NAME_FUNC_OFFSET(13557, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture),
+    NAME_FUNC_OFFSET(13574, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays),
+    NAME_FUNC_OFFSET(13590, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident),
+    NAME_FUNC_OFFSET(13615, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D),
+    NAME_FUNC_OFFSET(13635, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D),
+    NAME_FUNC_OFFSET(13655, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D),
+    NAME_FUNC_OFFSET(13678, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D),
+    NAME_FUNC_OFFSET(13701, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures),
+    NAME_FUNC_OFFSET(13721, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures),
+    NAME_FUNC_OFFSET(13738, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv),
+    NAME_FUNC_OFFSET(13755, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture),
+    NAME_FUNC_OFFSET(13770, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures),
+    NAME_FUNC_OFFSET(13794, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D),
+    NAME_FUNC_OFFSET(13813, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D),
+    NAME_FUNC_OFFSET(13832, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor),
+    NAME_FUNC_OFFSET(13848, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation),
+    NAME_FUNC_OFFSET(13867, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements),
+    NAME_FUNC_OFFSET(13890, glColorTable, glColorTable, NULL, _gloffset_ColorTable),
+    NAME_FUNC_OFFSET(13906, glColorTable, glColorTable, NULL, _gloffset_ColorTable),
+    NAME_FUNC_OFFSET(13922, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv),
+    NAME_FUNC_OFFSET(13949, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv),
+    NAME_FUNC_OFFSET(13976, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable),
+    NAME_FUNC_OFFSET(13996, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable),
+    NAME_FUNC_OFFSET(14015, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable),
+    NAME_FUNC_OFFSET(14034, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv),
+    NAME_FUNC_OFFSET(14064, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv),
+    NAME_FUNC_OFFSET(14094, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv),
+    NAME_FUNC_OFFSET(14124, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv),
+    NAME_FUNC_OFFSET(14154, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable),
+    NAME_FUNC_OFFSET(14173, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable),
+    NAME_FUNC_OFFSET(14196, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D),
+    NAME_FUNC_OFFSET(14221, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D),
+    NAME_FUNC_OFFSET(14246, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf),
+    NAME_FUNC_OFFSET(14273, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv),
+    NAME_FUNC_OFFSET(14301, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri),
+    NAME_FUNC_OFFSET(14328, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv),
+    NAME_FUNC_OFFSET(14356, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D),
+    NAME_FUNC_OFFSET(14385, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D),
+    NAME_FUNC_OFFSET(14414, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter),
+    NAME_FUNC_OFFSET(14440, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv),
+    NAME_FUNC_OFFSET(14471, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv),
+    NAME_FUNC_OFFSET(14502, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter),
+    NAME_FUNC_OFFSET(14526, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D),
+    NAME_FUNC_OFFSET(14549, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram),
+    NAME_FUNC_OFFSET(14567, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv),
+    NAME_FUNC_OFFSET(14596, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv),
+    NAME_FUNC_OFFSET(14625, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax),
+    NAME_FUNC_OFFSET(14640, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv),
+    NAME_FUNC_OFFSET(14666, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv),
+    NAME_FUNC_OFFSET(14692, glHistogram, glHistogram, NULL, _gloffset_Histogram),
+    NAME_FUNC_OFFSET(14707, glMinmax, glMinmax, NULL, _gloffset_Minmax),
+    NAME_FUNC_OFFSET(14719, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram),
+    NAME_FUNC_OFFSET(14739, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax),
+    NAME_FUNC_OFFSET(14756, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D),
+    NAME_FUNC_OFFSET(14772, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D),
+    NAME_FUNC_OFFSET(14791, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D),
+    NAME_FUNC_OFFSET(14814, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB),
+    NAME_FUNC_OFFSET(14830, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB),
+    NAME_FUNC_OFFSET(14852, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB),
+    NAME_FUNC_OFFSET(14870, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB),
+    NAME_FUNC_OFFSET(14889, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB),
+    NAME_FUNC_OFFSET(14907, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB),
+    NAME_FUNC_OFFSET(14926, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB),
+    NAME_FUNC_OFFSET(14944, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB),
+    NAME_FUNC_OFFSET(14963, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB),
+    NAME_FUNC_OFFSET(14981, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB),
+    NAME_FUNC_OFFSET(15000, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB),
+    NAME_FUNC_OFFSET(15018, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB),
+    NAME_FUNC_OFFSET(15037, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB),
+    NAME_FUNC_OFFSET(15055, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB),
+    NAME_FUNC_OFFSET(15074, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB),
+    NAME_FUNC_OFFSET(15092, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB),
+    NAME_FUNC_OFFSET(15111, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB),
+    NAME_FUNC_OFFSET(15129, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB),
+    NAME_FUNC_OFFSET(15148, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB),
+    NAME_FUNC_OFFSET(15166, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB),
+    NAME_FUNC_OFFSET(15185, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB),
+    NAME_FUNC_OFFSET(15203, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB),
+    NAME_FUNC_OFFSET(15222, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB),
+    NAME_FUNC_OFFSET(15240, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB),
+    NAME_FUNC_OFFSET(15259, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB),
+    NAME_FUNC_OFFSET(15277, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB),
+    NAME_FUNC_OFFSET(15296, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB),
+    NAME_FUNC_OFFSET(15314, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB),
+    NAME_FUNC_OFFSET(15333, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB),
+    NAME_FUNC_OFFSET(15351, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB),
+    NAME_FUNC_OFFSET(15370, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB),
+    NAME_FUNC_OFFSET(15388, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB),
+    NAME_FUNC_OFFSET(15407, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB),
+    NAME_FUNC_OFFSET(15425, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB),
+    NAME_FUNC_OFFSET(15444, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate),
+    NAME_FUNC_OFFSET(15467, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB),
+    NAME_FUNC_OFFSET(15490, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB),
+    NAME_FUNC_OFFSET(15513, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB),
+    NAME_FUNC_OFFSET(15536, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB),
+    NAME_FUNC_OFFSET(15559, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB),
+    NAME_FUNC_OFFSET(15576, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB),
+    NAME_FUNC_OFFSET(15599, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB),
+    NAME_FUNC_OFFSET(15622, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB),
+    NAME_FUNC_OFFSET(15645, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB),
+    NAME_FUNC_OFFSET(15671, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB),
+    NAME_FUNC_OFFSET(15697, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB),
+    NAME_FUNC_OFFSET(15723, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB),
+    NAME_FUNC_OFFSET(15747, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB),
+    NAME_FUNC_OFFSET(15774, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB),
+    NAME_FUNC_OFFSET(15800, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB),
+    NAME_FUNC_OFFSET(15820, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB),
+    NAME_FUNC_OFFSET(15840, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB),
+    NAME_FUNC_OFFSET(15860, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB),
+    NAME_FUNC_OFFSET(15883, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB),
+    NAME_FUNC_OFFSET(15907, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB),
+    NAME_FUNC_OFFSET(15930, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB),
     NAME_FUNC_OFFSET(15954, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB),
     NAME_FUNC_OFFSET(15971, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB),
     NAME_FUNC_OFFSET(15989, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB),
@@ -2252,8 +2252,8 @@ static const glprocs_table_t static_functions[] = {
     NAME_FUNC_OFFSET(18694, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV),
     NAME_FUNC_OFFSET(18709, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV),
     NAME_FUNC_OFFSET(18727, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV),
-    NAME_FUNC_OFFSET(18746, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT),
-    NAME_FUNC_OFFSET(18770, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT),
+    NAME_FUNC_OFFSET(18746, gl_dispatch_stub_745, gl_dispatch_stub_745, NULL, _gloffset_BlendEquationSeparateEXT),
+    NAME_FUNC_OFFSET(18770, gl_dispatch_stub_745, gl_dispatch_stub_745, NULL, _gloffset_BlendEquationSeparateEXT),
     NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)
 };
 
index afb04f7bf2bb65fc330e39ae423a9ed2db63e282..b8e9d5f59b8c3b20a6a334c2f409eb720db8c575 100644 (file)
@@ -116,9 +116,49 @@ typedef pthread_mutex_t _glthread_Mutex;
 #define _glthread_UNLOCK_MUTEX(name) \
    (void) pthread_mutex_unlock(&(name))
 
-#endif /* PTHREADS */
+typedef pthread_cond_t _glthread_Cond;
 
+#define _glthread_DECLARE_STATIC_COND(name) \
+   static _glthread_Cond name = PTHREAD_COND_INITIALIZER
 
+#define _glthread_INIT_COND(cond)                      \
+   pthread_cond_init(&(cond), NULL)
+
+#define _glthread_DESTROY_COND(name) \
+   pthread_cond_destroy(&(name))
+
+#define _glthread_COND_WAIT(cond, mutex) \
+  pthread_cond_wait(&(cond), &(mutex))
+
+#define _glthread_COND_SIGNAL(cond) \
+  pthread_cond_signal(&(cond))
+
+#define _glthread_COND_BROADCAST(cond) \
+  pthread_cond_broadcast(&(cond))
+
+
+#else /* PTHREADS */
+
+typedef unsigned int _glthread_Cond;
+#define _glthread_DECLARE_STATIC_COND(name) \
+//  #warning Condition variables not implemented.
+
+#define _glthread_INIT_COND(cond)          \
+  abort();
+
+#define _glthread_DESTROY_COND(name) \
+  abort();
+
+#define _glthread_COND_WAIT(cond, mutex) \
+  abort();
+
+#define _glthread_COND_SIGNAL(cond) \
+  abort();
+
+#define _glthread_COND_BROADCAST(cond) \
+  abort();
+
+#endif
 
 
 /*
@@ -259,11 +299,11 @@ typedef benaphore _glthread_Mutex;
  * THREADS not defined
  */
 
-typedef unsigned _glthread_TSD;
+typedef GLuint _glthread_TSD;
 
-typedef unsigned _glthread_Thread;
+typedef GLuint _glthread_Thread;
 
-typedef unsigned _glthread_Mutex;
+typedef GLuint _glthread_Mutex;
 
 #define _glthread_DECLARE_STATIC_MUTEX(name)  static _glthread_Mutex name = 0
 
index 8c6424884544c695568dddfe19ce18957f4c229e..232e698f50c15c1ddf7e430a475c3953d1df2a76 100644 (file)
 /** For GL_EXT_texture_lod_bias (typically MAX_TEXTURE_LEVELS - 1) */
 #define MAX_TEXTURE_LOD_BIAS 11.0
 
-/** For GL_NV_vertex_program */
-/*@{*/
-#define MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS 128
-#define MAX_NV_VERTEX_PROGRAM_TEMPS         12
-#define MAX_NV_VERTEX_PROGRAM_PARAMS        128        /* KW: power of two */
-#define MAX_NV_VERTEX_PROGRAM_INPUTS        16
-#define MAX_NV_VERTEX_PROGRAM_OUTPUTS       15
-/*@}*/
-
-/** For GL_NV_fragment_program */
-/*@{*/
-#define MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS 1024 /* 72 for GL_ARB_f_p */
-#define MAX_NV_FRAGMENT_PROGRAM_TEMPS         96
-#define MAX_NV_FRAGMENT_PROGRAM_PARAMS        64
-#define MAX_NV_FRAGMENT_PROGRAM_INPUTS        12
-#define MAX_NV_FRAGMENT_PROGRAM_OUTPUTS        3
-#define MAX_NV_FRAGMENT_PROGRAM_WRITE_ONLYS    2
-/*@}*/
-
 /** For GL_ARB_vertex_program */
 /*@{*/
 #define MAX_VERTEX_PROGRAM_ADDRESS_REGS 1
 #define MAX_SAMPLERS 8
 /*@}*/
 
+/** For GL_NV_vertex_program */
+/*@{*/
+#define MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS 128
+#define MAX_NV_VERTEX_PROGRAM_TEMPS         12
+#define MAX_NV_VERTEX_PROGRAM_PARAMS        MAX_PROGRAM_ENV_PARAMS
+#define MAX_NV_VERTEX_PROGRAM_INPUTS        16
+#define MAX_NV_VERTEX_PROGRAM_OUTPUTS       15
+/*@}*/
+
+/** For GL_NV_fragment_program */
+/*@{*/
+#define MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS 1024 /* 72 for GL_ARB_f_p */
+#define MAX_NV_FRAGMENT_PROGRAM_TEMPS         96
+#define MAX_NV_FRAGMENT_PROGRAM_PARAMS        64
+#define MAX_NV_FRAGMENT_PROGRAM_INPUTS        12
+#define MAX_NV_FRAGMENT_PROGRAM_OUTPUTS        3
+#define MAX_NV_FRAGMENT_PROGRAM_WRITE_ONLYS    2
+/*@}*/
+
+
 /** For GL_ARB_vertex_shader */
 /*@{*/
 #define MAX_VERTEX_ATTRIBS 16
index 893c79f28ca2d57b3d7e75b81c46f85ef75b0439..2158eb687384d00be02577615bb6345ff2c2319a 100755 (executable)
@@ -593,6 +593,8 @@ delete_program_cb(GLuint id, void *data, void *userData)
 {
    struct gl_program *prog = (struct gl_program *) data;
    GLcontext *ctx = (GLcontext *) userData;
+   ASSERT(prog->RefCount == 1); /* should only be referenced by hash table */
+   prog->RefCount = 0;  /* now going away */
    ctx->Driver.DeleteProgram(ctx, prog);
 }
 
@@ -686,22 +688,11 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
    _mesa_HashDeleteAll(ss->DisplayList, delete_displaylist_cb, ctx);
    _mesa_DeleteHashTable(ss->DisplayList);
 
-   /*
-    * Free texture objects
-    */
-   ASSERT(ctx->Driver.DeleteTexture);
-   /* the default textures */
-   ctx->Driver.DeleteTexture(ctx, ss->Default1D);
-   ctx->Driver.DeleteTexture(ctx, ss->Default2D);
-   ctx->Driver.DeleteTexture(ctx, ss->Default3D);
-   ctx->Driver.DeleteTexture(ctx, ss->DefaultCubeMap);
-   ctx->Driver.DeleteTexture(ctx, ss->DefaultRect);
-   ctx->Driver.DeleteTexture(ctx, ss->Default1DArray);
-   ctx->Driver.DeleteTexture(ctx, ss->Default2DArray);
-
-   /* all other textures */
-   _mesa_HashDeleteAll(ss->TexObjects, delete_texture_cb, ctx);
-   _mesa_DeleteHashTable(ss->TexObjects);
+#if FEATURE_ARB_shader_objects
+   _mesa_HashWalk(ss->ShaderObjects, free_shader_program_data_cb, ctx);
+   _mesa_HashDeleteAll(ss->ShaderObjects, delete_shader_cb, ctx);
+   _mesa_DeleteHashTable(ss->ShaderObjects);
+#endif
 
 #if defined(FEATURE_NV_vertex_program) || defined(FEATURE_NV_fragment_program)
    _mesa_HashDeleteAll(ss->Programs, delete_program_cb, ctx);
@@ -728,17 +719,28 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
    _mesa_HashDeleteAll(ss->ArrayObjects, delete_arrayobj_cb, ctx);
    _mesa_DeleteHashTable(ss->ArrayObjects);
 
-#if FEATURE_ARB_shader_objects
-   _mesa_HashWalk(ss->ShaderObjects, free_shader_program_data_cb, ctx);
-   _mesa_HashDeleteAll(ss->ShaderObjects, delete_shader_cb, ctx);
-   _mesa_DeleteHashTable(ss->ShaderObjects);
-#endif
-
 #if FEATURE_EXT_framebuffer_object
    _mesa_DeleteHashTable(ss->FrameBuffers);
    _mesa_DeleteHashTable(ss->RenderBuffers);
 #endif
 
+   /*
+    * Free texture objects (after FBOs since some textures might have
+    * been bound to FBOs).
+    */
+   ASSERT(ctx->Driver.DeleteTexture);
+   /* the default textures */
+   ctx->Driver.DeleteTexture(ctx, ss->Default1D);
+   ctx->Driver.DeleteTexture(ctx, ss->Default2D);
+   ctx->Driver.DeleteTexture(ctx, ss->Default3D);
+   ctx->Driver.DeleteTexture(ctx, ss->DefaultCubeMap);
+   ctx->Driver.DeleteTexture(ctx, ss->DefaultRect);
+   ctx->Driver.DeleteTexture(ctx, ss->Default1DArray);
+   ctx->Driver.DeleteTexture(ctx, ss->Default2DArray);
+   /* all other textures */
+   _mesa_HashDeleteAll(ss->TexObjects, delete_texture_cb, ctx);
+   _mesa_DeleteHashTable(ss->TexObjects);
+
    _glthread_DESTROY_MUTEX(ss->Mutex);
 
    _mesa_free(ss);
index 293ee5fa349dd9a148a5c445ee57faf1ca5f85d2..13ebd4dd0d482986e8e6995f204056146a41ee3e 100644 (file)
@@ -303,7 +303,6 @@ typedef enum
    OPCODE_EXECUTE_PROGRAM_NV,
    OPCODE_REQUEST_RESIDENT_PROGRAMS_NV,
    OPCODE_LOAD_PROGRAM_NV,
-   OPCODE_PROGRAM_PARAMETER4F_NV,
    OPCODE_TRACK_MATRIX_NV,
    /* GL_NV_fragment_program */
    OPCODE_PROGRAM_LOCAL_PARAMETER_ARB,
@@ -4248,77 +4247,111 @@ save_BindProgramNV(GLenum target, GLuint id)
       CALL_BindProgramNV(ctx->Exec, (target, id));
    }
 }
-#endif /* FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
 
-#if FEATURE_NV_vertex_program
 static void GLAPIENTRY
-save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
+save_ProgramEnvParameter4fARB(GLenum target, GLuint index,
+                              GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 {
    GET_CURRENT_CONTEXT(ctx);
    Node *n;
    ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-   n = ALLOC_INSTRUCTION(ctx, OPCODE_EXECUTE_PROGRAM_NV, 6);
+   n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
    if (n) {
       n[1].e = target;
-      n[2].ui = id;
-      n[3].f = params[0];
-      n[4].f = params[1];
-      n[5].f = params[2];
-      n[6].f = params[3];
+      n[2].ui = index;
+      n[3].f = x;
+      n[4].f = y;
+      n[5].f = z;
+      n[6].f = w;
    }
    if (ctx->ExecuteFlag) {
-      CALL_ExecuteProgramNV(ctx->Exec, (target, id, params));
+      CALL_ProgramEnvParameter4fARB(ctx->Exec, (target, index, x, y, z, w));
    }
 }
 
 
 static void GLAPIENTRY
-save_ProgramParameter4fNV(GLenum target, GLuint index,
-                          GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+save_ProgramEnvParameter4fvARB(GLenum target, GLuint index,
+                               const GLfloat *params)
+{
+   save_ProgramEnvParameter4fARB(target, index, params[0], params[1],
+                                 params[2], params[3]);
+}
+
+
+static void GLAPIENTRY
+save_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
+                               const GLfloat * params)
 {
    GET_CURRENT_CONTEXT(ctx);
    Node *n;
    ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-   n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_PARAMETER4F_NV, 6);
-   if (n) {
-      n[1].e = target;
-      n[2].ui = index;
-      n[3].f = x;
-      n[4].f = y;
-      n[5].f = z;
-      n[6].f = w;
+
+   if (count > 0) {
+      GLint i;
+      const GLfloat * p = params;
+
+      for (i = 0 ; i < count ; i++) {
+        n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
+        if (n) {
+           n[1].e = target;
+           n[2].ui = index;
+           n[3].f = p[0];
+           n[4].f = p[1];
+           n[5].f = p[2];
+           n[6].f = p[3];
+           p += 4;
+        }
+      }
    }
+
    if (ctx->ExecuteFlag) {
-      CALL_ProgramParameter4fNV(ctx->Exec, (target, index, x, y, z, w));
+      CALL_ProgramEnvParameters4fvEXT(ctx->Exec, (target, index, count, params));
    }
 }
 
 
 static void GLAPIENTRY
-save_ProgramParameter4fvNV(GLenum target, GLuint index,
-                           const GLfloat *params)
+save_ProgramEnvParameter4dARB(GLenum target, GLuint index,
+                              GLdouble x, GLdouble y, GLdouble z, GLdouble w)
 {
-   save_ProgramParameter4fNV(target, index, params[0], params[1],
-                             params[2], params[3]);
+   save_ProgramEnvParameter4fARB(target, index,
+                                 (GLfloat) x,
+                                 (GLfloat) y, (GLfloat) z, (GLfloat) w);
 }
 
 
 static void GLAPIENTRY
-save_ProgramParameter4dNV(GLenum target, GLuint index,
-                          GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+save_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
+                               const GLdouble *params)
 {
-   save_ProgramParameter4fNV(target, index, (GLfloat) x, (GLfloat) y,
-                             (GLfloat) z, (GLfloat) w);
+   save_ProgramEnvParameter4fARB(target, index,
+                                 (GLfloat) params[0],
+                                 (GLfloat) params[1],
+                                 (GLfloat) params[2], (GLfloat) params[3]);
 }
 
+#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
 
+#if FEATURE_NV_vertex_program
 static void GLAPIENTRY
-save_ProgramParameter4dvNV(GLenum target, GLuint index,
-                           const GLdouble *params)
+save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
 {
-   save_ProgramParameter4fNV(target, index, (GLfloat) params[0],
-                             (GLfloat) params[1], (GLfloat) params[2],
-                             (GLfloat) params[3]);
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = ALLOC_INSTRUCTION(ctx, OPCODE_EXECUTE_PROGRAM_NV, 6);
+   if (n) {
+      n[1].e = target;
+      n[2].ui = id;
+      n[3].f = params[0];
+      n[4].f = params[1];
+      n[5].f = params[2];
+      n[6].f = params[3];
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_ExecuteProgramNV(ctx->Exec, (target, id, params));
+   }
 }
 
 
@@ -4328,7 +4361,7 @@ save_ProgramParameters4dvNV(GLenum target, GLuint index,
 {
    GLuint i;
    for (i = 0; i < num; i++) {
-      save_ProgramParameter4dvNV(target, index + i, params + 4 * i);
+      save_ProgramEnvParameter4dvARB(target, index + i, params + 4 * i);
    }
 }
 
@@ -4339,7 +4372,7 @@ save_ProgramParameters4fvNV(GLenum target, GLuint index,
 {
    GLuint i;
    for (i = 0; i < num; i++) {
-      save_ProgramParameter4fvNV(target, index + i, params + 4 * i);
+      save_ProgramEnvParameter4fvARB(target, index + i, params + 4 * i);
    }
 }
 
@@ -4667,90 +4700,6 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
    }
 }
 
-
-static void GLAPIENTRY
-save_ProgramEnvParameter4fARB(GLenum target, GLuint index,
-                              GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-   n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
-   if (n) {
-      n[1].e = target;
-      n[2].ui = index;
-      n[3].f = x;
-      n[4].f = y;
-      n[5].f = z;
-      n[6].f = w;
-   }
-   if (ctx->ExecuteFlag) {
-      CALL_ProgramEnvParameter4fARB(ctx->Exec, (target, index, x, y, z, w));
-   }
-}
-
-
-static void GLAPIENTRY
-save_ProgramEnvParameter4fvARB(GLenum target, GLuint index,
-                               const GLfloat *params)
-{
-   save_ProgramEnvParameter4fARB(target, index, params[0], params[1],
-                                 params[2], params[3]);
-}
-
-
-static void GLAPIENTRY
-save_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
-                               const GLfloat * params)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
-   if (count > 0) {
-      GLint i;
-      const GLfloat * p = params;
-
-      for (i = 0 ; i < count ; i++) {
-        n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
-        if (n) {
-           n[1].e = target;
-           n[2].ui = index;
-           n[3].f = p[0];
-           n[4].f = p[1];
-           n[5].f = p[2];
-           n[6].f = p[3];
-           p += 4;
-        }
-      }
-   }
-
-   if (ctx->ExecuteFlag) {
-      CALL_ProgramEnvParameters4fvEXT(ctx->Exec, (target, index, count, params));
-   }
-}
-
-
-static void GLAPIENTRY
-save_ProgramEnvParameter4dARB(GLenum target, GLuint index,
-                              GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
-   save_ProgramEnvParameter4fARB(target, index,
-                                 (GLfloat) x,
-                                 (GLfloat) y, (GLfloat) z, (GLfloat) w);
-}
-
-
-static void GLAPIENTRY
-save_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
-                               const GLdouble *params)
-{
-   save_ProgramEnvParameter4fARB(target, index,
-                                 (GLfloat) params[0],
-                                 (GLfloat) params[1],
-                                 (GLfloat) params[2], (GLfloat) params[3]);
-}
-
 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
 
 
@@ -6425,10 +6374,6 @@ execute_list(GLcontext *ctx, GLuint list)
             CALL_LoadProgramNV(ctx->Exec, (n[1].e, n[2].ui, n[3].i,
                                            (const GLubyte *) n[4].data));
             break;
-         case OPCODE_PROGRAM_PARAMETER4F_NV:
-            CALL_ProgramParameter4fNV(ctx->Exec, (n[1].e, n[2].ui, n[3].f,
-                                                  n[4].f, n[5].f, n[6].f));
-            break;
          case OPCODE_TRACK_MATRIX_NV:
             CALL_TrackMatrixNV(ctx->Exec, (n[1].e, n[2].ui, n[3].e, n[4].e));
             break;
@@ -6459,6 +6404,8 @@ execute_list(GLcontext *ctx, GLuint list)
             CALL_ProgramStringARB(ctx->Exec,
                                   (n[1].e, n[2].e, n[3].i, n[4].data));
             break;
+#endif
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
          case OPCODE_PROGRAM_ENV_PARAMETER_ARB:
             CALL_ProgramEnvParameter4fARB(ctx->Exec, (n[1].e, n[2].ui, n[3].f,
                                                       n[4].f, n[5].f,
@@ -8014,10 +7961,10 @@ _mesa_init_dlist_table(struct _glapi_table *table)
    SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervNV);
    SET_IsProgramNV(table, _mesa_IsProgramARB);
    SET_LoadProgramNV(table, save_LoadProgramNV);
-   SET_ProgramParameter4dNV(table, save_ProgramParameter4dNV);
-   SET_ProgramParameter4dvNV(table, save_ProgramParameter4dvNV);
-   SET_ProgramParameter4fNV(table, save_ProgramParameter4fNV);
-   SET_ProgramParameter4fvNV(table, save_ProgramParameter4fvNV);
+   SET_ProgramEnvParameter4dARB(table, save_ProgramEnvParameter4dARB);
+   SET_ProgramEnvParameter4dvARB(table, save_ProgramEnvParameter4dvARB);
+   SET_ProgramEnvParameter4fARB(table, save_ProgramEnvParameter4fARB);
+   SET_ProgramEnvParameter4fvARB(table, save_ProgramEnvParameter4fvARB);
    SET_ProgramParameters4dvNV(table, save_ProgramParameters4dvNV);
    SET_ProgramParameters4fvNV(table, save_ProgramParameters4fvNV);
    SET_TrackMatrixNV(table, save_TrackMatrixNV);
index 90379a17726f240f4538b5080700f2db2d02b860..f8cb943e643b1c2a6ada29c6f5452d2d9110c55c 100644 (file)
@@ -536,10 +536,10 @@ _mesa_init_exec_table(struct _glapi_table *exec)
    SET_GetVertexAttribPointervNV(exec, _mesa_GetVertexAttribPointervNV);
    SET_IsProgramNV(exec, _mesa_IsProgramARB);
    SET_LoadProgramNV(exec, _mesa_LoadProgramNV);
-   SET_ProgramParameter4dNV(exec, _mesa_ProgramParameter4dNV);
-   SET_ProgramParameter4dvNV(exec, _mesa_ProgramParameter4dvNV);
-   SET_ProgramParameter4fNV(exec, _mesa_ProgramParameter4fNV);
-   SET_ProgramParameter4fvNV(exec, _mesa_ProgramParameter4fvNV);
+   SET_ProgramEnvParameter4dARB(exec, _mesa_ProgramEnvParameter4dARB); /* alias to ProgramParameter4dNV */
+   SET_ProgramEnvParameter4dvARB(exec, _mesa_ProgramEnvParameter4dvARB);  /* alias to ProgramParameter4dvNV */
+   SET_ProgramEnvParameter4fARB(exec, _mesa_ProgramEnvParameter4fARB);  /* alias to ProgramParameter4fNV */
+   SET_ProgramEnvParameter4fvARB(exec, _mesa_ProgramEnvParameter4fvARB);  /* alias to ProgramParameter4fvNV */
    SET_ProgramParameters4dvNV(exec, _mesa_ProgramParameters4dvNV);
    SET_ProgramParameters4fvNV(exec, _mesa_ProgramParameters4fvNV);
    SET_TrackMatrixNV(exec, _mesa_TrackMatrixNV);
index 4b5f63ef9207b15804a32806b3695d2171f5ce87..1656dc945073d5d4e48d3116c5edb23662a57db8 100644 (file)
@@ -229,7 +229,7 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
       struct gl_vertex_program *prog = ctx->VertexProgram.Current;
       _mesa_parse_arb_vertex_program(ctx, target, string, len, prog);
       
-      if (ctx->Driver.ProgramStringNotify)
+      if (ctx->Program.ErrorPos == -1 && ctx->Driver.ProgramStringNotify)
         ctx->Driver.ProgramStringNotify( ctx, target, &prog->Base );
    }
    else if (target == GL_FRAGMENT_PROGRAM_ARB
@@ -237,7 +237,7 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
       struct gl_fragment_program *prog = ctx->FragmentProgram.Current;
       _mesa_parse_arb_fragment_program(ctx, target, string, len, prog);
 
-      if (ctx->Driver.ProgramStringNotify)
+      if (ctx->Program.ErrorPos == -1 && ctx->Driver.ProgramStringNotify)
         ctx->Driver.ProgramStringNotify( ctx, target, &prog->Base );
    }
    else {
@@ -247,6 +247,12 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
 }
 
 
+/**
+ * Set a program env parameter register.
+ * \note Called from the GL API dispatcher.
+ * Note, this function is also used by the GL_NV_vertex_program extension
+ * (alias to ProgramParameterdNV)
+ */
 void GLAPIENTRY
 _mesa_ProgramEnvParameter4dARB(GLenum target, GLuint index,
                                GLdouble x, GLdouble y, GLdouble z, GLdouble w)
@@ -256,6 +262,12 @@ _mesa_ProgramEnvParameter4dARB(GLenum target, GLuint index,
 }
 
 
+/**
+ * Set a program env parameter register.
+ * \note Called from the GL API dispatcher.
+ * Note, this function is also used by the GL_NV_vertex_program extension
+ * (alias to ProgramParameterdvNV)
+ */
 void GLAPIENTRY
 _mesa_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
                                 const GLdouble *params)
@@ -266,6 +278,12 @@ _mesa_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
 }
 
 
+/**
+ * Set a program env parameter register.
+ * \note Called from the GL API dispatcher.
+ * Note, this function is also used by the GL_NV_vertex_program extension
+ * (alias to ProgramParameterfNV)
+ */
 void GLAPIENTRY
 _mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index,
                                GLfloat x, GLfloat y, GLfloat z, GLfloat w)
@@ -283,8 +301,8 @@ _mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index,
       }
       ASSIGN_4V(ctx->FragmentProgram.Parameters[index], x, y, z, w);
    }
-   else if (target == GL_VERTEX_PROGRAM_ARB
-       && ctx->Extensions.ARB_vertex_program) {
+   else if (target == GL_VERTEX_PROGRAM_ARB /* == GL_VERTEX_PROGRAM_NV */
+       && (ctx->Extensions.ARB_vertex_program || ctx->Extensions.NV_vertex_program)) {
       if (index >= ctx->Const.VertexProgram.MaxEnvParams) {
          _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameter(index)");
          return;
@@ -297,7 +315,12 @@ _mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index,
    }
 }
 
-
+/**
+ * Set a program env parameter register.
+ * \note Called from the GL API dispatcher.
+ * Note, this function is also used by the GL_NV_vertex_program extension
+ * (alias to ProgramParameterfvNV)
+ */
 void GLAPIENTRY
 _mesa_ProgramEnvParameter4fvARB(GLenum target, GLuint index,
                                    const GLfloat *params)
index ba17d638a3ab88f641c92ebe9b4cc840e00399a9..b12c6a0eda532c22d1faaae28b3a100319ca1672 100644 (file)
@@ -1942,10 +1942,10 @@ stateTexEnvProperty
 fragment program
     <optLegacyTexUnitNum>  ::= ""
                              | "[" <legacyTexUnitNum> "]"
-
-NOTE: <optLegaceTexUnitNum> is not optional.
 */
 optLegacyTexUnitNum
+    optLegacyTexUnitNum_1 .or .true .emit 0x00;
+optLegacyTexUnitNum_1
     lbracket_ne .and legacyTexUnitNum .and rbracket;
 
 /*
index e0c901ea8cda4ee956ae5967c2d2753dab41c88c..d95a5dede4af48538c53771f53b054aef0f30c78 100644 (file)
 "stateTexEnvProperty\n"
 " \"color\" .emit TEX_ENV_COLOR;\n"
 "optLegacyTexUnitNum\n"
+" optLegacyTexUnitNum_1 .or .true .emit 0x00;\n"
+"optLegacyTexUnitNum_1\n"
 " lbracket_ne .and legacyTexUnitNum .and rbracket;\n"
 "legacyTexUnitNum\n"
 " integer;\n"
index 4727c1a43657016fb6177e0272b4b361de62a024..854c91187415179d94ad57849ce4a7a6ca15990e 100644 (file)
@@ -440,7 +440,7 @@ _mesa_PassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle)
       _mesa_error(ctx, GL_INVALID_OPERATION, "glPassTexCoordATI(coord)");
       return;
    }
-   if ((swizzle < GL_SWIZZLE_STR_ATI) && (swizzle > GL_SWIZZLE_STQ_DQ_ATI)) {
+   if (!(swizzle >= GL_SWIZZLE_STR_ATI) && (swizzle <= GL_SWIZZLE_STQ_DQ_ATI)) {
       _mesa_error(ctx, GL_INVALID_ENUM, "glPassTexCoordATI(swizzle)");
       return;
    }
@@ -513,7 +513,7 @@ _mesa_SampleMapATI(GLuint dst, GLuint interp, GLenum swizzle)
       _mesa_error(ctx, GL_INVALID_OPERATION, "glSampleMapATI(interp)");
       return;
    }
-   if ((swizzle < GL_SWIZZLE_STR_ATI) && (swizzle > GL_SWIZZLE_STQ_DQ_ATI)) {
+   if (!(swizzle >= GL_SWIZZLE_STR_ATI) && (swizzle <= GL_SWIZZLE_STQ_DQ_ATI)) {
       _mesa_error(ctx, GL_INVALID_ENUM, "glSampleMapATI(swizzle)");
       return;
    }
index 337784bfe259b71641c48d0598bad4675215b0ac..409c61cdc114e5bbe078c6d5c82bdaffea723d15 100644 (file)
@@ -575,75 +575,6 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len,
 
 
 
-/**
- * Set a program parameter register.
- * \note Called from the GL API dispatcher.
- */
-void GLAPIENTRY
-_mesa_ProgramParameter4dNV(GLenum target, GLuint index,
-                           GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
-   _mesa_ProgramParameter4fNV(target, index, 
-                             (GLfloat)x, (GLfloat)y, (GLfloat)z, (GLfloat)w);
-}
-
-
-/**
- * Set a program parameter register.
- * \note Called from the GL API dispatcher.
- */
-void GLAPIENTRY
-_mesa_ProgramParameter4dvNV(GLenum target, GLuint index,
-                            const GLdouble *params)
-{
-   _mesa_ProgramParameter4fNV(target, index,
-                              (GLfloat)params[0], (GLfloat)params[1], 
-                             (GLfloat)params[2], (GLfloat)params[3]);
-}
-
-
-/**
- * Set a program parameter register.
- * \note Called from the GL API dispatcher.
- */
-void GLAPIENTRY
-_mesa_ProgramParameter4fNV(GLenum target, GLuint index,
-                           GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ASSERT_OUTSIDE_BEGIN_END(ctx);
-
-   if (target == GL_VERTEX_PROGRAM_NV && ctx->Extensions.NV_vertex_program) {
-      if (index < MAX_NV_VERTEX_PROGRAM_PARAMS) {
-         FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-         ASSIGN_4V(ctx->VertexProgram.Parameters[index], x, y, z, w);
-      }
-      else {
-         _mesa_error(ctx, GL_INVALID_VALUE, "glProgramParameterNV(index)");
-         return;
-      }
-   }
-   else {
-      _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameterNV");
-      return;
-   }
-}
-
-
-/**
- * Set a program parameter register.
- * \note Called from the GL API dispatcher.
- */
-void GLAPIENTRY
-_mesa_ProgramParameter4fvNV(GLenum target, GLuint index,
-                            const GLfloat *params)
-{
-   _mesa_ProgramParameter4fNV(target, index,
-                              params[0], params[1], params[2], params[3]);
-}
-
-
-
 /**
  * Set a sequence of program parameter registers.
  * \note Called from the GL API dispatcher.
index dcea7727e044acdb236652ecc9854536c74f1ca2..bfac165b5ed29a836aa7bd16054a9b55e87699eb 100644 (file)
@@ -69,18 +69,6 @@ _mesa_GetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid **pointer);
 extern void GLAPIENTRY
 _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte *program);
 
-extern void GLAPIENTRY
-_mesa_ProgramParameter4dNV(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-
-extern void GLAPIENTRY
-_mesa_ProgramParameter4dvNV(GLenum target, GLuint index, const GLdouble *params);
-
-extern void GLAPIENTRY
-_mesa_ProgramParameter4fNV(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-
-extern void GLAPIENTRY
-_mesa_ProgramParameter4fvNV(GLenum target, GLuint index, const GLfloat *params);
-
 extern void GLAPIENTRY
 _mesa_ProgramParameters4dvNV(GLenum target, GLuint index, GLuint num, const GLdouble *params);
 
index bd64b57eb98287b9492a96cae55da48ee5869d7c..8ce2ca396411266c45dc3fc6d5bf37897c9a418e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.3
+ * Version:  7.0.3
  *
  * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
@@ -46,9 +46,6 @@
 #include "shader/slang/slang_library_noise.h"
 
 
-/* See comments below for info about this */
-#define LAMBDA_ZERO 1
-
 /* debug predicate */
 #define DEBUG_PROG 0
 
@@ -92,6 +89,7 @@ get_register_pointer(const struct prog_src_register *source,
       else {
          const struct gl_program_parameter_list *params;
          ASSERT(source->File == PROGRAM_LOCAL_PARAM ||
+                source->File == PROGRAM_CONSTANT ||
                 source->File == PROGRAM_STATE_VAR);
          params = machine->CurProgram->Parameters;
          if (reg < 0 || reg >= params->NumParameters)
@@ -302,6 +300,36 @@ fetch_vector1(const struct prog_src_register *source,
 }
 
 
+/**
+ * Fetch texel from texture.  Use partial derivatives when possible.
+ */
+static INLINE void
+fetch_texel(GLcontext *ctx,
+            const struct gl_program_machine *machine,
+            const struct prog_instruction *inst,
+            const GLfloat texcoord[4], GLfloat lodBias,
+            GLfloat color[4])
+{
+   const GLuint unit = machine->Samplers[inst->TexSrcUnit];
+
+   /* Note: we only have the right derivatives for fragment input attribs.
+    */
+   if (machine->NumDeriv > 0 &&
+       inst->SrcReg[0].File == PROGRAM_INPUT &&
+       inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0 + inst->TexSrcUnit) {
+      /* simple texture fetch for which we should have derivatives */
+      GLuint attr = inst->SrcReg[0].Index;
+      machine->FetchTexelDeriv(ctx, texcoord,
+                               machine->DerivX[attr],
+                               machine->DerivY[attr],
+                               lodBias, unit, color);
+   }
+   else {
+      machine->FetchTexelLod(ctx, texcoord, lodBias, unit, color);
+   }
+}
+
+
 /**
  * Test value against zero and return GT, LT, EQ or UN if NaN.
  */
@@ -1306,33 +1334,18 @@ _mesa_execute_program(GLcontext * ctx,
          }
          break;
       case OPCODE_TEX:         /* Both ARB and NV frag prog */
-         /* Texel lookup */
+         /* Simple texel lookup */
          {
-            /* Note: only use the precomputed lambda value when we're
-             * sampling texture unit [K] with texcoord[K].
-             * Otherwise, the lambda value may have no relation to the
-             * instruction's texcoord or texture image.  Using the wrong
-             * lambda is usually bad news.
-             * The rest of the time, just use zero (until we get a more
-             * sophisticated way of computing lambda).
-             */
-            const GLuint unit = machine->Samplers[inst->TexSrcUnit];
-            GLfloat coord[4], color[4], lambda;
-#if 0
-            if (inst->SrcReg[0].File == PROGRAM_INPUT &&
-                inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0 + unit)
-               lambda = span->array->lambda[unit][column];
-            else
-#endif
-               lambda = 0.0;
-            fetch_vector4(&inst->SrcReg[0], machine, coord);
-            machine->FetchTexelLod(ctx, coord, lambda, unit, color);
+            GLfloat texcoord[4], color[4];
+            fetch_vector4(&inst->SrcReg[0], machine, texcoord);
+
+            fetch_texel(ctx, machine, inst, texcoord, 0.0, color);
+
             if (DEBUG_PROG) {
-               printf("TEX (%g, %g, %g, %g) = texture[%d][%g, %g, %g, %g], "
-                      "lod %f\n",
+               printf("TEX (%g, %g, %g, %g) = texture[%d][%g, %g, %g, %g]\n",
                       color[0], color[1], color[2], color[3],
-                      unit,
-                      coord[0], coord[1], coord[2], coord[3], lambda);
+                      inst->TexSrcUnit,
+                      texcoord[0], texcoord[1], texcoord[2], texcoord[3]);
             }
             store_vector4(inst, machine, color);
          }
@@ -1342,21 +1355,18 @@ _mesa_execute_program(GLcontext * ctx,
          {
             const struct gl_texture_unit *texUnit
                = &ctx->Texture.Unit[inst->TexSrcUnit];
-            GLfloat coord[4], color[4], lambda, bias;
-#if 0
-            if (inst->SrcReg[0].File == PROGRAM_INPUT &&
-                inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0 + inst->TexSrcUnit)
-               lambda = span->array->lambda[inst->TexSrcUnit][column];
-            else
-#endif
-               lambda = 0.0;
-            fetch_vector4(&inst->SrcReg[0], machine, coord);
-            /* coord[3] is the bias to add to lambda */
-            bias = texUnit->LodBias + coord[3];
-            if (texUnit->_Current)
-               bias += texUnit->_Current->LodBias;
-            machine->FetchTexelLod(ctx, coord, lambda + bias,
-                                   inst->TexSrcUnit, color);
+            GLfloat texcoord[4], color[4], lodBias;
+
+            fetch_vector4(&inst->SrcReg[0], machine, texcoord);
+
+            /* texcoord[3] is the bias to add to lambda */
+            lodBias = texUnit->LodBias + texcoord[3];
+            if (texUnit->_Current) {
+               lodBias += texUnit->_Current->LodBias;
+            }
+
+            fetch_texel(ctx, machine, inst, texcoord, lodBias, color);
+
             store_vector4(inst, machine, color);
          }
          break;
@@ -1368,6 +1378,7 @@ _mesa_execute_program(GLcontext * ctx,
             fetch_vector4(&inst->SrcReg[1], machine, dtdx);
             fetch_vector4(&inst->SrcReg[2], machine, dtdy);
             machine->FetchTexelDeriv(ctx, texcoord, dtdx, dtdy,
+                                     0.0, /* lodBias */
                                      inst->TexSrcUnit, color);
             store_vector4(inst, machine, color);
          }
@@ -1375,15 +1386,8 @@ _mesa_execute_program(GLcontext * ctx,
       case OPCODE_TXP:         /* GL_ARB_fragment_program only */
          /* Texture lookup w/ projective divide */
          {
-            const GLuint unit = machine->Samplers[inst->TexSrcUnit];
-            GLfloat texcoord[4], color[4], lambda;
-#if 0
-            if (inst->SrcReg[0].File == PROGRAM_INPUT &&
-                inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0 + inst->TexSrcUnit)
-               lambda = span->array->lambda[unit][column];
-            else
-#endif
-               lambda = 0.0;
+            GLfloat texcoord[4], color[4];
+
             fetch_vector4(&inst->SrcReg[0], machine, texcoord);
             /* Not so sure about this test - if texcoord[3] is
              * zero, we'd probably be fine except for an ASSERT in
@@ -1394,21 +1398,19 @@ _mesa_execute_program(GLcontext * ctx,
                texcoord[1] /= texcoord[3];
                texcoord[2] /= texcoord[3];
             }
-            machine->FetchTexelLod(ctx, texcoord, lambda, unit, color);
+
+            fetch_texel(ctx, machine, inst, texcoord, 0.0, color);
+
             store_vector4(inst, machine, color);
          }
          break;
       case OPCODE_TXP_NV:      /* GL_NV_fragment_program only */
-         /* Texture lookup w/ projective divide */
+         /* Texture lookup w/ projective divide, as above, but do not
+          * do the divide by w if sampling from a cube map.
+          */
          {
-            GLfloat texcoord[4], color[4], lambda;
-#if 0
-            if (inst->SrcReg[0].File == PROGRAM_INPUT &&
-                inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0 + inst->TexSrcUnit)
-               lambda = span->array->lambda[inst->TexSrcUnit][column];
-            else
-#endif
-               lambda = 0.0;
+            GLfloat texcoord[4], color[4];
+
             fetch_vector4(&inst->SrcReg[0], machine, texcoord);
             if (inst->TexSrcTarget != TEXTURE_CUBE_INDEX &&
                 texcoord[3] != 0.0) {
@@ -1416,8 +1418,9 @@ _mesa_execute_program(GLcontext * ctx,
                texcoord[1] /= texcoord[3];
                texcoord[2] /= texcoord[3];
             }
-            machine->FetchTexelLod(ctx, texcoord, lambda,
-                                   inst->TexSrcUnit, color);
+
+            fetch_texel(ctx, machine, inst, texcoord, 0.0, color);
+
             store_vector4(inst, machine, color);
          }
          break;
@@ -1517,10 +1520,9 @@ _mesa_execute_program(GLcontext * ctx,
       case OPCODE_END:
          return GL_TRUE;
       default:
-         _mesa_problem(ctx, "Bad opcode %d in _mesa_exec_fragment_program",
+         _mesa_problem(ctx, "Bad opcode %d in _mesa_execute_program",
                        inst->Opcode);
          return GL_TRUE;        /* return value doesn't matter */
-
       }
 
       numExec++;
index af77d4278bb6bebd8e4230825515664925c2daff..18b13e11a41d02eb3e33b6347e929f8c770d9a3c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.3
+ * Version:  7.0.3
  *
  * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
@@ -32,6 +32,7 @@ typedef void (*FetchTexelLodFunc)(GLcontext *ctx, const GLfloat texcoord[4],
 typedef void (*FetchTexelDerivFunc)(GLcontext *ctx, const GLfloat texcoord[4],
                                     const GLfloat texdx[4],
                                     const GLfloat texdy[4],
+                                    GLfloat lodBias,
                                     GLuint unit, GLfloat color[4]);
 
 
index 4eb7313bec1b9eea3dbe9d3698674c10b12a3fdc..152bd79f695643c82f25342cce5cef8fa65d9836 100644 (file)
@@ -40,8 +40,7 @@
 struct gl_program_parameter_list *
 _mesa_new_parameter_list(void)
 {
-   return (struct gl_program_parameter_list *)
-      _mesa_calloc(sizeof(struct gl_program_parameter_list));
+   return CALLOC_STRUCT(gl_program_parameter_list);
 }
 
 
@@ -284,25 +283,31 @@ _mesa_add_uniform(struct gl_program_parameter_list *paramList,
  * \param name  uniform's name
  * \param datatype  GL_SAMPLER_2D, GL_SAMPLER_2D_RECT_ARB, etc.
  * \param index  the sampler number (as seen in TEX instructions)
+ * \return  sampler index (starting at zero) or -1 if error
  */
 GLint
 _mesa_add_sampler(struct gl_program_parameter_list *paramList,
-                  const char *name, GLenum datatype, GLuint index)
+                  const char *name, GLenum datatype)
 {
    GLint i = _mesa_lookup_parameter_index(paramList, -1, name);
    if (i >= 0 && paramList->Parameters[i].Type == PROGRAM_SAMPLER) {
       ASSERT(paramList->Parameters[i].Size == 1);
       ASSERT(paramList->Parameters[i].DataType == datatype);
-      ASSERT(paramList->ParameterValues[i][0] == index);
       /* already in list */
-      return i;
+      return (GLint) paramList->ParameterValues[i][0];
    }
    else {
-      GLfloat indexf = index;
       const GLint size = 1; /* a sampler is basically a texture unit number */
-      i = _mesa_add_parameter(paramList, PROGRAM_SAMPLER, name,
-                              size, datatype, &indexf, NULL);
-      return i;
+      GLfloat value;
+      GLint numSamplers = 0;
+      for (i = 0; i < paramList->NumParameters; i++) {
+         if (paramList->Parameters[i].Type == PROGRAM_SAMPLER)
+            numSamplers++;
+      }
+      value = (GLfloat) numSamplers;
+      (void) _mesa_add_parameter(paramList, PROGRAM_SAMPLER, name,
+                                 size, datatype, &value, NULL);
+      return numSamplers;
    }
 }
 
@@ -603,6 +608,8 @@ _mesa_clone_parameter_list(const struct gl_program_parameter_list *list)
       }
    }
 
+   clone->StateFlags = list->StateFlags;
+
    return clone;
 }
 
index d6cc03448c87aaff932fa0e905fae4bdfb879256..105f6f24debe9909d599aef957fac2af55acd2b1 100644 (file)
@@ -114,7 +114,7 @@ _mesa_add_uniform(struct gl_program_parameter_list *paramList,
 
 extern GLint
 _mesa_add_sampler(struct gl_program_parameter_list *paramList,
-                  const char *name, GLenum datatype, GLuint index);
+                  const char *name, GLenum datatype);
 
 extern GLint
 _mesa_add_varying(struct gl_program_parameter_list *paramList,
index 1145f0c7a42abff59e2e59c139838842ad8c029a..1c35ce3fecf35ecbd5b9e1261b02080507978a45 100644 (file)
@@ -99,7 +99,23 @@ arb_input_attrib_string(GLint index, GLenum progType)
       "vertex.texcoord[4]",
       "vertex.texcoord[5]",
       "vertex.texcoord[6]",
-      "vertex.texcoord[7]"
+      "vertex.texcoord[7]",
+      "vertex.attrib[0]",
+      "vertex.attrib[1]",
+      "vertex.attrib[2]",
+      "vertex.attrib[3]",
+      "vertex.attrib[4]",
+      "vertex.attrib[5]",
+      "vertex.attrib[6]",
+      "vertex.attrib[7]",
+      "vertex.attrib[8]",
+      "vertex.attrib[9]",
+      "vertex.attrib[10]",
+      "vertex.attrib[11]",
+      "vertex.attrib[12]",
+      "vertex.attrib[13]",
+      "vertex.attrib[14]",
+      "vertex.attrib[15]"
    };
    const char *fragAttribs[] = {
       "fragment.position",
@@ -751,9 +767,9 @@ _mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog)
       _mesa_printf("%d ", prog->SamplerUnits[i]);
    }
    _mesa_printf("]\n");
-       
+
    _mesa_load_state_parameters(ctx, prog->Parameters);
-                       
+
 #if 0
    _mesa_printf("Local Params:\n");
    for (i = 0; i < MAX_PROGRAM_LOCAL_PARAMS; i++){
index eee4d2d9259f64d5ddf0d8675d169f97b5a5412b..ba3c9884456c75f69eaa2107af93021effc4f0e0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  7.0
+ * Version:  7.1
  *
  * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
@@ -181,7 +181,7 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
                      ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT+face][i];
                }
                /* [3] = material alpha */
-               value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE+face][3];
+               value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT+face][3];
                return;
             case STATE_DIFFUSE:
                for (i = 0; i < 3; i++) {
@@ -197,7 +197,7 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
                      ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SPECULAR+face][i];
                }
                /* [3] = material alpha */
-               value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE+face][3];
+               value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SPECULAR+face][3];
                return;
             default:
                _mesa_problem(ctx, "Invalid lightprod state in fetch_state");
@@ -354,7 +354,7 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
       value[0] = ctx->Viewport.Near;                     /* near       */
       value[1] = ctx->Viewport.Far;                      /* far        */
       value[2] = ctx->Viewport.Far - ctx->Viewport.Near; /* far - near */
-      value[3] = 0;
+      value[3] = 1.0;
       return;
    case STATE_FRAGMENT_PROGRAM:
       {
index 9a23c5d7d31fc1698e3a49bb57cc52ea46ea5e8a..a0817a91ec0ccfaed95f6cb7a2deaec4fcd2d553 100644 (file)
@@ -116,8 +116,6 @@ _mesa_free_program_data(GLcontext *ctx)
 }
 
 
-
-
 /**
  * Set the vertex/fragment program error state (position and error string).
  * This is generally called from within the parsers.
@@ -272,6 +270,7 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog)
 {
    (void) ctx;
    ASSERT(prog);
+   ASSERT(prog->RefCount==0);
 
    if (prog == &_mesa_DummyProgram)
       return;
@@ -391,7 +390,7 @@ _mesa_clone_program(GLcontext *ctx, const struct gl_program *prog)
    clone->Format = prog->Format;
    clone->Instructions = _mesa_alloc_instructions(prog->NumInstructions);
    if (!clone->Instructions) {
-      ctx->Driver.DeleteProgram(ctx, clone);
+      _mesa_reference_program(ctx, &clone, NULL);
       return NULL;
    }
    _mesa_copy_instructions(clone->Instructions, prog->Instructions,
@@ -603,7 +602,7 @@ _mesa_combine_programs(GLcontext *ctx,
       if ((progA->OutputsWritten & (1 << FRAG_RESULT_COLR)) &&
           (progB->InputsRead & (1 << FRAG_ATTRIB_COL0))) {
          GLint tempReg = _mesa_find_free_register(newProg, PROGRAM_TEMPORARY);
-         if (!tempReg) {
+         if (tempReg < 0) {
             _mesa_problem(ctx, "No free temp regs found in "
                           "_mesa_combine_programs(), using 31");
             tempReg = 31;
index f12fa28d97bb4d21407bed38bcec429a4918a74e..24ab7568d6c60e35b055280a3a56a0dfbb9a8491 100644 (file)
@@ -75,21 +75,8 @@ void
 _mesa_clear_shader_program_data(GLcontext *ctx,
                                 struct gl_shader_program *shProg)
 {
-   if (shProg->VertexProgram) {
-      /* Set ptr to NULL since the param list is shared with the
-       * original/unlinked program.
-       */
-      shProg->VertexProgram->Base.Parameters = NULL;
-      _mesa_reference_vertprog(ctx, &shProg->VertexProgram, NULL);
-   }
-
-   if (shProg->FragmentProgram) {
-      /* Set ptr to NULL since the param list is shared with the
-       * original/unlinked program.
-       */
-      shProg->FragmentProgram->Base.Parameters = NULL;
-      _mesa_reference_fragprog(ctx, &shProg->FragmentProgram, NULL);
-   }
+   _mesa_reference_vertprog(ctx, &shProg->VertexProgram, NULL);
+   _mesa_reference_fragprog(ctx, &shProg->FragmentProgram, NULL);
 
    if (shProg->Uniforms) {
       _mesa_free_uniform_list(shProg->Uniforms);
@@ -126,10 +113,17 @@ _mesa_free_shader_program_data(GLcontext *ctx,
    for (i = 0; i < shProg->NumShaders; i++) {
       _mesa_reference_shader(ctx, &shProg->Shaders[i], NULL);
    }
+   shProg->NumShaders = 0;
+
    if (shProg->Shaders) {
       _mesa_free(shProg->Shaders);
       shProg->Shaders = NULL;
    }
+
+   if (shProg->InfoLog) {
+      _mesa_free(shProg->InfoLog);
+      shProg->InfoLog = NULL;
+   }
 }
 
 
@@ -140,10 +134,7 @@ void
 _mesa_free_shader_program(GLcontext *ctx, struct gl_shader_program *shProg)
 {
    _mesa_free_shader_program_data(ctx, shProg);
-   if (shProg->Shaders) {
-      _mesa_free(shProg->Shaders);
-      shProg->Shaders = NULL;
-   }
+
    _mesa_free(shProg);
 }
 
@@ -172,8 +163,10 @@ _mesa_reference_shader_program(GLcontext *ctx,
 
       ASSERT(old->RefCount > 0);
       old->RefCount--;
-      /*printf("SHPROG DECR %p (%d) to %d\n",
-        (void*) old, old->Name, old->RefCount);*/
+#if 0
+      printf("ShaderProgram %p ID=%u  RefCount-- to %d\n",
+             (void *) old, old->Name, old->RefCount);
+#endif
       deleteFlag = (old->RefCount == 0);
 
       if (deleteFlag) {
@@ -187,8 +180,10 @@ _mesa_reference_shader_program(GLcontext *ctx,
 
    if (shProg) {
       shProg->RefCount++;
-      /*printf("SHPROG INCR %p (%d) to %d\n",
-        (void*) shProg, shProg->Name, shProg->RefCount);*/
+#if 0
+      printf("ShaderProgram %p ID=%u  RefCount++ to %d\n",
+             (void *) shProg, shProg->Name, shProg->RefCount);
+#endif
       *ptr = shProg;
    }
 }
@@ -243,10 +238,8 @@ _mesa_free_shader(GLcontext *ctx, struct gl_shader *sh)
       _mesa_free((void *) sh->Source);
    if (sh->InfoLog)
       _mesa_free(sh->InfoLog);
-   for (i = 0; i < sh->NumPrograms; i++) {
-      assert(sh->Programs[i]);
-      ctx->Driver.DeleteProgram(ctx, sh->Programs[i]);
-   }
+   for (i = 0; i < sh->NumPrograms; i++)
+      _mesa_reference_program(ctx, &sh->Programs[i], NULL);
    if (sh->Programs)
       _mesa_free(sh->Programs);
    _mesa_free(sh);
@@ -376,7 +369,7 @@ _mesa_attach_shader(GLcontext *ctx, GLuint program, GLuint shader)
    struct gl_shader_program *shProg
       = _mesa_lookup_shader_program(ctx, program);
    struct gl_shader *sh = _mesa_lookup_shader(ctx, shader);
-   const GLuint n = shProg->NumShaders;
+   GLuint n;
    GLuint i;
 
    if (!shProg || !sh) {
@@ -385,6 +378,8 @@ _mesa_attach_shader(GLcontext *ctx, GLuint program, GLuint shader)
       return;
    }
 
+   n = shProg->NumShaders;
+
    for (i = 0; i < n; i++) {
       if (shProg->Shaders[i] == sh) {
          /* already attached */
@@ -577,7 +572,7 @@ _mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader)
 {
    struct gl_shader_program *shProg
       = _mesa_lookup_shader_program(ctx, program);
-   const GLuint n = shProg->NumShaders;
+   GLuint n;
    GLuint i, j;
 
    if (!shProg) {
@@ -586,6 +581,8 @@ _mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader)
       return;
    }
 
+   n = shProg->NumShaders;
+
    for (i = 0; i < n; i++) {
       if (shProg->Shaders[i]->Name == shader) {
          /* found it */
@@ -897,7 +894,7 @@ _mesa_get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
    if (shProg) {
       if (location < shProg->Uniforms->NumUniforms) {
          GLint progPos, i;
-         const struct gl_program *prog;
+         const struct gl_program *prog = NULL;
 
          progPos = shProg->Uniforms->Uniforms[location].VertPos;
          if (progPos >= 0) {
@@ -910,8 +907,11 @@ _mesa_get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
             }
          }
 
-         for (i = 0; i < prog->Parameters->Parameters[progPos].Size; i++) {
-            params[i] = prog->Parameters->ParameterValues[progPos][i];
+         ASSERT(prog);
+         if (prog) {
+            for (i = 0; i < prog->Parameters->Parameters[progPos].Size; i++) {
+               params[i] = prog->Parameters->ParameterValues[progPos][i];
+            }
          }
       }
       else {
@@ -1008,6 +1008,8 @@ _mesa_link_program(GLcontext *ctx, GLuint program)
       return;
    }
 
+   FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+
    _slang_link(ctx, program, shProg);
 }
 
@@ -1153,6 +1155,10 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
       return;
    }
 
+   if (location == -1)
+      return;   /* The standard specifies this as a no-op */
+
+
    if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) {
       _mesa_error(ctx, GL_INVALID_VALUE, "glUniform(location)");
       return;
@@ -1248,11 +1254,16 @@ _mesa_uniform_matrix(GLcontext *ctx, GLint cols, GLint rows,
                      GLboolean transpose, const GLfloat *values)
 {
    struct gl_shader_program *shProg = ctx->Shader.CurrentProgram;
+
    if (!shProg || !shProg->LinkStatus) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
          "glUniformMatrix(program not linked)");
       return;
    }
+
+   if (location == -1)
+      return;   /* The standard specifies this as a no-op */
+
    if (location < 0 || location >= shProg->Uniforms->NumUniforms) {
       _mesa_error(ctx, GL_INVALID_VALUE, "glUniformMatrix(location)");
       return;
index dc67b590886d1ccc2f0efeeda10ff9c4c78f36ae..0e03fac2ee176ad8c296acf752785b1c3bac8869 100644 (file)
@@ -17,7 +17,7 @@ LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
 default: syntax builtin
 
 clean:
-       rm -f syn_to_c gc_to_bin *_syn.h *_gc.h
+       -rm -f syn_to_c gc_to_bin *_syn.h *_gc.h
 
 syntax: slang_pp_directives_syn.h slang_pp_expression_syn.h slang_shader_syn.h slang_pp_version_syn.h
 
index 45cf1c6fd095150134534a9bf4dc8e43bb5dfa3e..26080cf26ca689dea62e2e5388125d29af7645a7 100644 (file)
@@ -343,6 +343,7 @@ vec4 asin(const vec4 v)
    __retVal.x = asin(v.x);
    __retVal.y = asin(v.y);
    __retVal.z = asin(v.z);
+   __retVal.w = asin(v.w);
 }
 
 float acos(const float x)
index a896c5a287e58f4165dd9bf7fb4d4118173add31..c8d1ffc174852fe522ac5349571bb40de4e3e5ee 100644 (file)
 0,1,0,12,0,97,115,105,110,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,
 115,105,110,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,115,105,
 110,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,115,105,110,0,
-18,118,0,59,122,0,0,0,20,0,0,1,0,9,0,97,99,111,115,0,1,1,0,9,120,0,0,0,1,3,2,1,9,1,104,97,108,102,
-80,105,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,48,0,53,0,0,48,0,0,9,18,95,95,114,101,116,86,97,108,
-0,18,104,97,108,102,80,105,0,58,97,115,105,110,0,18,120,0,0,0,47,20,0,0,1,0,10,0,97,99,111,115,0,1,
-1,0,10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,18,118,0,59,120,
-0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,20,
-0,0,1,0,11,0,97,99,111,115,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,
-97,99,111,115,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,
-111,115,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,99,111,115,
-0,18,118,0,59,122,0,0,0,20,0,0,1,0,12,0,97,99,111,115,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,
-116,86,97,108,0,59,120,0,58,97,99,111,115,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,
-97,108,0,59,121,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,
-59,122,0,58,97,99,111,115,0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,
-58,97,99,111,115,0,18,118,0,59,119,0,0,0,20,0,0,1,0,9,0,97,116,97,110,0,1,1,0,9,120,0,0,0,1,9,18,
-95,95,114,101,116,86,97,108,0,58,97,115,105,110,0,18,120,0,58,105,110,118,101,114,115,101,115,113,
-114,116,0,18,120,0,18,120,0,48,17,49,0,48,0,0,46,0,0,48,0,0,20,0,0,1,0,10,0,97,116,97,110,0,1,1,0,
-10,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,
-110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,
-121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,0,1,0,11,0,97,116,97,
-110,0,1,1,0,11,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,
-58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,
-97,108,0,59,121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,9,18,95,
-95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,122,0,
-0,0,20,0,0,1,0,12,0,97,116,97,110,0,1,1,0,12,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,
-101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,
-0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,
-0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,121,95,111,
-118,101,114,95,120,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,
-110,0,18,121,95,111,118,101,114,95,120,0,59,119,0,0,0,20,0,0,1,0,9,0,97,116,97,110,0,1,1,0,9,121,0,
-0,1,1,0,9,120,0,0,0,1,10,18,120,0,17,48,0,48,0,0,38,0,8,17,48,0,48,0,0,0,9,14,0,3,2,0,9,1,122,0,2,
-58,97,116,97,110,0,18,121,0,18,120,0,49,0,0,0,0,10,18,120,0,17,48,0,48,0,0,40,0,2,10,18,121,0,17,
-48,0,48,0,0,40,0,8,18,122,0,17,51,0,49,52,49,53,57,51,0,0,47,0,9,14,0,8,18,122,0,17,51,0,49,52,49,
-53,57,51,0,0,46,0,0,9,14,0,8,18,122,0,0,0,1,0,10,0,97,116,97,110,0,1,1,0,10,117,0,0,1,1,0,10,118,0,
-0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,
-59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,
-0,18,118,0,59,121,0,0,0,20,0,0,1,0,11,0,97,116,97,110,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,9,18,
-95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,
-0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0,
-59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,117,0,59,122,0,
-0,18,118,0,59,122,0,0,0,20,0,0,1,0,12,0,97,116,97,110,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,9,18,
-95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,
-0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0,
+18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,115,105,110,0,18,118,
+0,59,119,0,0,0,20,0,0,1,0,9,0,97,99,111,115,0,1,1,0,9,120,0,0,0,1,3,2,1,9,1,104,97,108,102,80,105,
+0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,48,0,53,0,0,48,0,0,9,18,95,95,114,101,116,86,97,108,0,18,
+104,97,108,102,80,105,0,58,97,115,105,110,0,18,120,0,0,0,47,20,0,0,1,0,10,0,97,99,111,115,0,1,1,0,
+10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,18,118,0,59,120,0,0,
+0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,20,0,0,
+1,0,11,0,97,99,111,115,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,
+111,115,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,
+0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,99,111,115,0,18,118,
+0,59,122,0,0,0,20,0,0,1,0,12,0,97,99,111,115,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,
+108,0,59,120,0,58,97,99,111,115,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,
+121,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,
+97,99,111,115,0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,99,
+111,115,0,18,118,0,59,119,0,0,0,20,0,0,1,0,9,0,97,116,97,110,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,
+101,116,86,97,108,0,58,97,115,105,110,0,18,120,0,58,105,110,118,101,114,115,101,115,113,114,116,0,
+18,120,0,18,120,0,48,17,49,0,48,0,0,46,0,0,48,0,0,20,0,0,1,0,10,0,97,116,97,110,0,1,1,0,10,121,95,
+111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,
+121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,
+97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,0,1,0,11,0,97,116,97,110,0,1,
+1,0,11,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,
+97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,
+59,121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,9,18,95,95,114,
+101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,122,0,0,0,20,
+0,0,1,0,12,0,97,116,97,110,0,1,1,0,12,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,
+86,97,108,0,59,120,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,
+95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,
+121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,121,95,111,118,
+101,114,95,120,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,
+18,121,95,111,118,101,114,95,120,0,59,119,0,0,0,20,0,0,1,0,9,0,97,116,97,110,0,1,1,0,9,121,0,0,1,1,
+0,9,120,0,0,0,1,10,18,120,0,17,48,0,48,0,0,38,0,8,17,48,0,48,0,0,0,9,14,0,3,2,0,9,1,122,0,2,58,97,
+116,97,110,0,18,121,0,18,120,0,49,0,0,0,0,10,18,120,0,17,48,0,48,0,0,40,0,2,10,18,121,0,17,48,0,48,
+0,0,40,0,8,18,122,0,17,51,0,49,52,49,53,57,51,0,0,47,0,9,14,0,8,18,122,0,17,51,0,49,52,49,53,57,51,
+0,0,46,0,0,9,14,0,8,18,122,0,0,0,1,0,10,0,97,116,97,110,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,9,
+18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,
+0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,
+0,59,121,0,0,0,20,0,0,1,0,11,0,97,116,97,110,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,9,18,95,95,
+114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,
+9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0,59,121,
+0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18,
+118,0,59,122,0,0,0,20,0,0,1,0,12,0,97,116,97,110,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,9,18,95,
+95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,
+20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0,
 59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,117,0,59,122,0,
 0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,18,117,
 0,59,119,0,0,18,118,0,59,119,0,0,0,20,0,0,1,0,9,0,112,111,119,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,
index 2e7ebc347a69c1a39fecb520e82c321959a3161e..ffa57f74c2772cff98d169e6d31f0fc486f91d85 100644 (file)
@@ -1545,15 +1545,8 @@ mat2 __operator - (const mat2 m, const mat2 n)
 
 mat2 __operator * (const mat2 m, const mat2 n)
 {
-   vec2 mRow0, mRow1;
-   mRow0.x = m[0].x;
-   mRow0.y = m[1].x;
-   mRow1.x = m[0].y;
-   mRow1.y = m[1].y;
-   __retVal[0].x = dot(mRow0, n[0]);
-   __retVal[1].x = dot(mRow0, n[1]);
-   __retVal[0].y = dot(mRow1, n[0]);
-   __retVal[1].y = dot(mRow1, n[1]);
+   __retVal[0] = m[0] * n[0].xx + m[1] * n[0].yy;
+   __retVal[1] = m[0] * n[1].xx + m[1] * n[1].yy;
 }
 
 mat2 __operator / (const mat2 m, const mat2 n)
@@ -1581,34 +1574,9 @@ mat3 __operator - (const mat3 m, const mat3 n)
 
 mat3 __operator * (const mat3 m, const mat3 n)
 {
-   // sub-blocks to reduce register usage
-   {
-      vec3 mRow0;
-      mRow0.x = m[0].x;
-      mRow0.y = m[1].x;
-      mRow0.z = m[2].x;
-      __retVal[0].x = dot(mRow0, n[0]);
-      __retVal[1].x = dot(mRow0, n[1]);
-      __retVal[2].x = dot(mRow0, n[2]);
-   }
-   {
-      vec3 mRow1;
-      mRow1.x = m[0].y;
-      mRow1.y = m[1].y;
-      mRow1.z = m[2].y;
-      __retVal[0].y = dot(mRow1, n[0]);
-      __retVal[1].y = dot(mRow1, n[1]);
-      __retVal[2].y = dot(mRow1, n[2]);
-   }
-   {
-      vec3 mRow2;
-      mRow2.x = m[0].z;
-      mRow2.y = m[1].z;
-      mRow2.z = m[2].z;
-      __retVal[0].z = dot(mRow2, n[0]);
-      __retVal[1].z = dot(mRow2, n[1]);
-      __retVal[2].z = dot(mRow2, n[2]);
-   }
+   __retVal[0] = m[0] * n[0].xxx + m[1] * n[0].yyy + m[2] * n[0].zzz;
+   __retVal[1] = m[0] * n[1].xxx + m[1] * n[1].yyy + m[2] * n[1].zzz;
+   __retVal[2] = m[0] * n[2].xxx + m[1] * n[2].yyy + m[2] * n[2].zzz;
 }
 
 mat3 __operator / (const mat3 m, const mat3 n)
@@ -1639,51 +1607,10 @@ mat4 __operator - (const mat4 m, const mat4 n)
 
 mat4 __operator * (const mat4 m, const mat4 n)
 {
-   // sub-blocks to reduce temporary usage
-   {
-      vec4 mRow0;
-      mRow0.x = m[0].x;
-      mRow0.y = m[1].x;
-      mRow0.z = m[2].x;
-      mRow0.w = m[3].x;
-      __retVal[0].x = dot(mRow0, n[0]);
-      __retVal[1].x = dot(mRow0, n[1]);
-      __retVal[2].x = dot(mRow0, n[2]);
-      __retVal[3].x = dot(mRow0, n[3]);
-   }
-   {
-      vec4 mRow1;
-      mRow1.x = m[0].y;
-      mRow1.y = m[1].y;
-      mRow1.z = m[2].y;
-      mRow1.w = m[3].y;
-      __retVal[0].y = dot(mRow1, n[0]);
-      __retVal[1].y = dot(mRow1, n[1]);
-      __retVal[2].y = dot(mRow1, n[2]);
-      __retVal[3].y = dot(mRow1, n[3]);
-   }
-   {
-      vec4 mRow2;
-      mRow2.x = m[0].z;
-      mRow2.y = m[1].z;
-      mRow2.z = m[2].z;
-      mRow2.w = m[3].z;
-      __retVal[0].z = dot(mRow2, n[0]);
-      __retVal[1].z = dot(mRow2, n[1]);
-      __retVal[2].z = dot(mRow2, n[2]);
-      __retVal[3].z = dot(mRow2, n[3]);
-   }
-   {
-      vec4 mRow3;
-      mRow3.x = m[0].w;
-      mRow3.y = m[1].w;
-      mRow3.z = m[2].w;
-      mRow3.w = m[3].w;
-      __retVal[0].w = dot(mRow3, n[0]);
-      __retVal[1].w = dot(mRow3, n[1]);
-      __retVal[2].w = dot(mRow3, n[2]);
-      __retVal[3].w = dot(mRow3, n[3]);
-   }
+   __retVal[0] = m[0] * n[0].xxxx + m[1] * n[0].yyyy + m[2] * n[0].zzzz + m[3] * n[0].wwww;
+   __retVal[1] = m[0] * n[1].xxxx + m[1] * n[1].yyyy + m[2] * n[1].zzzz + m[3] * n[1].wwww;
+   __retVal[2] = m[0] * n[2].xxxx + m[1] * n[2].yyyy + m[2] * n[2].zzzz + m[3] * n[2].wwww;
+   __retVal[3] = m[0] * n[3].xxxx + m[1] * n[3].yyyy + m[2] * n[3].zzzz + m[3] * n[3].wwww;
 }
 
 mat4 __operator / (const mat4 m, const mat4 n)
@@ -1877,13 +1804,8 @@ mat4 __operator / (const mat4 m, const float b)
 
 vec2 __operator * (const mat2 m, const vec2 v)
 {
-   vec2 r0, r1;
-   r0.x = m[0].x;
-   r0.y = m[1].x;
-   r1.x = m[0].y;
-   r1.y = m[1].y;
-   __retVal.x = dot(r0, v);
-   __retVal.y = dot(r1, v);
+   __retVal = m[0] * v.xx
+            + m[1] * v.yy;
 }
 
 vec2 __operator * (const vec2 v, const mat2 m)
@@ -1894,27 +1816,9 @@ vec2 __operator * (const vec2 v, const mat2 m)
 
 vec3 __operator * (const mat3 m, const vec3 v)
 {
-   {
-      vec3 r0;
-      r0.x = m[0].x;
-      r0.y = m[1].x;
-      r0.z = m[2].x;
-      __asm vec3_dot __retVal.x, r0, v;
-   }
-   {
-      vec3 r1;
-      r1.x = m[0].y;
-      r1.y = m[1].y;
-      r1.z = m[2].y;
-      __asm vec3_dot __retVal.y, r1, v;
-   }
-   {
-      vec3 r2;
-      r2.x = m[0].z;
-      r2.y = m[1].z;
-      r2.z = m[2].z;
-      __asm vec3_dot __retVal.z, r2, v;
-   }
+   __retVal = m[0] * v.xxx
+            + m[1] * v.yyy
+            + m[2] * v.zzz;
 }
 
 vec3 __operator * (const vec3 v, const mat3 m)
@@ -1926,44 +1830,14 @@ vec3 __operator * (const vec3 v, const mat3 m)
 
 vec4 __operator * (const mat4 m, const vec4 v)
 {
-   // extract rows, then do dot product
-   {
-      vec4 r0;
-      r0.x = m[0].x;
-      r0.y = m[1].x;
-      r0.z = m[2].x;
-      r0.w = m[3].x;
-      __asm vec4_dot __retVal.x, r0, v;
-   }
-   {
-      vec4 r1;
-      r1.x = m[0].y;
-      r1.y = m[1].y;
-      r1.z = m[2].y;
-      r1.w = m[3].y;
-      __asm vec4_dot __retVal.y, r1, v;
-   }
-   {
-      vec4 r2;
-      r2.x = m[0].z;
-      r2.y = m[1].z;
-      r2.z = m[2].z;
-      r2.w = m[3].z;
-      __asm vec4_dot __retVal.z, r2, v;
-   }
-   {
-      vec4 r3;
-      r3.x = m[0].w;
-      r3.y = m[1].w;
-      r3.z = m[2].w;
-      r3.w = m[3].w;
-      __asm vec4_dot __retVal.w, r3, v;
-   }
+   __retVal = m[0] * v.xxxx
+            + m[1] * v.yyyy
+            + m[2] * v.zzzz
+            + m[3] * v.wwww;
 }
 
 vec4 __operator * (const vec4 v, const mat4 m)
 {
-   //mm
    __retVal.x = dot(v, m[0]);
    __retVal.y = dot(v, m[1]);
    __retVal.z = dot(v, m[2]);
index f2b4fd6464bf38b84908f6b8becdfcaaa37b8bae..1604d5a034a52b29a1529ec0df9be7f85b1df84f 100644 (file)
 97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,0,1,0,13,2,27,1,1,0,
 13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,
 57,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,
-49,0,57,18,110,0,16,10,49,0,57,47,20,0,0,1,0,13,2,21,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,3,2,0,
-10,1,109,82,111,119,48,0,0,1,1,109,82,111,119,49,0,0,0,9,18,109,82,111,119,48,0,59,120,0,18,109,0,
-16,8,48,0,57,59,120,0,20,0,9,18,109,82,111,119,48,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,20,0,
-9,18,109,82,111,119,49,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,20,0,9,18,109,82,111,119,49,0,59,
-121,0,18,109,0,16,10,49,0,57,59,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,
-0,58,100,111,116,0,18,109,82,111,119,48,0,0,18,110,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,
-86,97,108,0,16,10,49,0,57,59,120,0,58,100,111,116,0,18,109,82,111,119,48,0,0,18,110,0,16,10,49,0,
-57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,58,100,111,116,0,18,109,82,
-111,119,49,0,0,18,110,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,
-121,0,58,100,111,116,0,18,109,82,111,119,49,0,0,18,110,0,16,10,49,0,57,0,0,20,0,0,1,0,13,2,22,1,1,
-0,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,
+49,0,57,18,110,0,16,10,49,0,57,47,20,0,0,1,0,13,2,21,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,95,
+95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,59,120,120,0,
+48,18,109,0,16,10,49,0,57,18,110,0,16,8,48,0,57,59,121,121,0,48,46,20,0,9,18,95,95,114,101,116,86,
+97,108,0,16,10,49,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,49,0,57,59,120,120,0,48,18,109,0,16,10,
+49,0,57,18,110,0,16,10,49,0,57,59,121,121,0,48,46,20,0,0,1,0,13,2,22,1,1,0,13,109,0,0,1,1,0,13,110,
+0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,
+57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,
+49,0,57,49,20,0,0,1,0,14,2,26,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,
+108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,
+97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,9,18,95,95,114,101,
+116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,20,0,0,1,0,14,2,27,
+1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,
+8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,
+16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,
+109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,20,0,0,1,0,14,2,21,1,1,0,14,109,0,0,1,1,0,14,110,0,0,
+0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,59,
+120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,8,48,0,57,59,121,121,121,0,48,46,18,109,0,16,
+10,50,0,57,18,110,0,16,8,48,0,57,59,122,122,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,
+10,49,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,49,0,57,59,120,120,120,0,48,18,109,0,16,10,49,0,57,
+18,110,0,16,10,49,0,57,59,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,10,49,0,57,59,122,
+122,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,8,48,0,57,18,110,
+0,16,10,50,0,57,59,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,10,50,0,57,59,121,121,121,0,
+48,46,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,59,122,122,122,0,48,46,20,0,0,1,0,14,2,22,1,1,
+0,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,
 0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,
-49,0,57,18,110,0,16,10,49,0,57,49,20,0,0,1,0,14,2,26,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,
-95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,
-95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,
-9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,
-20,0,0,1,0,14,2,27,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,
-48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,
-10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,
-0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,20,0,0,1,0,14,2,21,1,1,0,14,109,0,
-0,1,1,0,14,110,0,0,0,1,2,3,2,0,11,1,109,82,111,119,48,0,0,0,9,18,109,82,111,119,48,0,59,120,0,18,
-109,0,16,8,48,0,57,59,120,0,20,0,9,18,109,82,111,119,48,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,
-20,0,9,18,109,82,111,119,48,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,20,0,9,18,95,95,114,101,116,
-86,97,108,0,16,8,48,0,57,59,120,0,58,100,111,116,0,18,109,82,111,119,48,0,0,18,110,0,16,8,48,0,57,
-0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,58,100,111,116,0,18,109,82,111,
-119,48,0,0,18,110,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,
-0,58,100,111,116,0,18,109,82,111,119,48,0,0,18,110,0,16,10,50,0,57,0,0,20,0,0,2,3,2,0,11,1,109,82,
-111,119,49,0,0,0,9,18,109,82,111,119,49,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,20,0,9,18,109,82,
-111,119,49,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,20,0,9,18,109,82,111,119,49,0,59,122,0,18,
-109,0,16,10,50,0,57,59,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,58,100,
-111,116,0,18,109,82,111,119,49,0,0,18,110,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,
-0,16,10,49,0,57,59,121,0,58,100,111,116,0,18,109,82,111,119,49,0,0,18,110,0,16,10,49,0,57,0,0,20,0,
-9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0,58,100,111,116,0,18,109,82,111,119,49,0,
-0,18,110,0,16,10,50,0,57,0,0,20,0,0,2,3,2,0,11,1,109,82,111,119,50,0,0,0,9,18,109,82,111,119,50,0,
-59,120,0,18,109,0,16,8,48,0,57,59,122,0,20,0,9,18,109,82,111,119,50,0,59,121,0,18,109,0,16,10,49,0,
-57,59,122,0,20,0,9,18,109,82,111,119,50,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,20,0,9,18,95,95,
-114,101,116,86,97,108,0,16,8,48,0,57,59,122,0,58,100,111,116,0,18,109,82,111,119,50,0,0,18,110,0,
-16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,122,0,58,100,111,116,0,
-18,109,82,111,119,50,0,0,18,110,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,
-50,0,57,59,122,0,58,100,111,116,0,18,109,82,111,119,50,0,0,18,110,0,16,10,50,0,57,0,0,20,0,0,0,1,0,
-14,2,22,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,
-109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,
-18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,
-0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,20,0,0,1,0,15,2,26,1,1,0,15,109,0,0,1,1,0,15,
-110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,
-0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,
-10,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,
-0,16,10,50,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,
-110,0,16,10,51,0,57,46,20,0,0,1,0,15,2,27,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,
-116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,
-101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,
-114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,20,0,9,18,
-95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,47,20,0,
-0,1,0,15,2,21,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,2,3,2,0,12,1,109,82,111,119,48,0,0,0,9,18,109,
-82,111,119,48,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,20,0,9,18,109,82,111,119,48,0,59,121,0,18,
-109,0,16,10,49,0,57,59,120,0,20,0,9,18,109,82,111,119,48,0,59,122,0,18,109,0,16,10,50,0,57,59,120,
-0,20,0,9,18,109,82,111,119,48,0,59,119,0,18,109,0,16,10,51,0,57,59,120,0,20,0,9,18,95,95,114,101,
-116,86,97,108,0,16,8,48,0,57,59,120,0,58,100,111,116,0,18,109,82,111,119,48,0,0,18,110,0,16,8,48,0,
-57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,58,100,111,116,0,18,109,82,
-111,119,48,0,0,18,110,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,
-120,0,58,100,111,116,0,18,109,82,111,119,48,0,0,18,110,0,16,10,50,0,57,0,0,20,0,9,18,95,95,114,101,
-116,86,97,108,0,16,10,51,0,57,59,120,0,58,100,111,116,0,18,109,82,111,119,48,0,0,18,110,0,16,10,51,
-0,57,0,0,20,0,0,2,3,2,0,12,1,109,82,111,119,49,0,0,0,9,18,109,82,111,119,49,0,59,120,0,18,109,0,16,
-8,48,0,57,59,121,0,20,0,9,18,109,82,111,119,49,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,20,0,9,
-18,109,82,111,119,49,0,59,122,0,18,109,0,16,10,50,0,57,59,121,0,20,0,9,18,109,82,111,119,49,0,59,
-119,0,18,109,0,16,10,51,0,57,59,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,
-0,58,100,111,116,0,18,109,82,111,119,49,0,0,18,110,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,
-86,97,108,0,16,10,49,0,57,59,121,0,58,100,111,116,0,18,109,82,111,119,49,0,0,18,110,0,16,10,49,0,
-57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0,58,100,111,116,0,18,109,82,
-111,119,49,0,0,18,110,0,16,10,50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,
-121,0,58,100,111,116,0,18,109,82,111,119,49,0,0,18,110,0,16,10,51,0,57,0,0,20,0,0,2,3,2,0,12,1,109,
-82,111,119,50,0,0,0,9,18,109,82,111,119,50,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,20,0,9,18,109,
-82,111,119,50,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,20,0,9,18,109,82,111,119,50,0,59,122,0,18,
-109,0,16,10,50,0,57,59,122,0,20,0,9,18,109,82,111,119,50,0,59,119,0,18,109,0,16,10,51,0,57,59,122,
-0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122,0,58,100,111,116,0,18,109,82,111,119,
-50,0,0,18,110,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,122,0,58,
-100,111,116,0,18,109,82,111,119,50,0,0,18,110,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,
-97,108,0,16,10,50,0,57,59,122,0,58,100,111,116,0,18,109,82,111,119,50,0,0,18,110,0,16,10,50,0,57,0,
-0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,122,0,58,100,111,116,0,18,109,82,111,
-119,50,0,0,18,110,0,16,10,51,0,57,0,0,20,0,0,2,3,2,0,12,1,109,82,111,119,51,0,0,0,9,18,109,82,111,
-119,51,0,59,120,0,18,109,0,16,8,48,0,57,59,119,0,20,0,9,18,109,82,111,119,51,0,59,121,0,18,109,0,
-16,10,49,0,57,59,119,0,20,0,9,18,109,82,111,119,51,0,59,122,0,18,109,0,16,10,50,0,57,59,119,0,20,0,
-9,18,109,82,111,119,51,0,59,119,0,18,109,0,16,10,51,0,57,59,119,0,20,0,9,18,95,95,114,101,116,86,
-97,108,0,16,8,48,0,57,59,119,0,58,100,111,116,0,18,109,82,111,119,51,0,0,18,110,0,16,8,48,0,57,0,0,
-20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,119,0,58,100,111,116,0,18,109,82,111,119,
-51,0,0,18,110,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,119,0,
-58,100,111,116,0,18,109,82,111,119,51,0,0,18,110,0,16,10,50,0,57,0,0,20,0,9,18,95,95,114,101,116,
-86,97,108,0,16,10,51,0,57,59,119,0,58,100,111,116,0,18,109,82,111,119,51,0,0,18,110,0,16,10,51,0,
-57,0,0,20,0,0,0,1,0,15,2,22,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,
-0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,
-108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,
-86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,20,0,9,18,95,95,114,101,
-116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,49,20,0,0,1,0,13,2,26,
-1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,
-0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,
-0,57,46,20,0,0,1,0,13,2,26,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,
-16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,
-57,18,109,0,16,10,49,0,57,18,98,0,46,20,0,0,1,0,13,2,27,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,9,18,
-95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,
-101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,47,20,0,0,1,0,13,2,27,1,1,0,13,
-109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,
-18,98,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,47,
-20,0,0,1,0,13,2,21,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,
+49,0,57,18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,
+16,10,50,0,57,18,110,0,16,10,50,0,57,49,20,0,0,1,0,15,2,26,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,9,
+18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,
+9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,
+20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,
+57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,110,0,16,10,
+51,0,57,46,20,0,0,1,0,15,2,27,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,
+108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,
+97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,114,101,
+116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,20,0,9,18,95,95,114,
+101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,47,20,0,0,1,0,15,2,
+21,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,
+16,8,48,0,57,18,110,0,16,8,48,0,57,59,120,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,8,48,
+0,57,59,121,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,8,48,0,57,59,122,122,122,122,0,
+48,46,18,109,0,16,10,51,0,57,18,110,0,16,8,48,0,57,59,119,119,119,119,0,48,46,20,0,9,18,95,95,114,
+101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,49,0,57,59,120,120,120,120,
+0,48,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,59,121,121,121,121,0,48,46,18,109,0,16,10,50,0,
+57,18,110,0,16,10,49,0,57,59,122,122,122,122,0,48,46,18,109,0,16,10,51,0,57,18,110,0,16,10,49,0,57,
+59,119,119,119,119,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,8,48,
+0,57,18,110,0,16,10,50,0,57,59,120,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,10,50,0,57,
+59,121,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,59,122,122,122,122,0,48,
+46,18,109,0,16,10,51,0,57,18,110,0,16,10,50,0,57,59,119,119,119,119,0,48,46,20,0,9,18,95,95,114,
+101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,51,0,57,59,120,120,120,120,
+0,48,18,109,0,16,10,49,0,57,18,110,0,16,10,51,0,57,59,121,121,121,121,0,48,46,18,109,0,16,10,50,0,
+57,18,110,0,16,10,51,0,57,59,122,122,122,122,0,48,46,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,
+59,119,119,119,119,0,48,46,20,0,0,1,0,15,2,22,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,
+101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,
+114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,9,18,
+95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,20,0,
+9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,49,
+20,0,0,1,0,13,2,26,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,
+0,57,18,97,0,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,
+0,18,110,0,16,10,49,0,57,46,20,0,0,1,0,13,2,26,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,
+101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,
+97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,46,20,0,0,1,0,13,2,27,1,1,0,9,97,0,0,1,1,0,
+13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,47,20,
+0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,47,20,0,0,1,0,13,
+2,27,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,
+16,8,48,0,57,18,98,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,
+57,18,98,0,47,20,0,0,1,0,13,2,21,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,
+108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,
+49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,13,2,21,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,9,
+18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,
+101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,0,1,0,13,2,22,1,1,0,9,97,
+0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,
+0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,49,20,
+0,0,1,0,13,2,22,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,
+57,18,109,0,16,8,48,0,57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,
+16,10,49,0,57,18,98,0,49,20,0,0,1,0,14,2,26,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,
+116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,
+108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,
+10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,46,20,0,0,1,0,14,2,26,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,
+1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,46,20,0,9,18,95,95,
+114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,46,20,0,9,18,95,95,114,101,
+116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,46,20,0,0,1,0,14,2,27,1,1,0,9,97,0,0,
+1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,
+47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,47,20,0,9,
+18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,47,20,0,0,1,0,14,2,
+27,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,
+8,48,0,57,18,98,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,
+18,98,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,47,
+20,0,0,1,0,14,2,21,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,
 0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,
-0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,13,2,21,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,
-101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,
-97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,0,1,0,13,2,22,1,1,0,9,97,0,0,1,1,0,
-13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,49,20,
-0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,49,20,0,0,1,0,13,
-2,22,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,
-16,8,48,0,57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,
-57,18,98,0,49,20,0,0,1,0,14,2,26,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,
-108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,
-49,0,57,18,97,0,18,110,0,16,10,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,
-97,0,18,110,0,16,10,50,0,57,46,20,0,0,1,0,14,2,26,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,
-114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,
-86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,
-0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,46,20,0,0,1,0,14,2,27,1,1,0,9,97,0,0,1,1,0,14,110,0,
-0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,47,20,0,9,18,
-95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,114,
-101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,47,20,0,0,1,0,14,2,27,1,1,0,14,
-109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,
-18,98,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,47,
-20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,47,20,0,0,1,0,
-14,2,21,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,
-0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,
-16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,
-57,48,20,0,0,1,0,14,2,21,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,
-8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,
-18,109,0,16,10,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,
-16,10,50,0,57,18,98,0,48,20,0,0,1,0,14,2,22,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,
-116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,
-108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,
-10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,49,20,0,0,1,0,14,2,22,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,
-1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,49,20,0,9,18,95,95,
-114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,49,20,0,9,18,95,95,114,101,
-116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,49,20,0,0,1,0,15,2,26,1,1,0,9,97,0,0,
-1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,
-46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,46,20,0,9,
-18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,46,20,0,9,18,95,95,
-114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,46,20,0,0,1,0,15,2,26,1,1,0,
-15,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,
-57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,
-46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,46,20,0,9,
-18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,46,20,0,0,1,0,15,2,
+0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,
+16,10,50,0,57,48,20,0,0,1,0,14,2,21,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,
+97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,
+10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,
+18,109,0,16,10,50,0,57,18,98,0,48,20,0,0,1,0,14,2,22,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,9,18,95,
+95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,
+116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,86,97,
+108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,49,20,0,0,1,0,14,2,22,1,1,0,14,109,0,0,1,1,0,9,
+98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,49,20,0,9,
+18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,49,20,0,9,18,95,95,
+114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,49,20,0,0,1,0,15,2,26,1,1,0,9,
+97,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,
+48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,46,
+20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,46,20,0,9,18,
+95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,46,20,0,0,1,0,15,2,26,1,
+1,0,15,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,
+0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,
+0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,46,20,0,
+9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,46,20,0,0,1,0,15,2,
 27,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,
 110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,
 49,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,47,
 97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,
 10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,
 18,109,0,16,10,50,0,57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,
-16,10,51,0,57,18,98,0,49,20,0,0,1,0,10,2,21,1,1,0,13,109,0,0,1,1,0,10,118,0,0,0,1,3,2,0,10,1,114,
-48,0,0,1,1,114,49,0,0,0,9,18,114,48,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,20,0,9,18,114,48,0,
-59,121,0,18,109,0,16,10,49,0,57,59,120,0,20,0,9,18,114,49,0,59,120,0,18,109,0,16,8,48,0,57,59,121,
-0,20,0,9,18,114,49,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,20,0,9,18,95,95,114,101,116,86,97,
-108,0,59,120,0,58,100,111,116,0,18,114,48,0,0,18,118,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,
-59,121,0,58,100,111,116,0,18,114,49,0,0,18,118,0,0,0,20,0,0,1,0,10,2,21,1,1,0,10,118,0,0,1,1,0,13,
-109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,
-48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,
-16,10,49,0,57,0,0,20,0,0,1,0,11,2,21,1,1,0,14,109,0,0,1,1,0,11,118,0,0,0,1,2,3,2,0,11,1,114,48,0,0,
-0,9,18,114,48,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,20,0,9,18,114,48,0,59,121,0,18,109,0,16,10,
-49,0,57,59,120,0,20,0,9,18,114,48,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,20,0,4,118,101,99,51,
-95,100,111,116,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,48,0,0,18,118,0,0,0,0,2,3,2,0,
-11,1,114,49,0,0,0,9,18,114,49,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,20,0,9,18,114,49,0,59,121,
-0,18,109,0,16,10,49,0,57,59,121,0,20,0,9,18,114,49,0,59,122,0,18,109,0,16,10,50,0,57,59,121,0,20,0,
-4,118,101,99,51,95,100,111,116,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,49,0,0,18,118,
-0,0,0,0,2,3,2,0,11,1,114,50,0,0,0,9,18,114,50,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,20,0,9,18,
-114,50,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,20,0,9,18,114,50,0,59,122,0,18,109,0,16,10,50,0,
-57,59,122,0,20,0,4,118,101,99,51,95,100,111,116,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,
-114,50,0,0,18,118,0,0,0,0,0,1,0,11,2,21,1,1,0,11,118,0,0,1,1,0,14,109,0,0,0,1,9,18,95,95,114,101,
-116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,
-101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,
-95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,0,
-1,0,12,2,21,1,1,0,15,109,0,0,1,1,0,12,118,0,0,0,1,2,3,2,0,12,1,114,48,0,0,0,9,18,114,48,0,59,120,0,
-18,109,0,16,8,48,0,57,59,120,0,20,0,9,18,114,48,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,20,0,9,
-18,114,48,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,20,0,9,18,114,48,0,59,119,0,18,109,0,16,10,51,
-0,57,59,120,0,20,0,4,118,101,99,52,95,100,111,116,0,18,95,95,114,101,116,86,97,108,0,59,115,0,0,18,
-114,48,0,0,18,118,0,0,0,0,2,3,2,0,12,1,114,49,0,0,0,9,18,114,49,0,59,120,0,18,109,0,16,8,48,0,57,
-59,121,0,20,0,9,18,114,49,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,20,0,9,18,114,49,0,59,122,0,
-18,109,0,16,10,50,0,57,59,121,0,20,0,9,18,114,49,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,20,0,4,
-118,101,99,52,95,100,111,116,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,49,0,0,18,118,0,
-0,0,0,2,3,2,0,12,1,114,50,0,0,0,9,18,114,50,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,20,0,9,18,
-114,50,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,20,0,9,18,114,50,0,59,122,0,18,109,0,16,10,50,0,
-57,59,122,0,20,0,9,18,114,50,0,59,119,0,18,109,0,16,10,51,0,57,59,122,0,20,0,4,118,101,99,52,95,
-100,111,116,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,114,50,0,0,18,118,0,0,0,0,2,3,2,0,12,
-1,114,51,0,0,0,9,18,114,51,0,59,120,0,18,109,0,16,8,48,0,57,59,119,0,20,0,9,18,114,51,0,59,121,0,
-18,109,0,16,10,49,0,57,59,119,0,20,0,9,18,114,51,0,59,122,0,18,109,0,16,10,50,0,57,59,119,0,20,0,9,
-18,114,51,0,59,119,0,18,109,0,16,10,51,0,57,59,119,0,20,0,4,118,101,99,52,95,100,111,116,0,18,95,
-95,114,101,116,86,97,108,0,59,119,0,0,18,114,51,0,0,18,118,0,0,0,0,0,1,0,12,2,21,1,1,0,12,118,0,0,
-1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,
-109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,
-0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,
-118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,
-0,18,118,0,0,18,109,0,16,10,51,0,57,0,0,20,0,0,1,0,0,2,1,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,
-18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,
-21,0,0,1,0,0,2,2,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,
-57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,0,1,0,0,2,3,1,0,2,13,109,0,0,1,1,0,13,
-110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,4,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,
-9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,
-24,0,0,1,0,0,2,1,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,
-57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,
-10,50,0,57,21,0,0,1,0,0,2,2,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,
-16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,
-110,0,16,10,50,0,57,22,0,0,1,0,0,2,3,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,18,109,0,18,
-110,0,48,20,0,0,1,0,0,2,4,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,
-16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,
-110,0,16,10,50,0,57,24,0,0,1,0,0,2,1,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,
-18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,
-50,0,57,18,110,0,16,10,50,0,57,21,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,21,0,0,1,0,0,2,
-2,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,
+16,10,51,0,57,18,98,0,49,20,0,0,1,0,10,2,21,1,1,0,13,109,0,0,1,1,0,10,118,0,0,0,1,9,18,95,95,114,
+101,116,86,97,108,0,18,109,0,16,8,48,0,57,18,118,0,59,120,120,0,48,18,109,0,16,10,49,0,57,18,118,0,
+59,121,121,0,48,46,20,0,0,1,0,10,2,21,1,1,0,10,118,0,0,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,
+86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,
+116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,11,2,21,
+1,1,0,14,109,0,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,16,8,48,0,57,18,
+118,0,59,120,120,120,0,48,18,109,0,16,10,49,0,57,18,118,0,59,121,121,121,0,48,46,18,109,0,16,10,50,
+0,57,18,118,0,59,122,122,122,0,48,46,20,0,0,1,0,11,2,21,1,1,0,11,118,0,0,1,1,0,14,109,0,0,0,1,9,18,
+95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,
+9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,
+20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,
+57,0,0,20,0,0,1,0,12,2,21,1,1,0,15,109,0,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,
+18,109,0,16,8,48,0,57,18,118,0,59,120,120,120,120,0,48,18,109,0,16,10,49,0,57,18,118,0,59,121,121,
+121,121,0,48,46,18,109,0,16,10,50,0,57,18,118,0,59,122,122,122,122,0,48,46,18,109,0,16,10,51,0,57,
+18,118,0,59,119,119,119,119,0,48,46,20,0,0,1,0,12,2,21,1,1,0,12,118,0,0,1,1,0,15,109,0,0,0,1,9,18,
+95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,
+9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,
+20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,
+57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,
+51,0,57,0,0,20,0,0,1,0,0,2,1,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,
+0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,0,1,0,0,2,2,1,0,2,13,109,
+0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,
+57,18,110,0,16,10,49,0,57,22,0,0,1,0,0,2,3,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,18,109,
+0,18,110,0,48,20,0,0,1,0,0,2,4,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,
+110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,0,1,0,0,2,1,1,0,2,14,
+109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,
+49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,0,1,0,0,2,
+2,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,
 109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,
-0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,22,0,0,1,0,0,2,3,1,0,2,15,109,0,0,1,1,0,15,110,0,
-0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,4,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,
-109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,
-9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,
-57,24,0,0,1,0,0,2,1,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,
-109,0,16,10,49,0,57,18,97,0,21,0,0,1,0,0,2,2,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,
-48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,0,0,2,3,1,0,2,13,109,0,0,1,1,0,9,97,
-0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,
-2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,
-97,0,24,0,0,1,0,0,2,1,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,
-18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,0,1,0,0,2,2,1,0,2,14,109,
-0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,
-9,18,109,0,16,10,50,0,57,18,97,0,22,0,0,1,0,0,2,3,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,
-16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,
-23,0,0,1,0,0,2,4,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,
-0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,0,1,0,0,2,1,1,0,2,15,109,0,0,1,
-1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,
-109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,0,21,0,0,1,0,0,2,2,1,0,2,15,109,0,
-0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,
-18,109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,97,0,22,0,0,1,0,0,2,3,1,0,2,15,109,
-0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,
-9,18,109,0,16,10,50,0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,15,
-109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,
-24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,0,0,2,3,1,0,2,
-10,118,0,0,1,1,0,13,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,0,2,3,1,0,2,11,118,0,0,
-1,1,0,14,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,0,2,3,1,0,2,12,118,0,0,1,1,0,15,
-109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,5,2,25,1,0,2,5,97,0,0,0,1,9,18,97,0,18,97,0,
-16,10,49,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,0,6,2,25,1,0,2,6,118,0,0,0,
-1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,16,10,49,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,
-108,0,18,118,0,20,0,0,1,0,7,2,25,1,0,2,7,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,16,
-10,49,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,8,2,25,1,0,2,8,118,0,0,
-0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,16,10,49,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,
-108,0,18,118,0,20,0,0,1,0,9,2,25,1,0,2,9,97,0,0,0,1,9,18,97,0,18,97,0,17,49,0,48,0,0,47,20,0,9,18,
-95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,0,10,2,25,1,0,2,10,118,0,0,0,1,9,18,118,0,18,118,0,
-58,118,101,99,50,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,
-0,11,2,25,1,0,2,11,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,
-18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,12,2,25,1,0,2,12,118,0,0,0,1,9,18,118,0,18,
-118,0,58,118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,
-0,0,1,0,13,2,25,1,0,2,13,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,
-50,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,
-17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,14,2,25,1,0,2,14,
-109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,
-20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,
-9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,
-95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,15,2,25,1,0,2,15,109,0,0,0,1,9,18,109,0,16,8,48,
-0,57,18,109,0,16,8,48,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,
-18,109,0,16,10,49,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,18,
-109,0,16,10,50,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,51,0,57,18,109,
-0,16,10,51,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,
-18,109,0,20,0,0,1,0,5,2,24,1,0,2,5,97,0,0,0,1,9,18,97,0,18,97,0,16,10,49,0,46,20,0,9,18,95,95,114,
-101,116,86,97,108,0,18,97,0,20,0,0,1,0,6,2,24,1,0,2,6,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,
-101,99,50,0,16,10,49,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,7,2,24,1,
-0,2,7,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,16,10,49,0,0,0,46,20,0,9,18,95,95,114,
-101,116,86,97,108,0,18,118,0,20,0,0,1,0,8,2,24,1,0,2,8,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,
-101,99,52,0,16,10,49,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,9,2,24,1,
-0,2,9,97,0,0,0,1,9,18,97,0,18,97,0,17,49,0,48,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,
-0,20,0,0,1,0,10,2,24,1,0,2,10,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,17,49,0,48,0,0,0,
-0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,11,2,24,1,0,2,11,118,0,0,0,1,9,18,
-118,0,18,118,0,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,
-118,0,20,0,0,1,0,12,2,24,1,0,2,12,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,17,49,0,48,0,
-0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,13,2,24,1,0,2,13,109,0,0,0,1,
-9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,9,18,
-109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,
-95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,14,2,24,1,0,2,14,109,0,0,0,1,9,18,109,0,16,8,48,0,
-57,18,109,0,16,8,48,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,
-109,0,16,10,49,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,
-0,16,10,50,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,
-18,109,0,20,0,0,1,0,15,2,24,1,0,2,15,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,
-118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,
-101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,
-99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118,101,99,
-52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,5,0,95,95,
-112,111,115,116,68,101,99,114,0,1,0,2,5,97,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,
-9,18,97,0,18,97,0,16,10,49,0,47,20,0,0,1,0,6,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,6,118,0,
-0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,50,0,
-16,10,49,0,0,0,47,20,0,0,1,0,7,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,7,118,0,0,0,1,9,18,95,
-95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,51,0,16,10,49,0,0,0,
-47,20,0,0,1,0,8,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,8,118,0,0,0,1,9,18,95,95,114,101,116,
-86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,52,0,16,10,49,0,0,0,47,20,0,0,1,0,
-9,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,9,97,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,
-97,0,20,0,9,18,97,0,18,97,0,17,49,0,48,0,0,47,20,0,0,1,0,10,0,95,95,112,111,115,116,68,101,99,114,
-0,1,0,2,10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,
-101,99,50,0,17,49,0,48,0,0,0,0,47,20,0,0,1,0,11,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,11,
-118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,51,
-0,17,49,0,48,0,0,0,0,47,20,0,0,1,0,12,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,12,118,0,0,0,1,
-9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,52,0,17,49,0,48,
-0,0,0,0,47,20,0,0,1,0,13,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,13,109,0,0,0,1,9,18,95,95,
-114,101,116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,
-50,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,
-17,49,0,48,0,0,0,0,47,20,0,0,1,0,14,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,14,109,0,0,0,1,9,
-18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,
-118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,
-101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,
-99,51,0,17,49,0,48,0,0,0,0,47,20,0,0,1,0,15,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,15,109,0,
-0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,
+0,0,1,0,0,2,3,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,
+4,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,
+109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,
+0,0,1,0,0,2,1,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,
+21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,
+50,0,57,21,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,21,0,0,1,0,0,2,2,1,0,2,15,109,0,0,1,1,
+0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,
+110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,9,18,109,0,16,10,51,
+0,57,18,110,0,16,10,51,0,57,22,0,0,1,0,0,2,3,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,18,
+109,0,18,110,0,48,20,0,0,1,0,0,2,4,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,
+18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,
+50,0,57,18,110,0,16,10,50,0,57,24,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,0,0,1,0,0,2,
+1,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,
+57,18,97,0,21,0,0,1,0,0,2,2,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,
+0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,0,0,2,3,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,
+16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,13,109,0,0,1,1,0,
+9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,0,1,0,0,2,
+1,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,
+57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,0,1,0,0,2,2,1,0,2,14,109,0,0,1,1,0,9,97,0,0,
+0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,
+0,57,18,97,0,22,0,0,1,0,0,2,3,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,
+23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,
+14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,
+0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,0,1,0,0,2,1,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,
+109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,
+97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,0,21,0,0,1,0,0,2,2,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,
+18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,
+18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,97,0,22,0,0,1,0,0,2,3,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,
+9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,
+57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,15,109,0,0,1,1,0,9,97,0,0,
+0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,
+0,57,18,97,0,24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,0,0,2,3,1,0,2,10,118,0,0,1,1,0,13,109,
+0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,0,2,3,1,0,2,11,118,0,0,1,1,0,14,109,0,0,0,1,9,
+18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,0,2,3,1,0,2,12,118,0,0,1,1,0,15,109,0,0,0,1,9,18,118,0,18,
+118,0,18,109,0,48,20,0,0,1,0,5,2,25,1,0,2,5,97,0,0,0,1,9,18,97,0,18,97,0,16,10,49,0,47,20,0,9,18,
+95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,0,6,2,25,1,0,2,6,118,0,0,0,1,9,18,118,0,18,118,0,58,
+105,118,101,99,50,0,16,10,49,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,
+7,2,25,1,0,2,7,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,16,10,49,0,0,0,47,20,0,9,18,
+95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,8,2,25,1,0,2,8,118,0,0,0,1,9,18,118,0,18,118,0,
+58,105,118,101,99,52,0,16,10,49,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,
+0,9,2,25,1,0,2,9,97,0,0,0,1,9,18,97,0,18,97,0,17,49,0,48,0,0,47,20,0,9,18,95,95,114,101,116,86,97,
+108,0,18,97,0,20,0,0,1,0,10,2,25,1,0,2,10,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,17,49,
+0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,11,2,25,1,0,2,11,118,0,
+0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,
+97,108,0,18,118,0,20,0,0,1,0,12,2,25,1,0,2,12,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,
+17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,13,2,25,1,0,2,13,
+109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,47,
+20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,47,20,0,
+9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,14,2,25,1,0,2,14,109,0,0,0,1,9,18,109,0,16,
+8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,
+0,57,18,109,0,16,10,49,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,
+18,109,0,16,10,50,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,
+108,0,18,109,0,20,0,0,1,0,15,2,25,1,0,2,15,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,
 57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,
 58,118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,
 118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118,
-101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,0,1,0,9,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,9,97,
-0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,16,10,49,0,46,20,0,0,1,0,
-10,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,
-18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,0,1,0,11,0,95,95,
-112,111,115,116,73,110,99,114,0,1,0,2,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,
-20,0,9,18,118,0,18,118,0,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,0,1,0,12,0,95,95,112,111,
-115,116,73,110,99,114,0,1,0,2,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,
-118,0,18,118,0,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,0,1,0,5,0,95,95,112,111,115,116,73,
-110,99,114,0,1,0,2,5,97,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,
-16,10,49,0,46,20,0,0,1,0,6,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,6,118,0,0,0,1,9,18,95,95,
-114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,50,0,16,10,49,0,0,0,46,
-20,0,0,1,0,7,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,7,118,0,0,0,1,9,18,95,95,114,101,116,86,
-97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,51,0,16,10,49,0,0,0,46,20,0,0,1,0,8,0,
-95,95,112,111,115,116,73,110,99,114,0,1,0,2,8,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,
-118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,51,0,16,10,49,0,0,0,46,20,0,0,1,0,13,0,95,95,112,
-111,115,116,73,110,99,114,0,1,0,2,13,109,0,0,0,1,3,2,0,13,1,110,0,2,18,109,0,0,0,9,18,109,0,16,8,
+101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,5,2,
+24,1,0,2,5,97,0,0,0,1,9,18,97,0,18,97,0,16,10,49,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,
+97,0,20,0,0,1,0,6,2,24,1,0,2,6,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,16,10,49,0,0,
+0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,7,2,24,1,0,2,7,118,0,0,0,1,9,18,
+118,0,18,118,0,58,105,118,101,99,51,0,16,10,49,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,
+118,0,20,0,0,1,0,8,2,24,1,0,2,8,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,16,10,49,0,
+0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,9,2,24,1,0,2,9,97,0,0,0,1,9,18,
+97,0,18,97,0,17,49,0,48,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,0,10,2,24,
+1,0,2,10,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,
+114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,11,2,24,1,0,2,11,118,0,0,0,1,9,18,118,0,18,118,0,58,
+118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,
+12,2,24,1,0,2,12,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,
+18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,13,2,24,1,0,2,13,109,0,0,0,1,9,18,109,0,16,8,
 48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,
-57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,8,18,110,0,0,0,1,0,14,0,95,
-95,112,111,115,116,73,110,99,114,0,1,0,2,14,109,0,0,0,1,3,2,0,14,1,110,0,2,18,109,0,0,0,9,18,109,0,
-16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,
-49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,50,0,
-57,18,109,0,16,10,50,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,8,18,110,0,0,0,1,0,15,0,95,
-95,112,111,115,116,73,110,99,114,0,1,0,2,15,109,0,0,0,1,3,2,0,15,1,110,0,2,18,109,0,0,0,9,18,109,0,
-16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,
-49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,50,0,
-57,18,109,0,16,10,50,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,51,0,57,
-18,109,0,16,10,51,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,8,18,110,0,0,0,1,0,1,2,15,1,1,
-0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,
-120,0,0,18,98,0,0,18,97,0,0,0,0,1,0,1,2,15,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,
-116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,40,0,0,1,0,1,2,16,1,1,0,9,97,0,0,1,1,0,9,98,
-0,0,0,1,3,2,0,1,1,99,0,0,0,4,102,108,111,97,116,95,108,101,115,115,0,18,99,0,0,18,98,0,0,18,97,0,0,
-0,8,18,99,0,0,0,1,0,1,2,16,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,
-58,102,108,111,97,116,0,18,98,0,0,0,41,0,0,1,0,1,2,18,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,
-103,0,0,1,1,101,0,0,0,4,102,108,111,97,116,95,108,101,115,115,0,18,103,0,0,18,98,0,0,18,97,0,0,0,4,
-102,108,111,97,116,95,101,113,117,97,108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,
-0,0,1,0,1,2,18,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,
-111,97,116,0,18,98,0,0,0,43,0,0,1,0,1,2,17,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,103,0,0,1,1,
-101,0,0,0,4,102,108,111,97,116,95,108,101,115,115,0,18,103,0,0,18,97,0,0,18,98,0,0,0,4,102,108,111,
-97,116,95,101,113,117,97,108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,0,1,2,
-17,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,
-18,98,0,0,0,42,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,9,102,0,0,0,1,4,102,108,111,97,
-116,95,112,114,105,110,116,0,18,102,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,5,105,
-0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,105,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,
-65,0,1,1,0,1,98,0,0,0,1,4,98,111,111,108,95,112,114,105,110,116,0,18,98,0,0,0,0,1,0,0,0,112,114,
-105,110,116,77,69,83,65,0,1,1,0,10,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,
-120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,0,1,0,0,0,112,114,105,
-110,116,77,69,83,65,0,1,1,0,11,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,
-0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,
-69,83,65,0,18,118,0,59,122,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,12,118,0,0,0,
-1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,
-65,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,122,0,0,0,0,9,58,
-112,114,105,110,116,77,69,83,65,0,18,118,0,59,119,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,
-65,0,1,1,0,6,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,
-114,105,110,116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,
-1,1,0,7,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,
-105,110,116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,
-59,122,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,8,118,0,0,0,1,9,58,112,114,105,
-110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,
-121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,
-116,77,69,83,65,0,18,118,0,59,119,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,2,118,
-0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,
-69,83,65,0,18,118,0,59,121,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,3,118,0,0,0,1,
-9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,
-65,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,122,0,0,0,0,0,1,0,
-0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,4,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,
-18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,9,58,112,
-114,105,110,116,77,69,83,65,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,
-118,0,59,119,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,13,109,0,0,0,1,9,58,112,114,
-105,110,116,77,69,83,65,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,
-109,0,16,10,49,0,57,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,14,109,0,0,0,1,9,58,
-112,114,105,110,116,77,69,83,65,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,
-0,18,109,0,16,10,49,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,50,0,57,0,0,0,
-0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,15,109,0,0,0,1,9,58,112,114,105,110,116,77,69,83,
-65,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,49,0,57,0,0,
-0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,50,0,57,0,0,0,9,58,112,114,105,110,116,77,
-69,83,65,0,18,109,0,16,10,51,0,57,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,16,101,0,
-0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,
-65,0,1,1,0,17,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,
-105,110,116,77,69,83,65,0,1,1,0,18,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,
-0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,19,101,0,0,0,1,4,105,110,116,95,112,114,105,110,
-116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,20,101,0,0,0,1,4,105,110,116,
-95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,21,101,0,0,
-0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,0
+57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,
+97,108,0,18,109,0,20,0,0,1,0,14,2,24,1,0,2,14,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,
+0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,
+58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,
+118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,
+15,2,24,1,0,2,15,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,52,0,17,
+49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,52,0,17,49,0,
+48,0,0,0,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,52,0,17,49,0,48,0,
+0,0,0,46,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,
+0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,5,0,95,95,112,111,115,116,68,101,
+99,114,0,1,0,2,5,97,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,16,
+10,49,0,47,20,0,0,1,0,6,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,6,118,0,0,0,1,9,18,95,95,114,
+101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,50,0,16,10,49,0,0,0,47,20,
+0,0,1,0,7,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,7,118,0,0,0,1,9,18,95,95,114,101,116,86,97,
+108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,51,0,16,10,49,0,0,0,47,20,0,0,1,0,8,0,95,
+95,112,111,115,116,68,101,99,114,0,1,0,2,8,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,
+20,0,9,18,118,0,18,118,0,58,105,118,101,99,52,0,16,10,49,0,0,0,47,20,0,0,1,0,9,0,95,95,112,111,115,
+116,68,101,99,114,0,1,0,2,9,97,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,
+18,97,0,17,49,0,48,0,0,47,20,0,0,1,0,10,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,10,118,0,0,0,
+1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,50,0,17,49,0,
+48,0,0,0,0,47,20,0,0,1,0,11,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,11,118,0,0,0,1,9,18,95,
+95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,51,0,17,49,0,48,0,0,0,0,
+47,20,0,0,1,0,12,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,12,118,0,0,0,1,9,18,95,95,114,101,
+116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,0,
+1,0,13,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,
+108,0,18,109,0,20,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,50,0,17,49,0,48,0,
+0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,
+0,47,20,0,0,1,0,14,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,14,109,0,0,0,1,9,18,95,95,114,101,
+116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,51,0,17,
+49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,51,0,17,49,0,
+48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,51,0,17,49,0,48,0,
+0,0,0,47,20,0,0,1,0,15,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,15,109,0,0,0,1,9,18,95,95,114,
+101,116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,52,0,
+17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,52,0,17,
+49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,52,0,17,49,0,
+48,0,0,0,0,47,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118,101,99,52,0,17,49,0,48,0,
+0,0,0,47,20,0,0,1,0,9,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,9,97,0,0,0,1,9,18,95,95,114,
+101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,16,10,49,0,46,20,0,0,1,0,10,0,95,95,112,111,115,
+116,73,110,99,114,0,1,0,2,10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,
+0,18,118,0,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,0,1,0,11,0,95,95,112,111,115,116,73,110,
+99,114,0,1,0,2,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,
+58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,0,1,0,12,0,95,95,112,111,115,116,73,110,99,114,0,1,0,
+2,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,
+99,52,0,17,49,0,48,0,0,0,0,46,20,0,0,1,0,5,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,5,97,0,0,
+0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,16,10,49,0,46,20,0,0,1,0,6,0,
+95,95,112,111,115,116,73,110,99,114,0,1,0,2,6,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,
+118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,50,0,16,10,49,0,0,0,46,20,0,0,1,0,7,0,95,95,112,
+111,115,116,73,110,99,114,0,1,0,2,7,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,
+18,118,0,18,118,0,58,105,118,101,99,51,0,16,10,49,0,0,0,46,20,0,0,1,0,8,0,95,95,112,111,115,116,73,
+110,99,114,0,1,0,2,8,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,
+118,0,58,105,118,101,99,51,0,16,10,49,0,0,0,46,20,0,0,1,0,13,0,95,95,112,111,115,116,73,110,99,114,
+0,1,0,2,13,109,0,0,0,1,3,2,0,13,1,110,0,2,18,109,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,
+57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,
+58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,8,18,110,0,0,0,1,0,14,0,95,95,112,111,115,116,73,110,
+99,114,0,1,0,2,14,109,0,0,0,1,3,2,0,14,1,110,0,2,18,109,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,
+8,48,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,
+0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,
+58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,8,18,110,0,0,0,1,0,15,0,95,95,112,111,115,116,73,110,
+99,114,0,1,0,2,15,109,0,0,0,1,3,2,0,15,1,110,0,2,18,109,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,
+8,48,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,
+0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,
+58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,
+118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,8,18,110,0,0,0,1,0,1,2,15,1,1,0,9,97,0,0,1,1,0,9,98,0,0,
+0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,98,0,0,18,97,0,
+0,0,0,1,0,1,2,15,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,
+108,111,97,116,0,18,98,0,0,0,40,0,0,1,0,1,2,16,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,99,0,0,
+0,4,102,108,111,97,116,95,108,101,115,115,0,18,99,0,0,18,98,0,0,18,97,0,0,0,8,18,99,0,0,0,1,0,1,2,
+16,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,
+18,98,0,0,0,41,0,0,1,0,1,2,18,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,103,0,0,1,1,101,0,0,0,4,
+102,108,111,97,116,95,108,101,115,115,0,18,103,0,0,18,98,0,0,18,97,0,0,0,4,102,108,111,97,116,95,
+101,113,117,97,108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,0,1,2,18,1,1,0,
+5,97,0,0,1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,
+0,0,43,0,0,1,0,1,2,17,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,103,0,0,1,1,101,0,0,0,4,102,108,
+111,97,116,95,108,101,115,115,0,18,103,0,0,18,97,0,0,18,98,0,0,0,4,102,108,111,97,116,95,101,113,
+117,97,108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,0,1,2,17,1,1,0,5,97,0,0,
+1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,42,0,
+0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,9,102,0,0,0,1,4,102,108,111,97,116,95,112,114,
+105,110,116,0,18,102,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,5,105,0,0,0,1,4,105,
+110,116,95,112,114,105,110,116,0,18,105,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,1,
+98,0,0,0,1,4,98,111,111,108,95,112,114,105,110,116,0,18,98,0,0,0,0,1,0,0,0,112,114,105,110,116,77,
+69,83,65,0,1,1,0,10,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,
+58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,
+83,65,0,1,1,0,11,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,
+112,114,105,110,116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,
+18,118,0,59,122,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,12,118,0,0,0,1,9,58,112,
+114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,
+118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,122,0,0,0,0,9,58,112,114,
+105,110,116,77,69,83,65,0,18,118,0,59,119,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,
+0,6,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,
+110,116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,7,
+118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,
+116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,122,0,
+0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,8,118,0,0,0,1,9,58,112,114,105,110,116,77,
+69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,
+9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,77,69,83,
+65,0,18,118,0,59,119,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,2,118,0,0,0,1,9,58,
+112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,
+18,118,0,59,121,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,3,118,0,0,0,1,9,58,112,
+114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,
+118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,122,0,0,0,0,0,1,0,0,0,112,
+114,105,110,116,77,69,83,65,0,1,1,0,4,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,
+59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,
+116,77,69,83,65,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,119,0,
+0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,13,109,0,0,0,1,9,58,112,114,105,110,116,77,
+69,83,65,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,49,0,
+57,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,14,109,0,0,0,1,9,58,112,114,105,110,116,
+77,69,83,65,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,49,
+0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,50,0,57,0,0,0,0,1,0,0,0,112,114,
+105,110,116,77,69,83,65,0,1,1,0,15,109,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,
+8,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,49,0,57,0,0,0,9,58,112,114,
+105,110,116,77,69,83,65,0,18,109,0,16,10,50,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,
+109,0,16,10,51,0,57,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,16,101,0,0,0,1,4,105,
+110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,17,
+101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,77,
+69,83,65,0,1,1,0,18,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,
+114,105,110,116,77,69,83,65,0,1,1,0,19,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,
+0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,20,101,0,0,0,1,4,105,110,116,95,112,114,105,
+110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,21,101,0,0,0,1,4,105,110,
+116,95,112,114,105,110,116,0,18,101,0,0,0,0,0
diff --git a/src/mesa/shader/slang/library/slang_version_syn.h b/src/mesa/shader/slang/library/slang_version_syn.h
deleted file mode 100755 (executable)
index 3b94d85..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-".syntax version_directive;\n"
-"version_directive\n"
-"      version_directive_1 .and .loop version_directive_2;\n"
-"version_directive_1\n"
-"      prior_optional_spaces .and optional_version_directive .and .true .emit $;\n"
-"version_directive_2\n"
-"      prior_optional_spaces .and version_directive_body .and .true .emit $;\n"
-"optional_version_directive\n"
-"      version_directive_body .or .true .emit 10 .emit 1;\n"
-"version_directive_body\n"
-"      '#' .and optional_space .and \"version\" .and space .and version_number .and optional_space .and\n"
-"      new_line;\n"
-"version_number\n"
-"      version_number_110;\n"
-"version_number_110\n"
-"      leading_zeroes .and \"110\" .emit 10 .emit 1;\n"
-"leading_zeroes\n"
-"      .loop zero;\n"
-"zero\n"
-"      '0';\n"
-"space\n"
-" single_space .and .loop single_space;\n"
-"optional_space\n"
-" .loop single_space;\n"
-"single_space\n"
-" ' ' .or '\\t';\n"
-"prior_optional_spaces\n"
-"      .loop prior_space;\n"
-"prior_space\n"
-"      c_style_comment_block .or cpp_style_comment_block .or space .or new_line;\n"
-"c_style_comment_block\n"
-" '/' .and '*' .and c_style_comment_rest;\n"
-"c_style_comment_rest\n"
-" .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\n"
-"c_style_comment_rest_1\n"
-" c_style_comment_end .or c_style_comment_rest_2;\n"
-"c_style_comment_rest_2\n"
-" '*' .and c_style_comment_rest;\n"
-"c_style_comment_char_no_star\n"
-" '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n"
-"c_style_comment_end\n"
-" '*' .and '/';\n"
-"cpp_style_comment_block\n"
-" '/' .and '/' .and cpp_style_comment_block_1;\n"
-"cpp_style_comment_block_1\n"
-" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n"
-"cpp_style_comment_block_2\n"
-" .loop cpp_style_comment_char .and new_line;\n"
-"cpp_style_comment_block_3\n"
-" .loop cpp_style_comment_char;\n"
-"cpp_style_comment_char\n"
-" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n"
-"new_line\n"
-" cr_lf .or lf_cr .or '\\n' .or '\\r';\n"
-"cr_lf\n"
-" '\\r' .and '\\n';\n"
-"lf_cr\n"
-"      '\\n' .and '\\r';\n"
-".string __string_filter;\n"
-"__string_filter\n"
-" .loop __identifier_char;\n"
-"__identifier_char\n"
-" 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';\n"
-""
index 1081d8ff8db744d06fc58069f4d2e262ad76b7e4..f0f59aa87a156c2592225f019a2647732b07d491 100644 (file)
@@ -250,7 +250,7 @@ lookup_statevar(const char *var, GLint index1, GLint index2, const char *field,
       }
    }
    else if (strcmp(var, "gl_FrontLightModelProduct") == 0) {
-      if (strcmp(field, "ambient") == 0) {
+      if (strcmp(field, "sceneColor") == 0) {
          tokens[0] = STATE_LIGHTMODEL_SCENECOLOR;
          tokens[1] = 0;
       }
@@ -259,7 +259,7 @@ lookup_statevar(const char *var, GLint index1, GLint index2, const char *field,
       }
    }
    else if (strcmp(var, "gl_BackLightModelProduct") == 0) {
-      if (strcmp(field, "ambient") == 0) {
+      if (strcmp(field, "sceneColor") == 0) {
          tokens[0] = STATE_LIGHTMODEL_SCENECOLOR;
          tokens[1] = 1;
       }
@@ -397,6 +397,8 @@ lookup_statevar(const char *var, GLint index1, GLint index2, const char *field,
  *   var.field
  *   var[i].field
  *   var[i][j]
+ *
+ * \return -1 upon error, else position in paramList of the state var/data
  */
 GLint
 _slang_alloc_statevar(slang_ir_node *n,
@@ -414,9 +416,13 @@ _slang_alloc_statevar(slang_ir_node *n,
 
    if (n->Opcode == IR_ELEMENT) {
       /* XXX can only handle constant indexes for now */
-      assert(n->Children[1]->Opcode == IR_FLOAT);
-      index1 = (GLint) n->Children[1]->Value[0];
-      n = n->Children[0];
+      if (n->Children[1]->Opcode == IR_FLOAT) {
+         index1 = (GLint) n->Children[1]->Value[0];
+         n = n->Children[0];
+      }
+      else {
+         return -1;
+      }
    }
 
    if (n->Opcode == IR_ELEMENT) {
index 0de2b0a57ea28b6402a6715d0690747f90904b06..d19d5a0abb697894f0885a56cc2fdb6d57aeaf83 100644 (file)
@@ -495,6 +495,9 @@ new_node0(slang_ir_opcode op)
 }
 
 
+/**
+ * Create sequence of two nodes.
+ */
 static slang_ir_node *
 new_seq(slang_ir_node *left, slang_ir_node *right)
 {
@@ -535,10 +538,10 @@ new_not(slang_ir_node *n)
 
 
 /**
- * Inlined subroutine.
+ * Non-inlined function call.
  */
 static slang_ir_node *
-new_inlined_function_call(slang_ir_node *code, slang_label *name)
+new_function_call(slang_ir_node *code, slang_label *name)
 {
    slang_ir_node *n = new_node1(IR_CALL, code);
    assert(name);
@@ -1226,7 +1229,7 @@ _slang_gen_function_call(slang_assemble_ctx *A, slang_function *fun,
          else {
             callOper = inlined;
          }
-         callOper->type = SLANG_OPER_INLINED_CALL;
+         callOper->type = SLANG_OPER_NON_INLINED_CALL;
          callOper->fun = fun;
          callOper->label = _slang_label_new_unique((char*) fun->header.a_name);
       }
@@ -1844,6 +1847,7 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var)
 
       n->Store->File = PROGRAM_TEMPORARY;
       n->Store->Size = _slang_sizeof_type_specifier(&n->Var->type.specifier);
+      A->program->NumTemporaries++;
       assert(n->Store->Size > 0);
    }
    return n;
@@ -2060,7 +2064,8 @@ _slang_gen_declaration(slang_assemble_ctx *A, slang_operation *oper)
       }
       /* XXX make copy of this initializer? */
       rhs = _slang_gen_operation(A, &oper->children[0]);
-      assert(rhs);
+      if (!rhs)
+         return NULL;  /* must have found an error */
       init = new_node2(IR_MOVE, var, rhs);
       /*assert(rhs->Opcode != IR_SEQ);*/
       n = new_seq(varDecl, init);
@@ -2347,7 +2352,8 @@ _slang_gen_field(slang_assemble_ctx * A, slang_operation *oper)
       return n;
    }
    else if (   ti.spec.type == SLANG_SPEC_FLOAT
-            || ti.spec.type == SLANG_SPEC_INT) {
+            || ti.spec.type == SLANG_SPEC_INT
+            || ti.spec.type == SLANG_SPEC_BOOL) {
       const GLuint rows = 1;
       slang_swizzle swz;
       slang_ir_node *n;
@@ -2508,49 +2514,6 @@ _slang_gen_subscript(slang_assemble_ctx * A, slang_operation *oper)
 }
 
 
-/**
- * Look for expressions such as:  gl_ModelviewMatrix * gl_Vertex
- * and replace with this:  gl_Vertex * gl_ModelviewMatrixTranpose
- * Since matrices are stored in column-major order, the second form of
- * multiplication is much more efficient (just 4 dot products).
- */
-static void
-_slang_check_matmul_optimization(slang_assemble_ctx *A, slang_operation *oper)
-{
-   static const struct {
-      const char *orig;
-      const char *tranpose;
-   } matrices[] = {
-      {"gl_ModelViewMatrix", "gl_ModelViewMatrixTranspose"},
-      {"gl_ProjectionMatrix", "gl_ProjectionMatrixTranspose"},
-      {"gl_ModelViewProjectionMatrix", "gl_ModelViewProjectionMatrixTranspose"},
-      {"gl_TextureMatrix", "gl_TextureMatrixTranspose"},
-      {"gl_NormalMatrix", "__NormalMatrixTranspose"},
-      { NULL, NULL }
-   };
-
-   assert(oper->type == SLANG_OPER_MULTIPLY);
-   if (oper->children[0].type == SLANG_OPER_IDENTIFIER) {
-      GLuint i;
-      for (i = 0; matrices[i].orig; i++) {
-         if (oper->children[0].a_id
-             == slang_atom_pool_atom(A->atoms, matrices[i].orig)) {
-            /*
-            _mesa_printf("Replace %s with %s\n",
-                         matrices[i].orig, matrices[i].tranpose);
-            */
-            assert(oper->children[0].type == SLANG_OPER_IDENTIFIER);
-            oper->children[0].a_id
-               = slang_atom_pool_atom(A->atoms, matrices[i].tranpose);
-            /* finally, swap the operands */
-            _slang_operation_swap(&oper->children[0], &oper->children[1]);
-            return;
-         }
-      }
-   }
-}
-
-
 /**
  * Generate IR tree for a slang_operation (AST node)
  */
@@ -2589,7 +2552,7 @@ _slang_gen_operation(slang_assemble_ctx * A, slang_operation *oper)
                _slang_free_ir_tree(tree);
                return NULL; /* error must have occured */
             }
-            tree = tree ? new_seq(tree, n) : n;
+            tree = new_seq(tree, n);
          }
 
 #if 00
@@ -2684,7 +2647,6 @@ _slang_gen_operation(slang_assemble_ctx * A, slang_operation *oper)
       {
         slang_ir_node *n;
          assert(oper->num_children == 2);
-         _slang_check_matmul_optimization(A, oper);
          n = _slang_gen_function_call_name(A, "*", oper, NULL);
         return n;
       }
@@ -2817,17 +2779,17 @@ _slang_gen_operation(slang_assemble_ctx * A, slang_operation *oper)
         return n;
       }
 
-   case SLANG_OPER_INLINED_CALL:
+   case SLANG_OPER_NON_INLINED_CALL:
    case SLANG_OPER_SEQUENCE:
       {
          slang_ir_node *tree = NULL;
          GLuint i;
          for (i = 0; i < oper->num_children; i++) {
             slang_ir_node *n = _slang_gen_operation(A, &oper->children[i]);
-            tree = tree ? new_seq(tree, n) : n;
+            tree = new_seq(tree, n);
          }
-         if (oper->type == SLANG_OPER_INLINED_CALL) {
-            tree = new_inlined_function_call(tree, oper->label);
+         if (oper->type == SLANG_OPER_NON_INLINED_CALL) {
+            tree = new_function_call(tree, oper->label);
          }
          return tree;
       }
@@ -2879,17 +2841,7 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
        * store->Index = sampler number (0..7, typically)
        * store->Size = texture type index (1D, 2D, 3D, cube, etc)
        */
-#if 0
-      GLint samplerUniform
-         = _mesa_add_sampler(prog->Parameters, varName, datatype);
-#elif 0
-      GLint samplerUniform
-         = _mesa_add_sampler(prog->Samplers, varName, datatype);
-      (void) _mesa_add_sampler(prog->Parameters, varName, datatype); /* dummy entry */
-#else
-      const GLint sampNum = A->numSamplers++;
-      _mesa_add_sampler(prog->Parameters, varName, datatype, sampNum);
-#endif
+      GLint sampNum = _mesa_add_sampler(prog->Parameters, varName, datatype);
       store = _slang_new_ir_storage(PROGRAM_SAMPLER, sampNum, texIndex);
       if (dbg) printf("SAMPLER ");
    }
index 0df673085b7aa14756c5efc886e23cfc058634a8..46b5c54bbeb204d39797190ec8451a0d199830d9 100644 (file)
@@ -1620,7 +1620,6 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
       A.program = O->program;
       A.vartable = O->vartable;
       A.curFuncEndLabel = NULL;
-      A.numSamplers = 0;
       if (!_slang_codegen_global_variable(&A, var, C->type))
          return 0;
    }
@@ -1643,7 +1642,6 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
          A.space.funcs = O->funs;
          A.space.structs = O->structs;
          A.space.vars = O->vars;
-         A.numSamplers = 0;
          if (!initialize_global(&A, var))
             return 0;
       }
@@ -1777,7 +1775,6 @@ parse_function(slang_parse_ctx * C, slang_output_ctx * O, int definition,
       A.program = O->program;
       A.vartable = O->vartable;
       A.log = C->L;
-      A.numSamplers = 0;
 
       _slang_codegen_function(&A, *parsed_func_ret);
    }
@@ -2157,9 +2154,6 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader)
       shader->Programs[0]->Parameters = _mesa_new_parameter_list();
       shader->Programs[0]->Varying = _mesa_new_parameter_list();
       shader->Programs[0]->Attributes = _mesa_new_parameter_list();
-#if 0
-      shader->Programs[0]->Samplers = _mesa_new_parameter_list();
-#endif
    }
 
    slang_info_log_construct(&info_log);
index d497b6f66f70a1a0e13c5f92728803e594a8cf28..d5cbe779a6c5d9b83a7db01bcb880271b4efb9b1 100644 (file)
@@ -93,7 +93,7 @@ typedef enum slang_operation_type_
    SLANG_OPER_NOT,              /* "!" [expr] */
    SLANG_OPER_SUBSCRIPT,        /* [expr] "[" [expr] "]" */
    SLANG_OPER_CALL,             /* [func name] [param] [param] [...] */
-   SLANG_OPER_INLINED_CALL,     /* inlined function call */
+   SLANG_OPER_NON_INLINED_CALL, /* a real function call */
    SLANG_OPER_FIELD,            /* i.e.: ".next" or ".xzy" or ".xxx" etc */
    SLANG_OPER_POSTINCREMENT,    /* [var] "++" */
    SLANG_OPER_POSTDECREMENT     /* [var] "--" */
index 382b13ff05677b743a2c74d825629eddb91cca40..ff63e05dd2001d8bb87f7bff071fdf8e304e63d6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.3
+ * Version:  7.0.3
  *
  * Copyright (C) 2005-2007  Brian Paul   All Rights Reserved.
  *
@@ -79,7 +79,7 @@ new_subroutine(slang_emit_info *emitInfo, GLuint *id)
       _mesa_realloc(emitInfo->Subroutines,
                     n * sizeof(struct gl_program),
                     (n + 1) * sizeof(struct gl_program));
-   emitInfo->Subroutines[n] = _mesa_new_program(ctx, emitInfo->prog->Target, 0);
+   emitInfo->Subroutines[n] = ctx->Driver.NewProgram(ctx, emitInfo->prog->Target, 0);
    emitInfo->Subroutines[n]->Parameters = emitInfo->prog->Parameters;
    emitInfo->NumSubroutines++;
    *id = n;
@@ -869,12 +869,18 @@ emit_return(slang_emit_info *emitInfo, slang_ir_node *n)
 static struct prog_instruction *
 emit_kill(slang_emit_info *emitInfo)
 {
+   struct gl_fragment_program *fp;
    struct prog_instruction *inst;
    /* NV-KILL - discard fragment depending on condition code.
     * Note that ARB-KILL depends on sign of vector operand.
     */
    inst = new_instruction(emitInfo, OPCODE_KIL_NV);
    inst->DstReg.CondMask = COND_TR;  /* always branch */
+
+   assert(emitInfo->prog->Target == GL_FRAGMENT_PROGRAM_ARB);
+   fp = (struct gl_fragment_program *) emitInfo->prog;
+   fp->UsesKill = GL_TRUE;
+
    return inst;
 }
 
@@ -1500,6 +1506,10 @@ emit_struct_field(slang_emit_info *emitInfo, slang_ir_node *n)
 {
    if (n->Store->File == PROGRAM_STATE_VAR) {
       n->Store->Index = _slang_alloc_statevar(n, emitInfo->prog->Parameters);
+      if (n->Store->Index < 0) {
+         slang_info_log_error(emitInfo->log, "Error parsing state variable");
+         return NULL;
+      }
    }
    else {
       GLint offset = n->FieldOffset / 4;
@@ -1787,7 +1797,7 @@ _slang_resolve_subroutines(slang_emit_info *emitInfo)
                               sub->NumInstructions);
       /* delete subroutine code */
       sub->Parameters = NULL; /* prevent double-free */
-      _mesa_delete_program(ctx, sub);
+      _mesa_reference_program(ctx, &emitInfo->Subroutines[i], NULL);
    }
 
    /* free subroutine list */
index ae581553dc719aad2a5ab31d544e06222c1efb78..80cd4b6df624f15b297cef85ed4ea3886de4eeee 100644 (file)
@@ -369,12 +369,9 @@ link_error(struct gl_shader_program *shProg, const char *msg)
  * 2. Varying vars in the two shaders are combined so their locations
  *    agree between the vertex and fragment stages.  They're treated as
  *    vertex program output attribs and as fragment program input attribs.
- * 3. Uniform vars (including state references, constants, etc) from the
- *    vertex and fragment shaders are merged into one group.  Recall that
- *    GLSL uniforms are shared by all linked shaders.
- * 4. The vertex and fragment programs are cloned and modified to update
- *    src/dst register references so they use the new, linked uniform/
- *    varying storage locations.
+ * 3. The vertex and fragment programs are cloned and modified to update
+ *    src/dst register references so they use the new, linked varying
+ *    storage locations.
  */
 void
 _slang_link(GLcontext *ctx,
@@ -409,20 +406,20 @@ _slang_link(GLcontext *ctx,
     * Make copies of the vertex/fragment programs now since we'll be
     * changing src/dst registers after merging the uniforms and varying vars.
     */
+   _mesa_reference_vertprog(ctx, &shProg->VertexProgram, NULL);
    if (vertProg) {
-      _mesa_reference_vertprog(ctx, &shProg->VertexProgram,
-                               vertex_program(_mesa_clone_program(ctx, &vertProg->Base)));
-   }
-   else {
-      _mesa_reference_vertprog(ctx, &shProg->VertexProgram, NULL);
+      struct gl_vertex_program *linked_vprog =
+         vertex_program(_mesa_clone_program(ctx, &vertProg->Base));
+      shProg->VertexProgram = linked_vprog; /* refcount OK */
+      ASSERT(shProg->VertexProgram->Base.RefCount == 1);
    }
 
+   _mesa_reference_fragprog(ctx, &shProg->FragmentProgram, NULL);
    if (fragProg) {
-      _mesa_reference_fragprog(ctx, &shProg->FragmentProgram,
-                               fragment_program(_mesa_clone_program(ctx, &fragProg->Base)));
-   }
-   else {
-      _mesa_reference_fragprog(ctx, &shProg->FragmentProgram, NULL);
+      struct gl_fragment_program *linked_fprog = 
+         fragment_program(_mesa_clone_program(ctx, &fragProg->Base));
+      shProg->FragmentProgram = linked_fprog; /* refcount OK */
+      ASSERT(shProg->FragmentProgram->Base.RefCount == 1);
    }
 
    /* link varying vars */
@@ -439,18 +436,6 @@ _slang_link(GLcontext *ctx,
 
    /*_mesa_print_uniforms(shProg->Uniforms);*/
 
-   if (shProg->VertexProgram) {
-      /* Rather than cloning the parameter list here, just share it.
-       * We need to be careful _mesa_clear_shader_program_data() in
-       * to avoid double-freeing.
-       */
-      shProg->VertexProgram->Base.Parameters = vertProg->Base.Parameters;
-   }
-   if (shProg->FragmentProgram) {
-      /* see comment just above */
-      shProg->FragmentProgram->Base.Parameters = fragProg->Base.Parameters;
-   }
-
    if (shProg->VertexProgram) {
       if (!_slang_resolve_attributes(shProg, &shProg->VertexProgram->Base)) {
          /*goto cleanup;*/
index ad5aa3e195e7e6a2b878ad01c20dd75163e170b9..587331e8b1e0dd55244e047006a32330c2ab85fc 100644 (file)
@@ -65,7 +65,6 @@ typedef struct slang_assemble_ctx_
    struct slang_label_ *curFuncEndLabel;
    struct slang_ir_node_ *CurLoop;
    struct slang_function_ *CurFunction;
-   GLuint numSamplers;
 } slang_assemble_ctx;
 
 
index b214bef54de63822d7264b5273f68b45a6bfebc2..3d1d55fd7624159cabf24be89206061688929a7f 100644 (file)
@@ -738,10 +738,6 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
                .globl glGetVertexAttribivNV ; .type glGetVertexAttribivNV,#function
                .globl glIsProgramNV ; .type glIsProgramNV,#function
                .globl glLoadProgramNV ; .type glLoadProgramNV,#function
-               .globl glProgramParameter4dNV ; .type glProgramParameter4dNV,#function
-               .globl glProgramParameter4dvNV ; .type glProgramParameter4dvNV,#function
-               .globl glProgramParameter4fNV ; .type glProgramParameter4fNV,#function
-               .globl glProgramParameter4fvNV ; .type glProgramParameter4fvNV,#function
                .globl glProgramParameters4dvNV ; .type glProgramParameters4dvNV,#function
                .globl glProgramParameters4fvNV ; .type glProgramParameters4fvNV,#function
                .globl glRequestResidentProgramsNV ; .type glRequestResidentProgramsNV,#function
@@ -802,19 +798,19 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
                .globl glSetFragmentShaderConstantATI ; .type glSetFragmentShaderConstantATI,#function
                .globl glPointParameteriNV ; .type glPointParameteriNV,#function
                .globl glPointParameterivNV ; .type glPointParameterivNV,#function
+               .globl gl_dispatch_stub_733 ; .type gl_dispatch_stub_733,#function
+               .globl gl_dispatch_stub_734 ; .type gl_dispatch_stub_734,#function
+               .globl gl_dispatch_stub_735 ; .type gl_dispatch_stub_735,#function
+               .globl gl_dispatch_stub_736 ; .type gl_dispatch_stub_736,#function
                .globl gl_dispatch_stub_737 ; .type gl_dispatch_stub_737,#function
-               .globl gl_dispatch_stub_738 ; .type gl_dispatch_stub_738,#function
-               .globl gl_dispatch_stub_739 ; .type gl_dispatch_stub_739,#function
-               .globl gl_dispatch_stub_740 ; .type gl_dispatch_stub_740,#function
-               .globl gl_dispatch_stub_741 ; .type gl_dispatch_stub_741,#function
                .globl glGetProgramNamedParameterdvNV ; .type glGetProgramNamedParameterdvNV,#function
                .globl glGetProgramNamedParameterfvNV ; .type glGetProgramNamedParameterfvNV,#function
                .globl glProgramNamedParameter4dNV ; .type glProgramNamedParameter4dNV,#function
                .globl glProgramNamedParameter4dvNV ; .type glProgramNamedParameter4dvNV,#function
                .globl glProgramNamedParameter4fNV ; .type glProgramNamedParameter4fNV,#function
                .globl glProgramNamedParameter4fvNV ; .type glProgramNamedParameter4fvNV,#function
-               .globl gl_dispatch_stub_748 ; .type gl_dispatch_stub_748,#function
-               .globl gl_dispatch_stub_749 ; .type gl_dispatch_stub_749,#function
+               .globl gl_dispatch_stub_744 ; .type gl_dispatch_stub_744,#function
+               .globl gl_dispatch_stub_745 ; .type gl_dispatch_stub_745,#function
                .globl glBindFramebufferEXT ; .type glBindFramebufferEXT,#function
                .globl glBindRenderbufferEXT ; .type glBindRenderbufferEXT,#function
                .globl glCheckFramebufferStatusEXT ; .type glCheckFramebufferStatusEXT,#function
@@ -832,13 +828,13 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
                .globl glIsFramebufferEXT ; .type glIsFramebufferEXT,#function
                .globl glIsRenderbufferEXT ; .type glIsRenderbufferEXT,#function
                .globl glRenderbufferStorageEXT ; .type glRenderbufferStorageEXT,#function
-               .globl gl_dispatch_stub_767 ; .type gl_dispatch_stub_767,#function
+               .globl gl_dispatch_stub_763 ; .type gl_dispatch_stub_763,#function
                .globl glFramebufferTextureLayerEXT ; .type glFramebufferTextureLayerEXT,#function
+               .globl gl_dispatch_stub_765 ; .type gl_dispatch_stub_765,#function
+               .globl gl_dispatch_stub_766 ; .type gl_dispatch_stub_766,#function
+               .globl gl_dispatch_stub_767 ; .type gl_dispatch_stub_767,#function
+               .globl gl_dispatch_stub_768 ; .type gl_dispatch_stub_768,#function
                .globl gl_dispatch_stub_769 ; .type gl_dispatch_stub_769,#function
-               .globl gl_dispatch_stub_770 ; .type gl_dispatch_stub_770,#function
-               .globl gl_dispatch_stub_771 ; .type gl_dispatch_stub_771,#function
-               .globl gl_dispatch_stub_772 ; .type gl_dispatch_stub_772,#function
-               .globl gl_dispatch_stub_773 ; .type gl_dispatch_stub_773,#function
                .globl _mesa_sparc_glapi_begin ; .type _mesa_sparc_glapi_begin,#function
 _mesa_sparc_glapi_begin:
 
@@ -1515,10 +1511,6 @@ _mesa_sparc_glapi_begin:
        GL_STUB(glGetVertexAttribivNV, _gloffset_GetVertexAttribivNV)
        GL_STUB(glIsProgramNV, _gloffset_IsProgramNV)
        GL_STUB(glLoadProgramNV, _gloffset_LoadProgramNV)
-       GL_STUB(glProgramParameter4dNV, _gloffset_ProgramParameter4dNV)
-       GL_STUB(glProgramParameter4dvNV, _gloffset_ProgramParameter4dvNV)
-       GL_STUB(glProgramParameter4fNV, _gloffset_ProgramParameter4fNV)
-       GL_STUB(glProgramParameter4fvNV, _gloffset_ProgramParameter4fvNV)
        GL_STUB(glProgramParameters4dvNV, _gloffset_ProgramParameters4dvNV)
        GL_STUB(glProgramParameters4fvNV, _gloffset_ProgramParameters4fvNV)
        GL_STUB(glRequestResidentProgramsNV, _gloffset_RequestResidentProgramsNV)
@@ -1579,19 +1571,19 @@ _mesa_sparc_glapi_begin:
        GL_STUB(glSetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI)
        GL_STUB(glPointParameteriNV, _gloffset_PointParameteriNV)
        GL_STUB(glPointParameterivNV, _gloffset_PointParameterivNV)
+       GL_STUB(gl_dispatch_stub_733, _gloffset__dispatch_stub_733)
+       GL_STUB(gl_dispatch_stub_734, _gloffset__dispatch_stub_734)
+       GL_STUB(gl_dispatch_stub_735, _gloffset__dispatch_stub_735)
+       GL_STUB(gl_dispatch_stub_736, _gloffset__dispatch_stub_736)
        GL_STUB(gl_dispatch_stub_737, _gloffset__dispatch_stub_737)
-       GL_STUB(gl_dispatch_stub_738, _gloffset__dispatch_stub_738)
-       GL_STUB(gl_dispatch_stub_739, _gloffset__dispatch_stub_739)
-       GL_STUB(gl_dispatch_stub_740, _gloffset__dispatch_stub_740)
-       GL_STUB(gl_dispatch_stub_741, _gloffset__dispatch_stub_741)
        GL_STUB(glGetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV)
        GL_STUB(glGetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV)
        GL_STUB(glProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV)
        GL_STUB(glProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV)
        GL_STUB(glProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV)
        GL_STUB(glProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV)
-       GL_STUB(gl_dispatch_stub_748, _gloffset__dispatch_stub_748)
-       GL_STUB(gl_dispatch_stub_749, _gloffset__dispatch_stub_749)
+       GL_STUB(gl_dispatch_stub_744, _gloffset__dispatch_stub_744)
+       GL_STUB(gl_dispatch_stub_745, _gloffset__dispatch_stub_745)
        GL_STUB(glBindFramebufferEXT, _gloffset_BindFramebufferEXT)
        GL_STUB(glBindRenderbufferEXT, _gloffset_BindRenderbufferEXT)
        GL_STUB(glCheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT)
@@ -1609,13 +1601,13 @@ _mesa_sparc_glapi_begin:
        GL_STUB(glIsFramebufferEXT, _gloffset_IsFramebufferEXT)
        GL_STUB(glIsRenderbufferEXT, _gloffset_IsRenderbufferEXT)
        GL_STUB(glRenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT)
-       GL_STUB(gl_dispatch_stub_767, _gloffset__dispatch_stub_767)
+       GL_STUB(gl_dispatch_stub_763, _gloffset__dispatch_stub_763)
        GL_STUB(glFramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT)
+       GL_STUB(gl_dispatch_stub_765, _gloffset__dispatch_stub_765)
+       GL_STUB(gl_dispatch_stub_766, _gloffset__dispatch_stub_766)
+       GL_STUB(gl_dispatch_stub_767, _gloffset__dispatch_stub_767)
+       GL_STUB(gl_dispatch_stub_768, _gloffset__dispatch_stub_768)
        GL_STUB(gl_dispatch_stub_769, _gloffset__dispatch_stub_769)
-       GL_STUB(gl_dispatch_stub_770, _gloffset__dispatch_stub_770)
-       GL_STUB(gl_dispatch_stub_771, _gloffset__dispatch_stub_771)
-       GL_STUB(gl_dispatch_stub_772, _gloffset__dispatch_stub_772)
-       GL_STUB(gl_dispatch_stub_773, _gloffset__dispatch_stub_773)
 
                .globl _mesa_sparc_glapi_end ; .type _mesa_sparc_glapi_end,#function
 _mesa_sparc_glapi_end:
@@ -1710,6 +1702,10 @@ _mesa_sparc_glapi_end:
        .globl glGetVertexAttribdv ; .type glGetVertexAttribdv,#function ; glGetVertexAttribdv = glGetVertexAttribdvARB
        .globl glGetVertexAttribfv ; .type glGetVertexAttribfv,#function ; glGetVertexAttribfv = glGetVertexAttribfvARB
        .globl glGetVertexAttribiv ; .type glGetVertexAttribiv,#function ; glGetVertexAttribiv = glGetVertexAttribivARB
+       .globl glProgramParameter4dNV ; .type glProgramParameter4dNV,#function ; glProgramParameter4dNV = glProgramEnvParameter4dARB
+       .globl glProgramParameter4dvNV ; .type glProgramParameter4dvNV,#function ; glProgramParameter4dvNV = glProgramEnvParameter4dvARB
+       .globl glProgramParameter4fNV ; .type glProgramParameter4fNV,#function ; glProgramParameter4fNV = glProgramEnvParameter4fARB
+       .globl glProgramParameter4fvNV ; .type glProgramParameter4fvNV,#function ; glProgramParameter4fvNV = glProgramEnvParameter4fvARB
        .globl glVertexAttrib1d ; .type glVertexAttrib1d,#function ; glVertexAttrib1d = glVertexAttrib1dARB
        .globl glVertexAttrib1dv ; .type glVertexAttrib1dv,#function ; glVertexAttrib1dv = glVertexAttrib1dvARB
        .globl glVertexAttrib1f ; .type glVertexAttrib1f,#function ; glVertexAttrib1f = glVertexAttrib1fARB
index ce8fefe703fc395083e782e9c059ed07827fe2e1..e95ff5e2e0d36dc9c145859961732ce784020a25 100644 (file)
@@ -198,6 +198,10 @@ combined_bitmap_fragment_program(GLcontext *ctx)
          _mesa_combine_programs(ctx,
                                 &bitmap_prog->Base.Base, &stfp->Base.Base);
       stfp->bitmap_program->bitmap_sampler = sampler;
+
+      /* done with this after combining */
+      st_reference_fragprog(st, &bitmap_prog, NULL);
+
 #if 0
       {
          struct gl_program *p = &stfp->bitmap_program->Base.Base;
@@ -743,15 +747,6 @@ st_destroy_bitmap(struct st_context *st)
 {
    struct pipe_context *pipe = st->pipe;
 
-#if 0
-   if (st->bitmap.combined_prog) {
-      st_delete_program(st->ctx, &st->bitmap.combined_prog->Base.Base);
-   }
-
-   if (st->bitmap.program) {
-      st_delete_program(st->ctx, &st->bitmap.program->Base.Base);
-   }
-#endif
    if (st->bitmap.vs) {
       cso_delete_vertex_shader(st->cso_context, st->bitmap.vs);
       st->bitmap.vs = NULL;
index b7d72046339c3fe4d8e88a880039c620cd6568a0..cdfcdcee72c4adf4da6a91e1fc1ce84e9d9659c7 100644 (file)
@@ -97,6 +97,16 @@ st_destroy_clear(struct st_context *st)
 {
    struct pipe_context *pipe = st->pipe;
 
+   if (st->clear.vert_shader.tokens) {
+      FREE((void *) st->clear.vert_shader.tokens);
+      st->clear.vert_shader.tokens = NULL;
+   }
+
+   if (st->clear.frag_shader.tokens) {
+      FREE((void *) st->clear.frag_shader.tokens);
+      st->clear.frag_shader.tokens = NULL;
+   }
+
    if (st->clear.fs) {
       cso_delete_fragment_shader(st->cso_context, st->clear.fs);
       st->clear.fs = NULL;
index 65bfd6cfcc01499d30ebc3b1d618ca572d2076cb..fbbe8d2d64ecf8de4f749b4cff7a26f229777787 100644 (file)
@@ -164,14 +164,16 @@ static struct st_fragment_program *
 make_fragment_shader_z(struct st_context *st)
 {
    GLcontext *ctx = st->ctx;
-   /* only make programs once and re-use */
-   static struct st_fragment_program *stfp = NULL;
    struct gl_program *p;
    GLuint ic = 0;
 
-   if (stfp)
-      return stfp;
+   if (st->drawpix.z_shader) {
+      return st->drawpix.z_shader;
+   }
 
+   /*
+    * Create shader now
+    */
    p = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
    if (!p)
       return NULL;
@@ -213,10 +215,10 @@ make_fragment_shader_z(struct st_context *st)
    p->OutputsWritten = (1 << FRAG_RESULT_COLR) | (1 << FRAG_RESULT_DEPR);
    p->SamplersUsed = 0x1;  /* sampler 0 (bit 0) is used */
 
-   stfp = (struct st_fragment_program *) p;
-   st_translate_fragment_program(st, stfp, NULL);
+   st->drawpix.z_shader = (struct st_fragment_program *) p;
+   st_translate_fragment_program(st, st->drawpix.z_shader, NULL);
 
-   return stfp;
+   return st->drawpix.z_shader;
 }
 
 
@@ -228,16 +230,17 @@ make_fragment_shader_z(struct st_context *st)
 static struct st_vertex_program *
 st_make_passthrough_vertex_shader(struct st_context *st, GLboolean passColor)
 {
-   /* only make programs once and re-use */
-   static struct st_vertex_program *progs[2] = { NULL, NULL };
    GLcontext *ctx = st->ctx;
    struct st_vertex_program *stvp;
    struct gl_program *p;
    GLuint ic = 0;
 
-   if (progs[passColor])
-      return progs[passColor];
+   if (st->drawpix.vert_shaders[passColor])
+      return st->drawpix.vert_shaders[passColor];
 
+   /*
+    * Create shader now
+    */
    p = ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0);
    if (!p)
       return NULL;
@@ -293,7 +296,7 @@ st_make_passthrough_vertex_shader(struct st_context *st, GLboolean passColor)
    stvp = (struct st_vertex_program *) p;
    st_translate_vertex_program(st, stvp, NULL);
 
-   progs[passColor] = stvp;
+   st->drawpix.vert_shaders[passColor] = stvp;
 
    return stvp;
 }
@@ -770,7 +773,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
             }
 
             switch (ps->format) {
-            case PIPE_FORMAT_U_S8:
+            case PIPE_FORMAT_S8_UNORM:
                {
                   ubyte *dest = stmap + spanY * ps->pitch + spanX;
                   memcpy(dest, values, spanWidth);
@@ -914,7 +917,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
             }
          }
          break;
-      case PIPE_FORMAT_U_S8:
+      case PIPE_FORMAT_S8_UNORM:
          memcpy(dst, src, width);
          break;
       default:
@@ -1042,3 +1045,15 @@ void st_init_drawpixels_functions(struct dd_function_table *functions)
    functions->DrawPixels = st_DrawPixels;
    functions->CopyPixels = st_CopyPixels;
 }
+
+
+void
+st_destroy_drawpix(struct st_context *st)
+{
+   st_reference_fragprog(st, &st->drawpix.z_shader, NULL);
+   st_reference_fragprog(st, &st->pixel_xfer.combined_prog, NULL);
+   st_reference_vertprog(st, &st->drawpix.vert_shaders[0], NULL);
+   st_reference_vertprog(st, &st->drawpix.vert_shaders[1], NULL);
+}
+
+
index 71ba487020090f08e8e9c28678c915a05733cf9e..26fe864d185599590ff289991fe49fef7b035ca6 100644 (file)
@@ -32,5 +32,8 @@
 
 extern void st_init_drawpixels_functions(struct dd_function_table *functions);
 
+extern void
+st_destroy_drawpix(struct st_context *st);
+
 
 #endif /* ST_CB_DRAWPIXELS_H */
index a293ec3f0b99fc849b4825dc72f44118812186ef..5f753afdd3635b6cc48590d326ce962ff511c71f 100644 (file)
@@ -89,8 +89,12 @@ static void st_use_program( GLcontext *ctx,
 
 
 
+/**
+ * Called via ctx->Driver.NewProgram() to allocate a new vertex or
+ * fragment program.
+ */
 static struct gl_program *st_new_program( GLcontext *ctx,
-                                         GLenum target, 
+                                         GLenum target,
                                          GLuint id )
 {
    switch (target) {
@@ -118,7 +122,8 @@ static struct gl_program *st_new_program( GLcontext *ctx,
    }
 
    default:
-      return _mesa_new_program(ctx, target, id);
+      assert(0);
+      return NULL;
    }
 }
 
@@ -138,6 +143,12 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog)
             stvp->driver_shader = NULL;
          }
 
+         if (stvp->draw_shader) {
+            /* this would only have been allocated for the RasterPos path */
+            draw_delete_vertex_shader(st->draw, stvp->draw_shader);
+            stvp->draw_shader = NULL;
+         }
+
          if (stvp->state.tokens) {
             FREE((void *) stvp->state.tokens);
             stvp->state.tokens = NULL;
@@ -159,7 +170,9 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog)
          }
 
          if (stfp->bitmap_program) {
-            st_delete_program(ctx, &stfp->bitmap_program->Base.Base);
+            struct gl_program *prg = &stfp->bitmap_program->Base.Base;
+            _mesa_reference_program(ctx, &prg, NULL);
+            stfp->bitmap_program = NULL;
          }
 
          st_free_translated_vertex_programs(st, stfp->vertex_programs);
@@ -218,6 +231,7 @@ static void st_program_string_notify( GLcontext *ctx,
       }
 
       if (stvp->draw_shader) {
+         /* this would only have been allocated for the RasterPos path */
          draw_delete_vertex_shader(st->draw, stvp->draw_shader);
          stvp->draw_shader = NULL;
       }
index ddbe36106c86367c4478eeb59b7c5073f71b662d..745755566e7e312f19d3438599e4961bb3b3e516 100644 (file)
@@ -87,7 +87,7 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
 
       /* get stencil values */
       switch (ps->format) {
-      case PIPE_FORMAT_U_S8:
+      case PIPE_FORMAT_S8_UNORM:
          {
             const ubyte *src = stmap + srcY * ps->pitch + x;
             memcpy(values, src, width);
index 866683c23e99a0cec7a524c419408c2b539efed7..cc17bebc6b696188c7f1261edca5dd4ff3ecfceb 100644 (file)
@@ -151,7 +151,7 @@ st_DeleteTextureObject(GLcontext *ctx,
 {
    struct st_texture_object *stObj = st_texture_object(texObj);
    if (stObj->pt)
-      pipe_texture_release(&stObj->pt);
+      pipe_texture_reference(&stObj->pt, NULL);
 
    _mesa_delete_texture_object(ctx, texObj);
 }
@@ -165,7 +165,7 @@ st_FreeTextureImageData(GLcontext * ctx, struct gl_texture_image *texImage)
    DBG("%s\n", __FUNCTION__);
 
    if (stImage->pt) {
-      pipe_texture_release(&stImage->pt);
+      pipe_texture_reference(&stImage->pt, NULL);
    }
 
    if (texImage->Data) {
@@ -544,7 +544,7 @@ st_TexImage(GLcontext * ctx,
     * Release any old malloced memory.
     */
    if (stImage->pt) {
-      pipe_texture_release(&stImage->pt);
+      pipe_texture_reference(&stImage->pt, NULL);
       assert(!texImage->Data);
    }
    else if (texImage->Data) {
@@ -564,7 +564,7 @@ st_TexImage(GLcontext * ctx,
                                  stImage->face, stImage->level)))) {
 
       DBG("release it\n");
-      pipe_texture_release(&stObj->pt);
+      pipe_texture_reference(&stObj->pt, NULL);
       assert(!stObj->pt);
       stObj->teximage_realloc = FALSE;
    }
@@ -1396,7 +1396,7 @@ copy_image_data_to_texture(struct st_context *st,
                             stImage->face
                             );
 
-      pipe_texture_release(&stImage->pt);
+      pipe_texture_reference(&stImage->pt, NULL);
    }
    else if (stImage->base.Data) {
       assert(stImage->base.Data != NULL);
@@ -1457,9 +1457,6 @@ st_finalize_texture(GLcontext *ctx,
        firstImage->pt != stObj->pt &&
        firstImage->pt->last_level >= stObj->lastLevel) {
 
-      if (stObj->pt)
-         pipe_texture_release(&stObj->pt);
-
       pipe_texture_reference(&stObj->pt, firstImage->pt);
    }
 
index 8db55a179f8217ca939bc938b93e39163dcfdbb3..4081722bc71f9be12c9105dcca8def72effca2dd 100644 (file)
@@ -158,9 +158,6 @@ static void st_destroy_context_priv( struct st_context *st )
 {
    uint i;
 
-   st_reference_fragprog(st, &st->fp, NULL);
-   st_reference_vertprog(st, &st->vp, NULL);
-
    draw_destroy(st->draw);
    st_destroy_atoms( st );
    st_destroy_draw( st );
@@ -168,9 +165,14 @@ static void st_destroy_context_priv( struct st_context *st )
    st_destroy_bitmap(st);
    st_destroy_blit(st);
    st_destroy_clear(st);
+   st_destroy_drawpix(st);
 
    _vbo_DestroyContext(st->ctx);
 
+   for (i = 0; i < Elements(st->state.sampler_texture); i++) {
+      pipe_texture_reference(&st->state.sampler_texture[i], NULL);
+   }
+
    for (i = 0; i < Elements(st->state.constants); i++) {
       if (st->state.constants[i].buffer) {
          pipe_reference_buffer(st->pipe, &st->state.constants[i].buffer, NULL);
@@ -190,6 +192,9 @@ void st_destroy_context( struct st_context *st )
    /* need to unbind and destroy CSO objects before anything else */
    cso_release_all(st->cso_context);
 
+   st_reference_fragprog(st, &st->fp, NULL);
+   st_reference_vertprog(st, &st->vp, NULL);
+
    _mesa_delete_program_cache(st->ctx, st->pixel_xfer.cache);
 
    _mesa_free_context_data(ctx);
index 1ca779d0a98e5eb2d2a4db787d4a046a84b18547..46c16e45e66e817d9a26de57e048bd300249ec91 100644 (file)
@@ -152,6 +152,12 @@ struct st_context
       struct bitmap_cache *cache;
    } bitmap;
 
+   /** for glDraw/CopyPixels */
+   struct {
+      struct st_fragment_program *z_shader;
+      struct st_vertex_program *vert_shaders[2];
+   } drawpix;
+
    /** for glClear */
    struct {
       struct pipe_shader_state vert_shader;
index 9a385a0457983fd7c508e17e5f5a950527636a75..17a3cfd5a466357f8d3be741a35843ea60f6729f 100644 (file)
@@ -503,8 +503,8 @@ st_choose_format(struct pipe_context *pipe, GLint internalFormat,
    case GL_STENCIL_INDEX4_EXT:
    case GL_STENCIL_INDEX8_EXT:
    case GL_STENCIL_INDEX16_EXT:
-      if (screen->is_format_supported( screen, PIPE_FORMAT_U_S8, surfType ))
-         return PIPE_FORMAT_U_S8;
+      if (screen->is_format_supported( screen, PIPE_FORMAT_S8_UNORM, surfType ))
+         return PIPE_FORMAT_S8_UNORM;
       if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, surfType ))
          return PIPE_FORMAT_S8Z24_UNORM;
       if (screen->is_format_supported( screen, PIPE_FORMAT_Z24S8_UNORM, surfType ))
index 1a0e19c2f92ae2008dd735e86147726cf8cf9a55..047743689dcfde987cc75aa2ce4a9ddd81af1403 100644 (file)
@@ -197,6 +197,6 @@ st_generate_mipmap(GLcontext *ctx, GLenum target,
       dstImage->TexFormat = srcImage->TexFormat;
 
       stImage = (struct st_texture_image *) dstImage;
-      stImage->pt = pt;
+      pipe_texture_reference(&stImage->pt, pt);
    }
 }
index 6ee8bfd0a5ef93ed9002459aa1de2ce453d35011..8eeb40f7c53a9a8f488930b3682a05238a4d27dc 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.2
+ * Version:  7.0.3
  *
- * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 
 
 /**
- * Fetch a texel.
+ * Fetch a texel with given lod.
+ * Called via machine->FetchTexelLod()
  */
 static void
-fetch_texel( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda,
-             GLuint unit, GLfloat color[4] )
+fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda,
+                 GLuint unit, GLfloat color[4] )
 {
    GLchan rgba[4];
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
+   const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
+
+   lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod);
 
    /* XXX use a float-valued TextureSample routine here!!! */
-   swrast->TextureSample[unit](ctx, ctx->Texture.Unit[unit]._Current,
-                               1, (const GLfloat (*)[4]) texcoord,
+   swrast->TextureSample[unit](ctx, texObj, 1, (const GLfloat (*)[4]) texcoord,
                                &lambda, &rgba);
    color[0] = CHAN_TO_FLOAT(rgba[0]);
    color[1] = CHAN_TO_FLOAT(rgba[1]);
@@ -56,11 +59,12 @@ fetch_texel( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda,
 /**
  * Fetch a texel with the given partial derivatives to compute a level
  * of detail in the mipmap.
+ * Called via machine->FetchTexelDeriv()
  */
 static void
 fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4],
                    const GLfloat texdx[4], const GLfloat texdy[4],
-                   GLuint unit, GLfloat color[4] )
+                   GLfloat lodBias, GLuint unit, GLfloat color[4] )
 {
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
    const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
@@ -69,15 +73,17 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4],
    const GLfloat texH = (GLfloat) texImg->HeightScale;
    GLchan rgba[4];
 
-   GLfloat lambda = _swrast_compute_lambda(texdx[0], texdy[0], /* ds/dx, ds/dy */
-                                         texdx[1], texdy[1], /* dt/dx, dt/dy */
-                                         texdx[3], texdy[2], /* dq/dx, dq/dy */
-                                         texW, texH,
-                                         texcoord[0], texcoord[1], texcoord[3],
-                                         1.0F / texcoord[3]);
+   GLfloat lambda
+      = _swrast_compute_lambda(texdx[0], texdy[0], /* ds/dx, ds/dy */
+                               texdx[1], texdy[1], /* dt/dx, dt/dy */
+                               texdx[3], texdy[2], /* dq/dx, dq/dy */
+                               texW, texH,
+                               texcoord[0], texcoord[1], texcoord[3],
+                               1.0F / texcoord[3]) + lodBias;
+
+   lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod);
 
-   swrast->TextureSample[unit](ctx, ctx->Texture.Unit[unit]._Current,
-                               1, (const GLfloat (*)[4]) texcoord,
+   swrast->TextureSample[unit](ctx, texObj, 1, (const GLfloat (*)[4]) texcoord,
                                &lambda, &rgba);
    color[0] = CHAN_TO_FLOAT(rgba[0]);
    color[1] = CHAN_TO_FLOAT(rgba[1]);
@@ -132,7 +138,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine,
    /* init call stack */
    machine->StackDepth = 0;
 
-   machine->FetchTexelLod = fetch_texel;
+   machine->FetchTexelLod = fetch_texel_lod;
    machine->FetchTexelDeriv = fetch_texel_deriv;
 }
 
index 23a3658386c2cd270610e3b7d99585548b529d49..6bb6849a6a53e231cf908ccd30dca7d0f55b2e31 100644 (file)
@@ -198,7 +198,7 @@ static void vbo_exec_bind_arrays( GLcontext *ctx )
         arrays[attr].BufferObj = exec->vtx.bufferobj;
         arrays[attr]._MaxElement = count; /* ??? */
 
-        data += exec->vtx.attrsz[attr] * sizeof(GLfloat);
+        data += exec->vtx.attrsz[src] * sizeof(GLfloat);
       }
    }
 }
index 3c6f0fccd98e41c51d311f37537f65e75e1c29fe..bf5c6d4eefe98e06d5ac61922f1dd58cc7a3159e 100644 (file)
@@ -131,10 +131,12 @@ static void vbo_bind_vertex_list( GLcontext *ctx,
       break;
    }
 
-   for (attr = 0; attr < VBO_ATTRIB_MAX; attr++) {
-      if (node->attrsz[attr]) {
+   for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
+      GLuint src = map[attr];
+
+      if (node->attrsz[src]) {
         arrays[attr].Ptr = (const GLubyte *)data;
-        arrays[attr].Size = node->attrsz[attr];
+        arrays[attr].Size = node->attrsz[src];
         arrays[attr].StrideB = node->vertex_size * sizeof(GLfloat);
         arrays[attr].Stride = node->vertex_size * sizeof(GLfloat);
         arrays[attr].Type = GL_FLOAT;
@@ -144,7 +146,7 @@ static void vbo_bind_vertex_list( GLcontext *ctx,
         
         assert(arrays[attr].BufferObj->Name);
 
-        data += node->attrsz[attr] * sizeof(GLfloat);
+        data += node->attrsz[src] * sizeof(GLfloat);
       }
    }
 }
index a239a6749d5a3e6b210ddbbd5b4f8270b866e3d6..cb34061b36cacbf625af0b381aeaed1ea16487ab 100644 (file)
@@ -25267,193 +25267,13 @@ GL_PREFIX(LoadProgramNV):
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(LoadProgramNV), .-GL_PREFIX(LoadProgramNV)
 
-       .p2align        4,,15
-       .globl  GL_PREFIX(ProgramParameter4dNV)
-       .type   GL_PREFIX(ProgramParameter4dNV), @function
-GL_PREFIX(ProgramParameter4dNV):
-#if defined(GLX_USE_TLS)
-       call    _x86_64_get_dispatch@PLT
-       movq    5384(%rax), %r11
-       jmp     *%r11
-#elif defined(PTHREADS)
-       subq    $56, %rsp
-       movq    %rdi, (%rsp)
-       movq    %rsi, 8(%rsp)
-       movq    %xmm0, 16(%rsp)
-       movq    %xmm1, 24(%rsp)
-       movq    %xmm2, 32(%rsp)
-       movq    %xmm3, 40(%rsp)
-       call    _x86_64_get_dispatch@PLT
-       movq    40(%rsp), %xmm3
-       movq    32(%rsp), %xmm2
-       movq    24(%rsp), %xmm1
-       movq    16(%rsp), %xmm0
-       movq    8(%rsp), %rsi
-       movq    (%rsp), %rdi
-       addq    $56, %rsp
-       movq    5384(%rax), %r11
-       jmp     *%r11
-#else
-       movq    _glapi_Dispatch(%rip), %rax
-       testq   %rax, %rax
-       je      1f
-       movq    5384(%rax), %r11
-       jmp     *%r11
-1:
-       subq    $56, %rsp
-       movq    %rdi, (%rsp)
-       movq    %rsi, 8(%rsp)
-       movq    %xmm0, 16(%rsp)
-       movq    %xmm1, 24(%rsp)
-       movq    %xmm2, 32(%rsp)
-       movq    %xmm3, 40(%rsp)
-       call    _glapi_get_dispatch
-       movq    40(%rsp), %xmm3
-       movq    32(%rsp), %xmm2
-       movq    24(%rsp), %xmm1
-       movq    16(%rsp), %xmm0
-       movq    8(%rsp), %rsi
-       movq    (%rsp), %rdi
-       addq    $56, %rsp
-       movq    5384(%rax), %r11
-       jmp     *%r11
-#endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(ProgramParameter4dNV), .-GL_PREFIX(ProgramParameter4dNV)
-
-       .p2align        4,,15
-       .globl  GL_PREFIX(ProgramParameter4dvNV)
-       .type   GL_PREFIX(ProgramParameter4dvNV), @function
-GL_PREFIX(ProgramParameter4dvNV):
-#if defined(GLX_USE_TLS)
-       call    _x86_64_get_dispatch@PLT
-       movq    5392(%rax), %r11
-       jmp     *%r11
-#elif defined(PTHREADS)
-       pushq   %rdi
-       pushq   %rsi
-       pushq   %rdx
-       call    _x86_64_get_dispatch@PLT
-       popq    %rdx
-       popq    %rsi
-       popq    %rdi
-       movq    5392(%rax), %r11
-       jmp     *%r11
-#else
-       movq    _glapi_Dispatch(%rip), %rax
-       testq   %rax, %rax
-       je      1f
-       movq    5392(%rax), %r11
-       jmp     *%r11
-1:
-       pushq   %rdi
-       pushq   %rsi
-       pushq   %rdx
-       call    _glapi_get_dispatch
-       popq    %rdx
-       popq    %rsi
-       popq    %rdi
-       movq    5392(%rax), %r11
-       jmp     *%r11
-#endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(ProgramParameter4dvNV), .-GL_PREFIX(ProgramParameter4dvNV)
-
-       .p2align        4,,15
-       .globl  GL_PREFIX(ProgramParameter4fNV)
-       .type   GL_PREFIX(ProgramParameter4fNV), @function
-GL_PREFIX(ProgramParameter4fNV):
-#if defined(GLX_USE_TLS)
-       call    _x86_64_get_dispatch@PLT
-       movq    5400(%rax), %r11
-       jmp     *%r11
-#elif defined(PTHREADS)
-       subq    $56, %rsp
-       movq    %rdi, (%rsp)
-       movq    %rsi, 8(%rsp)
-       movq    %xmm0, 16(%rsp)
-       movq    %xmm1, 24(%rsp)
-       movq    %xmm2, 32(%rsp)
-       movq    %xmm3, 40(%rsp)
-       call    _x86_64_get_dispatch@PLT
-       movq    40(%rsp), %xmm3
-       movq    32(%rsp), %xmm2
-       movq    24(%rsp), %xmm1
-       movq    16(%rsp), %xmm0
-       movq    8(%rsp), %rsi
-       movq    (%rsp), %rdi
-       addq    $56, %rsp
-       movq    5400(%rax), %r11
-       jmp     *%r11
-#else
-       movq    _glapi_Dispatch(%rip), %rax
-       testq   %rax, %rax
-       je      1f
-       movq    5400(%rax), %r11
-       jmp     *%r11
-1:
-       subq    $56, %rsp
-       movq    %rdi, (%rsp)
-       movq    %rsi, 8(%rsp)
-       movq    %xmm0, 16(%rsp)
-       movq    %xmm1, 24(%rsp)
-       movq    %xmm2, 32(%rsp)
-       movq    %xmm3, 40(%rsp)
-       call    _glapi_get_dispatch
-       movq    40(%rsp), %xmm3
-       movq    32(%rsp), %xmm2
-       movq    24(%rsp), %xmm1
-       movq    16(%rsp), %xmm0
-       movq    8(%rsp), %rsi
-       movq    (%rsp), %rdi
-       addq    $56, %rsp
-       movq    5400(%rax), %r11
-       jmp     *%r11
-#endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(ProgramParameter4fNV), .-GL_PREFIX(ProgramParameter4fNV)
-
-       .p2align        4,,15
-       .globl  GL_PREFIX(ProgramParameter4fvNV)
-       .type   GL_PREFIX(ProgramParameter4fvNV), @function
-GL_PREFIX(ProgramParameter4fvNV):
-#if defined(GLX_USE_TLS)
-       call    _x86_64_get_dispatch@PLT
-       movq    5408(%rax), %r11
-       jmp     *%r11
-#elif defined(PTHREADS)
-       pushq   %rdi
-       pushq   %rsi
-       pushq   %rdx
-       call    _x86_64_get_dispatch@PLT
-       popq    %rdx
-       popq    %rsi
-       popq    %rdi
-       movq    5408(%rax), %r11
-       jmp     *%r11
-#else
-       movq    _glapi_Dispatch(%rip), %rax
-       testq   %rax, %rax
-       je      1f
-       movq    5408(%rax), %r11
-       jmp     *%r11
-1:
-       pushq   %rdi
-       pushq   %rsi
-       pushq   %rdx
-       call    _glapi_get_dispatch
-       popq    %rdx
-       popq    %rsi
-       popq    %rdi
-       movq    5408(%rax), %r11
-       jmp     *%r11
-#endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(ProgramParameter4fvNV), .-GL_PREFIX(ProgramParameter4fvNV)
-
        .p2align        4,,15
        .globl  GL_PREFIX(ProgramParameters4dvNV)
        .type   GL_PREFIX(ProgramParameters4dvNV), @function
 GL_PREFIX(ProgramParameters4dvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5416(%rax), %r11
+       movq    5384(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -25467,13 +25287,13 @@ GL_PREFIX(ProgramParameters4dvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5416(%rax), %r11
+       movq    5384(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5416(%rax), %r11
+       movq    5384(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -25487,7 +25307,7 @@ GL_PREFIX(ProgramParameters4dvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5416(%rax), %r11
+       movq    5384(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(ProgramParameters4dvNV), .-GL_PREFIX(ProgramParameters4dvNV)
@@ -25498,7 +25318,7 @@ GL_PREFIX(ProgramParameters4dvNV):
 GL_PREFIX(ProgramParameters4fvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5424(%rax), %r11
+       movq    5392(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -25512,13 +25332,13 @@ GL_PREFIX(ProgramParameters4fvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5424(%rax), %r11
+       movq    5392(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5424(%rax), %r11
+       movq    5392(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -25532,7 +25352,7 @@ GL_PREFIX(ProgramParameters4fvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5424(%rax), %r11
+       movq    5392(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(ProgramParameters4fvNV), .-GL_PREFIX(ProgramParameters4fvNV)
@@ -25543,7 +25363,7 @@ GL_PREFIX(ProgramParameters4fvNV):
 GL_PREFIX(RequestResidentProgramsNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5432(%rax), %r11
+       movq    5400(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -25553,13 +25373,13 @@ GL_PREFIX(RequestResidentProgramsNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5432(%rax), %r11
+       movq    5400(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5432(%rax), %r11
+       movq    5400(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -25569,7 +25389,7 @@ GL_PREFIX(RequestResidentProgramsNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5432(%rax), %r11
+       movq    5400(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(RequestResidentProgramsNV), .-GL_PREFIX(RequestResidentProgramsNV)
@@ -25580,7 +25400,7 @@ GL_PREFIX(RequestResidentProgramsNV):
 GL_PREFIX(TrackMatrixNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5440(%rax), %r11
+       movq    5408(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -25594,13 +25414,13 @@ GL_PREFIX(TrackMatrixNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5440(%rax), %r11
+       movq    5408(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5440(%rax), %r11
+       movq    5408(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -25614,7 +25434,7 @@ GL_PREFIX(TrackMatrixNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5440(%rax), %r11
+       movq    5408(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(TrackMatrixNV), .-GL_PREFIX(TrackMatrixNV)
@@ -25625,7 +25445,7 @@ GL_PREFIX(TrackMatrixNV):
 GL_PREFIX(VertexAttrib1dNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5448(%rax), %r11
+       movq    5416(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        subq    $24, %rsp
@@ -25635,13 +25455,13 @@ GL_PREFIX(VertexAttrib1dNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $24, %rsp
-       movq    5448(%rax), %r11
+       movq    5416(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5448(%rax), %r11
+       movq    5416(%rax), %r11
        jmp     *%r11
 1:
        subq    $24, %rsp
@@ -25651,7 +25471,7 @@ GL_PREFIX(VertexAttrib1dNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $24, %rsp
-       movq    5448(%rax), %r11
+       movq    5416(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib1dNV), .-GL_PREFIX(VertexAttrib1dNV)
@@ -25662,7 +25482,7 @@ GL_PREFIX(VertexAttrib1dNV):
 GL_PREFIX(VertexAttrib1dvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5456(%rax), %r11
+       movq    5424(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -25672,13 +25492,13 @@ GL_PREFIX(VertexAttrib1dvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5456(%rax), %r11
+       movq    5424(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5456(%rax), %r11
+       movq    5424(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -25688,7 +25508,7 @@ GL_PREFIX(VertexAttrib1dvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5456(%rax), %r11
+       movq    5424(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib1dvNV), .-GL_PREFIX(VertexAttrib1dvNV)
@@ -25699,7 +25519,7 @@ GL_PREFIX(VertexAttrib1dvNV):
 GL_PREFIX(VertexAttrib1fNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5464(%rax), %r11
+       movq    5432(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        subq    $24, %rsp
@@ -25709,13 +25529,13 @@ GL_PREFIX(VertexAttrib1fNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $24, %rsp
-       movq    5464(%rax), %r11
+       movq    5432(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5464(%rax), %r11
+       movq    5432(%rax), %r11
        jmp     *%r11
 1:
        subq    $24, %rsp
@@ -25725,7 +25545,7 @@ GL_PREFIX(VertexAttrib1fNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $24, %rsp
-       movq    5464(%rax), %r11
+       movq    5432(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib1fNV), .-GL_PREFIX(VertexAttrib1fNV)
@@ -25736,7 +25556,7 @@ GL_PREFIX(VertexAttrib1fNV):
 GL_PREFIX(VertexAttrib1fvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5472(%rax), %r11
+       movq    5440(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -25746,13 +25566,13 @@ GL_PREFIX(VertexAttrib1fvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5472(%rax), %r11
+       movq    5440(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5472(%rax), %r11
+       movq    5440(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -25762,7 +25582,7 @@ GL_PREFIX(VertexAttrib1fvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5472(%rax), %r11
+       movq    5440(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib1fvNV), .-GL_PREFIX(VertexAttrib1fvNV)
@@ -25773,7 +25593,7 @@ GL_PREFIX(VertexAttrib1fvNV):
 GL_PREFIX(VertexAttrib1sNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5480(%rax), %r11
+       movq    5448(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -25783,13 +25603,13 @@ GL_PREFIX(VertexAttrib1sNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5480(%rax), %r11
+       movq    5448(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5480(%rax), %r11
+       movq    5448(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -25799,7 +25619,7 @@ GL_PREFIX(VertexAttrib1sNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5480(%rax), %r11
+       movq    5448(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib1sNV), .-GL_PREFIX(VertexAttrib1sNV)
@@ -25810,7 +25630,7 @@ GL_PREFIX(VertexAttrib1sNV):
 GL_PREFIX(VertexAttrib1svNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5488(%rax), %r11
+       movq    5456(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -25820,13 +25640,13 @@ GL_PREFIX(VertexAttrib1svNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5488(%rax), %r11
+       movq    5456(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5488(%rax), %r11
+       movq    5456(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -25836,7 +25656,7 @@ GL_PREFIX(VertexAttrib1svNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5488(%rax), %r11
+       movq    5456(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib1svNV), .-GL_PREFIX(VertexAttrib1svNV)
@@ -25847,7 +25667,7 @@ GL_PREFIX(VertexAttrib1svNV):
 GL_PREFIX(VertexAttrib2dNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5496(%rax), %r11
+       movq    5464(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        subq    $24, %rsp
@@ -25859,13 +25679,13 @@ GL_PREFIX(VertexAttrib2dNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $24, %rsp
-       movq    5496(%rax), %r11
+       movq    5464(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5496(%rax), %r11
+       movq    5464(%rax), %r11
        jmp     *%r11
 1:
        subq    $24, %rsp
@@ -25877,7 +25697,7 @@ GL_PREFIX(VertexAttrib2dNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $24, %rsp
-       movq    5496(%rax), %r11
+       movq    5464(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib2dNV), .-GL_PREFIX(VertexAttrib2dNV)
@@ -25888,7 +25708,7 @@ GL_PREFIX(VertexAttrib2dNV):
 GL_PREFIX(VertexAttrib2dvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5504(%rax), %r11
+       movq    5472(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -25898,13 +25718,13 @@ GL_PREFIX(VertexAttrib2dvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5504(%rax), %r11
+       movq    5472(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5504(%rax), %r11
+       movq    5472(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -25914,7 +25734,7 @@ GL_PREFIX(VertexAttrib2dvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5504(%rax), %r11
+       movq    5472(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib2dvNV), .-GL_PREFIX(VertexAttrib2dvNV)
@@ -25925,7 +25745,7 @@ GL_PREFIX(VertexAttrib2dvNV):
 GL_PREFIX(VertexAttrib2fNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5512(%rax), %r11
+       movq    5480(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        subq    $24, %rsp
@@ -25937,13 +25757,13 @@ GL_PREFIX(VertexAttrib2fNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $24, %rsp
-       movq    5512(%rax), %r11
+       movq    5480(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5512(%rax), %r11
+       movq    5480(%rax), %r11
        jmp     *%r11
 1:
        subq    $24, %rsp
@@ -25955,7 +25775,7 @@ GL_PREFIX(VertexAttrib2fNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $24, %rsp
-       movq    5512(%rax), %r11
+       movq    5480(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib2fNV), .-GL_PREFIX(VertexAttrib2fNV)
@@ -25966,7 +25786,7 @@ GL_PREFIX(VertexAttrib2fNV):
 GL_PREFIX(VertexAttrib2fvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5520(%rax), %r11
+       movq    5488(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -25976,13 +25796,13 @@ GL_PREFIX(VertexAttrib2fvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5520(%rax), %r11
+       movq    5488(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5520(%rax), %r11
+       movq    5488(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -25992,7 +25812,7 @@ GL_PREFIX(VertexAttrib2fvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5520(%rax), %r11
+       movq    5488(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib2fvNV), .-GL_PREFIX(VertexAttrib2fvNV)
@@ -26003,7 +25823,7 @@ GL_PREFIX(VertexAttrib2fvNV):
 GL_PREFIX(VertexAttrib2sNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5528(%rax), %r11
+       movq    5496(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26013,13 +25833,13 @@ GL_PREFIX(VertexAttrib2sNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5528(%rax), %r11
+       movq    5496(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5528(%rax), %r11
+       movq    5496(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26029,7 +25849,7 @@ GL_PREFIX(VertexAttrib2sNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5528(%rax), %r11
+       movq    5496(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib2sNV), .-GL_PREFIX(VertexAttrib2sNV)
@@ -26040,7 +25860,7 @@ GL_PREFIX(VertexAttrib2sNV):
 GL_PREFIX(VertexAttrib2svNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5536(%rax), %r11
+       movq    5504(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26050,13 +25870,13 @@ GL_PREFIX(VertexAttrib2svNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5536(%rax), %r11
+       movq    5504(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5536(%rax), %r11
+       movq    5504(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26066,7 +25886,7 @@ GL_PREFIX(VertexAttrib2svNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5536(%rax), %r11
+       movq    5504(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib2svNV), .-GL_PREFIX(VertexAttrib2svNV)
@@ -26077,7 +25897,7 @@ GL_PREFIX(VertexAttrib2svNV):
 GL_PREFIX(VertexAttrib3dNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5544(%rax), %r11
+       movq    5512(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        subq    $40, %rsp
@@ -26091,13 +25911,13 @@ GL_PREFIX(VertexAttrib3dNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $40, %rsp
-       movq    5544(%rax), %r11
+       movq    5512(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5544(%rax), %r11
+       movq    5512(%rax), %r11
        jmp     *%r11
 1:
        subq    $40, %rsp
@@ -26111,7 +25931,7 @@ GL_PREFIX(VertexAttrib3dNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $40, %rsp
-       movq    5544(%rax), %r11
+       movq    5512(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib3dNV), .-GL_PREFIX(VertexAttrib3dNV)
@@ -26122,7 +25942,7 @@ GL_PREFIX(VertexAttrib3dNV):
 GL_PREFIX(VertexAttrib3dvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5552(%rax), %r11
+       movq    5520(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26132,13 +25952,13 @@ GL_PREFIX(VertexAttrib3dvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5552(%rax), %r11
+       movq    5520(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5552(%rax), %r11
+       movq    5520(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26148,7 +25968,7 @@ GL_PREFIX(VertexAttrib3dvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5552(%rax), %r11
+       movq    5520(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib3dvNV), .-GL_PREFIX(VertexAttrib3dvNV)
@@ -26159,7 +25979,7 @@ GL_PREFIX(VertexAttrib3dvNV):
 GL_PREFIX(VertexAttrib3fNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5560(%rax), %r11
+       movq    5528(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        subq    $40, %rsp
@@ -26173,13 +25993,13 @@ GL_PREFIX(VertexAttrib3fNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $40, %rsp
-       movq    5560(%rax), %r11
+       movq    5528(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5560(%rax), %r11
+       movq    5528(%rax), %r11
        jmp     *%r11
 1:
        subq    $40, %rsp
@@ -26193,7 +26013,7 @@ GL_PREFIX(VertexAttrib3fNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $40, %rsp
-       movq    5560(%rax), %r11
+       movq    5528(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib3fNV), .-GL_PREFIX(VertexAttrib3fNV)
@@ -26204,7 +26024,7 @@ GL_PREFIX(VertexAttrib3fNV):
 GL_PREFIX(VertexAttrib3fvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5568(%rax), %r11
+       movq    5536(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26214,13 +26034,13 @@ GL_PREFIX(VertexAttrib3fvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5568(%rax), %r11
+       movq    5536(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5568(%rax), %r11
+       movq    5536(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26230,7 +26050,7 @@ GL_PREFIX(VertexAttrib3fvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5568(%rax), %r11
+       movq    5536(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib3fvNV), .-GL_PREFIX(VertexAttrib3fvNV)
@@ -26241,7 +26061,7 @@ GL_PREFIX(VertexAttrib3fvNV):
 GL_PREFIX(VertexAttrib3sNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5576(%rax), %r11
+       movq    5544(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26255,13 +26075,13 @@ GL_PREFIX(VertexAttrib3sNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5576(%rax), %r11
+       movq    5544(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5576(%rax), %r11
+       movq    5544(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26275,7 +26095,7 @@ GL_PREFIX(VertexAttrib3sNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5576(%rax), %r11
+       movq    5544(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib3sNV), .-GL_PREFIX(VertexAttrib3sNV)
@@ -26286,7 +26106,7 @@ GL_PREFIX(VertexAttrib3sNV):
 GL_PREFIX(VertexAttrib3svNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5584(%rax), %r11
+       movq    5552(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26296,13 +26116,13 @@ GL_PREFIX(VertexAttrib3svNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5584(%rax), %r11
+       movq    5552(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5584(%rax), %r11
+       movq    5552(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26312,7 +26132,7 @@ GL_PREFIX(VertexAttrib3svNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5584(%rax), %r11
+       movq    5552(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib3svNV), .-GL_PREFIX(VertexAttrib3svNV)
@@ -26323,7 +26143,7 @@ GL_PREFIX(VertexAttrib3svNV):
 GL_PREFIX(VertexAttrib4dNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5592(%rax), %r11
+       movq    5560(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        subq    $40, %rsp
@@ -26339,13 +26159,13 @@ GL_PREFIX(VertexAttrib4dNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $40, %rsp
-       movq    5592(%rax), %r11
+       movq    5560(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5592(%rax), %r11
+       movq    5560(%rax), %r11
        jmp     *%r11
 1:
        subq    $40, %rsp
@@ -26361,7 +26181,7 @@ GL_PREFIX(VertexAttrib4dNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $40, %rsp
-       movq    5592(%rax), %r11
+       movq    5560(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib4dNV), .-GL_PREFIX(VertexAttrib4dNV)
@@ -26372,7 +26192,7 @@ GL_PREFIX(VertexAttrib4dNV):
 GL_PREFIX(VertexAttrib4dvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5600(%rax), %r11
+       movq    5568(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26382,13 +26202,13 @@ GL_PREFIX(VertexAttrib4dvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5600(%rax), %r11
+       movq    5568(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5600(%rax), %r11
+       movq    5568(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26398,7 +26218,7 @@ GL_PREFIX(VertexAttrib4dvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5600(%rax), %r11
+       movq    5568(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib4dvNV), .-GL_PREFIX(VertexAttrib4dvNV)
@@ -26409,7 +26229,7 @@ GL_PREFIX(VertexAttrib4dvNV):
 GL_PREFIX(VertexAttrib4fNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5608(%rax), %r11
+       movq    5576(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        subq    $40, %rsp
@@ -26425,13 +26245,13 @@ GL_PREFIX(VertexAttrib4fNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $40, %rsp
-       movq    5608(%rax), %r11
+       movq    5576(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5608(%rax), %r11
+       movq    5576(%rax), %r11
        jmp     *%r11
 1:
        subq    $40, %rsp
@@ -26447,7 +26267,7 @@ GL_PREFIX(VertexAttrib4fNV):
        movq    8(%rsp), %xmm0
        movq    (%rsp), %rdi
        addq    $40, %rsp
-       movq    5608(%rax), %r11
+       movq    5576(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib4fNV), .-GL_PREFIX(VertexAttrib4fNV)
@@ -26458,7 +26278,7 @@ GL_PREFIX(VertexAttrib4fNV):
 GL_PREFIX(VertexAttrib4fvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5616(%rax), %r11
+       movq    5584(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26468,13 +26288,13 @@ GL_PREFIX(VertexAttrib4fvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5616(%rax), %r11
+       movq    5584(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5616(%rax), %r11
+       movq    5584(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26484,7 +26304,7 @@ GL_PREFIX(VertexAttrib4fvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5616(%rax), %r11
+       movq    5584(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib4fvNV), .-GL_PREFIX(VertexAttrib4fvNV)
@@ -26495,7 +26315,7 @@ GL_PREFIX(VertexAttrib4fvNV):
 GL_PREFIX(VertexAttrib4sNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5624(%rax), %r11
+       movq    5592(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26509,13 +26329,13 @@ GL_PREFIX(VertexAttrib4sNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5624(%rax), %r11
+       movq    5592(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5624(%rax), %r11
+       movq    5592(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26529,7 +26349,7 @@ GL_PREFIX(VertexAttrib4sNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5624(%rax), %r11
+       movq    5592(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib4sNV), .-GL_PREFIX(VertexAttrib4sNV)
@@ -26540,7 +26360,7 @@ GL_PREFIX(VertexAttrib4sNV):
 GL_PREFIX(VertexAttrib4svNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5632(%rax), %r11
+       movq    5600(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26550,13 +26370,13 @@ GL_PREFIX(VertexAttrib4svNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5632(%rax), %r11
+       movq    5600(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5632(%rax), %r11
+       movq    5600(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26566,7 +26386,7 @@ GL_PREFIX(VertexAttrib4svNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5632(%rax), %r11
+       movq    5600(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib4svNV), .-GL_PREFIX(VertexAttrib4svNV)
@@ -26577,7 +26397,7 @@ GL_PREFIX(VertexAttrib4svNV):
 GL_PREFIX(VertexAttrib4ubNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5640(%rax), %r11
+       movq    5608(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26591,13 +26411,13 @@ GL_PREFIX(VertexAttrib4ubNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5640(%rax), %r11
+       movq    5608(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5640(%rax), %r11
+       movq    5608(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26611,7 +26431,7 @@ GL_PREFIX(VertexAttrib4ubNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5640(%rax), %r11
+       movq    5608(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib4ubNV), .-GL_PREFIX(VertexAttrib4ubNV)
@@ -26622,7 +26442,7 @@ GL_PREFIX(VertexAttrib4ubNV):
 GL_PREFIX(VertexAttrib4ubvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5648(%rax), %r11
+       movq    5616(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26632,13 +26452,13 @@ GL_PREFIX(VertexAttrib4ubvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5648(%rax), %r11
+       movq    5616(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5648(%rax), %r11
+       movq    5616(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26648,7 +26468,7 @@ GL_PREFIX(VertexAttrib4ubvNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5648(%rax), %r11
+       movq    5616(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttrib4ubvNV), .-GL_PREFIX(VertexAttrib4ubvNV)
@@ -26659,7 +26479,7 @@ GL_PREFIX(VertexAttrib4ubvNV):
 GL_PREFIX(VertexAttribPointerNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5656(%rax), %r11
+       movq    5624(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26673,13 +26493,13 @@ GL_PREFIX(VertexAttribPointerNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5656(%rax), %r11
+       movq    5624(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5656(%rax), %r11
+       movq    5624(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26693,7 +26513,7 @@ GL_PREFIX(VertexAttribPointerNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5656(%rax), %r11
+       movq    5624(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttribPointerNV), .-GL_PREFIX(VertexAttribPointerNV)
@@ -26704,7 +26524,7 @@ GL_PREFIX(VertexAttribPointerNV):
 GL_PREFIX(VertexAttribs1dvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5664(%rax), %r11
+       movq    5632(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26714,13 +26534,13 @@ GL_PREFIX(VertexAttribs1dvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5664(%rax), %r11
+       movq    5632(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5664(%rax), %r11
+       movq    5632(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26730,7 +26550,7 @@ GL_PREFIX(VertexAttribs1dvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5664(%rax), %r11
+       movq    5632(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttribs1dvNV), .-GL_PREFIX(VertexAttribs1dvNV)
@@ -26741,7 +26561,7 @@ GL_PREFIX(VertexAttribs1dvNV):
 GL_PREFIX(VertexAttribs1fvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5672(%rax), %r11
+       movq    5640(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26751,13 +26571,13 @@ GL_PREFIX(VertexAttribs1fvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5672(%rax), %r11
+       movq    5640(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5672(%rax), %r11
+       movq    5640(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26767,7 +26587,7 @@ GL_PREFIX(VertexAttribs1fvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5672(%rax), %r11
+       movq    5640(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttribs1fvNV), .-GL_PREFIX(VertexAttribs1fvNV)
@@ -26778,7 +26598,7 @@ GL_PREFIX(VertexAttribs1fvNV):
 GL_PREFIX(VertexAttribs1svNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5680(%rax), %r11
+       movq    5648(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26788,13 +26608,13 @@ GL_PREFIX(VertexAttribs1svNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5680(%rax), %r11
+       movq    5648(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5680(%rax), %r11
+       movq    5648(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26804,7 +26624,7 @@ GL_PREFIX(VertexAttribs1svNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5680(%rax), %r11
+       movq    5648(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttribs1svNV), .-GL_PREFIX(VertexAttribs1svNV)
@@ -26815,7 +26635,7 @@ GL_PREFIX(VertexAttribs1svNV):
 GL_PREFIX(VertexAttribs2dvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5688(%rax), %r11
+       movq    5656(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26825,13 +26645,13 @@ GL_PREFIX(VertexAttribs2dvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5688(%rax), %r11
+       movq    5656(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5688(%rax), %r11
+       movq    5656(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26841,7 +26661,7 @@ GL_PREFIX(VertexAttribs2dvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5688(%rax), %r11
+       movq    5656(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttribs2dvNV), .-GL_PREFIX(VertexAttribs2dvNV)
@@ -26852,7 +26672,7 @@ GL_PREFIX(VertexAttribs2dvNV):
 GL_PREFIX(VertexAttribs2fvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5696(%rax), %r11
+       movq    5664(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26862,13 +26682,13 @@ GL_PREFIX(VertexAttribs2fvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5696(%rax), %r11
+       movq    5664(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5696(%rax), %r11
+       movq    5664(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26878,7 +26698,7 @@ GL_PREFIX(VertexAttribs2fvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5696(%rax), %r11
+       movq    5664(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttribs2fvNV), .-GL_PREFIX(VertexAttribs2fvNV)
@@ -26889,7 +26709,7 @@ GL_PREFIX(VertexAttribs2fvNV):
 GL_PREFIX(VertexAttribs2svNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5704(%rax), %r11
+       movq    5672(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26899,13 +26719,13 @@ GL_PREFIX(VertexAttribs2svNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5704(%rax), %r11
+       movq    5672(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5704(%rax), %r11
+       movq    5672(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26915,7 +26735,7 @@ GL_PREFIX(VertexAttribs2svNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5704(%rax), %r11
+       movq    5672(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttribs2svNV), .-GL_PREFIX(VertexAttribs2svNV)
@@ -26926,7 +26746,7 @@ GL_PREFIX(VertexAttribs2svNV):
 GL_PREFIX(VertexAttribs3dvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5712(%rax), %r11
+       movq    5680(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26936,13 +26756,13 @@ GL_PREFIX(VertexAttribs3dvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5712(%rax), %r11
+       movq    5680(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5712(%rax), %r11
+       movq    5680(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26952,7 +26772,7 @@ GL_PREFIX(VertexAttribs3dvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5712(%rax), %r11
+       movq    5680(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttribs3dvNV), .-GL_PREFIX(VertexAttribs3dvNV)
@@ -26963,7 +26783,7 @@ GL_PREFIX(VertexAttribs3dvNV):
 GL_PREFIX(VertexAttribs3fvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5720(%rax), %r11
+       movq    5688(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -26973,13 +26793,13 @@ GL_PREFIX(VertexAttribs3fvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5720(%rax), %r11
+       movq    5688(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5720(%rax), %r11
+       movq    5688(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -26989,7 +26809,7 @@ GL_PREFIX(VertexAttribs3fvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5720(%rax), %r11
+       movq    5688(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttribs3fvNV), .-GL_PREFIX(VertexAttribs3fvNV)
@@ -27000,7 +26820,7 @@ GL_PREFIX(VertexAttribs3fvNV):
 GL_PREFIX(VertexAttribs3svNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5728(%rax), %r11
+       movq    5696(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27010,13 +26830,13 @@ GL_PREFIX(VertexAttribs3svNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5728(%rax), %r11
+       movq    5696(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5728(%rax), %r11
+       movq    5696(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27026,7 +26846,7 @@ GL_PREFIX(VertexAttribs3svNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5728(%rax), %r11
+       movq    5696(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttribs3svNV), .-GL_PREFIX(VertexAttribs3svNV)
@@ -27037,7 +26857,7 @@ GL_PREFIX(VertexAttribs3svNV):
 GL_PREFIX(VertexAttribs4dvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5736(%rax), %r11
+       movq    5704(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27047,13 +26867,13 @@ GL_PREFIX(VertexAttribs4dvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5736(%rax), %r11
+       movq    5704(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5736(%rax), %r11
+       movq    5704(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27063,7 +26883,7 @@ GL_PREFIX(VertexAttribs4dvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5736(%rax), %r11
+       movq    5704(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttribs4dvNV), .-GL_PREFIX(VertexAttribs4dvNV)
@@ -27074,7 +26894,7 @@ GL_PREFIX(VertexAttribs4dvNV):
 GL_PREFIX(VertexAttribs4fvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5744(%rax), %r11
+       movq    5712(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27084,13 +26904,13 @@ GL_PREFIX(VertexAttribs4fvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5744(%rax), %r11
+       movq    5712(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5744(%rax), %r11
+       movq    5712(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27100,7 +26920,7 @@ GL_PREFIX(VertexAttribs4fvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5744(%rax), %r11
+       movq    5712(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttribs4fvNV), .-GL_PREFIX(VertexAttribs4fvNV)
@@ -27111,7 +26931,7 @@ GL_PREFIX(VertexAttribs4fvNV):
 GL_PREFIX(VertexAttribs4svNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5752(%rax), %r11
+       movq    5720(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27121,13 +26941,13 @@ GL_PREFIX(VertexAttribs4svNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5752(%rax), %r11
+       movq    5720(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5752(%rax), %r11
+       movq    5720(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27137,7 +26957,7 @@ GL_PREFIX(VertexAttribs4svNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5752(%rax), %r11
+       movq    5720(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttribs4svNV), .-GL_PREFIX(VertexAttribs4svNV)
@@ -27148,7 +26968,7 @@ GL_PREFIX(VertexAttribs4svNV):
 GL_PREFIX(VertexAttribs4ubvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5760(%rax), %r11
+       movq    5728(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27158,13 +26978,13 @@ GL_PREFIX(VertexAttribs4ubvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5760(%rax), %r11
+       movq    5728(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5760(%rax), %r11
+       movq    5728(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27174,7 +26994,7 @@ GL_PREFIX(VertexAttribs4ubvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5760(%rax), %r11
+       movq    5728(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(VertexAttribs4ubvNV), .-GL_PREFIX(VertexAttribs4ubvNV)
@@ -27185,7 +27005,7 @@ GL_PREFIX(VertexAttribs4ubvNV):
 GL_PREFIX(AlphaFragmentOp1ATI):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5768(%rax), %r11
+       movq    5736(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27203,13 +27023,13 @@ GL_PREFIX(AlphaFragmentOp1ATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5768(%rax), %r11
+       movq    5736(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5768(%rax), %r11
+       movq    5736(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27227,7 +27047,7 @@ GL_PREFIX(AlphaFragmentOp1ATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5768(%rax), %r11
+       movq    5736(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(AlphaFragmentOp1ATI), .-GL_PREFIX(AlphaFragmentOp1ATI)
@@ -27238,7 +27058,7 @@ GL_PREFIX(AlphaFragmentOp1ATI):
 GL_PREFIX(AlphaFragmentOp2ATI):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5776(%rax), %r11
+       movq    5744(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27256,13 +27076,13 @@ GL_PREFIX(AlphaFragmentOp2ATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5776(%rax), %r11
+       movq    5744(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5776(%rax), %r11
+       movq    5744(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27280,7 +27100,7 @@ GL_PREFIX(AlphaFragmentOp2ATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5776(%rax), %r11
+       movq    5744(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(AlphaFragmentOp2ATI), .-GL_PREFIX(AlphaFragmentOp2ATI)
@@ -27291,7 +27111,7 @@ GL_PREFIX(AlphaFragmentOp2ATI):
 GL_PREFIX(AlphaFragmentOp3ATI):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5784(%rax), %r11
+       movq    5752(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27309,13 +27129,13 @@ GL_PREFIX(AlphaFragmentOp3ATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5784(%rax), %r11
+       movq    5752(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5784(%rax), %r11
+       movq    5752(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27333,7 +27153,7 @@ GL_PREFIX(AlphaFragmentOp3ATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5784(%rax), %r11
+       movq    5752(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(AlphaFragmentOp3ATI), .-GL_PREFIX(AlphaFragmentOp3ATI)
@@ -27344,25 +27164,25 @@ GL_PREFIX(AlphaFragmentOp3ATI):
 GL_PREFIX(BeginFragmentShaderATI):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5792(%rax), %r11
+       movq    5760(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rbp
        call    _x86_64_get_dispatch@PLT
        popq    %rbp
-       movq    5792(%rax), %r11
+       movq    5760(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5792(%rax), %r11
+       movq    5760(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rbp
        call    _glapi_get_dispatch
        popq    %rbp
-       movq    5792(%rax), %r11
+       movq    5760(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(BeginFragmentShaderATI), .-GL_PREFIX(BeginFragmentShaderATI)
@@ -27373,25 +27193,25 @@ GL_PREFIX(BeginFragmentShaderATI):
 GL_PREFIX(BindFragmentShaderATI):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5800(%rax), %r11
+       movq    5768(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
        call    _x86_64_get_dispatch@PLT
        popq    %rdi
-       movq    5800(%rax), %r11
+       movq    5768(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5800(%rax), %r11
+       movq    5768(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
        call    _glapi_get_dispatch
        popq    %rdi
-       movq    5800(%rax), %r11
+       movq    5768(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(BindFragmentShaderATI), .-GL_PREFIX(BindFragmentShaderATI)
@@ -27402,7 +27222,7 @@ GL_PREFIX(BindFragmentShaderATI):
 GL_PREFIX(ColorFragmentOp1ATI):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5808(%rax), %r11
+       movq    5776(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27420,13 +27240,13 @@ GL_PREFIX(ColorFragmentOp1ATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5808(%rax), %r11
+       movq    5776(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5808(%rax), %r11
+       movq    5776(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27444,7 +27264,7 @@ GL_PREFIX(ColorFragmentOp1ATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5808(%rax), %r11
+       movq    5776(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(ColorFragmentOp1ATI), .-GL_PREFIX(ColorFragmentOp1ATI)
@@ -27455,7 +27275,7 @@ GL_PREFIX(ColorFragmentOp1ATI):
 GL_PREFIX(ColorFragmentOp2ATI):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5816(%rax), %r11
+       movq    5784(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27473,13 +27293,13 @@ GL_PREFIX(ColorFragmentOp2ATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5816(%rax), %r11
+       movq    5784(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5816(%rax), %r11
+       movq    5784(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27497,7 +27317,7 @@ GL_PREFIX(ColorFragmentOp2ATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5816(%rax), %r11
+       movq    5784(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(ColorFragmentOp2ATI), .-GL_PREFIX(ColorFragmentOp2ATI)
@@ -27508,7 +27328,7 @@ GL_PREFIX(ColorFragmentOp2ATI):
 GL_PREFIX(ColorFragmentOp3ATI):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5824(%rax), %r11
+       movq    5792(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27526,13 +27346,13 @@ GL_PREFIX(ColorFragmentOp3ATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5824(%rax), %r11
+       movq    5792(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5824(%rax), %r11
+       movq    5792(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27550,7 +27370,7 @@ GL_PREFIX(ColorFragmentOp3ATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5824(%rax), %r11
+       movq    5792(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(ColorFragmentOp3ATI), .-GL_PREFIX(ColorFragmentOp3ATI)
@@ -27561,25 +27381,25 @@ GL_PREFIX(ColorFragmentOp3ATI):
 GL_PREFIX(DeleteFragmentShaderATI):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5832(%rax), %r11
+       movq    5800(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
        call    _x86_64_get_dispatch@PLT
        popq    %rdi
-       movq    5832(%rax), %r11
+       movq    5800(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5832(%rax), %r11
+       movq    5800(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
        call    _glapi_get_dispatch
        popq    %rdi
-       movq    5832(%rax), %r11
+       movq    5800(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(DeleteFragmentShaderATI), .-GL_PREFIX(DeleteFragmentShaderATI)
@@ -27590,25 +27410,25 @@ GL_PREFIX(DeleteFragmentShaderATI):
 GL_PREFIX(EndFragmentShaderATI):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5840(%rax), %r11
+       movq    5808(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rbp
        call    _x86_64_get_dispatch@PLT
        popq    %rbp
-       movq    5840(%rax), %r11
+       movq    5808(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5840(%rax), %r11
+       movq    5808(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rbp
        call    _glapi_get_dispatch
        popq    %rbp
-       movq    5840(%rax), %r11
+       movq    5808(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(EndFragmentShaderATI), .-GL_PREFIX(EndFragmentShaderATI)
@@ -27619,25 +27439,25 @@ GL_PREFIX(EndFragmentShaderATI):
 GL_PREFIX(GenFragmentShadersATI):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5848(%rax), %r11
+       movq    5816(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
        call    _x86_64_get_dispatch@PLT
        popq    %rdi
-       movq    5848(%rax), %r11
+       movq    5816(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5848(%rax), %r11
+       movq    5816(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
        call    _glapi_get_dispatch
        popq    %rdi
-       movq    5848(%rax), %r11
+       movq    5816(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(GenFragmentShadersATI), .-GL_PREFIX(GenFragmentShadersATI)
@@ -27648,7 +27468,7 @@ GL_PREFIX(GenFragmentShadersATI):
 GL_PREFIX(PassTexCoordATI):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5856(%rax), %r11
+       movq    5824(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27658,13 +27478,13 @@ GL_PREFIX(PassTexCoordATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5856(%rax), %r11
+       movq    5824(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5856(%rax), %r11
+       movq    5824(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27674,7 +27494,7 @@ GL_PREFIX(PassTexCoordATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5856(%rax), %r11
+       movq    5824(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(PassTexCoordATI), .-GL_PREFIX(PassTexCoordATI)
@@ -27685,7 +27505,7 @@ GL_PREFIX(PassTexCoordATI):
 GL_PREFIX(SampleMapATI):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5864(%rax), %r11
+       movq    5832(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27695,13 +27515,13 @@ GL_PREFIX(SampleMapATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5864(%rax), %r11
+       movq    5832(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5864(%rax), %r11
+       movq    5832(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27711,7 +27531,7 @@ GL_PREFIX(SampleMapATI):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5864(%rax), %r11
+       movq    5832(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(SampleMapATI), .-GL_PREFIX(SampleMapATI)
@@ -27722,7 +27542,7 @@ GL_PREFIX(SampleMapATI):
 GL_PREFIX(SetFragmentShaderConstantATI):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5872(%rax), %r11
+       movq    5840(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27732,13 +27552,13 @@ GL_PREFIX(SetFragmentShaderConstantATI):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5872(%rax), %r11
+       movq    5840(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5872(%rax), %r11
+       movq    5840(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27748,7 +27568,7 @@ GL_PREFIX(SetFragmentShaderConstantATI):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5872(%rax), %r11
+       movq    5840(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(SetFragmentShaderConstantATI), .-GL_PREFIX(SetFragmentShaderConstantATI)
@@ -27759,7 +27579,7 @@ GL_PREFIX(SetFragmentShaderConstantATI):
 GL_PREFIX(PointParameteriNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5880(%rax), %r11
+       movq    5848(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27769,13 +27589,13 @@ GL_PREFIX(PointParameteriNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5880(%rax), %r11
+       movq    5848(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5880(%rax), %r11
+       movq    5848(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27785,7 +27605,7 @@ GL_PREFIX(PointParameteriNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5880(%rax), %r11
+       movq    5848(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(PointParameteriNV), .-GL_PREFIX(PointParameteriNV)
@@ -27796,7 +27616,7 @@ GL_PREFIX(PointParameteriNV):
 GL_PREFIX(PointParameterivNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5888(%rax), %r11
+       movq    5856(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27806,13 +27626,13 @@ GL_PREFIX(PointParameterivNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5888(%rax), %r11
+       movq    5856(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5888(%rax), %r11
+       movq    5856(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27822,79 +27642,79 @@ GL_PREFIX(PointParameterivNV):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5888(%rax), %r11
+       movq    5856(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(PointParameterivNV), .-GL_PREFIX(PointParameterivNV)
 
        .p2align        4,,15
-       .globl  GL_PREFIX(_dispatch_stub_737)
-       .type   GL_PREFIX(_dispatch_stub_737), @function
-       HIDDEN(GL_PREFIX(_dispatch_stub_737))
-GL_PREFIX(_dispatch_stub_737):
+       .globl  GL_PREFIX(_dispatch_stub_733)
+       .type   GL_PREFIX(_dispatch_stub_733), @function
+       HIDDEN(GL_PREFIX(_dispatch_stub_733))
+GL_PREFIX(_dispatch_stub_733):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5896(%rax), %r11
+       movq    5864(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
        call    _x86_64_get_dispatch@PLT
        popq    %rdi
-       movq    5896(%rax), %r11
+       movq    5864(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5896(%rax), %r11
+       movq    5864(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
        call    _glapi_get_dispatch
        popq    %rdi
-       movq    5896(%rax), %r11
+       movq    5864(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(_dispatch_stub_737), .-GL_PREFIX(_dispatch_stub_737)
+       .size   GL_PREFIX(_dispatch_stub_733), .-GL_PREFIX(_dispatch_stub_733)
 
        .p2align        4,,15
-       .globl  GL_PREFIX(_dispatch_stub_738)
-       .type   GL_PREFIX(_dispatch_stub_738), @function
-       HIDDEN(GL_PREFIX(_dispatch_stub_738))
-GL_PREFIX(_dispatch_stub_738):
+       .globl  GL_PREFIX(_dispatch_stub_734)
+       .type   GL_PREFIX(_dispatch_stub_734), @function
+       HIDDEN(GL_PREFIX(_dispatch_stub_734))
+GL_PREFIX(_dispatch_stub_734):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5904(%rax), %r11
+       movq    5872(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
        call    _x86_64_get_dispatch@PLT
        popq    %rdi
-       movq    5904(%rax), %r11
+       movq    5872(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5904(%rax), %r11
+       movq    5872(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
        call    _glapi_get_dispatch
        popq    %rdi
-       movq    5904(%rax), %r11
+       movq    5872(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(_dispatch_stub_738), .-GL_PREFIX(_dispatch_stub_738)
+       .size   GL_PREFIX(_dispatch_stub_734), .-GL_PREFIX(_dispatch_stub_734)
 
        .p2align        4,,15
-       .globl  GL_PREFIX(_dispatch_stub_739)
-       .type   GL_PREFIX(_dispatch_stub_739), @function
-       HIDDEN(GL_PREFIX(_dispatch_stub_739))
-GL_PREFIX(_dispatch_stub_739):
+       .globl  GL_PREFIX(_dispatch_stub_735)
+       .type   GL_PREFIX(_dispatch_stub_735), @function
+       HIDDEN(GL_PREFIX(_dispatch_stub_735))
+GL_PREFIX(_dispatch_stub_735):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5912(%rax), %r11
+       movq    5880(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27904,13 +27724,13 @@ GL_PREFIX(_dispatch_stub_739):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5912(%rax), %r11
+       movq    5880(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5912(%rax), %r11
+       movq    5880(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27920,19 +27740,19 @@ GL_PREFIX(_dispatch_stub_739):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5912(%rax), %r11
+       movq    5880(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(_dispatch_stub_739), .-GL_PREFIX(_dispatch_stub_739)
+       .size   GL_PREFIX(_dispatch_stub_735), .-GL_PREFIX(_dispatch_stub_735)
 
        .p2align        4,,15
-       .globl  GL_PREFIX(_dispatch_stub_740)
-       .type   GL_PREFIX(_dispatch_stub_740), @function
-       HIDDEN(GL_PREFIX(_dispatch_stub_740))
-GL_PREFIX(_dispatch_stub_740):
+       .globl  GL_PREFIX(_dispatch_stub_736)
+       .type   GL_PREFIX(_dispatch_stub_736), @function
+       HIDDEN(GL_PREFIX(_dispatch_stub_736))
+GL_PREFIX(_dispatch_stub_736):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5920(%rax), %r11
+       movq    5888(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -27942,13 +27762,13 @@ GL_PREFIX(_dispatch_stub_740):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5920(%rax), %r11
+       movq    5888(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5920(%rax), %r11
+       movq    5888(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -27958,40 +27778,40 @@ GL_PREFIX(_dispatch_stub_740):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5920(%rax), %r11
+       movq    5888(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(_dispatch_stub_740), .-GL_PREFIX(_dispatch_stub_740)
+       .size   GL_PREFIX(_dispatch_stub_736), .-GL_PREFIX(_dispatch_stub_736)
 
        .p2align        4,,15
-       .globl  GL_PREFIX(_dispatch_stub_741)
-       .type   GL_PREFIX(_dispatch_stub_741), @function
-       HIDDEN(GL_PREFIX(_dispatch_stub_741))
-GL_PREFIX(_dispatch_stub_741):
+       .globl  GL_PREFIX(_dispatch_stub_737)
+       .type   GL_PREFIX(_dispatch_stub_737), @function
+       HIDDEN(GL_PREFIX(_dispatch_stub_737))
+GL_PREFIX(_dispatch_stub_737):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5928(%rax), %r11
+       movq    5896(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
        call    _x86_64_get_dispatch@PLT
        popq    %rdi
-       movq    5928(%rax), %r11
+       movq    5896(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5928(%rax), %r11
+       movq    5896(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
        call    _glapi_get_dispatch
        popq    %rdi
-       movq    5928(%rax), %r11
+       movq    5896(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(_dispatch_stub_741), .-GL_PREFIX(_dispatch_stub_741)
+       .size   GL_PREFIX(_dispatch_stub_737), .-GL_PREFIX(_dispatch_stub_737)
 
        .p2align        4,,15
        .globl  GL_PREFIX(GetProgramNamedParameterdvNV)
@@ -27999,7 +27819,7 @@ GL_PREFIX(_dispatch_stub_741):
 GL_PREFIX(GetProgramNamedParameterdvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5936(%rax), %r11
+       movq    5904(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28013,13 +27833,13 @@ GL_PREFIX(GetProgramNamedParameterdvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5936(%rax), %r11
+       movq    5904(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5936(%rax), %r11
+       movq    5904(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28033,7 +27853,7 @@ GL_PREFIX(GetProgramNamedParameterdvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5936(%rax), %r11
+       movq    5904(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(GetProgramNamedParameterdvNV), .-GL_PREFIX(GetProgramNamedParameterdvNV)
@@ -28044,7 +27864,7 @@ GL_PREFIX(GetProgramNamedParameterdvNV):
 GL_PREFIX(GetProgramNamedParameterfvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5944(%rax), %r11
+       movq    5912(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28058,13 +27878,13 @@ GL_PREFIX(GetProgramNamedParameterfvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5944(%rax), %r11
+       movq    5912(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5944(%rax), %r11
+       movq    5912(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28078,7 +27898,7 @@ GL_PREFIX(GetProgramNamedParameterfvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5944(%rax), %r11
+       movq    5912(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(GetProgramNamedParameterfvNV), .-GL_PREFIX(GetProgramNamedParameterfvNV)
@@ -28089,7 +27909,7 @@ GL_PREFIX(GetProgramNamedParameterfvNV):
 GL_PREFIX(ProgramNamedParameter4dNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5952(%rax), %r11
+       movq    5920(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        subq    $56, %rsp
@@ -28109,13 +27929,13 @@ GL_PREFIX(ProgramNamedParameter4dNV):
        movq    8(%rsp), %rsi
        movq    (%rsp), %rdi
        addq    $56, %rsp
-       movq    5952(%rax), %r11
+       movq    5920(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5952(%rax), %r11
+       movq    5920(%rax), %r11
        jmp     *%r11
 1:
        subq    $56, %rsp
@@ -28135,7 +27955,7 @@ GL_PREFIX(ProgramNamedParameter4dNV):
        movq    8(%rsp), %rsi
        movq    (%rsp), %rdi
        addq    $56, %rsp
-       movq    5952(%rax), %r11
+       movq    5920(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(ProgramNamedParameter4dNV), .-GL_PREFIX(ProgramNamedParameter4dNV)
@@ -28146,7 +27966,7 @@ GL_PREFIX(ProgramNamedParameter4dNV):
 GL_PREFIX(ProgramNamedParameter4dvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5960(%rax), %r11
+       movq    5928(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28160,13 +27980,13 @@ GL_PREFIX(ProgramNamedParameter4dvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5960(%rax), %r11
+       movq    5928(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5960(%rax), %r11
+       movq    5928(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28180,7 +28000,7 @@ GL_PREFIX(ProgramNamedParameter4dvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5960(%rax), %r11
+       movq    5928(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(ProgramNamedParameter4dvNV), .-GL_PREFIX(ProgramNamedParameter4dvNV)
@@ -28191,7 +28011,7 @@ GL_PREFIX(ProgramNamedParameter4dvNV):
 GL_PREFIX(ProgramNamedParameter4fNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5968(%rax), %r11
+       movq    5936(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        subq    $56, %rsp
@@ -28211,13 +28031,13 @@ GL_PREFIX(ProgramNamedParameter4fNV):
        movq    8(%rsp), %rsi
        movq    (%rsp), %rdi
        addq    $56, %rsp
-       movq    5968(%rax), %r11
+       movq    5936(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5968(%rax), %r11
+       movq    5936(%rax), %r11
        jmp     *%r11
 1:
        subq    $56, %rsp
@@ -28237,7 +28057,7 @@ GL_PREFIX(ProgramNamedParameter4fNV):
        movq    8(%rsp), %rsi
        movq    (%rsp), %rdi
        addq    $56, %rsp
-       movq    5968(%rax), %r11
+       movq    5936(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(ProgramNamedParameter4fNV), .-GL_PREFIX(ProgramNamedParameter4fNV)
@@ -28248,7 +28068,7 @@ GL_PREFIX(ProgramNamedParameter4fNV):
 GL_PREFIX(ProgramNamedParameter4fvNV):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5976(%rax), %r11
+       movq    5944(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28262,13 +28082,13 @@ GL_PREFIX(ProgramNamedParameter4fvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5976(%rax), %r11
+       movq    5944(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5976(%rax), %r11
+       movq    5944(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28282,19 +28102,19 @@ GL_PREFIX(ProgramNamedParameter4fvNV):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    5976(%rax), %r11
+       movq    5944(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(ProgramNamedParameter4fvNV), .-GL_PREFIX(ProgramNamedParameter4fvNV)
 
        .p2align        4,,15
-       .globl  GL_PREFIX(_dispatch_stub_748)
-       .type   GL_PREFIX(_dispatch_stub_748), @function
-       HIDDEN(GL_PREFIX(_dispatch_stub_748))
-GL_PREFIX(_dispatch_stub_748):
+       .globl  GL_PREFIX(_dispatch_stub_744)
+       .type   GL_PREFIX(_dispatch_stub_744), @function
+       HIDDEN(GL_PREFIX(_dispatch_stub_744))
+GL_PREFIX(_dispatch_stub_744):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5984(%rax), %r11
+       movq    5952(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28304,13 +28124,13 @@ GL_PREFIX(_dispatch_stub_748):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5984(%rax), %r11
+       movq    5952(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5984(%rax), %r11
+       movq    5952(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28320,19 +28140,19 @@ GL_PREFIX(_dispatch_stub_748):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5984(%rax), %r11
+       movq    5952(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(_dispatch_stub_748), .-GL_PREFIX(_dispatch_stub_748)
+       .size   GL_PREFIX(_dispatch_stub_744), .-GL_PREFIX(_dispatch_stub_744)
 
        .p2align        4,,15
-       .globl  GL_PREFIX(_dispatch_stub_749)
-       .type   GL_PREFIX(_dispatch_stub_749), @function
-       HIDDEN(GL_PREFIX(_dispatch_stub_749))
-GL_PREFIX(_dispatch_stub_749):
+       .globl  GL_PREFIX(_dispatch_stub_745)
+       .type   GL_PREFIX(_dispatch_stub_745), @function
+       HIDDEN(GL_PREFIX(_dispatch_stub_745))
+GL_PREFIX(_dispatch_stub_745):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    5992(%rax), %r11
+       movq    5960(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28342,13 +28162,13 @@ GL_PREFIX(_dispatch_stub_749):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5992(%rax), %r11
+       movq    5960(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    5992(%rax), %r11
+       movq    5960(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28358,10 +28178,10 @@ GL_PREFIX(_dispatch_stub_749):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    5992(%rax), %r11
+       movq    5960(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(_dispatch_stub_749), .-GL_PREFIX(_dispatch_stub_749)
+       .size   GL_PREFIX(_dispatch_stub_745), .-GL_PREFIX(_dispatch_stub_745)
 
        .p2align        4,,15
        .globl  GL_PREFIX(BindFramebufferEXT)
@@ -28369,7 +28189,7 @@ GL_PREFIX(_dispatch_stub_749):
 GL_PREFIX(BindFramebufferEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6000(%rax), %r11
+       movq    5968(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28379,13 +28199,13 @@ GL_PREFIX(BindFramebufferEXT):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    6000(%rax), %r11
+       movq    5968(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6000(%rax), %r11
+       movq    5968(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28395,7 +28215,7 @@ GL_PREFIX(BindFramebufferEXT):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    6000(%rax), %r11
+       movq    5968(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(BindFramebufferEXT), .-GL_PREFIX(BindFramebufferEXT)
@@ -28406,7 +28226,7 @@ GL_PREFIX(BindFramebufferEXT):
 GL_PREFIX(BindRenderbufferEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6008(%rax), %r11
+       movq    5976(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28416,13 +28236,13 @@ GL_PREFIX(BindRenderbufferEXT):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    6008(%rax), %r11
+       movq    5976(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6008(%rax), %r11
+       movq    5976(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28432,7 +28252,7 @@ GL_PREFIX(BindRenderbufferEXT):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    6008(%rax), %r11
+       movq    5976(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(BindRenderbufferEXT), .-GL_PREFIX(BindRenderbufferEXT)
@@ -28443,25 +28263,25 @@ GL_PREFIX(BindRenderbufferEXT):
 GL_PREFIX(CheckFramebufferStatusEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6016(%rax), %r11
+       movq    5984(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
        call    _x86_64_get_dispatch@PLT
        popq    %rdi
-       movq    6016(%rax), %r11
+       movq    5984(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6016(%rax), %r11
+       movq    5984(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
        call    _glapi_get_dispatch
        popq    %rdi
-       movq    6016(%rax), %r11
+       movq    5984(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(CheckFramebufferStatusEXT), .-GL_PREFIX(CheckFramebufferStatusEXT)
@@ -28472,7 +28292,7 @@ GL_PREFIX(CheckFramebufferStatusEXT):
 GL_PREFIX(DeleteFramebuffersEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6024(%rax), %r11
+       movq    5992(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28482,13 +28302,13 @@ GL_PREFIX(DeleteFramebuffersEXT):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    6024(%rax), %r11
+       movq    5992(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6024(%rax), %r11
+       movq    5992(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28498,7 +28318,7 @@ GL_PREFIX(DeleteFramebuffersEXT):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    6024(%rax), %r11
+       movq    5992(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(DeleteFramebuffersEXT), .-GL_PREFIX(DeleteFramebuffersEXT)
@@ -28509,7 +28329,7 @@ GL_PREFIX(DeleteFramebuffersEXT):
 GL_PREFIX(DeleteRenderbuffersEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6032(%rax), %r11
+       movq    6000(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28519,13 +28339,13 @@ GL_PREFIX(DeleteRenderbuffersEXT):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    6032(%rax), %r11
+       movq    6000(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6032(%rax), %r11
+       movq    6000(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28535,7 +28355,7 @@ GL_PREFIX(DeleteRenderbuffersEXT):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    6032(%rax), %r11
+       movq    6000(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(DeleteRenderbuffersEXT), .-GL_PREFIX(DeleteRenderbuffersEXT)
@@ -28546,7 +28366,7 @@ GL_PREFIX(DeleteRenderbuffersEXT):
 GL_PREFIX(FramebufferRenderbufferEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6040(%rax), %r11
+       movq    6008(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28560,13 +28380,13 @@ GL_PREFIX(FramebufferRenderbufferEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6040(%rax), %r11
+       movq    6008(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6040(%rax), %r11
+       movq    6008(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28580,7 +28400,7 @@ GL_PREFIX(FramebufferRenderbufferEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6040(%rax), %r11
+       movq    6008(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(FramebufferRenderbufferEXT), .-GL_PREFIX(FramebufferRenderbufferEXT)
@@ -28591,7 +28411,7 @@ GL_PREFIX(FramebufferRenderbufferEXT):
 GL_PREFIX(FramebufferTexture1DEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6048(%rax), %r11
+       movq    6016(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28605,13 +28425,13 @@ GL_PREFIX(FramebufferTexture1DEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6048(%rax), %r11
+       movq    6016(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6048(%rax), %r11
+       movq    6016(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28625,7 +28445,7 @@ GL_PREFIX(FramebufferTexture1DEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6048(%rax), %r11
+       movq    6016(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(FramebufferTexture1DEXT), .-GL_PREFIX(FramebufferTexture1DEXT)
@@ -28636,7 +28456,7 @@ GL_PREFIX(FramebufferTexture1DEXT):
 GL_PREFIX(FramebufferTexture2DEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6056(%rax), %r11
+       movq    6024(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28650,13 +28470,13 @@ GL_PREFIX(FramebufferTexture2DEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6056(%rax), %r11
+       movq    6024(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6056(%rax), %r11
+       movq    6024(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28670,7 +28490,7 @@ GL_PREFIX(FramebufferTexture2DEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6056(%rax), %r11
+       movq    6024(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(FramebufferTexture2DEXT), .-GL_PREFIX(FramebufferTexture2DEXT)
@@ -28681,7 +28501,7 @@ GL_PREFIX(FramebufferTexture2DEXT):
 GL_PREFIX(FramebufferTexture3DEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6064(%rax), %r11
+       movq    6032(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28699,13 +28519,13 @@ GL_PREFIX(FramebufferTexture3DEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6064(%rax), %r11
+       movq    6032(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6064(%rax), %r11
+       movq    6032(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28723,7 +28543,7 @@ GL_PREFIX(FramebufferTexture3DEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6064(%rax), %r11
+       movq    6032(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(FramebufferTexture3DEXT), .-GL_PREFIX(FramebufferTexture3DEXT)
@@ -28734,7 +28554,7 @@ GL_PREFIX(FramebufferTexture3DEXT):
 GL_PREFIX(GenFramebuffersEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6072(%rax), %r11
+       movq    6040(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28744,13 +28564,13 @@ GL_PREFIX(GenFramebuffersEXT):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    6072(%rax), %r11
+       movq    6040(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6072(%rax), %r11
+       movq    6040(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28760,7 +28580,7 @@ GL_PREFIX(GenFramebuffersEXT):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    6072(%rax), %r11
+       movq    6040(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(GenFramebuffersEXT), .-GL_PREFIX(GenFramebuffersEXT)
@@ -28771,7 +28591,7 @@ GL_PREFIX(GenFramebuffersEXT):
 GL_PREFIX(GenRenderbuffersEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6080(%rax), %r11
+       movq    6048(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28781,13 +28601,13 @@ GL_PREFIX(GenRenderbuffersEXT):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    6080(%rax), %r11
+       movq    6048(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6080(%rax), %r11
+       movq    6048(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28797,7 +28617,7 @@ GL_PREFIX(GenRenderbuffersEXT):
        popq    %rbp
        popq    %rsi
        popq    %rdi
-       movq    6080(%rax), %r11
+       movq    6048(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(GenRenderbuffersEXT), .-GL_PREFIX(GenRenderbuffersEXT)
@@ -28808,25 +28628,25 @@ GL_PREFIX(GenRenderbuffersEXT):
 GL_PREFIX(GenerateMipmapEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6088(%rax), %r11
+       movq    6056(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
        call    _x86_64_get_dispatch@PLT
        popq    %rdi
-       movq    6088(%rax), %r11
+       movq    6056(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6088(%rax), %r11
+       movq    6056(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
        call    _glapi_get_dispatch
        popq    %rdi
-       movq    6088(%rax), %r11
+       movq    6056(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(GenerateMipmapEXT), .-GL_PREFIX(GenerateMipmapEXT)
@@ -28837,7 +28657,7 @@ GL_PREFIX(GenerateMipmapEXT):
 GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6096(%rax), %r11
+       movq    6064(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28851,13 +28671,13 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6096(%rax), %r11
+       movq    6064(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6096(%rax), %r11
+       movq    6064(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28871,7 +28691,7 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6096(%rax), %r11
+       movq    6064(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(GetFramebufferAttachmentParameterivEXT), .-GL_PREFIX(GetFramebufferAttachmentParameterivEXT)
@@ -28882,7 +28702,7 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
 GL_PREFIX(GetRenderbufferParameterivEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6104(%rax), %r11
+       movq    6072(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28892,13 +28712,13 @@ GL_PREFIX(GetRenderbufferParameterivEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6104(%rax), %r11
+       movq    6072(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6104(%rax), %r11
+       movq    6072(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -28908,7 +28728,7 @@ GL_PREFIX(GetRenderbufferParameterivEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6104(%rax), %r11
+       movq    6072(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(GetRenderbufferParameterivEXT), .-GL_PREFIX(GetRenderbufferParameterivEXT)
@@ -28919,25 +28739,25 @@ GL_PREFIX(GetRenderbufferParameterivEXT):
 GL_PREFIX(IsFramebufferEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6112(%rax), %r11
+       movq    6080(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
        call    _x86_64_get_dispatch@PLT
        popq    %rdi
-       movq    6112(%rax), %r11
+       movq    6080(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6112(%rax), %r11
+       movq    6080(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
        call    _glapi_get_dispatch
        popq    %rdi
-       movq    6112(%rax), %r11
+       movq    6080(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(IsFramebufferEXT), .-GL_PREFIX(IsFramebufferEXT)
@@ -28948,25 +28768,25 @@ GL_PREFIX(IsFramebufferEXT):
 GL_PREFIX(IsRenderbufferEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6120(%rax), %r11
+       movq    6088(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
        call    _x86_64_get_dispatch@PLT
        popq    %rdi
-       movq    6120(%rax), %r11
+       movq    6088(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6120(%rax), %r11
+       movq    6088(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
        call    _glapi_get_dispatch
        popq    %rdi
-       movq    6120(%rax), %r11
+       movq    6088(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(IsRenderbufferEXT), .-GL_PREFIX(IsRenderbufferEXT)
@@ -28977,7 +28797,7 @@ GL_PREFIX(IsRenderbufferEXT):
 GL_PREFIX(RenderbufferStorageEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6128(%rax), %r11
+       movq    6096(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -28991,13 +28811,13 @@ GL_PREFIX(RenderbufferStorageEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6128(%rax), %r11
+       movq    6096(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6128(%rax), %r11
+       movq    6096(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -29011,19 +28831,19 @@ GL_PREFIX(RenderbufferStorageEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6128(%rax), %r11
+       movq    6096(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(RenderbufferStorageEXT), .-GL_PREFIX(RenderbufferStorageEXT)
 
        .p2align        4,,15
-       .globl  GL_PREFIX(_dispatch_stub_767)
-       .type   GL_PREFIX(_dispatch_stub_767), @function
-       HIDDEN(GL_PREFIX(_dispatch_stub_767))
-GL_PREFIX(_dispatch_stub_767):
+       .globl  GL_PREFIX(_dispatch_stub_763)
+       .type   GL_PREFIX(_dispatch_stub_763), @function
+       HIDDEN(GL_PREFIX(_dispatch_stub_763))
+GL_PREFIX(_dispatch_stub_763):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6136(%rax), %r11
+       movq    6104(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -29041,13 +28861,13 @@ GL_PREFIX(_dispatch_stub_767):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6136(%rax), %r11
+       movq    6104(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6136(%rax), %r11
+       movq    6104(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -29065,10 +28885,10 @@ GL_PREFIX(_dispatch_stub_767):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6136(%rax), %r11
+       movq    6104(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(_dispatch_stub_767), .-GL_PREFIX(_dispatch_stub_767)
+       .size   GL_PREFIX(_dispatch_stub_763), .-GL_PREFIX(_dispatch_stub_763)
 
        .p2align        4,,15
        .globl  GL_PREFIX(FramebufferTextureLayerEXT)
@@ -29076,7 +28896,7 @@ GL_PREFIX(_dispatch_stub_767):
 GL_PREFIX(FramebufferTextureLayerEXT):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6144(%rax), %r11
+       movq    6112(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -29090,13 +28910,13 @@ GL_PREFIX(FramebufferTextureLayerEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6144(%rax), %r11
+       movq    6112(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6144(%rax), %r11
+       movq    6112(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -29110,19 +28930,19 @@ GL_PREFIX(FramebufferTextureLayerEXT):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6144(%rax), %r11
+       movq    6112(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
        .size   GL_PREFIX(FramebufferTextureLayerEXT), .-GL_PREFIX(FramebufferTextureLayerEXT)
 
        .p2align        4,,15
-       .globl  GL_PREFIX(_dispatch_stub_769)
-       .type   GL_PREFIX(_dispatch_stub_769), @function
-       HIDDEN(GL_PREFIX(_dispatch_stub_769))
-GL_PREFIX(_dispatch_stub_769):
+       .globl  GL_PREFIX(_dispatch_stub_765)
+       .type   GL_PREFIX(_dispatch_stub_765), @function
+       HIDDEN(GL_PREFIX(_dispatch_stub_765))
+GL_PREFIX(_dispatch_stub_765):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6152(%rax), %r11
+       movq    6120(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -29136,13 +28956,13 @@ GL_PREFIX(_dispatch_stub_769):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6152(%rax), %r11
+       movq    6120(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6152(%rax), %r11
+       movq    6120(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -29156,19 +28976,19 @@ GL_PREFIX(_dispatch_stub_769):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6152(%rax), %r11
+       movq    6120(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(_dispatch_stub_769), .-GL_PREFIX(_dispatch_stub_769)
+       .size   GL_PREFIX(_dispatch_stub_765), .-GL_PREFIX(_dispatch_stub_765)
 
        .p2align        4,,15
-       .globl  GL_PREFIX(_dispatch_stub_770)
-       .type   GL_PREFIX(_dispatch_stub_770), @function
-       HIDDEN(GL_PREFIX(_dispatch_stub_770))
-GL_PREFIX(_dispatch_stub_770):
+       .globl  GL_PREFIX(_dispatch_stub_766)
+       .type   GL_PREFIX(_dispatch_stub_766), @function
+       HIDDEN(GL_PREFIX(_dispatch_stub_766))
+GL_PREFIX(_dispatch_stub_766):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6160(%rax), %r11
+       movq    6128(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -29182,13 +29002,13 @@ GL_PREFIX(_dispatch_stub_770):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6160(%rax), %r11
+       movq    6128(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6160(%rax), %r11
+       movq    6128(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -29202,19 +29022,19 @@ GL_PREFIX(_dispatch_stub_770):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6160(%rax), %r11
+       movq    6128(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(_dispatch_stub_770), .-GL_PREFIX(_dispatch_stub_770)
+       .size   GL_PREFIX(_dispatch_stub_766), .-GL_PREFIX(_dispatch_stub_766)
 
        .p2align        4,,15
-       .globl  GL_PREFIX(_dispatch_stub_771)
-       .type   GL_PREFIX(_dispatch_stub_771), @function
-       HIDDEN(GL_PREFIX(_dispatch_stub_771))
-GL_PREFIX(_dispatch_stub_771):
+       .globl  GL_PREFIX(_dispatch_stub_767)
+       .type   GL_PREFIX(_dispatch_stub_767), @function
+       HIDDEN(GL_PREFIX(_dispatch_stub_767))
+GL_PREFIX(_dispatch_stub_767):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6168(%rax), %r11
+       movq    6136(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -29228,13 +29048,13 @@ GL_PREFIX(_dispatch_stub_771):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6168(%rax), %r11
+       movq    6136(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6168(%rax), %r11
+       movq    6136(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -29248,19 +29068,19 @@ GL_PREFIX(_dispatch_stub_771):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6168(%rax), %r11
+       movq    6136(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(_dispatch_stub_771), .-GL_PREFIX(_dispatch_stub_771)
+       .size   GL_PREFIX(_dispatch_stub_767), .-GL_PREFIX(_dispatch_stub_767)
 
        .p2align        4,,15
-       .globl  GL_PREFIX(_dispatch_stub_772)
-       .type   GL_PREFIX(_dispatch_stub_772), @function
-       HIDDEN(GL_PREFIX(_dispatch_stub_772))
-GL_PREFIX(_dispatch_stub_772):
+       .globl  GL_PREFIX(_dispatch_stub_768)
+       .type   GL_PREFIX(_dispatch_stub_768), @function
+       HIDDEN(GL_PREFIX(_dispatch_stub_768))
+GL_PREFIX(_dispatch_stub_768):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6176(%rax), %r11
+       movq    6144(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -29270,13 +29090,13 @@ GL_PREFIX(_dispatch_stub_772):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6176(%rax), %r11
+       movq    6144(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6176(%rax), %r11
+       movq    6144(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -29286,19 +29106,19 @@ GL_PREFIX(_dispatch_stub_772):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6176(%rax), %r11
+       movq    6144(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(_dispatch_stub_772), .-GL_PREFIX(_dispatch_stub_772)
+       .size   GL_PREFIX(_dispatch_stub_768), .-GL_PREFIX(_dispatch_stub_768)
 
        .p2align        4,,15
-       .globl  GL_PREFIX(_dispatch_stub_773)
-       .type   GL_PREFIX(_dispatch_stub_773), @function
-       HIDDEN(GL_PREFIX(_dispatch_stub_773))
-GL_PREFIX(_dispatch_stub_773):
+       .globl  GL_PREFIX(_dispatch_stub_769)
+       .type   GL_PREFIX(_dispatch_stub_769), @function
+       HIDDEN(GL_PREFIX(_dispatch_stub_769))
+GL_PREFIX(_dispatch_stub_769):
 #if defined(GLX_USE_TLS)
        call    _x86_64_get_dispatch@PLT
-       movq    6184(%rax), %r11
+       movq    6152(%rax), %r11
        jmp     *%r11
 #elif defined(PTHREADS)
        pushq   %rdi
@@ -29308,13 +29128,13 @@ GL_PREFIX(_dispatch_stub_773):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6184(%rax), %r11
+       movq    6152(%rax), %r11
        jmp     *%r11
 #else
        movq    _glapi_Dispatch(%rip), %rax
        testq   %rax, %rax
        je      1f
-       movq    6184(%rax), %r11
+       movq    6152(%rax), %r11
        jmp     *%r11
 1:
        pushq   %rdi
@@ -29324,10 +29144,10 @@ GL_PREFIX(_dispatch_stub_773):
        popq    %rdx
        popq    %rsi
        popq    %rdi
-       movq    6184(%rax), %r11
+       movq    6152(%rax), %r11
        jmp     *%r11
 #endif /* defined(GLX_USE_TLS) */
-       .size   GL_PREFIX(_dispatch_stub_773), .-GL_PREFIX(_dispatch_stub_773)
+       .size   GL_PREFIX(_dispatch_stub_769), .-GL_PREFIX(_dispatch_stub_769)
 
        .globl GL_PREFIX(ArrayElementEXT) ; .set GL_PREFIX(ArrayElementEXT), GL_PREFIX(ArrayElement)
        .globl GL_PREFIX(BindTextureEXT) ; .set GL_PREFIX(BindTextureEXT), GL_PREFIX(BindTexture)
@@ -29419,6 +29239,10 @@ GL_PREFIX(_dispatch_stub_773):
        .globl GL_PREFIX(GetVertexAttribdv) ; .set GL_PREFIX(GetVertexAttribdv), GL_PREFIX(GetVertexAttribdvARB)
        .globl GL_PREFIX(GetVertexAttribfv) ; .set GL_PREFIX(GetVertexAttribfv), GL_PREFIX(GetVertexAttribfvARB)
        .globl GL_PREFIX(GetVertexAttribiv) ; .set GL_PREFIX(GetVertexAttribiv), GL_PREFIX(GetVertexAttribivARB)
+       .globl GL_PREFIX(ProgramParameter4dNV) ; .set GL_PREFIX(ProgramParameter4dNV), GL_PREFIX(ProgramEnvParameter4dARB)
+       .globl GL_PREFIX(ProgramParameter4dvNV) ; .set GL_PREFIX(ProgramParameter4dvNV), GL_PREFIX(ProgramEnvParameter4dvARB)
+       .globl GL_PREFIX(ProgramParameter4fNV) ; .set GL_PREFIX(ProgramParameter4fNV), GL_PREFIX(ProgramEnvParameter4fARB)
+       .globl GL_PREFIX(ProgramParameter4fvNV) ; .set GL_PREFIX(ProgramParameter4fvNV), GL_PREFIX(ProgramEnvParameter4fvARB)
        .globl GL_PREFIX(VertexAttrib1d) ; .set GL_PREFIX(VertexAttrib1d), GL_PREFIX(VertexAttrib1dARB)
        .globl GL_PREFIX(VertexAttrib1dv) ; .set GL_PREFIX(VertexAttrib1dv), GL_PREFIX(VertexAttrib1dvARB)
        .globl GL_PREFIX(VertexAttrib1f) ; .set GL_PREFIX(VertexAttrib1f), GL_PREFIX(VertexAttrib1fARB)
@@ -29578,7 +29402,7 @@ GL_PREFIX(_dispatch_stub_773):
        .globl GL_PREFIX(IsProgramARB) ; .set GL_PREFIX(IsProgramARB), GL_PREFIX(IsProgramNV)
        .globl GL_PREFIX(PointParameteri) ; .set GL_PREFIX(PointParameteri), GL_PREFIX(PointParameteriNV)
        .globl GL_PREFIX(PointParameteriv) ; .set GL_PREFIX(PointParameteriv), GL_PREFIX(PointParameterivNV)
-       .globl GL_PREFIX(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_749)
+       .globl GL_PREFIX(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_745)
 
 #if defined(GLX_USE_TLS) && defined(__linux__)
        .section ".note.ABI-tag", "a"
index 40ecc207532f4d5f577ba58adb2b4ec44795843d..b99c2b65203534d4dd4aa2430a0f8c5f0c7a3c61 100644 (file)
@@ -844,10 +844,6 @@ GLNAME(gl_dispatch_functions_start):
        GL_STUB(GetVertexAttribivNV, _gloffset_GetVertexAttribivNV, GetVertexAttribivNV@12)
        GL_STUB(IsProgramNV, _gloffset_IsProgramNV, IsProgramNV@4)
        GL_STUB(LoadProgramNV, _gloffset_LoadProgramNV, LoadProgramNV@16)
-       GL_STUB(ProgramParameter4dNV, _gloffset_ProgramParameter4dNV, ProgramParameter4dNV@40)
-       GL_STUB(ProgramParameter4dvNV, _gloffset_ProgramParameter4dvNV, ProgramParameter4dvNV@12)
-       GL_STUB(ProgramParameter4fNV, _gloffset_ProgramParameter4fNV, ProgramParameter4fNV@24)
-       GL_STUB(ProgramParameter4fvNV, _gloffset_ProgramParameter4fvNV, ProgramParameter4fvNV@12)
        GL_STUB(ProgramParameters4dvNV, _gloffset_ProgramParameters4dvNV, ProgramParameters4dvNV@16)
        GL_STUB(ProgramParameters4fvNV, _gloffset_ProgramParameters4fvNV, ProgramParameters4fvNV@16)
        GL_STUB(RequestResidentProgramsNV, _gloffset_RequestResidentProgramsNV, RequestResidentProgramsNV@8)
@@ -908,26 +904,26 @@ GLNAME(gl_dispatch_functions_start):
        GL_STUB(SetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI, SetFragmentShaderConstantATI@8)
        GL_STUB(PointParameteriNV, _gloffset_PointParameteriNV, PointParameteriNV@8)
        GL_STUB(PointParameterivNV, _gloffset_PointParameterivNV, PointParameterivNV@8)
-       GL_STUB(_dispatch_stub_737, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_737@4)
+       GL_STUB(_dispatch_stub_733, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_733@4)
+       HIDDEN(GL_PREFIX(_dispatch_stub_733, _dispatch_stub_733@4))
+       GL_STUB(_dispatch_stub_734, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_734@4)
+       HIDDEN(GL_PREFIX(_dispatch_stub_734, _dispatch_stub_734@4))
+       GL_STUB(_dispatch_stub_735, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_735@8)
+       HIDDEN(GL_PREFIX(_dispatch_stub_735, _dispatch_stub_735@8))
+       GL_STUB(_dispatch_stub_736, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_736@8)
+       HIDDEN(GL_PREFIX(_dispatch_stub_736, _dispatch_stub_736@8))
+       GL_STUB(_dispatch_stub_737, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_737@4)
        HIDDEN(GL_PREFIX(_dispatch_stub_737, _dispatch_stub_737@4))
-       GL_STUB(_dispatch_stub_738, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_738@4)
-       HIDDEN(GL_PREFIX(_dispatch_stub_738, _dispatch_stub_738@4))
-       GL_STUB(_dispatch_stub_739, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_739@8)
-       HIDDEN(GL_PREFIX(_dispatch_stub_739, _dispatch_stub_739@8))
-       GL_STUB(_dispatch_stub_740, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_740@8)
-       HIDDEN(GL_PREFIX(_dispatch_stub_740, _dispatch_stub_740@8))
-       GL_STUB(_dispatch_stub_741, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_741@4)
-       HIDDEN(GL_PREFIX(_dispatch_stub_741, _dispatch_stub_741@4))
        GL_STUB(GetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV, GetProgramNamedParameterdvNV@16)
        GL_STUB(GetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV, GetProgramNamedParameterfvNV@16)
        GL_STUB(ProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV, ProgramNamedParameter4dNV@44)
        GL_STUB(ProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV, ProgramNamedParameter4dvNV@16)
        GL_STUB(ProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV, ProgramNamedParameter4fNV@28)
        GL_STUB(ProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV, ProgramNamedParameter4fvNV@16)
-       GL_STUB(_dispatch_stub_748, _gloffset_DepthBoundsEXT, _dispatch_stub_748@16)
-       HIDDEN(GL_PREFIX(_dispatch_stub_748, _dispatch_stub_748@16))
-       GL_STUB(_dispatch_stub_749, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_749@8)
-       HIDDEN(GL_PREFIX(_dispatch_stub_749, _dispatch_stub_749@8))
+       GL_STUB(_dispatch_stub_744, _gloffset_DepthBoundsEXT, _dispatch_stub_744@16)
+       HIDDEN(GL_PREFIX(_dispatch_stub_744, _dispatch_stub_744@16))
+       GL_STUB(_dispatch_stub_745, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_745@8)
+       HIDDEN(GL_PREFIX(_dispatch_stub_745, _dispatch_stub_745@8))
        GL_STUB(BindFramebufferEXT, _gloffset_BindFramebufferEXT, BindFramebufferEXT@8)
        GL_STUB(BindRenderbufferEXT, _gloffset_BindRenderbufferEXT, BindRenderbufferEXT@8)
        GL_STUB(CheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4)
@@ -945,19 +941,19 @@ GLNAME(gl_dispatch_functions_start):
        GL_STUB(IsFramebufferEXT, _gloffset_IsFramebufferEXT, IsFramebufferEXT@4)
        GL_STUB(IsRenderbufferEXT, _gloffset_IsRenderbufferEXT, IsRenderbufferEXT@4)
        GL_STUB(RenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT, RenderbufferStorageEXT@16)
-       GL_STUB(_dispatch_stub_767, _gloffset_BlitFramebufferEXT, _dispatch_stub_767@40)
-       HIDDEN(GL_PREFIX(_dispatch_stub_767, _dispatch_stub_767@40))
+       GL_STUB(_dispatch_stub_763, _gloffset_BlitFramebufferEXT, _dispatch_stub_763@40)
+       HIDDEN(GL_PREFIX(_dispatch_stub_763, _dispatch_stub_763@40))
        GL_STUB(FramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20)
-       GL_STUB(_dispatch_stub_769, _gloffset_StencilFuncSeparateATI, _dispatch_stub_769@16)
-       HIDDEN(GL_PREFIX(_dispatch_stub_769, _dispatch_stub_769@16))
-       GL_STUB(_dispatch_stub_770, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_770@16)
-       HIDDEN(GL_PREFIX(_dispatch_stub_770, _dispatch_stub_770@16))
-       GL_STUB(_dispatch_stub_771, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_771@16)
-       HIDDEN(GL_PREFIX(_dispatch_stub_771, _dispatch_stub_771@16))
-       GL_STUB(_dispatch_stub_772, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_772@12)
-       HIDDEN(GL_PREFIX(_dispatch_stub_772, _dispatch_stub_772@12))
-       GL_STUB(_dispatch_stub_773, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_773@12)
-       HIDDEN(GL_PREFIX(_dispatch_stub_773, _dispatch_stub_773@12))
+       GL_STUB(_dispatch_stub_765, _gloffset_StencilFuncSeparateATI, _dispatch_stub_765@16)
+       HIDDEN(GL_PREFIX(_dispatch_stub_765, _dispatch_stub_765@16))
+       GL_STUB(_dispatch_stub_766, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_766@16)
+       HIDDEN(GL_PREFIX(_dispatch_stub_766, _dispatch_stub_766@16))
+       GL_STUB(_dispatch_stub_767, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_767@16)
+       HIDDEN(GL_PREFIX(_dispatch_stub_767, _dispatch_stub_767@16))
+       GL_STUB(_dispatch_stub_768, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_768@12)
+       HIDDEN(GL_PREFIX(_dispatch_stub_768, _dispatch_stub_768@12))
+       GL_STUB(_dispatch_stub_769, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_769@12)
+       HIDDEN(GL_PREFIX(_dispatch_stub_769, _dispatch_stub_769@12))
        GL_STUB_ALIAS(ArrayElementEXT, _gloffset_ArrayElement, ArrayElementEXT@4, ArrayElement, ArrayElement@4)
        GL_STUB_ALIAS(BindTextureEXT, _gloffset_BindTexture, BindTextureEXT@8, BindTexture, BindTexture@8)
        GL_STUB_ALIAS(DrawArraysEXT, _gloffset_DrawArrays, DrawArraysEXT@12, DrawArrays, DrawArrays@12)
@@ -1107,6 +1103,10 @@ GLNAME(gl_dispatch_functions_start):
        GL_STUB_ALIAS(GetVertexAttribdv, _gloffset_GetVertexAttribdvARB, GetVertexAttribdv@12, GetVertexAttribdvARB, GetVertexAttribdvARB@12)
        GL_STUB_ALIAS(GetVertexAttribfv, _gloffset_GetVertexAttribfvARB, GetVertexAttribfv@12, GetVertexAttribfvARB, GetVertexAttribfvARB@12)
        GL_STUB_ALIAS(GetVertexAttribiv, _gloffset_GetVertexAttribivARB, GetVertexAttribiv@12, GetVertexAttribivARB, GetVertexAttribivARB@12)
+       GL_STUB_ALIAS(ProgramParameter4dNV, _gloffset_ProgramEnvParameter4dARB, ProgramParameter4dNV@40, ProgramEnvParameter4dARB, ProgramEnvParameter4dARB@40)
+       GL_STUB_ALIAS(ProgramParameter4dvNV, _gloffset_ProgramEnvParameter4dvARB, ProgramParameter4dvNV@12, ProgramEnvParameter4dvARB, ProgramEnvParameter4dvARB@12)
+       GL_STUB_ALIAS(ProgramParameter4fNV, _gloffset_ProgramEnvParameter4fARB, ProgramParameter4fNV@24, ProgramEnvParameter4fARB, ProgramEnvParameter4fARB@24)
+       GL_STUB_ALIAS(ProgramParameter4fvNV, _gloffset_ProgramEnvParameter4fvARB, ProgramParameter4fvNV@12, ProgramEnvParameter4fvARB, ProgramEnvParameter4fvARB@12)
        GL_STUB_ALIAS(VertexAttrib1d, _gloffset_VertexAttrib1dARB, VertexAttrib1d@12, VertexAttrib1dARB, VertexAttrib1dARB@12)
        GL_STUB_ALIAS(VertexAttrib1dv, _gloffset_VertexAttrib1dvARB, VertexAttrib1dv@8, VertexAttrib1dvARB, VertexAttrib1dvARB@8)
        GL_STUB_ALIAS(VertexAttrib1f, _gloffset_VertexAttrib1fARB, VertexAttrib1f@8, VertexAttrib1fARB, VertexAttrib1fARB@8)