summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xc/extras/Mesa/include/GL/gl.h2529
-rw-r--r--xc/extras/Mesa/include/GL/glx.h180
-rw-r--r--xc/extras/Mesa/include/GL/xmesa.h57
-rw-r--r--xc/extras/Mesa/include/GL/xmesa_x.h2
-rw-r--r--xc/extras/Mesa/include/GL/xmesa_xf86.h10
-rw-r--r--xc/extras/Mesa/src/FX/fxapi.c22
-rw-r--r--xc/extras/Mesa/src/FX/fxdd.c147
-rw-r--r--xc/extras/Mesa/src/FX/fxddspan.c485
-rw-r--r--xc/extras/Mesa/src/FX/fxddtex.c40
-rw-r--r--xc/extras/Mesa/src/FX/fxdrv.h24
-rw-r--r--xc/extras/Mesa/src/FX/fxsanity.c6
-rw-r--r--xc/extras/Mesa/src/FX/fxsetup.c6
-rw-r--r--xc/extras/Mesa/src/X/fakeglx.c525
-rw-r--r--xc/extras/Mesa/src/X/glxapi.c873
-rw-r--r--xc/extras/Mesa/src/X/glxapi.h162
-rw-r--r--xc/extras/Mesa/src/X/glxheader.h71
-rw-r--r--xc/extras/Mesa/src/X/xfonts.c10
-rw-r--r--xc/extras/Mesa/src/X/xmesa1.c222
-rw-r--r--xc/extras/Mesa/src/X/xmesa2.c1321
-rw-r--r--xc/extras/Mesa/src/X/xmesa3.c82
-rw-r--r--xc/extras/Mesa/src/X/xmesa4.c146
-rw-r--r--xc/extras/Mesa/src/X/xmesaP.h44
-rw-r--r--xc/extras/Mesa/src/X86/3dnow.c115
-rw-r--r--xc/extras/Mesa/src/X86/3dnow.h2
-rw-r--r--xc/extras/Mesa/src/X86/assyntax.h56
-rw-r--r--xc/extras/Mesa/src/X86/common_x86.c32
-rw-r--r--xc/extras/Mesa/src/X86/common_x86asm.S11
-rw-r--r--xc/extras/Mesa/src/X86/common_x86asm.h8
-rw-r--r--xc/extras/Mesa/src/X86/glapi_x86.S4021
-rw-r--r--xc/extras/Mesa/src/X86/katmai.c225
-rw-r--r--xc/extras/Mesa/src/X86/katmai.h (renamed from xc/extras/Mesa/src/pointers.h)16
-rw-r--r--xc/extras/Mesa/src/X86/katmai_norm_raw.S265
-rw-r--r--xc/extras/Mesa/src/X86/katmai_xform_masked1.S518
-rw-r--r--xc/extras/Mesa/src/X86/katmai_xform_masked2.S544
-rw-r--r--xc/extras/Mesa/src/X86/katmai_xform_masked3.S584
-rw-r--r--xc/extras/Mesa/src/X86/katmai_xform_masked4.S373
-rw-r--r--xc/extras/Mesa/src/X86/katmai_xform_raw1.S448
-rw-r--r--xc/extras/Mesa/src/X86/katmai_xform_raw2.S469
-rw-r--r--xc/extras/Mesa/src/X86/katmai_xform_raw3.S515
-rw-r--r--xc/extras/Mesa/src/X86/katmai_xform_raw4.S203
-rw-r--r--xc/extras/Mesa/src/X86/mmx.h4
-rw-r--r--xc/extras/Mesa/src/X86/vertex_katmai.S192
-rw-r--r--xc/extras/Mesa/src/X86/x86.c22
-rw-r--r--xc/extras/Mesa/src/X86/x86.h2
-rw-r--r--xc/extras/Mesa/src/accum.c121
-rw-r--r--xc/extras/Mesa/src/accum.h11
-rw-r--r--xc/extras/Mesa/src/all.h52
-rw-r--r--xc/extras/Mesa/src/alpha.c16
-rw-r--r--xc/extras/Mesa/src/alpha.h10
-rw-r--r--xc/extras/Mesa/src/alphabuf.c114
-rw-r--r--xc/extras/Mesa/src/alphabuf.h2
-rw-r--r--xc/extras/Mesa/src/api.h118
-rw-r--r--xc/extras/Mesa/src/api1.c2058
-rw-r--r--xc/extras/Mesa/src/api2.c1362
-rw-r--r--xc/extras/Mesa/src/apiext.c1297
-rw-r--r--xc/extras/Mesa/src/attrib.c67
-rw-r--r--xc/extras/Mesa/src/attrib.h20
-rw-r--r--xc/extras/Mesa/src/bbox.c9
-rw-r--r--xc/extras/Mesa/src/bbox.h2
-rw-r--r--xc/extras/Mesa/src/bitmap.c94
-rw-r--r--xc/extras/Mesa/src/bitmap.h13
-rw-r--r--xc/extras/Mesa/src/blend.c77
-rw-r--r--xc/extras/Mesa/src/blend.h16
-rw-r--r--xc/extras/Mesa/src/clip.c110
-rw-r--r--xc/extras/Mesa/src/clip.h8
-rw-r--r--xc/extras/Mesa/src/clip_funcs.h2
-rw-r--r--xc/extras/Mesa/src/clip_tmp.h8
-rw-r--r--xc/extras/Mesa/src/colortab.c306
-rw-r--r--xc/extras/Mesa/src/colortab.h38
-rw-r--r--xc/extras/Mesa/src/config.c26
-rw-r--r--xc/extras/Mesa/src/config.h51
-rw-r--r--xc/extras/Mesa/src/context.c2009
-rw-r--r--xc/extras/Mesa/src/context.h111
-rw-r--r--xc/extras/Mesa/src/copy_tmp.h2
-rw-r--r--xc/extras/Mesa/src/copypix.c256
-rw-r--r--xc/extras/Mesa/src/copypix.h14
-rw-r--r--xc/extras/Mesa/src/cull_tmp.h2
-rw-r--r--xc/extras/Mesa/src/cva.c36
-rw-r--r--xc/extras/Mesa/src/cva.h11
-rw-r--r--xc/extras/Mesa/src/dd.h122
-rw-r--r--xc/extras/Mesa/src/ddsample.c17
-rw-r--r--xc/extras/Mesa/src/debug_xform.c26
-rw-r--r--xc/extras/Mesa/src/debug_xform.h2
-rw-r--r--xc/extras/Mesa/src/depth.c716
-rw-r--r--xc/extras/Mesa/src/depth.h69
-rw-r--r--xc/extras/Mesa/src/dispatch.c640
-rw-r--r--xc/extras/Mesa/src/dispatch.h44
-rw-r--r--xc/extras/Mesa/src/dlist.c2344
-rw-r--r--xc/extras/Mesa/src/dlist.h21
-rw-r--r--xc/extras/Mesa/src/dotprod_tmp.h2
-rw-r--r--xc/extras/Mesa/src/drawpix.c641
-rw-r--r--xc/extras/Mesa/src/drawpix.h25
-rw-r--r--xc/extras/Mesa/src/enable.c50
-rw-r--r--xc/extras/Mesa/src/enable.h25
-rw-r--r--xc/extras/Mesa/src/enums.c18
-rw-r--r--xc/extras/Mesa/src/enums.h2
-rw-r--r--xc/extras/Mesa/src/eval.c523
-rw-r--r--xc/extras/Mesa/src/eval.h97
-rw-r--r--xc/extras/Mesa/src/extensions.c559
-rw-r--r--xc/extras/Mesa/src/extensions.h9
-rw-r--r--xc/extras/Mesa/src/feedback.c123
-rw-r--r--xc/extras/Mesa/src/feedback.h33
-rw-r--r--xc/extras/Mesa/src/fixed.h2
-rw-r--r--xc/extras/Mesa/src/fog.c141
-rw-r--r--xc/extras/Mesa/src/fog.h25
-rw-r--r--xc/extras/Mesa/src/fog_tmp.h175
-rw-r--r--xc/extras/Mesa/src/general_clip.h2
-rw-r--r--xc/extras/Mesa/src/get.c216
-rw-r--r--xc/extras/Mesa/src/get.h29
-rw-r--r--xc/extras/Mesa/src/glapi.c1369
-rw-r--r--xc/extras/Mesa/src/glapi.h90
-rw-r--r--xc/extras/Mesa/src/glapinoop.c4869
-rw-r--r--xc/extras/Mesa/src/glapinoop.h41
-rw-r--r--xc/extras/Mesa/src/glapioffsets.h801
-rw-r--r--xc/extras/Mesa/src/glapitable.h833
-rw-r--r--xc/extras/Mesa/src/glapitemp.h2724
-rw-r--r--xc/extras/Mesa/src/glheader.h109
-rw-r--r--xc/extras/Mesa/src/glmisc.c375
-rw-r--r--xc/extras/Mesa/src/glmisc.h40
-rw-r--r--xc/extras/Mesa/src/glthread.c246
-rw-r--r--xc/extras/Mesa/src/glthread.h145
-rw-r--r--xc/extras/Mesa/src/hash.c65
-rw-r--r--xc/extras/Mesa/src/hash.h27
-rw-r--r--xc/extras/Mesa/src/highpc.c12
-rw-r--r--xc/extras/Mesa/src/image.c1526
-rw-r--r--xc/extras/Mesa/src/image.h75
-rw-r--r--xc/extras/Mesa/src/imaging.c347
-rw-r--r--xc/extras/Mesa/src/imaging.h108
-rw-r--r--xc/extras/Mesa/src/indirect_tmp.h2
-rw-r--r--xc/extras/Mesa/src/interp_tmp.h16
-rw-r--r--xc/extras/Mesa/src/light.c248
-rw-r--r--xc/extras/Mesa/src/light.h78
-rw-r--r--xc/extras/Mesa/src/lines.c27
-rw-r--r--xc/extras/Mesa/src/lines.h16
-rw-r--r--xc/extras/Mesa/src/linetemp.h10
-rw-r--r--xc/extras/Mesa/src/lnaatemp.h2
-rw-r--r--xc/extras/Mesa/src/logic.c22
-rw-r--r--xc/extras/Mesa/src/logic.h10
-rw-r--r--xc/extras/Mesa/src/lowpc.c2
-rw-r--r--xc/extras/Mesa/src/macros.h177
-rw-r--r--xc/extras/Mesa/src/masking.c28
-rw-r--r--xc/extras/Mesa/src/masking.h15
-rw-r--r--xc/extras/Mesa/src/matrix.c227
-rw-r--r--xc/extras/Mesa/src/matrix.h122
-rw-r--r--xc/extras/Mesa/src/mem.c74
-rw-r--r--xc/extras/Mesa/src/mem.h106
-rw-r--r--xc/extras/Mesa/src/mmath.c18
-rw-r--r--xc/extras/Mesa/src/mmath.h94
-rw-r--r--xc/extras/Mesa/src/mthreads.c20
-rw-r--r--xc/extras/Mesa/src/mthreads.h6
-rw-r--r--xc/extras/Mesa/src/norm_tmp.h20
-rw-r--r--xc/extras/Mesa/src/pb.c88
-rw-r--r--xc/extras/Mesa/src/pb.h2
-rw-r--r--xc/extras/Mesa/src/pipeline.c40
-rw-r--r--xc/extras/Mesa/src/pipeline.h2
-rw-r--r--xc/extras/Mesa/src/pixel.c98
-rw-r--r--xc/extras/Mesa/src/pixel.h41
-rw-r--r--xc/extras/Mesa/src/pointers.c290
-rw-r--r--xc/extras/Mesa/src/points.c103
-rw-r--r--xc/extras/Mesa/src/points.h18
-rw-r--r--xc/extras/Mesa/src/polygon.c49
-rw-r--r--xc/extras/Mesa/src/polygon.h29
-rw-r--r--xc/extras/Mesa/src/quads.c16
-rw-r--r--xc/extras/Mesa/src/quads.h2
-rw-r--r--xc/extras/Mesa/src/rastpos.c212
-rw-r--r--xc/extras/Mesa/src/rastpos.h79
-rw-r--r--xc/extras/Mesa/src/readpix.c66
-rw-r--r--xc/extras/Mesa/src/readpix.h15
-rw-r--r--xc/extras/Mesa/src/rect.c60
-rw-r--r--xc/extras/Mesa/src/rect.h32
-rw-r--r--xc/extras/Mesa/src/render_tmp.h23
-rw-r--r--xc/extras/Mesa/src/scissor.c52
-rw-r--r--xc/extras/Mesa/src/scissor.h21
-rw-r--r--xc/extras/Mesa/src/shade.c18
-rw-r--r--xc/extras/Mesa/src/shade.h2
-rw-r--r--xc/extras/Mesa/src/shade_tmp.h17
-rw-r--r--xc/extras/Mesa/src/simple_list.h2
-rw-r--r--xc/extras/Mesa/src/span.c126
-rw-r--r--xc/extras/Mesa/src/span.h6
-rw-r--r--xc/extras/Mesa/src/stages.c27
-rw-r--r--xc/extras/Mesa/src/stages.h4
-rw-r--r--xc/extras/Mesa/src/stencil.c574
-rw-r--r--xc/extras/Mesa/src/stencil.h58
-rw-r--r--xc/extras/Mesa/src/texgen_tmp.h6
-rw-r--r--xc/extras/Mesa/src/teximage.c202
-rw-r--r--xc/extras/Mesa/src/teximage.h121
-rw-r--r--xc/extras/Mesa/src/texobj.c85
-rw-r--r--xc/extras/Mesa/src/texobj.h32
-rw-r--r--xc/extras/Mesa/src/texstate.c209
-rw-r--r--xc/extras/Mesa/src/texstate.h94
-rw-r--r--xc/extras/Mesa/src/texture.c174
-rw-r--r--xc/extras/Mesa/src/texture.h2
-rw-r--r--xc/extras/Mesa/src/trans_tmp.h12
-rw-r--r--xc/extras/Mesa/src/translate.c48
-rw-r--r--xc/extras/Mesa/src/translate.h2
-rw-r--r--xc/extras/Mesa/src/triangle.c80
-rw-r--r--xc/extras/Mesa/src/triangle.h2
-rw-r--r--xc/extras/Mesa/src/tritemp.h20
-rw-r--r--xc/extras/Mesa/src/types.h343
-rw-r--r--xc/extras/Mesa/src/varray.c203
-rw-r--r--xc/extras/Mesa/src/varray.h84
-rw-r--r--xc/extras/Mesa/src/vb.c20
-rw-r--r--xc/extras/Mesa/src/vb.h13
-rw-r--r--xc/extras/Mesa/src/vbcull.c11
-rw-r--r--xc/extras/Mesa/src/vbcull.h2
-rw-r--r--xc/extras/Mesa/src/vbfill.c1591
-rw-r--r--xc/extras/Mesa/src/vbfill.h321
-rw-r--r--xc/extras/Mesa/src/vbindirect.c22
-rw-r--r--xc/extras/Mesa/src/vbindirect.h2
-rw-r--r--xc/extras/Mesa/src/vbrender.c101
-rw-r--r--xc/extras/Mesa/src/vbrender.h2
-rw-r--r--xc/extras/Mesa/src/vbxform.c34
-rw-r--r--xc/extras/Mesa/src/vbxform.h2
-rw-r--r--xc/extras/Mesa/src/vector.c16
-rw-r--r--xc/extras/Mesa/src/vector.h7
-rw-r--r--xc/extras/Mesa/src/vertices.c32
-rw-r--r--xc/extras/Mesa/src/vertices.h19
-rw-r--r--xc/extras/Mesa/src/winpos.c99
-rw-r--r--xc/extras/Mesa/src/winpos.h18
-rw-r--r--xc/extras/Mesa/src/xform.c16
-rw-r--r--xc/extras/Mesa/src/xform.h16
-rw-r--r--xc/extras/Mesa/src/xform_tmp.h68
-rw-r--r--xc/extras/Mesa/src/zoom.c29
-rw-r--r--xc/extras/Mesa/src/zoom.h7
-rw-r--r--xc/include/GL/gl.h8
-rw-r--r--xc/lib/GL/Imakefile53
-rw-r--r--xc/lib/GL/dri/Imakefile10
-rw-r--r--xc/lib/GL/dri/dri_glx.c252
-rw-r--r--xc/lib/GL/dri/dri_glx.h (renamed from xc/lib/GL/dri/dri_mesa_init.h)33
-rw-r--r--xc/lib/GL/glx/Imakefile119
-rw-r--r--xc/lib/GL/glx/dispatch.c62
-rw-r--r--xc/lib/GL/glx/dri_glapi.h343
-rw-r--r--xc/lib/GL/glx/glxclient.h21
-rw-r--r--xc/lib/GL/glx/glxcmds.c17
-rw-r--r--xc/lib/GL/glx/glxext.c44
-rw-r--r--xc/lib/GL/glx/indirect_init.c40
-rw-r--r--xc/lib/GL/glx/indirect_init.h4
-rw-r--r--xc/lib/GL/glx/indirect_wrap.h259
-rw-r--r--xc/lib/GL/glx/packrender.h5
-rw-r--r--xc/lib/GL/glx/packsingle.h5
-rw-r--r--xc/lib/GL/glx/packvendpriv.h5
-rw-r--r--xc/lib/GL/glx/pixel.c2
-rw-r--r--xc/lib/GL/mesa/dri/Imakefile42
-rw-r--r--xc/lib/GL/mesa/dri/dri_mesa.c742
-rw-r--r--xc/lib/GL/mesa/dri/dri_mesa.h (renamed from xc/lib/GL/dri/dri_mesa.h)0
-rw-r--r--xc/lib/GL/mesa/dri/dri_mesaint.h (renamed from xc/lib/GL/dri/dri_mesaint.h)15
-rw-r--r--xc/lib/GL/mesa/dri/dri_xmesaapi.h (renamed from xc/lib/GL/dri/dri_xmesaapi.h)0
-rw-r--r--xc/lib/GL/mesa/src/Imakefile196
-rw-r--r--xc/lib/GL/mesa/src/X/Imakefile10
-rw-r--r--xc/lib/GL/mesa/src/X86/Imakefile69
-rw-r--r--xc/lib/GL/mesa/src/drv/gamma/Imakefile27
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/Imakefile221
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_xmesa.c8
-rw-r--r--xc/lib/GL/mesa/src/mesa_api.h384
-rw-r--r--xc/lib/GL/mesa/src/mesa_api_wrap.h381
-rw-r--r--xc/programs/Xserver/GL/mesa/src/Imakefile199
-rw-r--r--xc/programs/Xserver/GL/mesa/src/X/Imakefile1
-rw-r--r--xc/programs/Xserver/GL/mesa/src/X/xf86glx.c3
-rw-r--r--xc/programs/Xserver/Imakefile235
259 files changed, 38303 insertions, 17729 deletions
diff --git a/xc/extras/Mesa/include/GL/gl.h b/xc/extras/Mesa/include/GL/gl.h
index 3e11b4a9b..e90fe5cd6 100644
--- a/xc/extras/Mesa/include/GL/gl.h
+++ b/xc/extras/Mesa/include/GL/gl.h
@@ -1,10 +1,10 @@
-/* $Id: gl.h,v 1.1 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: gl.h,v 1.2 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,10 +25,8 @@
*/
-
-
-#ifndef GL_H
-#define GL_H
+#ifndef __gl_h_
+#define __gl_h_
#if defined(USE_MGL_NAMESPACE)
#include "gl_mangle.h"
@@ -45,6 +43,11 @@
#endif
+/*
+ * XXX move as many of these pragma's and MS Windows-isms into
+ * the new src/glheader.h file.
+ */
+
#if defined(_WIN32) && !defined(__WIN32__)
# define __WIN32__
#endif
@@ -72,14 +75,18 @@
# define WGLAPI __declspec(dllimport)
# endif /* _STATIC_MESA support */
# define GLAPIENTRY __stdcall
+# define GLAPIENTRYP __stdcall *
# define GLCALLBACK __stdcall
+# define GLCALLBACKP __stdcall *
# define GLWINAPI __stdcall
# define GLWINAPIV __cdecl
#else
/* non-Windows compilation */
# define GLAPI extern
# define GLAPIENTRY
+# define GLAPIENTRYP *
# define GLCALLBACK
+# define GLCALLBACKP *
# define GLWINAPI
# define GLWINAPIV
#endif /* WIN32 / CYGWIN32 bracket */
@@ -127,980 +134,30 @@ extern "C" {
/*
* Apps can test for this symbol to do conditional compilation if needed.
*/
+/* XXX these Mesa symbols are going away
#define MESA
-
#define MESA_MAJOR_VERSION 3
#define MESA_MINOR_VERSION 1
+*/
#define GL_VERSION_1_1 1
#define GL_VERSION_1_2 1
+
/*
*
- * Enumerations
+ * Datatypes
*
*/
-
-typedef enum {
- /* Boolean values */
- GL_FALSE = 0,
- GL_TRUE = 1,
-
- /* Data types */
- GL_BYTE = 0x1400,
- GL_UNSIGNED_BYTE = 0x1401,
- GL_SHORT = 0x1402,
- GL_UNSIGNED_SHORT = 0x1403,
- GL_INT = 0x1404,
- GL_UNSIGNED_INT = 0x1405,
- GL_FLOAT = 0x1406,
- GL_DOUBLE = 0x140A,
- GL_2_BYTES = 0x1407,
- GL_3_BYTES = 0x1408,
- GL_4_BYTES = 0x1409,
-
- /* Primitives */
- GL_POINTS = 0x0000,
- GL_LINES = 0x0001,
- GL_LINE_LOOP = 0x0002,
- GL_LINE_STRIP = 0x0003,
- GL_TRIANGLES = 0x0004,
- GL_TRIANGLE_STRIP = 0x0005,
- GL_TRIANGLE_FAN = 0x0006,
- GL_QUADS = 0x0007,
- GL_QUAD_STRIP = 0x0008,
- GL_POLYGON = 0x0009,
-
- /* Vertex Arrays */
- GL_VERTEX_ARRAY = 0x8074,
- GL_NORMAL_ARRAY = 0x8075,
- GL_COLOR_ARRAY = 0x8076,
- GL_INDEX_ARRAY = 0x8077,
- GL_TEXTURE_COORD_ARRAY = 0x8078,
- GL_EDGE_FLAG_ARRAY = 0x8079,
- GL_VERTEX_ARRAY_SIZE = 0x807A,
- GL_VERTEX_ARRAY_TYPE = 0x807B,
- GL_VERTEX_ARRAY_STRIDE = 0x807C,
- GL_NORMAL_ARRAY_TYPE = 0x807E,
- GL_NORMAL_ARRAY_STRIDE = 0x807F,
- GL_COLOR_ARRAY_SIZE = 0x8081,
- GL_COLOR_ARRAY_TYPE = 0x8082,
- GL_COLOR_ARRAY_STRIDE = 0x8083,
- GL_INDEX_ARRAY_TYPE = 0x8085,
- GL_INDEX_ARRAY_STRIDE = 0x8086,
- GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088,
- GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089,
- GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A,
- GL_EDGE_FLAG_ARRAY_STRIDE = 0x808C,
- GL_VERTEX_ARRAY_POINTER = 0x808E,
- GL_NORMAL_ARRAY_POINTER = 0x808F,
- GL_COLOR_ARRAY_POINTER = 0x8090,
- GL_INDEX_ARRAY_POINTER = 0x8091,
- GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092,
- GL_EDGE_FLAG_ARRAY_POINTER = 0x8093,
- GL_V2F = 0x2A20,
- GL_V3F = 0x2A21,
- GL_C4UB_V2F = 0x2A22,
- GL_C4UB_V3F = 0x2A23,
- GL_C3F_V3F = 0x2A24,
- GL_N3F_V3F = 0x2A25,
- GL_C4F_N3F_V3F = 0x2A26,
- GL_T2F_V3F = 0x2A27,
- GL_T4F_V4F = 0x2A28,
- GL_T2F_C4UB_V3F = 0x2A29,
- GL_T2F_C3F_V3F = 0x2A2A,
- GL_T2F_N3F_V3F = 0x2A2B,
- GL_T2F_C4F_N3F_V3F = 0x2A2C,
- GL_T4F_C4F_N3F_V4F = 0x2A2D,
-
- /* Matrix Mode */
- GL_MATRIX_MODE = 0x0BA0,
- GL_MODELVIEW = 0x1700,
- GL_PROJECTION = 0x1701,
- GL_TEXTURE = 0x1702,
-
- /* Points */
- GL_POINT_SMOOTH = 0x0B10,
- GL_POINT_SIZE = 0x0B11,
- GL_POINT_SIZE_GRANULARITY = 0x0B13,
- GL_POINT_SIZE_RANGE = 0x0B12,
-
- /* Lines */
- GL_LINE_SMOOTH = 0x0B20,
- GL_LINE_STIPPLE = 0x0B24,
- GL_LINE_STIPPLE_PATTERN = 0x0B25,
- GL_LINE_STIPPLE_REPEAT = 0x0B26,
- GL_LINE_WIDTH = 0x0B21,
- GL_LINE_WIDTH_GRANULARITY = 0x0B23,
- GL_LINE_WIDTH_RANGE = 0x0B22,
-
- /* Polygons */
- GL_POINT = 0x1B00,
- GL_LINE = 0x1B01,
- GL_FILL = 0x1B02,
- GL_CW = 0x0900,
- GL_CCW = 0x0901,
- GL_FRONT = 0x0404,
- GL_BACK = 0x0405,
- GL_POLYGON_MODE = 0x0B40,
- GL_POLYGON_SMOOTH = 0x0B41,
- GL_POLYGON_STIPPLE = 0x0B42,
- GL_EDGE_FLAG = 0x0B43,
- GL_CULL_FACE = 0x0B44,
- GL_CULL_FACE_MODE = 0x0B45,
- GL_FRONT_FACE = 0x0B46,
- GL_POLYGON_OFFSET_FACTOR = 0x8038,
- GL_POLYGON_OFFSET_UNITS = 0x2A00,
- GL_POLYGON_OFFSET_POINT = 0x2A01,
- GL_POLYGON_OFFSET_LINE = 0x2A02,
- GL_POLYGON_OFFSET_FILL = 0x8037,
-
- /* Display Lists */
- GL_COMPILE = 0x1300,
- GL_COMPILE_AND_EXECUTE = 0x1301,
- GL_LIST_BASE = 0x0B32,
- GL_LIST_INDEX = 0x0B33,
- GL_LIST_MODE = 0x0B30,
-
- /* Depth buffer */
- GL_NEVER = 0x0200,
- GL_LESS = 0x0201,
- GL_GEQUAL = 0x0206,
- GL_LEQUAL = 0x0203,
- GL_GREATER = 0x0204,
- GL_NOTEQUAL = 0x0205,
- GL_EQUAL = 0x0202,
- GL_ALWAYS = 0x0207,
- GL_DEPTH_TEST = 0x0B71,
- GL_DEPTH_BITS = 0x0D56,
- GL_DEPTH_CLEAR_VALUE = 0x0B73,
- GL_DEPTH_FUNC = 0x0B74,
- GL_DEPTH_RANGE = 0x0B70,
- GL_DEPTH_WRITEMASK = 0x0B72,
- GL_DEPTH_COMPONENT = 0x1902,
-
- /* Lighting */
- GL_LIGHTING = 0x0B50,
- GL_LIGHT0 = 0x4000,
- GL_LIGHT1 = 0x4001,
- GL_LIGHT2 = 0x4002,
- GL_LIGHT3 = 0x4003,
- GL_LIGHT4 = 0x4004,
- GL_LIGHT5 = 0x4005,
- GL_LIGHT6 = 0x4006,
- GL_LIGHT7 = 0x4007,
- GL_SPOT_EXPONENT = 0x1205,
- GL_SPOT_CUTOFF = 0x1206,
- GL_CONSTANT_ATTENUATION = 0x1207,
- GL_LINEAR_ATTENUATION = 0x1208,
- GL_QUADRATIC_ATTENUATION = 0x1209,
- GL_AMBIENT = 0x1200,
- GL_DIFFUSE = 0x1201,
- GL_SPECULAR = 0x1202,
- GL_SHININESS = 0x1601,
- GL_EMISSION = 0x1600,
- GL_POSITION = 0x1203,
- GL_SPOT_DIRECTION = 0x1204,
- GL_AMBIENT_AND_DIFFUSE = 0x1602,
- GL_COLOR_INDEXES = 0x1603,
- GL_LIGHT_MODEL_TWO_SIDE = 0x0B52,
- GL_LIGHT_MODEL_LOCAL_VIEWER = 0x0B51,
- GL_LIGHT_MODEL_AMBIENT = 0x0B53,
- GL_FRONT_AND_BACK = 0x0408,
- GL_SHADE_MODEL = 0x0B54,
- GL_FLAT = 0x1D00,
- GL_SMOOTH = 0x1D01,
- GL_COLOR_MATERIAL = 0x0B57,
- GL_COLOR_MATERIAL_FACE = 0x0B55,
- GL_COLOR_MATERIAL_PARAMETER = 0x0B56,
- GL_NORMALIZE = 0x0BA1,
-
- /* User clipping planes */
- GL_CLIP_PLANE0 = 0x3000,
- GL_CLIP_PLANE1 = 0x3001,
- GL_CLIP_PLANE2 = 0x3002,
- GL_CLIP_PLANE3 = 0x3003,
- GL_CLIP_PLANE4 = 0x3004,
- GL_CLIP_PLANE5 = 0x3005,
-
- /* Accumulation buffer */
- GL_ACCUM_RED_BITS = 0x0D58,
- GL_ACCUM_GREEN_BITS = 0x0D59,
- GL_ACCUM_BLUE_BITS = 0x0D5A,
- GL_ACCUM_ALPHA_BITS = 0x0D5B,
- GL_ACCUM_CLEAR_VALUE = 0x0B80,
- GL_ACCUM = 0x0100,
- GL_ADD = 0x0104,
- GL_LOAD = 0x0101,
- GL_MULT = 0x0103,
- GL_RETURN = 0x0102,
-
- /* Alpha testing */
- GL_ALPHA_TEST = 0x0BC0,
- GL_ALPHA_TEST_REF = 0x0BC2,
- GL_ALPHA_TEST_FUNC = 0x0BC1,
-
- /* Blending */
- GL_BLEND = 0x0BE2,
- GL_BLEND_SRC = 0x0BE1,
- GL_BLEND_DST = 0x0BE0,
- GL_ZERO = 0,
- GL_ONE = 1,
- GL_SRC_COLOR = 0x0300,
- GL_ONE_MINUS_SRC_COLOR = 0x0301,
- GL_DST_COLOR = 0x0306,
- GL_ONE_MINUS_DST_COLOR = 0x0307,
- GL_SRC_ALPHA = 0x0302,
- GL_ONE_MINUS_SRC_ALPHA = 0x0303,
- GL_DST_ALPHA = 0x0304,
- GL_ONE_MINUS_DST_ALPHA = 0x0305,
- GL_SRC_ALPHA_SATURATE = 0x0308,
- GL_CONSTANT_COLOR = 0x8001,
- GL_ONE_MINUS_CONSTANT_COLOR = 0x8002,
- GL_CONSTANT_ALPHA = 0x8003,
- GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004,
-
- /* Render Mode */
- GL_FEEDBACK = 0x1C01,
- GL_RENDER = 0x1C00,
- GL_SELECT = 0x1C02,
-
- /* Feedback */
- GL_2D = 0x0600,
- GL_3D = 0x0601,
- GL_3D_COLOR = 0x0602,
- GL_3D_COLOR_TEXTURE = 0x0603,
- GL_4D_COLOR_TEXTURE = 0x0604,
- GL_POINT_TOKEN = 0x0701,
- GL_LINE_TOKEN = 0x0702,
- GL_LINE_RESET_TOKEN = 0x0707,
- GL_POLYGON_TOKEN = 0x0703,
- GL_BITMAP_TOKEN = 0x0704,
- GL_DRAW_PIXEL_TOKEN = 0x0705,
- GL_COPY_PIXEL_TOKEN = 0x0706,
- GL_PASS_THROUGH_TOKEN = 0x0700,
- GL_FEEDBACK_BUFFER_POINTER = 0x0DF0,
- GL_FEEDBACK_BUFFER_SIZE = 0x0DF1,
- GL_FEEDBACK_BUFFER_TYPE = 0x0DF2,
-
- /* Selection */
- GL_SELECTION_BUFFER_POINTER = 0x0DF3,
- GL_SELECTION_BUFFER_SIZE = 0x0DF4,
-
- /* Fog */
- GL_FOG = 0x0B60,
- GL_FOG_MODE = 0x0B65,
- GL_FOG_DENSITY = 0x0B62,
- GL_FOG_COLOR = 0x0B66,
- GL_FOG_INDEX = 0x0B61,
- GL_FOG_START = 0x0B63,
- GL_FOG_END = 0x0B64,
- GL_LINEAR = 0x2601,
- GL_EXP = 0x0800,
- GL_EXP2 = 0x0801,
-
- /* Logic Ops */
- GL_LOGIC_OP = 0x0BF1,
- GL_INDEX_LOGIC_OP = 0x0BF1,
- GL_COLOR_LOGIC_OP = 0x0BF2,
- GL_LOGIC_OP_MODE = 0x0BF0,
- GL_CLEAR = 0x1500,
- GL_SET = 0x150F,
- GL_COPY = 0x1503,
- GL_COPY_INVERTED = 0x150C,
- GL_NOOP = 0x1505,
- GL_INVERT = 0x150A,
- GL_AND = 0x1501,
- GL_NAND = 0x150E,
- GL_OR = 0x1507,
- GL_NOR = 0x1508,
- GL_XOR = 0x1506,
- GL_EQUIV = 0x1509,
- GL_AND_REVERSE = 0x1502,
- GL_AND_INVERTED = 0x1504,
- GL_OR_REVERSE = 0x150B,
- GL_OR_INVERTED = 0x150D,
-
- /* Stencil */
- GL_STENCIL_TEST = 0x0B90,
- GL_STENCIL_WRITEMASK = 0x0B98,
- GL_STENCIL_BITS = 0x0D57,
- GL_STENCIL_FUNC = 0x0B92,
- GL_STENCIL_VALUE_MASK = 0x0B93,
- GL_STENCIL_REF = 0x0B97,
- GL_STENCIL_FAIL = 0x0B94,
- GL_STENCIL_PASS_DEPTH_PASS = 0x0B96,
- GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95,
- GL_STENCIL_CLEAR_VALUE = 0x0B91,
- GL_STENCIL_INDEX = 0x1901,
- GL_KEEP = 0x1E00,
- GL_REPLACE = 0x1E01,
- GL_INCR = 0x1E02,
- GL_DECR = 0x1E03,
-
- /* Buffers, Pixel Drawing/Reading */
- GL_NONE = 0,
- GL_LEFT = 0x0406,
- GL_RIGHT = 0x0407,
- /*GL_FRONT = 0x0404, */
- /*GL_BACK = 0x0405, */
- /*GL_FRONT_AND_BACK = 0x0408, */
- GL_FRONT_LEFT = 0x0400,
- GL_FRONT_RIGHT = 0x0401,
- GL_BACK_LEFT = 0x0402,
- GL_BACK_RIGHT = 0x0403,
- GL_AUX0 = 0x0409,
- GL_AUX1 = 0x040A,
- GL_AUX2 = 0x040B,
- GL_AUX3 = 0x040C,
- GL_COLOR_INDEX = 0x1900,
- GL_RED = 0x1903,
- GL_GREEN = 0x1904,
- GL_BLUE = 0x1905,
- GL_ALPHA = 0x1906,
- GL_LUMINANCE = 0x1909,
- GL_LUMINANCE_ALPHA = 0x190A,
- GL_ALPHA_BITS = 0x0D55,
- GL_RED_BITS = 0x0D52,
- GL_GREEN_BITS = 0x0D53,
- GL_BLUE_BITS = 0x0D54,
- GL_INDEX_BITS = 0x0D51,
- GL_SUBPIXEL_BITS = 0x0D50,
- GL_AUX_BUFFERS = 0x0C00,
- GL_READ_BUFFER = 0x0C02,
- GL_DRAW_BUFFER = 0x0C01,
- GL_DOUBLEBUFFER = 0x0C32,
- GL_STEREO = 0x0C33,
- GL_BITMAP = 0x1A00,
- GL_COLOR = 0x1800,
- GL_DEPTH = 0x1801,
- GL_STENCIL = 0x1802,
- GL_DITHER = 0x0BD0,
- GL_RGB = 0x1907,
- GL_RGBA = 0x1908,
-
- /* Implementation limits */
- GL_MAX_LIST_NESTING = 0x0B31,
- GL_MAX_ATTRIB_STACK_DEPTH = 0x0D35,
- GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36,
- GL_MAX_NAME_STACK_DEPTH = 0x0D37,
- GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38,
- GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39,
- GL_MAX_EVAL_ORDER = 0x0D30,
- GL_MAX_LIGHTS = 0x0D31,
- GL_MAX_CLIP_PLANES = 0x0D32,
- GL_MAX_TEXTURE_SIZE = 0x0D33,
- GL_MAX_PIXEL_MAP_TABLE = 0x0D34,
- GL_MAX_VIEWPORT_DIMS = 0x0D3A,
- GL_MAX_CLIENT_ATTRIB_STACK_DEPTH= 0x0D3B,
-
- /* Gets */
- GL_ATTRIB_STACK_DEPTH = 0x0BB0,
- GL_CLIENT_ATTRIB_STACK_DEPTH = 0x0BB1,
- GL_COLOR_CLEAR_VALUE = 0x0C22,
- GL_COLOR_WRITEMASK = 0x0C23,
- GL_CURRENT_INDEX = 0x0B01,
- GL_CURRENT_COLOR = 0x0B00,
- GL_CURRENT_NORMAL = 0x0B02,
- GL_CURRENT_RASTER_COLOR = 0x0B04,
- GL_CURRENT_RASTER_DISTANCE = 0x0B09,
- GL_CURRENT_RASTER_INDEX = 0x0B05,
- GL_CURRENT_RASTER_POSITION = 0x0B07,
- GL_CURRENT_RASTER_TEXTURE_COORDS = 0x0B06,
- GL_CURRENT_RASTER_POSITION_VALID = 0x0B08,
- GL_CURRENT_TEXTURE_COORDS = 0x0B03,
- GL_INDEX_CLEAR_VALUE = 0x0C20,
- GL_INDEX_MODE = 0x0C30,
- GL_INDEX_WRITEMASK = 0x0C21,
- GL_MODELVIEW_MATRIX = 0x0BA6,
- GL_MODELVIEW_STACK_DEPTH = 0x0BA3,
- GL_NAME_STACK_DEPTH = 0x0D70,
- GL_PROJECTION_MATRIX = 0x0BA7,
- GL_PROJECTION_STACK_DEPTH = 0x0BA4,
- GL_RENDER_MODE = 0x0C40,
- GL_RGBA_MODE = 0x0C31,
- GL_TEXTURE_MATRIX = 0x0BA8,
- GL_TEXTURE_STACK_DEPTH = 0x0BA5,
- GL_VIEWPORT = 0x0BA2,
-
- /* Evaluators */
- GL_AUTO_NORMAL = 0x0D80,
- GL_MAP1_COLOR_4 = 0x0D90,
- GL_MAP1_GRID_DOMAIN = 0x0DD0,
- GL_MAP1_GRID_SEGMENTS = 0x0DD1,
- GL_MAP1_INDEX = 0x0D91,
- GL_MAP1_NORMAL = 0x0D92,
- GL_MAP1_TEXTURE_COORD_1 = 0x0D93,
- GL_MAP1_TEXTURE_COORD_2 = 0x0D94,
- GL_MAP1_TEXTURE_COORD_3 = 0x0D95,
- GL_MAP1_TEXTURE_COORD_4 = 0x0D96,
- GL_MAP1_VERTEX_3 = 0x0D97,
- GL_MAP1_VERTEX_4 = 0x0D98,
- GL_MAP2_COLOR_4 = 0x0DB0,
- GL_MAP2_GRID_DOMAIN = 0x0DD2,
- GL_MAP2_GRID_SEGMENTS = 0x0DD3,
- GL_MAP2_INDEX = 0x0DB1,
- GL_MAP2_NORMAL = 0x0DB2,
- GL_MAP2_TEXTURE_COORD_1 = 0x0DB3,
- GL_MAP2_TEXTURE_COORD_2 = 0x0DB4,
- GL_MAP2_TEXTURE_COORD_3 = 0x0DB5,
- GL_MAP2_TEXTURE_COORD_4 = 0x0DB6,
- GL_MAP2_VERTEX_3 = 0x0DB7,
- GL_MAP2_VERTEX_4 = 0x0DB8,
- GL_COEFF = 0x0A00,
- GL_DOMAIN = 0x0A02,
- GL_ORDER = 0x0A01,
-
- /* Hints */
- GL_FOG_HINT = 0x0C54,
- GL_LINE_SMOOTH_HINT = 0x0C52,
- GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50,
- GL_POINT_SMOOTH_HINT = 0x0C51,
- GL_POLYGON_SMOOTH_HINT = 0x0C53,
- GL_DONT_CARE = 0x1100,
- GL_FASTEST = 0x1101,
- GL_NICEST = 0x1102,
-
- /* Scissor box */
- GL_SCISSOR_TEST = 0x0C11,
- GL_SCISSOR_BOX = 0x0C10,
-
- /* Pixel Mode / Transfer */
- GL_MAP_COLOR = 0x0D10,
- GL_MAP_STENCIL = 0x0D11,
- GL_INDEX_SHIFT = 0x0D12,
- GL_INDEX_OFFSET = 0x0D13,
- GL_RED_SCALE = 0x0D14,
- GL_RED_BIAS = 0x0D15,
- GL_GREEN_SCALE = 0x0D18,
- GL_GREEN_BIAS = 0x0D19,
- GL_BLUE_SCALE = 0x0D1A,
- GL_BLUE_BIAS = 0x0D1B,
- GL_ALPHA_SCALE = 0x0D1C,
- GL_ALPHA_BIAS = 0x0D1D,
- GL_DEPTH_SCALE = 0x0D1E,
- GL_DEPTH_BIAS = 0x0D1F,
- GL_PIXEL_MAP_S_TO_S_SIZE = 0x0CB1,
- GL_PIXEL_MAP_I_TO_I_SIZE = 0x0CB0,
- GL_PIXEL_MAP_I_TO_R_SIZE = 0x0CB2,
- GL_PIXEL_MAP_I_TO_G_SIZE = 0x0CB3,
- GL_PIXEL_MAP_I_TO_B_SIZE = 0x0CB4,
- GL_PIXEL_MAP_I_TO_A_SIZE = 0x0CB5,
- GL_PIXEL_MAP_R_TO_R_SIZE = 0x0CB6,
- GL_PIXEL_MAP_G_TO_G_SIZE = 0x0CB7,
- GL_PIXEL_MAP_B_TO_B_SIZE = 0x0CB8,
- GL_PIXEL_MAP_A_TO_A_SIZE = 0x0CB9,
- GL_PIXEL_MAP_S_TO_S = 0x0C71,
- GL_PIXEL_MAP_I_TO_I = 0x0C70,
- GL_PIXEL_MAP_I_TO_R = 0x0C72,
- GL_PIXEL_MAP_I_TO_G = 0x0C73,
- GL_PIXEL_MAP_I_TO_B = 0x0C74,
- GL_PIXEL_MAP_I_TO_A = 0x0C75,
- GL_PIXEL_MAP_R_TO_R = 0x0C76,
- GL_PIXEL_MAP_G_TO_G = 0x0C77,
- GL_PIXEL_MAP_B_TO_B = 0x0C78,
- GL_PIXEL_MAP_A_TO_A = 0x0C79,
- GL_PACK_ALIGNMENT = 0x0D05,
- GL_PACK_LSB_FIRST = 0x0D01,
- GL_PACK_ROW_LENGTH = 0x0D02,
- GL_PACK_SKIP_PIXELS = 0x0D04,
- GL_PACK_SKIP_ROWS = 0x0D03,
- GL_PACK_SWAP_BYTES = 0x0D00,
- GL_UNPACK_ALIGNMENT = 0x0CF5,
- GL_UNPACK_LSB_FIRST = 0x0CF1,
- GL_UNPACK_ROW_LENGTH = 0x0CF2,
- GL_UNPACK_SKIP_PIXELS = 0x0CF4,
- GL_UNPACK_SKIP_ROWS = 0x0CF3,
- GL_UNPACK_SWAP_BYTES = 0x0CF0,
- GL_ZOOM_X = 0x0D16,
- GL_ZOOM_Y = 0x0D17,
-
- /* Texture mapping */
- GL_TEXTURE_ENV = 0x2300,
- GL_TEXTURE_ENV_MODE = 0x2200,
- GL_TEXTURE_1D = 0x0DE0,
- GL_TEXTURE_2D = 0x0DE1,
- GL_TEXTURE_WRAP_S = 0x2802,
- GL_TEXTURE_WRAP_T = 0x2803,
- GL_TEXTURE_MAG_FILTER = 0x2800,
- GL_TEXTURE_MIN_FILTER = 0x2801,
- GL_TEXTURE_ENV_COLOR = 0x2201,
- GL_TEXTURE_GEN_S = 0x0C60,
- GL_TEXTURE_GEN_T = 0x0C61,
- GL_TEXTURE_GEN_MODE = 0x2500,
- GL_TEXTURE_BORDER_COLOR = 0x1004,
- GL_TEXTURE_WIDTH = 0x1000,
- GL_TEXTURE_HEIGHT = 0x1001,
- GL_TEXTURE_BORDER = 0x1005,
- GL_TEXTURE_COMPONENTS = 0x1003,
- GL_TEXTURE_RED_SIZE = 0x805C,
- GL_TEXTURE_GREEN_SIZE = 0x805D,
- GL_TEXTURE_BLUE_SIZE = 0x805E,
- GL_TEXTURE_ALPHA_SIZE = 0x805F,
- GL_TEXTURE_LUMINANCE_SIZE = 0x8060,
- GL_TEXTURE_INTENSITY_SIZE = 0x8061,
- GL_NEAREST_MIPMAP_NEAREST = 0x2700,
- GL_NEAREST_MIPMAP_LINEAR = 0x2702,
- GL_LINEAR_MIPMAP_NEAREST = 0x2701,
- GL_LINEAR_MIPMAP_LINEAR = 0x2703,
- GL_OBJECT_LINEAR = 0x2401,
- GL_OBJECT_PLANE = 0x2501,
- GL_EYE_LINEAR = 0x2400,
- GL_EYE_PLANE = 0x2502,
- GL_SPHERE_MAP = 0x2402,
- GL_DECAL = 0x2101,
- GL_MODULATE = 0x2100,
- GL_NEAREST = 0x2600,
- GL_REPEAT = 0x2901,
- GL_CLAMP = 0x2900,
- GL_S = 0x2000,
- GL_T = 0x2001,
- GL_R = 0x2002,
- GL_Q = 0x2003,
- GL_TEXTURE_GEN_R = 0x0C62,
- GL_TEXTURE_GEN_Q = 0x0C63,
-
- /* GL 1.1 texturing */
- GL_PROXY_TEXTURE_1D = 0x8063,
- GL_PROXY_TEXTURE_2D = 0x8064,
- GL_TEXTURE_PRIORITY = 0x8066,
- GL_TEXTURE_RESIDENT = 0x8067,
- GL_TEXTURE_BINDING_1D = 0x8068,
- GL_TEXTURE_BINDING_2D = 0x8069,
- GL_TEXTURE_INTERNAL_FORMAT = 0x1003,
-
- /* GL 1.2 texturing */
- GL_PACK_SKIP_IMAGES = 0x806B,
- GL_PACK_IMAGE_HEIGHT = 0x806C,
- GL_UNPACK_SKIP_IMAGES = 0x806D,
- GL_UNPACK_IMAGE_HEIGHT = 0x806E,
- GL_TEXTURE_3D = 0x806F,
- GL_PROXY_TEXTURE_3D = 0x8070,
- GL_TEXTURE_DEPTH = 0x8071,
- GL_TEXTURE_WRAP_R = 0x8072,
- GL_MAX_3D_TEXTURE_SIZE = 0x8073,
- GL_TEXTURE_BINDING_3D = 0x806A,
-
- /* Internal texture formats (GL 1.1) */
- GL_ALPHA4 = 0x803B,
- GL_ALPHA8 = 0x803C,
- GL_ALPHA12 = 0x803D,
- GL_ALPHA16 = 0x803E,
- GL_LUMINANCE4 = 0x803F,
- GL_LUMINANCE8 = 0x8040,
- GL_LUMINANCE12 = 0x8041,
- GL_LUMINANCE16 = 0x8042,
- GL_LUMINANCE4_ALPHA4 = 0x8043,
- GL_LUMINANCE6_ALPHA2 = 0x8044,
- GL_LUMINANCE8_ALPHA8 = 0x8045,
- GL_LUMINANCE12_ALPHA4 = 0x8046,
- GL_LUMINANCE12_ALPHA12 = 0x8047,
- GL_LUMINANCE16_ALPHA16 = 0x8048,
- GL_INTENSITY = 0x8049,
- GL_INTENSITY4 = 0x804A,
- GL_INTENSITY8 = 0x804B,
- GL_INTENSITY12 = 0x804C,
- GL_INTENSITY16 = 0x804D,
- GL_R3_G3_B2 = 0x2A10,
- GL_RGB4 = 0x804F,
- GL_RGB5 = 0x8050,
- GL_RGB8 = 0x8051,
- GL_RGB10 = 0x8052,
- GL_RGB12 = 0x8053,
- GL_RGB16 = 0x8054,
- GL_RGBA2 = 0x8055,
- GL_RGBA4 = 0x8056,
- GL_RGB5_A1 = 0x8057,
- GL_RGBA8 = 0x8058,
- GL_RGB10_A2 = 0x8059,
- GL_RGBA12 = 0x805A,
- GL_RGBA16 = 0x805B,
-
- /* Utility */
- GL_VENDOR = 0x1F00,
- GL_RENDERER = 0x1F01,
- GL_VERSION = 0x1F02,
- GL_EXTENSIONS = 0x1F03,
-
- /* Errors */
- GL_INVALID_VALUE = 0x0501,
- GL_INVALID_ENUM = 0x0500,
- GL_INVALID_OPERATION = 0x0502,
- GL_STACK_OVERFLOW = 0x0503,
- GL_STACK_UNDERFLOW = 0x0504,
- GL_OUT_OF_MEMORY = 0x0505,
-
- /*
- * Extensions
- */
-
- /* GL_EXT_blend_minmax and GL_EXT_blend_color */
- GL_CONSTANT_COLOR_EXT = 0x8001,
- GL_ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002,
- GL_CONSTANT_ALPHA_EXT = 0x8003,
- GL_ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004,
- GL_BLEND_EQUATION_EXT = 0x8009,
- GL_MIN_EXT = 0x8007,
- GL_MAX_EXT = 0x8008,
- GL_FUNC_ADD_EXT = 0x8006,
- GL_FUNC_SUBTRACT_EXT = 0x800A,
- GL_FUNC_REVERSE_SUBTRACT_EXT = 0x800B,
- GL_BLEND_COLOR_EXT = 0x8005,
-
- /* GL_EXT_polygon_offset */
- GL_POLYGON_OFFSET_EXT = 0x8037,
- GL_POLYGON_OFFSET_FACTOR_EXT = 0x8038,
- GL_POLYGON_OFFSET_BIAS_EXT = 0x8039,
-
- /* GL_EXT_vertex_array */
- GL_VERTEX_ARRAY_EXT = 0x8074,
- GL_NORMAL_ARRAY_EXT = 0x8075,
- GL_COLOR_ARRAY_EXT = 0x8076,
- GL_INDEX_ARRAY_EXT = 0x8077,
- GL_TEXTURE_COORD_ARRAY_EXT = 0x8078,
- GL_EDGE_FLAG_ARRAY_EXT = 0x8079,
- GL_VERTEX_ARRAY_SIZE_EXT = 0x807A,
- GL_VERTEX_ARRAY_TYPE_EXT = 0x807B,
- GL_VERTEX_ARRAY_STRIDE_EXT = 0x807C,
- GL_VERTEX_ARRAY_COUNT_EXT = 0x807D,
- GL_NORMAL_ARRAY_TYPE_EXT = 0x807E,
- GL_NORMAL_ARRAY_STRIDE_EXT = 0x807F,
- GL_NORMAL_ARRAY_COUNT_EXT = 0x8080,
- GL_COLOR_ARRAY_SIZE_EXT = 0x8081,
- GL_COLOR_ARRAY_TYPE_EXT = 0x8082,
- GL_COLOR_ARRAY_STRIDE_EXT = 0x8083,
- GL_COLOR_ARRAY_COUNT_EXT = 0x8084,
- GL_INDEX_ARRAY_TYPE_EXT = 0x8085,
- GL_INDEX_ARRAY_STRIDE_EXT = 0x8086,
- GL_INDEX_ARRAY_COUNT_EXT = 0x8087,
- GL_TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088,
- GL_TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089,
- GL_TEXTURE_COORD_ARRAY_STRIDE_EXT = 0x808A,
- GL_TEXTURE_COORD_ARRAY_COUNT_EXT = 0x808B,
- GL_EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C,
- GL_EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D,
- GL_VERTEX_ARRAY_POINTER_EXT = 0x808E,
- GL_NORMAL_ARRAY_POINTER_EXT = 0x808F,
- GL_COLOR_ARRAY_POINTER_EXT = 0x8090,
- GL_INDEX_ARRAY_POINTER_EXT = 0x8091,
- GL_TEXTURE_COORD_ARRAY_POINTER_EXT = 0x8092,
- GL_EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093,
-
- /* GL_EXT_texture_object */
- GL_TEXTURE_PRIORITY_EXT = 0x8066,
- GL_TEXTURE_RESIDENT_EXT = 0x8067,
- GL_TEXTURE_1D_BINDING_EXT = 0x8068,
- GL_TEXTURE_2D_BINDING_EXT = 0x8069,
-
- /* GL_EXT_texture3D */
- GL_PACK_SKIP_IMAGES_EXT = 0x806B,
- GL_PACK_IMAGE_HEIGHT_EXT = 0x806C,
- GL_UNPACK_SKIP_IMAGES_EXT = 0x806D,
- GL_UNPACK_IMAGE_HEIGHT_EXT = 0x806E,
- GL_TEXTURE_3D_EXT = 0x806F,
- GL_PROXY_TEXTURE_3D_EXT = 0x8070,
- GL_TEXTURE_DEPTH_EXT = 0x8071,
- GL_TEXTURE_WRAP_R_EXT = 0x8072,
- GL_MAX_3D_TEXTURE_SIZE_EXT = 0x8073,
- GL_TEXTURE_3D_BINDING_EXT = 0x806A,
-
- /* GL_EXT_paletted_texture */
- GL_TABLE_TOO_LARGE_EXT = 0x8031,
- GL_COLOR_TABLE_FORMAT_EXT = 0x80D8,
- GL_COLOR_TABLE_WIDTH_EXT = 0x80D9,
- GL_COLOR_TABLE_RED_SIZE_EXT = 0x80DA,
- GL_COLOR_TABLE_GREEN_SIZE_EXT = 0x80DB,
- GL_COLOR_TABLE_BLUE_SIZE_EXT = 0x80DC,
- GL_COLOR_TABLE_ALPHA_SIZE_EXT = 0x80DD,
- GL_COLOR_TABLE_LUMINANCE_SIZE_EXT = 0x80DE,
- GL_COLOR_TABLE_INTENSITY_SIZE_EXT = 0x80DF,
- GL_TEXTURE_INDEX_SIZE_EXT = 0x80ED,
- GL_COLOR_INDEX1_EXT = 0x80E2,
- GL_COLOR_INDEX2_EXT = 0x80E3,
- GL_COLOR_INDEX4_EXT = 0x80E4,
- GL_COLOR_INDEX8_EXT = 0x80E5,
- GL_COLOR_INDEX12_EXT = 0x80E6,
- GL_COLOR_INDEX16_EXT = 0x80E7,
-
- /* GL_EXT_shared_texture_palette */
- GL_SHARED_TEXTURE_PALETTE_EXT = 0x81FB,
-
- /* GL_EXT_point_parameters */
- GL_POINT_SIZE_MIN_EXT = 0x8126,
- GL_POINT_SIZE_MAX_EXT = 0x8127,
- GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128,
- GL_DISTANCE_ATTENUATION_EXT = 0x8129,
-
- /* GL_EXT_rescale_normal */
- GL_RESCALE_NORMAL_EXT = 0x803A,
-
- /* GL_EXT_abgr */
- GL_ABGR_EXT = 0x8000,
-
- /* GL_EXT_stencil_wrap */
- GL_INCR_WRAP_EXT = 0x8507,
- GL_DECR_WRAP_EXT = 0x8508,
-
- /* GL_SGIS_texture_edge_clamp */
- GL_CLAMP_TO_EDGE_SGIS = 0x812F,
-
- /* GL_INGR_blend_func_separate */
- GL_BLEND_DST_RGB_INGR = 0x80C8,
- GL_BLEND_SRC_RGB_INGR = 0x80C9,
- GL_BLEND_DST_ALPHA_INGR = 0x80CA,
- GL_BLEND_SRC_ALPHA_INGR = 0x80CB,
-
- /* OpenGL 1.2 */
- GL_RESCALE_NORMAL = 0x803A,
- GL_CLAMP_TO_EDGE = 0x812F,
- GL_MAX_ELEMENTS_VERTICES = 0x80E8,
- GL_MAX_ELEMENTS_INDICES = 0x80E9,
- GL_BGR = 0x80E0,
- GL_BGRA = 0x80E1,
- GL_UNSIGNED_BYTE_3_3_2 = 0x8032,
- GL_UNSIGNED_BYTE_2_3_3_REV = 0x8362,
- GL_UNSIGNED_SHORT_5_6_5 = 0x8363,
- GL_UNSIGNED_SHORT_5_6_5_REV = 0x8364,
- GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033,
- GL_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365,
- GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034,
- GL_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366,
- GL_UNSIGNED_INT_8_8_8_8 = 0x8035,
- GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367,
- GL_UNSIGNED_INT_10_10_10_2 = 0x8036,
- GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368,
- GL_LIGHT_MODEL_COLOR_CONTROL = 0x81F8,
- GL_SINGLE_COLOR = 0x81F9,
- GL_SEPARATE_SPECULAR_COLOR = 0x81FA,
- GL_TEXTURE_MIN_LOD = 0x813A,
- GL_TEXTURE_MAX_LOD = 0x813B,
- GL_TEXTURE_BASE_LEVEL = 0x813C,
- GL_TEXTURE_MAX_LEVEL = 0x813D,
-
- /* GL_ARB_multitexture */
- GL_TEXTURE0_ARB = 0x84C0,
- GL_TEXTURE1_ARB = 0x84C1,
- GL_TEXTURE2_ARB = 0x84C2,
- GL_TEXTURE3_ARB = 0x84C3,
- GL_TEXTURE4_ARB = 0x84C4,
- GL_TEXTURE5_ARB = 0x84C5,
- GL_TEXTURE6_ARB = 0x84C6,
- GL_TEXTURE7_ARB = 0x84C7,
- GL_TEXTURE8_ARB = 0x84C8,
- GL_TEXTURE9_ARB = 0x84C9,
- GL_TEXTURE10_ARB = 0x84CA,
- GL_TEXTURE11_ARB = 0x84CB,
- GL_TEXTURE12_ARB = 0x84CC,
- GL_TEXTURE13_ARB = 0x84CD,
- GL_TEXTURE14_ARB = 0x84CE,
- GL_TEXTURE15_ARB = 0x84CF,
- GL_TEXTURE16_ARB = 0x84D0,
- GL_TEXTURE17_ARB = 0x84D1,
- GL_TEXTURE18_ARB = 0x84D2,
- GL_TEXTURE19_ARB = 0x84D3,
- GL_TEXTURE20_ARB = 0x84D4,
- GL_TEXTURE21_ARB = 0x84D5,
- GL_TEXTURE22_ARB = 0x84D6,
- GL_TEXTURE23_ARB = 0x84D7,
- GL_TEXTURE24_ARB = 0x84D8,
- GL_TEXTURE25_ARB = 0x84D9,
- GL_TEXTURE26_ARB = 0x84DA,
- GL_TEXTURE27_ARB = 0x84DB,
- GL_TEXTURE28_ARB = 0x84DC,
- GL_TEXTURE29_ARB = 0x84DD,
- GL_TEXTURE30_ARB = 0x84DE,
- GL_TEXTURE31_ARB = 0x84DF,
- GL_ACTIVE_TEXTURE_ARB = 0x84E0,
- GL_CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1,
- GL_MAX_TEXTURE_UNITS_ARB = 0x84E2,
-
- /*
- * OpenGL 1.2 imaging subset (NOT IMPLEMENTED BY MESA)
- */
- /* GL_EXT_color_table */
- GL_COLOR_TABLE = 0x80D0,
- GL_POST_CONVOLUTION_COLOR_TABLE = 0x80D1,
- GL_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D2,
- GL_PROXY_COLOR_TABLE = 0x80D3,
- GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = 0x80D4,
- GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D5,
- GL_COLOR_TABLE_SCALE = 0x80D6,
- GL_COLOR_TABLE_BIAS = 0x80D7,
- GL_COLOR_TABLE_FORMAT = 0x80D8,
- GL_COLOR_TABLE_WIDTH = 0x80D9,
- GL_COLOR_TABLE_RED_SIZE = 0x80DA,
- GL_COLOR_TABLE_GREEN_SIZE = 0x80DB,
- GL_COLOR_TABLE_BLUE_SIZE = 0x80DC,
- GL_COLOR_TABLE_ALPHA_SIZE = 0x80DD,
- GL_COLOR_TABLE_LUMINANCE_SIZE = 0x80DE,
- GL_COLOR_TABLE_INTENSITY_SIZE = 0x80DF,
- /* GL_EXT_convolution and GL_HP_convolution_border_modes */
- GL_CONVOLUTION_1D = 0x8010,
- GL_CONVOLUTION_2D = 0x8011,
- GL_SEPARABLE_2D = 0x8012,
- GL_CONVOLUTION_BORDER_MODE = 0x8013,
- GL_CONVOLUTION_FILTER_SCALE = 0x8014,
- GL_CONVOLUTION_FILTER_BIAS = 0x8015,
- GL_REDUCE = 0x8016,
- GL_CONVOLUTION_FORMAT = 0x8017,
- GL_CONVOLUTION_WIDTH = 0x8018,
- GL_CONVOLUTION_HEIGHT = 0x8019,
- GL_MAX_CONVOLUTION_WIDTH = 0x801A,
- GL_MAX_CONVOLUTION_HEIGHT = 0x801B,
- GL_POST_CONVOLUTION_RED_SCALE = 0x801C,
- GL_POST_CONVOLUTION_GREEN_SCALE = 0x801D,
- GL_POST_CONVOLUTION_BLUE_SCALE = 0x801E,
- GL_POST_CONVOLUTION_ALPHA_SCALE = 0x801F,
- GL_POST_CONVOLUTION_RED_BIAS = 0x8020,
- GL_POST_CONVOLUTION_GREEN_BIAS = 0x8021,
- GL_POST_CONVOLUTION_BLUE_BIAS = 0x8022,
- GL_POST_CONVOLUTION_ALPHA_BIAS = 0x8023,
- GL_CONSTANT_BORDER = 0x8151,
- GL_REPLICATE_BORDER = 0x8153,
- GL_CONVOLUTION_BORDER_COLOR = 0x8154,
- /* GL_SGI_color_matrix */
- GL_COLOR_MATRIX = 0x80B1,
- GL_COLOR_MATRIX_STACK_DEPTH = 0x80B2,
- GL_MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3,
- GL_POST_COLOR_MATRIX_RED_SCALE = 0x80B4,
- GL_POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5,
- GL_POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6,
- GL_POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7,
- GL_POST_COLOR_MATRIX_RED_BIAS = 0x80B8,
- GL_POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9,
- GL_POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA,
- GL_POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB,
- /* GL_EXT_histogram */
- GL_HISTOGRAM = 0x8024,
- GL_PROXY_HISTOGRAM = 0x8025,
- GL_HISTOGRAM_WIDTH = 0x8026,
- GL_HISTOGRAM_FORMAT = 0x8027,
- GL_HISTOGRAM_RED_SIZE = 0x8028,
- GL_HISTOGRAM_GREEN_SIZE = 0x8029,
- GL_HISTOGRAM_BLUE_SIZE = 0x802A,
- GL_HISTOGRAM_ALPHA_SIZE = 0x802B,
- GL_HISTOGRAM_LUMINANCE_SIZE = 0x802C,
- GL_HISTOGRAM_SINK = 0x802D,
- GL_MINMAX = 0x802E,
- GL_MINMAX_FORMAT = 0x802F,
- GL_MINMAX_SINK = 0x8030,
- GL_TABLE_TOO_LARGE = 0x8031,
- /* GL_EXT_blend_color, GL_EXT_blend_minmax */
- GL_BLEND_EQUATION = 0x8009,
- GL_MIN = 0x8007,
- GL_MAX = 0x8008,
- GL_FUNC_ADD = 0x8006,
- GL_FUNC_SUBTRACT = 0x800A,
- GL_FUNC_REVERSE_SUBTRACT = 0x800B,
- GL_BLEND_COLOR = 0x8005,
-
- /* GL_NV_texgen_reflection (nVidia) */
- GL_NORMAL_MAP_NV = 0x8511,
- GL_REFLECTION_MAP_NV = 0x8512,
-
- /* GL_PGI_misc_hints */
- GL_PREFER_DOUBLEBUFFER_HINT_PGI = 107000,
- GL_STRICT_DEPTHFUNC_HINT_PGI = 107030,
- GL_STRICT_LIGHTING_HINT_PGI = 107031,
- GL_STRICT_SCISSOR_HINT_PGI = 107032,
- GL_FULL_STIPPLE_HINT_PGI = 107033,
- GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI = 107011,
- GL_NATIVE_GRAPHICS_END_HINT_PGI = 107012,
- GL_CONSERVE_MEMORY_HINT_PGI = 107005,
- GL_RECLAIM_MEMORY_HINT_PGI = 107006,
- GL_ALWAYS_FAST_HINT_PGI = 107020,
- GL_ALWAYS_SOFT_HINT_PGI = 107021,
- GL_ALLOW_DRAW_OBJ_HINT_PGI = 107022,
- GL_ALLOW_DRAW_WIN_HINT_PGI = 107023,
- GL_ALLOW_DRAW_FRG_HINT_PGI = 107024,
- GL_ALLOW_DRAW_SPN_HINT_PGI = 107024,
- GL_ALLOW_DRAW_MEM_HINT_PGI = 107025,
- GL_CLIP_NEAR_HINT_PGI = 107040,
- GL_CLIP_FAR_HINT_PGI = 107041,
- GL_WIDE_LINE_HINT_PGI = 107042,
- GL_BACK_NORMALS_HINT_PGI = 107043,
- GL_NATIVE_GRAPHICS_HANDLE_PGI = 107010,
-
- /* GL_EXT_compiled_vertex_array */
- GL_ARRAY_ELEMENT_LOCK_FIRST_SGI = 0x81A8,
- GL_ARRAY_ELEMENT_LOCK_COUNT_SGI = 0x81A9,
-
- /* GL_EXT_clip_volume_hint */
- GL_CLIP_VOLUME_CLIPPING_HINT_EXT = 0x80F0
-
-
-/* When you add new enums, please make sure you update the strings
- * in enums.c as well...
- */
-
-}
-#ifdef CENTERLINE_CLPP
- /* CenterLine C++ workaround: */
- gl_enum;
- typedef int GLenum;
-#else
- /* all other compilers */
- GLenum;
-#endif
-
-
-/* GL_NO_ERROR must be zero */
-#define GL_NO_ERROR 0
-
-
-
-enum {
- GL_CURRENT_BIT = 0x00000001,
- GL_POINT_BIT = 0x00000002,
- GL_LINE_BIT = 0x00000004,
- GL_POLYGON_BIT = 0x00000008,
- GL_POLYGON_STIPPLE_BIT = 0x00000010,
- GL_PIXEL_MODE_BIT = 0x00000020,
- GL_LIGHTING_BIT = 0x00000040,
- GL_FOG_BIT = 0x00000080,
- GL_DEPTH_BUFFER_BIT = 0x00000100,
- GL_ACCUM_BUFFER_BIT = 0x00000200,
- GL_STENCIL_BUFFER_BIT = 0x00000400,
- GL_VIEWPORT_BIT = 0x00000800,
- GL_TRANSFORM_BIT = 0x00001000,
- GL_ENABLE_BIT = 0x00002000,
- GL_COLOR_BUFFER_BIT = 0x00004000,
- GL_HINT_BIT = 0x00008000,
- GL_EVAL_BIT = 0x00010000,
- GL_LIST_BIT = 0x00020000,
- GL_TEXTURE_BIT = 0x00040000,
- GL_SCISSOR_BIT = 0x00080000,
- GL_ALL_ATTRIB_BITS = 0x000FFFFF
-};
-
-
-enum {
- GL_CLIENT_PIXEL_STORE_BIT = 0x00000001,
- GL_CLIENT_VERTEX_ARRAY_BIT = 0x00000002
-};
-#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
-
-
-typedef unsigned int GLbitfield;
-
-
#ifdef CENTERLINE_CLPP
#define signed
#endif
-
-
-/*
- *
- * Data types (may be architecture dependent in some cases)
- *
- */
-
-/* C type GL type storage */
-/*-------------------------------------------------------------------------*/
-typedef void GLvoid;
+typedef unsigned int GLenum;
typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef void GLvoid;
typedef signed char GLbyte; /* 1-byte signed */
typedef short GLshort; /* 2-byte signed */
typedef int GLint; /* 4-byte signed */
@@ -1115,6 +172,750 @@ typedef double GLclampd; /* double precision float in [0,1] */
+/*
+ *
+ * Constants
+ *
+ */
+
+/* Boolean values */
+#define GL_FALSE 0x0
+#define GL_TRUE 0x1
+
+/* Data types */
+#define GL_BYTE 0x1400
+#define GL_UNSIGNED_BYTE 0x1401
+#define GL_SHORT 0x1402
+#define GL_UNSIGNED_SHORT 0x1403
+#define GL_INT 0x1404
+#define GL_UNSIGNED_INT 0x1405
+#define GL_FLOAT 0x1406
+#define GL_DOUBLE 0x140A
+#define GL_2_BYTES 0x1407
+#define GL_3_BYTES 0x1408
+#define GL_4_BYTES 0x1409
+
+/* Primitives */
+#define GL_POINTS 0x0000
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_FAN 0x0006
+#define GL_QUADS 0x0007
+#define GL_QUAD_STRIP 0x0008
+#define GL_POLYGON 0x0009
+
+/* Vertex Arrays */
+#define GL_VERTEX_ARRAY 0x8074
+#define GL_NORMAL_ARRAY 0x8075
+#define GL_COLOR_ARRAY 0x8076
+#define GL_INDEX_ARRAY 0x8077
+#define GL_TEXTURE_COORD_ARRAY 0x8078
+#define GL_EDGE_FLAG_ARRAY 0x8079
+#define GL_VERTEX_ARRAY_SIZE 0x807A
+#define GL_VERTEX_ARRAY_TYPE 0x807B
+#define GL_VERTEX_ARRAY_STRIDE 0x807C
+#define GL_NORMAL_ARRAY_TYPE 0x807E
+#define GL_NORMAL_ARRAY_STRIDE 0x807F
+#define GL_COLOR_ARRAY_SIZE 0x8081
+#define GL_COLOR_ARRAY_TYPE 0x8082
+#define GL_COLOR_ARRAY_STRIDE 0x8083
+#define GL_INDEX_ARRAY_TYPE 0x8085
+#define GL_INDEX_ARRAY_STRIDE 0x8086
+#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
+#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
+#define GL_VERTEX_ARRAY_POINTER 0x808E
+#define GL_NORMAL_ARRAY_POINTER 0x808F
+#define GL_COLOR_ARRAY_POINTER 0x8090
+#define GL_INDEX_ARRAY_POINTER 0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
+#define GL_V2F 0x2A20
+#define GL_V3F 0x2A21
+#define GL_C4UB_V2F 0x2A22
+#define GL_C4UB_V3F 0x2A23
+#define GL_C3F_V3F 0x2A24
+#define GL_N3F_V3F 0x2A25
+#define GL_C4F_N3F_V3F 0x2A26
+#define GL_T2F_V3F 0x2A27
+#define GL_T4F_V4F 0x2A28
+#define GL_T2F_C4UB_V3F 0x2A29
+#define GL_T2F_C3F_V3F 0x2A2A
+#define GL_T2F_N3F_V3F 0x2A2B
+#define GL_T2F_C4F_N3F_V3F 0x2A2C
+#define GL_T4F_C4F_N3F_V4F 0x2A2D
+
+/* Matrix Mode */
+#define GL_MATRIX_MODE 0x0BA0
+#define GL_MODELVIEW 0x1700
+#define GL_PROJECTION 0x1701
+#define GL_TEXTURE 0x1702
+
+/* Points */
+#define GL_POINT_SMOOTH 0x0B10
+#define GL_POINT_SIZE 0x0B11
+#define GL_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_POINT_SIZE_RANGE 0x0B12
+
+/* Lines */
+#define GL_LINE_SMOOTH 0x0B20
+#define GL_LINE_STIPPLE 0x0B24
+#define GL_LINE_STIPPLE_PATTERN 0x0B25
+#define GL_LINE_STIPPLE_REPEAT 0x0B26
+#define GL_LINE_WIDTH 0x0B21
+#define GL_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_LINE_WIDTH_RANGE 0x0B22
+
+/* Polygons */
+#define GL_POINT 0x1B00
+#define GL_LINE 0x1B01
+#define GL_FILL 0x1B02
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_POLYGON_MODE 0x0B40
+#define GL_POLYGON_SMOOTH 0x0B41
+#define GL_POLYGON_STIPPLE 0x0B42
+#define GL_EDGE_FLAG 0x0B43
+#define GL_CULL_FACE 0x0B44
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_POINT 0x2A01
+#define GL_POLYGON_OFFSET_LINE 0x2A02
+#define GL_POLYGON_OFFSET_FILL 0x8037
+
+/* Display Lists */
+#define GL_COMPILE 0x1300
+#define GL_COMPILE_AND_EXECUTE 0x1301
+#define GL_LIST_BASE 0x0B32
+#define GL_LIST_INDEX 0x0B33
+#define GL_LIST_MODE 0x0B30
+
+/* Depth buffer */
+#define GL_NEVER 0x0200
+#define GL_LESS 0x0201
+#define GL_EQUAL 0x0202
+#define GL_LEQUAL 0x0203
+#define GL_GREATER 0x0204
+#define GL_NOTEQUAL 0x0205
+#define GL_GEQUAL 0x0206
+#define GL_ALWAYS 0x0207
+#define GL_DEPTH_TEST 0x0B71
+#define GL_DEPTH_BITS 0x0D56
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_COMPONENT 0x1902
+
+/* Lighting */
+#define GL_LIGHTING 0x0B50
+#define GL_LIGHT0 0x4000
+#define GL_LIGHT1 0x4001
+#define GL_LIGHT2 0x4002
+#define GL_LIGHT3 0x4003
+#define GL_LIGHT4 0x4004
+#define GL_LIGHT5 0x4005
+#define GL_LIGHT6 0x4006
+#define GL_LIGHT7 0x4007
+#define GL_SPOT_EXPONENT 0x1205
+#define GL_SPOT_CUTOFF 0x1206
+#define GL_CONSTANT_ATTENUATION 0x1207
+#define GL_LINEAR_ATTENUATION 0x1208
+#define GL_QUADRATIC_ATTENUATION 0x1209
+#define GL_AMBIENT 0x1200
+#define GL_DIFFUSE 0x1201
+#define GL_SPECULAR 0x1202
+#define GL_SHININESS 0x1601
+#define GL_EMISSION 0x1600
+#define GL_POSITION 0x1203
+#define GL_SPOT_DIRECTION 0x1204
+#define GL_AMBIENT_AND_DIFFUSE 0x1602
+#define GL_COLOR_INDEXES 0x1603
+#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
+#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
+#define GL_LIGHT_MODEL_AMBIENT 0x0B53
+#define GL_FRONT_AND_BACK 0x0408
+#define GL_SHADE_MODEL 0x0B54
+#define GL_FLAT 0x1D00
+#define GL_SMOOTH 0x1D01
+#define GL_COLOR_MATERIAL 0x0B57
+#define GL_COLOR_MATERIAL_FACE 0x0B55
+#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
+#define GL_NORMALIZE 0x0BA1
+
+/* User clipping planes */
+#define GL_CLIP_PLANE0 0x3000
+#define GL_CLIP_PLANE1 0x3001
+#define GL_CLIP_PLANE2 0x3002
+#define GL_CLIP_PLANE3 0x3003
+#define GL_CLIP_PLANE4 0x3004
+#define GL_CLIP_PLANE5 0x3005
+
+/* Accumulation buffer */
+#define GL_ACCUM_RED_BITS 0x0D58
+#define GL_ACCUM_GREEN_BITS 0x0D59
+#define GL_ACCUM_BLUE_BITS 0x0D5A
+#define GL_ACCUM_ALPHA_BITS 0x0D5B
+#define GL_ACCUM_CLEAR_VALUE 0x0B80
+#define GL_ACCUM 0x0100
+#define GL_ADD 0x0104
+#define GL_LOAD 0x0101
+#define GL_MULT 0x0103
+#define GL_RETURN 0x0102
+
+/* Alpha testing */
+#define GL_ALPHA_TEST 0x0BC0
+#define GL_ALPHA_TEST_REF 0x0BC2
+#define GL_ALPHA_TEST_FUNC 0x0BC1
+
+/* Blending */
+#define GL_BLEND 0x0BE2
+#define GL_BLEND_SRC 0x0BE1
+#define GL_BLEND_DST 0x0BE0
+#define GL_ZERO 0x0
+#define GL_ONE 0x1
+#define GL_SRC_COLOR 0x0300
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_DST_COLOR 0x0306
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_SRC_ALPHA 0x0302
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_DST_ALPHA 0x0304
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+#define GL_SRC_ALPHA_SATURATE 0x0308
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+
+/* Render Mode */
+#define GL_FEEDBACK 0x1C01
+#define GL_RENDER 0x1C00
+#define GL_SELECT 0x1C02
+
+/* Feedback */
+#define GL_2D 0x0600
+#define GL_3D 0x0601
+#define GL_3D_COLOR 0x0602
+#define GL_3D_COLOR_TEXTURE 0x0603
+#define GL_4D_COLOR_TEXTURE 0x0604
+#define GL_POINT_TOKEN 0x0701
+#define GL_LINE_TOKEN 0x0702
+#define GL_LINE_RESET_TOKEN 0x0707
+#define GL_POLYGON_TOKEN 0x0703
+#define GL_BITMAP_TOKEN 0x0704
+#define GL_DRAW_PIXEL_TOKEN 0x0705
+#define GL_COPY_PIXEL_TOKEN 0x0706
+#define GL_PASS_THROUGH_TOKEN 0x0700
+#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
+#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
+#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
+
+/* Selection */
+#define GL_SELECTION_BUFFER_POINTER 0x0DF3
+#define GL_SELECTION_BUFFER_SIZE 0x0DF4
+
+/* Fog */
+#define GL_FOG 0x0B60
+#define GL_FOG_MODE 0x0B65
+#define GL_FOG_DENSITY 0x0B62
+#define GL_FOG_COLOR 0x0B66
+#define GL_FOG_INDEX 0x0B61
+#define GL_FOG_START 0x0B63
+#define GL_FOG_END 0x0B64
+#define GL_LINEAR 0x2601
+#define GL_EXP 0x0800
+#define GL_EXP2 0x0801
+
+/* Logic Ops */
+#define GL_LOGIC_OP 0x0BF1
+#define GL_INDEX_LOGIC_OP 0x0BF1
+#define GL_COLOR_LOGIC_OP 0x0BF2
+#define GL_LOGIC_OP_MODE 0x0BF0
+#define GL_CLEAR 0x1500
+#define GL_SET 0x150F
+#define GL_COPY 0x1503
+#define GL_COPY_INVERTED 0x150C
+#define GL_NOOP 0x1505
+#define GL_INVERT 0x150A
+#define GL_AND 0x1501
+#define GL_NAND 0x150E
+#define GL_OR 0x1507
+#define GL_NOR 0x1508
+#define GL_XOR 0x1506
+#define GL_EQUIV 0x1509
+#define GL_AND_REVERSE 0x1502
+#define GL_AND_INVERTED 0x1504
+#define GL_OR_REVERSE 0x150B
+#define GL_OR_INVERTED 0x150D
+
+/* Stencil */
+#define GL_STENCIL_TEST 0x0B90
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_STENCIL_BITS 0x0D57
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_INDEX 0x1901
+#define GL_KEEP 0x1E00
+#define GL_REPLACE 0x1E01
+#define GL_INCR 0x1E02
+#define GL_DECR 0x1E03
+
+/* Buffers, Pixel Drawing/Reading */
+#define GL_NONE 0x0
+#define GL_LEFT 0x0406
+#define GL_RIGHT 0x0407
+/*GL_FRONT 0x0404 */
+/*GL_BACK 0x0405 */
+/*GL_FRONT_AND_BACK 0x0408 */
+#define GL_FRONT_LEFT 0x0400
+#define GL_FRONT_RIGHT 0x0401
+#define GL_BACK_LEFT 0x0402
+#define GL_BACK_RIGHT 0x0403
+#define GL_AUX0 0x0409
+#define GL_AUX1 0x040A
+#define GL_AUX2 0x040B
+#define GL_AUX3 0x040C
+#define GL_COLOR_INDEX 0x1900
+#define GL_RED 0x1903
+#define GL_GREEN 0x1904
+#define GL_BLUE 0x1905
+#define GL_ALPHA 0x1906
+#define GL_LUMINANCE 0x1909
+#define GL_LUMINANCE_ALPHA 0x190A
+#define GL_ALPHA_BITS 0x0D55
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_INDEX_BITS 0x0D51
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_AUX_BUFFERS 0x0C00
+#define GL_READ_BUFFER 0x0C02
+#define GL_DRAW_BUFFER 0x0C01
+#define GL_DOUBLEBUFFER 0x0C32
+#define GL_STEREO 0x0C33
+#define GL_BITMAP 0x1A00
+#define GL_COLOR 0x1800
+#define GL_DEPTH 0x1801
+#define GL_STENCIL 0x1802
+#define GL_DITHER 0x0BD0
+#define GL_RGB 0x1907
+#define GL_RGBA 0x1908
+
+/* Implementation limits */
+#define GL_MAX_LIST_NESTING 0x0B31
+#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
+#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
+#define GL_MAX_NAME_STACK_DEPTH 0x0D37
+#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
+#define GL_MAX_EVAL_ORDER 0x0D30
+#define GL_MAX_LIGHTS 0x0D31
+#define GL_MAX_CLIP_PLANES 0x0D32
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
+
+/* Gets */
+#define GL_ATTRIB_STACK_DEPTH 0x0BB0
+#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_CURRENT_INDEX 0x0B01
+#define GL_CURRENT_COLOR 0x0B00
+#define GL_CURRENT_NORMAL 0x0B02
+#define GL_CURRENT_RASTER_COLOR 0x0B04
+#define GL_CURRENT_RASTER_DISTANCE 0x0B09
+#define GL_CURRENT_RASTER_INDEX 0x0B05
+#define GL_CURRENT_RASTER_POSITION 0x0B07
+#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
+#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
+#define GL_CURRENT_TEXTURE_COORDS 0x0B03
+#define GL_INDEX_CLEAR_VALUE 0x0C20
+#define GL_INDEX_MODE 0x0C30
+#define GL_INDEX_WRITEMASK 0x0C21
+#define GL_MODELVIEW_MATRIX 0x0BA6
+#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
+#define GL_NAME_STACK_DEPTH 0x0D70
+#define GL_PROJECTION_MATRIX 0x0BA7
+#define GL_PROJECTION_STACK_DEPTH 0x0BA4
+#define GL_RENDER_MODE 0x0C40
+#define GL_RGBA_MODE 0x0C31
+#define GL_TEXTURE_MATRIX 0x0BA8
+#define GL_TEXTURE_STACK_DEPTH 0x0BA5
+#define GL_VIEWPORT 0x0BA2
+
+/* Evaluators */
+#define GL_AUTO_NORMAL 0x0D80
+#define GL_MAP1_COLOR_4 0x0D90
+#define GL_MAP1_GRID_DOMAIN 0x0DD0
+#define GL_MAP1_GRID_SEGMENTS 0x0DD1
+#define GL_MAP1_INDEX 0x0D91
+#define GL_MAP1_NORMAL 0x0D92
+#define GL_MAP1_TEXTURE_COORD_1 0x0D93
+#define GL_MAP1_TEXTURE_COORD_2 0x0D94
+#define GL_MAP1_TEXTURE_COORD_3 0x0D95
+#define GL_MAP1_TEXTURE_COORD_4 0x0D96
+#define GL_MAP1_VERTEX_3 0x0D97
+#define GL_MAP1_VERTEX_4 0x0D98
+#define GL_MAP2_COLOR_4 0x0DB0
+#define GL_MAP2_GRID_DOMAIN 0x0DD2
+#define GL_MAP2_GRID_SEGMENTS 0x0DD3
+#define GL_MAP2_INDEX 0x0DB1
+#define GL_MAP2_NORMAL 0x0DB2
+#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
+#define GL_MAP2_TEXTURE_COORD_2 0x0DB4
+#define GL_MAP2_TEXTURE_COORD_3 0x0DB5
+#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
+#define GL_MAP2_VERTEX_3 0x0DB7
+#define GL_MAP2_VERTEX_4 0x0DB8
+#define GL_COEFF 0x0A00
+#define GL_DOMAIN 0x0A02
+#define GL_ORDER 0x0A01
+
+/* Hints */
+#define GL_FOG_HINT 0x0C54
+#define GL_LINE_SMOOTH_HINT 0x0C52
+#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
+#define GL_POINT_SMOOTH_HINT 0x0C51
+#define GL_POLYGON_SMOOTH_HINT 0x0C53
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
+
+/* Scissor box */
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_SCISSOR_BOX 0x0C10
+
+/* Pixel Mode / Transfer */
+#define GL_MAP_COLOR 0x0D10
+#define GL_MAP_STENCIL 0x0D11
+#define GL_INDEX_SHIFT 0x0D12
+#define GL_INDEX_OFFSET 0x0D13
+#define GL_RED_SCALE 0x0D14
+#define GL_RED_BIAS 0x0D15
+#define GL_GREEN_SCALE 0x0D18
+#define GL_GREEN_BIAS 0x0D19
+#define GL_BLUE_SCALE 0x0D1A
+#define GL_BLUE_BIAS 0x0D1B
+#define GL_ALPHA_SCALE 0x0D1C
+#define GL_ALPHA_BIAS 0x0D1D
+#define GL_DEPTH_SCALE 0x0D1E
+#define GL_DEPTH_BIAS 0x0D1F
+#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
+#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
+#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
+#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
+#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
+#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
+#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
+#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
+#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
+#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
+#define GL_PIXEL_MAP_S_TO_S 0x0C71
+#define GL_PIXEL_MAP_I_TO_I 0x0C70
+#define GL_PIXEL_MAP_I_TO_R 0x0C72
+#define GL_PIXEL_MAP_I_TO_G 0x0C73
+#define GL_PIXEL_MAP_I_TO_B 0x0C74
+#define GL_PIXEL_MAP_I_TO_A 0x0C75
+#define GL_PIXEL_MAP_R_TO_R 0x0C76
+#define GL_PIXEL_MAP_G_TO_G 0x0C77
+#define GL_PIXEL_MAP_B_TO_B 0x0C78
+#define GL_PIXEL_MAP_A_TO_A 0x0C79
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_PACK_LSB_FIRST 0x0D01
+#define GL_PACK_ROW_LENGTH 0x0D02
+#define GL_PACK_SKIP_PIXELS 0x0D04
+#define GL_PACK_SKIP_ROWS 0x0D03
+#define GL_PACK_SWAP_BYTES 0x0D00
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_UNPACK_LSB_FIRST 0x0CF1
+#define GL_UNPACK_ROW_LENGTH 0x0CF2
+#define GL_UNPACK_SKIP_PIXELS 0x0CF4
+#define GL_UNPACK_SKIP_ROWS 0x0CF3
+#define GL_UNPACK_SWAP_BYTES 0x0CF0
+#define GL_ZOOM_X 0x0D16
+#define GL_ZOOM_Y 0x0D17
+
+/* Texture mapping */
+#define GL_TEXTURE_ENV 0x2300
+#define GL_TEXTURE_ENV_MODE 0x2200
+#define GL_TEXTURE_1D 0x0DE0
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_ENV_COLOR 0x2201
+#define GL_TEXTURE_GEN_S 0x0C60
+#define GL_TEXTURE_GEN_T 0x0C61
+#define GL_TEXTURE_GEN_MODE 0x2500
+#define GL_TEXTURE_BORDER_COLOR 0x1004
+#define GL_TEXTURE_WIDTH 0x1000
+#define GL_TEXTURE_HEIGHT 0x1001
+#define GL_TEXTURE_BORDER 0x1005
+#define GL_TEXTURE_COMPONENTS 0x1003
+#define GL_TEXTURE_RED_SIZE 0x805C
+#define GL_TEXTURE_GREEN_SIZE 0x805D
+#define GL_TEXTURE_BLUE_SIZE 0x805E
+#define GL_TEXTURE_ALPHA_SIZE 0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
+#define GL_TEXTURE_INTENSITY_SIZE 0x8061
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+#define GL_OBJECT_LINEAR 0x2401
+#define GL_OBJECT_PLANE 0x2501
+#define GL_EYE_LINEAR 0x2400
+#define GL_EYE_PLANE 0x2502
+#define GL_SPHERE_MAP 0x2402
+#define GL_DECAL 0x2101
+#define GL_MODULATE 0x2100
+#define GL_NEAREST 0x2600
+#define GL_REPEAT 0x2901
+#define GL_CLAMP 0x2900
+#define GL_S 0x2000
+#define GL_T 0x2001
+#define GL_R 0x2002
+#define GL_Q 0x2003
+#define GL_TEXTURE_GEN_R 0x0C62
+#define GL_TEXTURE_GEN_Q 0x0C63
+
+/* GL 1.1 texturing */
+#define GL_PROXY_TEXTURE_1D 0x8063
+#define GL_PROXY_TEXTURE_2D 0x8064
+#define GL_TEXTURE_PRIORITY 0x8066
+#define GL_TEXTURE_RESIDENT 0x8067
+#define GL_TEXTURE_BINDING_1D 0x8068
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
+
+/* GL 1.2 texturing */
+#define GL_PACK_SKIP_IMAGES 0x806B
+#define GL_PACK_IMAGE_HEIGHT 0x806C
+#define GL_UNPACK_SKIP_IMAGES 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT 0x806E
+#define GL_TEXTURE_3D 0x806F
+#define GL_PROXY_TEXTURE_3D 0x8070
+#define GL_TEXTURE_DEPTH 0x8071
+#define GL_TEXTURE_WRAP_R 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE 0x8073
+#define GL_TEXTURE_BINDING_3D 0x806A
+
+/* Internal texture formats (GL 1.1) */
+#define GL_ALPHA4 0x803B
+#define GL_ALPHA8 0x803C
+#define GL_ALPHA12 0x803D
+#define GL_ALPHA16 0x803E
+#define GL_LUMINANCE4 0x803F
+#define GL_LUMINANCE8 0x8040
+#define GL_LUMINANCE12 0x8041
+#define GL_LUMINANCE16 0x8042
+#define GL_LUMINANCE4_ALPHA4 0x8043
+#define GL_LUMINANCE6_ALPHA2 0x8044
+#define GL_LUMINANCE8_ALPHA8 0x8045
+#define GL_LUMINANCE12_ALPHA4 0x8046
+#define GL_LUMINANCE12_ALPHA12 0x8047
+#define GL_LUMINANCE16_ALPHA16 0x8048
+#define GL_INTENSITY 0x8049
+#define GL_INTENSITY4 0x804A
+#define GL_INTENSITY8 0x804B
+#define GL_INTENSITY12 0x804C
+#define GL_INTENSITY16 0x804D
+#define GL_R3_G3_B2 0x2A10
+#define GL_RGB4 0x804F
+#define GL_RGB5 0x8050
+#define GL_RGB8 0x8051
+#define GL_RGB10 0x8052
+#define GL_RGB12 0x8053
+#define GL_RGB16 0x8054
+#define GL_RGBA2 0x8055
+#define GL_RGBA4 0x8056
+#define GL_RGB5_A1 0x8057
+#define GL_RGBA8 0x8058
+#define GL_RGB10_A2 0x8059
+#define GL_RGBA12 0x805A
+#define GL_RGBA16 0x805B
+
+/* Utility */
+#define GL_VENDOR 0x1F00
+#define GL_RENDERER 0x1F01
+#define GL_VERSION 0x1F02
+#define GL_EXTENSIONS 0x1F03
+
+/* Errors */
+#define GL_NO_ERROR 0x0
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_OPERATION 0x0502
+#define GL_STACK_OVERFLOW 0x0503
+#define GL_STACK_UNDERFLOW 0x0504
+#define GL_OUT_OF_MEMORY 0x0505
+
+
+/* OpenGL 1.2 */
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_BGR 0x80E0
+#define GL_BGRA 0x80E1
+#define GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define GL_UNSIGNED_INT_8_8_8_8 0x8035
+#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
+#define GL_UNSIGNED_INT_10_10_10_2 0x8036
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
+#define GL_SINGLE_COLOR 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
+#define GL_TEXTURE_MIN_LOD 0x813A
+#define GL_TEXTURE_MAX_LOD 0x813B
+#define GL_TEXTURE_BASE_LEVEL 0x813C
+#define GL_TEXTURE_MAX_LEVEL 0x813D
+#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+
+
+
+/*
+ * OpenGL 1.2 imaging subset (NOT IMPLEMENTED BY MESA)
+ */
+/* GL_EXT_color_table */
+#define GL_COLOR_TABLE 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
+#define GL_PROXY_COLOR_TABLE 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE 0x80D6
+#define GL_COLOR_TABLE_BIAS 0x80D7
+#define GL_COLOR_TABLE_FORMAT 0x80D8
+#define GL_COLOR_TABLE_WIDTH 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
+/* GL_EXT_convolution and GL_HP_convolution_border_modes */
+#define GL_CONVOLUTION_1D 0x8010
+#define GL_CONVOLUTION_2D 0x8011
+#define GL_SEPARABLE_2D 0x8012
+#define GL_CONVOLUTION_BORDER_MODE 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS 0x8015
+#define GL_REDUCE 0x8016
+#define GL_CONVOLUTION_FORMAT 0x8017
+#define GL_CONVOLUTION_WIDTH 0x8018
+#define GL_CONVOLUTION_HEIGHT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
+#define GL_CONSTANT_BORDER 0x8151
+#define GL_REPLICATE_BORDER 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR 0x8154
+/* GL_SGI_color_matrix */
+#define GL_COLOR_MATRIX 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
+/* GL_EXT_histogram */
+#define GL_HISTOGRAM 0x8024
+#define GL_PROXY_HISTOGRAM 0x8025
+#define GL_HISTOGRAM_WIDTH 0x8026
+#define GL_HISTOGRAM_FORMAT 0x8027
+#define GL_HISTOGRAM_RED_SIZE 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
+#define GL_HISTOGRAM_SINK 0x802D
+#define GL_MINMAX 0x802E
+#define GL_MINMAX_FORMAT 0x802F
+#define GL_MINMAX_SINK 0x8030
+#define GL_TABLE_TOO_LARGE 0x8031
+/* GL_EXT_blend_color, GL_EXT_blend_minmax */
+#define GL_BLEND_EQUATION 0x8009
+#define GL_MIN 0x8007
+#define GL_MAX 0x8008
+#define GL_FUNC_ADD 0x8006
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_BLEND_COLOR 0x8005
+
+
+/* glPush/PopAttrib bits */
+#define GL_CURRENT_BIT 0x00000001
+#define GL_POINT_BIT 0x00000002
+#define GL_LINE_BIT 0x00000004
+#define GL_POLYGON_BIT 0x00000008
+#define GL_POLYGON_STIPPLE_BIT 0x00000010
+#define GL_PIXEL_MODE_BIT 0x00000020
+#define GL_LIGHTING_BIT 0x00000040
+#define GL_FOG_BIT 0x00000080
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_ACCUM_BUFFER_BIT 0x00000200
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_VIEWPORT_BIT 0x00000800
+#define GL_TRANSFORM_BIT 0x00001000
+#define GL_ENABLE_BIT 0x00002000
+#define GL_COLOR_BUFFER_BIT 0x00004000
+#define GL_HINT_BIT 0x00008000
+#define GL_EVAL_BIT 0x00010000
+#define GL_LIST_BIT 0x00020000
+#define GL_TEXTURE_BIT 0x00040000
+#define GL_SCISSOR_BIT 0x00080000
+#define GL_ALL_ATTRIB_BITS 0x000FFFFF
+
+
+#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
+#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
+#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
+
+
+
+
+
#if defined(__BEOS__) || defined(__QUICKDRAW__)
#pragma export on
#endif
@@ -1844,217 +1645,6 @@ GLAPI void GLAPIENTRY glPopName( void );
-/*
- * Extensions
- */
-
-/* GL_EXT_blend_minmax */
-GLAPI void GLAPIENTRY glBlendEquationEXT( GLenum mode );
-
-
-
-/* GL_EXT_blend_color */
-GLAPI void GLAPIENTRY glBlendColorEXT( GLclampf red, GLclampf green,
- GLclampf blue, GLclampf alpha );
-
-
-
-/* GL_EXT_polygon_offset */
-GLAPI void GLAPIENTRY glPolygonOffsetEXT( GLfloat factor, GLfloat bias );
-
-
-
-/* GL_EXT_vertex_array */
-
-GLAPI void GLAPIENTRY glVertexPointerEXT( GLint size, GLenum type,
- GLsizei stride,
- GLsizei count, const GLvoid *ptr );
-
-GLAPI void GLAPIENTRY glNormalPointerEXT( GLenum type, GLsizei stride,
- GLsizei count, const GLvoid *ptr );
-
-GLAPI void GLAPIENTRY glColorPointerEXT( GLint size, GLenum type,
- GLsizei stride,
- GLsizei count, const GLvoid *ptr );
-
-GLAPI void GLAPIENTRY glIndexPointerEXT( GLenum type, GLsizei stride,
- GLsizei count, const GLvoid *ptr );
-
-GLAPI void GLAPIENTRY glTexCoordPointerEXT( GLint size, GLenum type,
- GLsizei stride, GLsizei count,
- const GLvoid *ptr );
-
-GLAPI void GLAPIENTRY glEdgeFlagPointerEXT( GLsizei stride, GLsizei count,
- const GLboolean *ptr );
-
-GLAPI void GLAPIENTRY glGetPointervEXT( GLenum pname, void **params );
-
-GLAPI void GLAPIENTRY glArrayElementEXT( GLint i );
-
-GLAPI void GLAPIENTRY glDrawArraysEXT( GLenum mode, GLint first,
- GLsizei count );
-
-
-
-/* GL_EXT_texture_object */
-
-GLAPI void GLAPIENTRY glGenTexturesEXT( GLsizei n, GLuint *textures );
-
-GLAPI void GLAPIENTRY glDeleteTexturesEXT( GLsizei n, const GLuint *textures);
-
-GLAPI void GLAPIENTRY glBindTextureEXT( GLenum target, GLuint texture );
-
-GLAPI void GLAPIENTRY glPrioritizeTexturesEXT( GLsizei n,
- const GLuint *textures,
- const GLclampf *priorities );
-
-GLAPI GLboolean GLAPIENTRY glAreTexturesResidentEXT( GLsizei n,
- const GLuint *textures,
- GLboolean *residences );
-
-GLAPI GLboolean GLAPIENTRY glIsTextureEXT( GLuint texture );
-
-
-
-/* GL_EXT_texture3D */
-
-GLAPI void GLAPIENTRY glTexImage3DEXT( GLenum target, GLint level,
- GLenum internalFormat,
- GLsizei width, GLsizei height,
- GLsizei depth, GLint border,
- GLenum format, GLenum type,
- const GLvoid *pixels );
-
-GLAPI void GLAPIENTRY glTexSubImage3DEXT( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint zoffset, GLsizei width,
- GLsizei height, GLsizei depth,
- GLenum format,
- GLenum type, const GLvoid *pixels);
-
-GLAPI void GLAPIENTRY glCopyTexSubImage3DEXT( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint zoffset, GLint x,
- GLint y, GLsizei width,
- GLsizei height );
-
-
-
-/* GL_EXT_color_table */
-
-GLAPI void GLAPIENTRY glColorTableEXT( GLenum target, GLenum internalformat,
- GLsizei width, GLenum format,
- GLenum type, const GLvoid *table );
-
-GLAPI void GLAPIENTRY glColorSubTableEXT( GLenum target,
- GLsizei start, GLsizei count,
- GLenum format, GLenum type,
- const GLvoid *data );
-
-GLAPI void GLAPIENTRY glGetColorTableEXT( GLenum target, GLenum format,
- GLenum type, GLvoid *table );
-
-GLAPI void GLAPIENTRY glGetColorTableParameterfvEXT( GLenum target,
- GLenum pname,
- GLfloat *params );
-
-GLAPI void GLAPIENTRY glGetColorTableParameterivEXT( GLenum target,
- GLenum pname,
- GLint *params );
-
-
-/* GL_ARB_multitexture */
-
-GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture);
-GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture);
-GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s);
-GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v);
-GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s);
-GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v);
-GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s);
-GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v);
-GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s);
-GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v);
-GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t);
-GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v);
-GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);
-GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v);
-GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t);
-GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v);
-GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t);
-GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v);
-GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r);
-GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v);
-GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r);
-GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v);
-GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r);
-GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v);
-GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r);
-GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v);
-GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v);
-GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v);
-GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q);
-GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v);
-GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v);
-
-
-
-/* GL_EXT_point_parameters */
-GLAPI void GLAPIENTRY glPointParameterfEXT( GLenum pname, GLfloat param );
-GLAPI void GLAPIENTRY glPointParameterfvEXT( GLenum pname,
- const GLfloat *params );
-
-
-
-/* GL_INGR_blend_func_separate */
-GLAPI void GLAPIENTRY glBlendFuncSeparateINGR( GLenum sfactorRGB,
- GLenum dfactorRGB,
- GLenum sfactorAlpha,
- GLenum dfactorAlpha );
-
-
-
-/* GL_MESA_window_pos */
-
-GLAPI void GLAPIENTRY glWindowPos2iMESA( GLint x, GLint y );
-GLAPI void GLAPIENTRY glWindowPos2sMESA( GLshort x, GLshort y );
-GLAPI void GLAPIENTRY glWindowPos2fMESA( GLfloat x, GLfloat y );
-GLAPI void GLAPIENTRY glWindowPos2dMESA( GLdouble x, GLdouble y );
-
-GLAPI void GLAPIENTRY glWindowPos2ivMESA( const GLint *p );
-GLAPI void GLAPIENTRY glWindowPos2svMESA( const GLshort *p );
-GLAPI void GLAPIENTRY glWindowPos2fvMESA( const GLfloat *p );
-GLAPI void GLAPIENTRY glWindowPos2dvMESA( const GLdouble *p );
-
-GLAPI void GLAPIENTRY glWindowPos3iMESA( GLint x, GLint y, GLint z );
-GLAPI void GLAPIENTRY glWindowPos3sMESA( GLshort x, GLshort y, GLshort z );
-GLAPI void GLAPIENTRY glWindowPos3fMESA( GLfloat x, GLfloat y, GLfloat z );
-GLAPI void GLAPIENTRY glWindowPos3dMESA( GLdouble x, GLdouble y, GLdouble z );
-
-GLAPI void GLAPIENTRY glWindowPos3ivMESA( const GLint *p );
-GLAPI void GLAPIENTRY glWindowPos3svMESA( const GLshort *p );
-GLAPI void GLAPIENTRY glWindowPos3fvMESA( const GLfloat *p );
-GLAPI void GLAPIENTRY glWindowPos3dvMESA( const GLdouble *p );
-
-GLAPI void GLAPIENTRY glWindowPos4iMESA( GLint x, GLint y, GLint z, GLint w );
-GLAPI void GLAPIENTRY glWindowPos4sMESA( GLshort x, GLshort y, GLshort z, GLshort w );
-GLAPI void GLAPIENTRY glWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
-GLAPI void GLAPIENTRY glWindowPos4dMESA( GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-
-GLAPI void GLAPIENTRY glWindowPos4ivMESA( const GLint *p );
-GLAPI void GLAPIENTRY glWindowPos4svMESA( const GLshort *p );
-GLAPI void GLAPIENTRY glWindowPos4fvMESA( const GLfloat *p );
-GLAPI void GLAPIENTRY glWindowPos4dvMESA( const GLdouble *p );
-
-
-/* GL_MESA_resize_buffers */
-
-GLAPI void GLAPIENTRY glResizeBuffersMESA( void );
-
-
/* 1.2 functions */
GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start,
GLuint end, GLsizei count, GLenum type, const GLvoid *indices );
@@ -2192,43 +1782,574 @@ GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
-/* GL_EXT_compiled_vertex_array */
+
+/*
+ * XXX these extensions may eventually be moved into a new glext.h file
+ */
+
+
+/*
+ * GL_EXT_abgr (number 1)
+ */
+#ifndef GL_EXT_abgr
+#define GL_EXT_abgr 1
+
+#define GL_ABGR_EXT 0x8000
+
+#endif /* GL_EXT_abgr */
+
+
+
+/*
+ * GL_EXT_blend_color (number 2)
+ */
+#ifndef GL_EXT_blend_color
+#define GL_EXT_blend_color 1
+
+#define GL_CONSTANT_COLOR_EXT 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002
+#define GL_CONSTANT_ALPHA_EXT 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004
+#define GL_BLEND_COLOR_EXT 0x8005
+
+GLAPI void GLAPIENTRY glBlendColorEXT( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
+
+#endif /* GL_EXT_blend_color */
+
+
+
+/*
+ * GL_EXT_polygon_offset (number 3)
+ */
+#ifndef GL_EXT_polygon_offset
+#define GL_EXT_polygon_offset 1
+
+#define GL_POLYGON_OFFSET_EXT 0x8037
+#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038
+#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039
+
+GLAPI void GLAPIENTRY glPolygonOffsetEXT( GLfloat factor, GLfloat bias );
+
+#endif /* GL_EXT_polygon_offset */
+
+
+
+/*
+ * GL_EXT_texture3D (number 6)
+ */
+#ifndef GL_EXT_texture3D
+#define GL_EXT_texture3D 1
+
+#define GL_PACK_SKIP_IMAGES_EXT 0x806B
+#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
+#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
+#define GL_TEXTURE_3D_EXT 0x806F
+#define GL_PROXY_TEXTURE_3D_EXT 0x8070
+#define GL_TEXTURE_DEPTH_EXT 0x8071
+#define GL_TEXTURE_WRAP_R_EXT 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
+#define GL_TEXTURE_3D_BINDING_EXT 0x806A
+
+GLAPI void GLAPIENTRY glTexImage3DEXT( GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glTexSubImage3DEXT( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+
+GLAPI void GLAPIENTRY glCopyTexSubImage3DEXT( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height );
+
+#endif /* GL_EXT_texture3D */
+
+
+
+/*
+ * GL_EXT_texture_object (number 20)
+ */
+#ifndef GL_EXT_texture_object
+#define GL_EXT_texture_object 1
+
+#define GL_TEXTURE_PRIORITY_EXT 0x8066
+#define GL_TEXTURE_RESIDENT_EXT 0x8067
+#define GL_TEXTURE_1D_BINDING_EXT 0x8068
+#define GL_TEXTURE_2D_BINDING_EXT 0x8069
+
+GLAPI void GLAPIENTRY glGenTexturesEXT( GLsizei n, GLuint *textures );
+
+GLAPI void GLAPIENTRY glDeleteTexturesEXT( GLsizei n, const GLuint *textures);
+
+GLAPI void GLAPIENTRY glBindTextureEXT( GLenum target, GLuint texture );
+
+GLAPI void GLAPIENTRY glPrioritizeTexturesEXT( GLsizei n, const GLuint *textures, const GLclampf *priorities );
+
+GLAPI GLboolean GLAPIENTRY glAreTexturesResidentEXT( GLsizei n, const GLuint *textures, GLboolean *residences );
+
+GLAPI GLboolean GLAPIENTRY glIsTextureEXT( GLuint texture );
+
+#endif /* GL_EXT_texture_object */
+
+
+
+/*
+ * GL_EXT_rescale_normal (number 27)
+ */
+#ifndef GL_EXT_rescale_normal
+#define GL_EXT_rescale_normal 1
+
+#define GL_RESCALE_NORMAL_EXT 0x803A
+
+#endif /* GL_EXT_rescale_normal */
+
+
+
+/*
+ * GL_EXT_vertex_array (number 30)
+ */
+#ifndef GL_EXT_vertex_array
+#define GL_EXT_vertex_array 1
+
+#define GL_VERTEX_ARRAY_EXT 0x8074
+#define GL_NORMAL_ARRAY_EXT 0x8075
+#define GL_COLOR_ARRAY_EXT 0x8076
+#define GL_INDEX_ARRAY_EXT 0x8077
+#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
+#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
+#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
+#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
+#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
+#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
+#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
+#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
+#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
+#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
+#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
+#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
+#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
+#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
+#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
+#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
+#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
+#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
+#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
+#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
+#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
+#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
+#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
+#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
+
+GLAPI void GLAPIENTRY glVertexPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glNormalPointerEXT( GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glColorPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glIndexPointerEXT( GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glTexCoordPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glEdgeFlagPointerEXT( GLsizei stride, GLsizei count, const GLboolean *ptr );
+
+GLAPI void GLAPIENTRY glGetPointervEXT( GLenum pname, void **params );
+
+GLAPI void GLAPIENTRY glArrayElementEXT( GLint i );
+
+GLAPI void GLAPIENTRY glDrawArraysEXT( GLenum mode, GLint first, GLsizei count );
+
+#endif /* GL_EXT_vertex_array */
+
+
+
+/*
+ * GL_SGIS_texture_edge_clamp (number 35)
+ */
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_SGIS_texture_edge_clamp 1
+
+#define GL_CLAMP_TO_EDGE_SGIS 0x812F
+
+#endif /* GL_SGIS_texture_edge_clamp */
+
+
+
+/*
+ * GL_EXT_blend_minmax (number 37)
+ */
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+
+#define GL_FUNC_ADD_EXT 0x8006
+#define GL_MIN_EXT 0x8007
+#define GL_MAX_EXT 0x8008
+#define GL_BLEND_EQUATION_EXT 0x8009
+
+GLAPI void GLAPIENTRY glBlendEquationEXT( GLenum mode );
+
+#endif /* GL_EXT_blend_minmax */
+
+
+
+/*
+ * GL_EXT_blend_subtract (number 38) (requires GL_EXT_blend_max )
+ */
+#ifndef GL_EXT_blend_subtract
+#define GL_EXT_blend_subtract 1
+
+#define GL_FUNC_SUBTRACT_EXT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
+
+#endif /* GL_EXT_blend_subtract */
+
+
+
+/*
+ * GL_EXT_blend_logic_op (number 39)
+ */
+#ifndef GL_EXT_blend_logic_op
+#define GL_EXT_blend_logic_op 1
+
+/* No new tokens or functions */
+
+#endif /* GL_EXT_blend_logic_op */
+
+
+
+/*
+ * GL_EXT_point_parameters (number 54)
+ */
+#ifndef GL_EXT_point_parameters
+#define GL_EXT_point_parameters 1
+
+#define GL_POINT_SIZE_MIN_EXT 0x8126
+#define GL_POINT_SIZE_MAX_EXT 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
+#define GL_DISTANCE_ATTENUATION_EXT 0x8129
+
+GLAPI void GLAPIENTRY glPointParameterfEXT( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glPointParameterfvEXT( GLenum pname, const GLfloat *params );
+
+#endif /* GL_EXT_point_parameters */
+
+
+
+/*
+ * GL_PGI_misc_hints (number 77)
+ */
+#ifndef GL_PGI_misc_hints
+#define GL_PGI_misc_hints 1
+
+#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000
+#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030
+#define GL_STRICT_LIGHTING_HINT_PGI 107031
+#define GL_STRICT_SCISSOR_HINT_PGI 107032
+#define GL_FULL_STIPPLE_HINT_PGI 107033
+#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011
+#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012
+#define GL_CONSERVE_MEMORY_HINT_PGI 107005
+#define GL_RECLAIM_MEMORY_HINT_PGI 107006
+#define GL_ALWAYS_FAST_HINT_PGI 107020
+#define GL_ALWAYS_SOFT_HINT_PGI 107021
+#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022
+#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023
+#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024
+#define GL_ALLOW_DRAW_SPN_HINT_PGI 107024
+#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025
+#define GL_CLIP_NEAR_HINT_PGI 107040
+#define GL_CLIP_FAR_HINT_PGI 107041
+#define GL_WIDE_LINE_HINT_PGI 107042
+#define GL_BACK_NORMALS_HINT_PGI 107043
+#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010
+
+GLAPI void GLAPIENTRY glHintPGI(GLenum target, GLint mode);
+
+#endif /* GL_PGI_misc_hints */
+
+
+
+/*
+ * GL_EXT_paletted_texture (number 78)
+ */
+#ifndef GL_EXT_paletted_texture
+#define GL_EXT_paletted_texture 1
+
+#define GL_TABLE_TOO_LARGE_EXT 0x8031
+#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8
+#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF
+#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
+#define GL_COLOR_INDEX1_EXT 0x80E2
+#define GL_COLOR_INDEX2_EXT 0x80E3
+#define GL_COLOR_INDEX4_EXT 0x80E4
+#define GL_COLOR_INDEX8_EXT 0x80E5
+#define GL_COLOR_INDEX12_EXT 0x80E6
+#define GL_COLOR_INDEX16_EXT 0x80E7
+
+GLAPI void GLAPIENTRY glColorTableEXT( GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table );
+
+GLAPI void GLAPIENTRY glColorSubTableEXT( GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glGetColorTableEXT( GLenum target, GLenum format, GLenum type, GLvoid *table );
+
+GLAPI void GLAPIENTRY glGetColorTableParameterfvEXT( GLenum target, GLenum pname, GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetColorTableParameterivEXT( GLenum target, GLenum pname, GLint *params );
+
+#endif /* GL_EXT_paletted_texture */
+
+
+
+/*
+ * GL_EXT_clip_volume_hint (number 79)
+ */
+#ifndef GL_EXT_clip_volume_hint
+#define GL_EXT_clip_volume_hint 1
+
+#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F
+
+#endif /* GL_EXT_clip_volume_hint */
+
+
+
+/*
+ * GL_EXT_compiled_vertex_array (number 97)
+ */
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_EXT_compiled_vertex_array 1
+
+#define GL_ARRAY_ELEMENT_LOCK_FIRST_SGI 0x81A8
+#define GL_ARRAY_ELEMENT_LOCK_COUNT_SGI 0x81A9
+
GLAPI void GLAPIENTRY glLockArraysEXT( GLint first, GLsizei count );
GLAPI void GLAPIENTRY glUnlockArraysEXT( void );
+#endif /* GL_EXT_compiled_vertex_array */
-#if defined(__BEOS__) || defined(__QUICKDRAW__)
-#pragma export off
-#endif
+
+/*
+ * GL_EXT_shared_texture_palette (number 141) (req's GL_EXT_paletted_texture)
+ */
+#ifndef GL_EXT_shared_texture_palette
+#define GL_EXT_shared_texture_palette 1
+
+#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
+
+#endif /* GL_EXT_shared_texture_palette */
+
+
+
+/*
+ * GL_EXT_stencil_wrap (number 176)
+ */
+#ifndef GL_EXT_stencil_wrap
+#define GL_EXT_stencil_wrap 1
+
+#define GL_INCR_WRAP_EXT 0x8507
+#define GL_DECR_WRAP_EXT 0x8508
+
+#endif /* GL_EXT_stencil_wrap */
+
/*
- * Compile-time tests for extensions:
+ * GL_INGR_blend_func_separate (EXT number 173)
*/
-#define GL_EXT_blend_color 1
-#define GL_EXT_blend_logic_op 1
-#define GL_EXT_blend_minmax 1
-#define GL_EXT_blend_subtract 1
-#define GL_EXT_polygon_offset 1
-#define GL_EXT_vertex_array 1
-#define GL_EXT_texture_object 1
-#define GL_EXT_texture3D 1
-#define GL_EXT_paletted_texture 1
-#define GL_EXT_shared_texture_palette 1
-#define GL_EXT_point_parameters 1
-#define GL_EXT_rescale_normal 1
-#define GL_EXT_abgr 1
-#define GL_EXT_stencil_wrap 1
-#define GL_MESA_window_pos 1
-#define GL_MESA_resize_buffers 1
-#define GL_SGIS_texture_edge_clamp 1
-#define GL_INGR_blend_func_separate 1
-#define GL_ARB_multitexture 1
-#define GL_NV_texgen_reflection 1
-#define GL_PGI_misc_hints 1
-#define GL_EXT_compiled_vertex_array 1
-#define GL_EXT_clip_volume_hint 1
+#ifndef GL_INGR_blend_func_separate
+#define GL_INGR_blend_func_separate 1
+
+#define GL_BLEND_DST_RGB_INGR 0x80C8
+#define GL_BLEND_SRC_RGB_INGR 0x80C9
+#define GL_BLEND_DST_ALPHA_INGR 0x80CA
+#define GL_BLEND_SRC_ALPHA_INGR 0x80CB
+
+GLAPI void GLAPIENTRY glBlendFuncSeparateINGR( GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha );
+
+#endif /* GL_INGR_blend_func_separate */
+
+
+
+/*
+ * GL_NV_texgen_reflection (number 179)
+ */
+#ifndef GL_NV_texgen_reflection
+#define GL_NV_texgen_reflection 1
+
+#define GL_NORMAL_MAP_NV 0x8511
+#define GL_REFLECTION_MAP_NV 0x8512
+
+#endif /* GL_NV_texgen_reflection */
+
+
+
+/*
+ * GL_EXT_texture_env_add (number 185)
+ */
+#ifndef GL_EXT_texture_env_add
+#define GL_EXT_texture_env_add 1
+
+/* No new tokens or functions */
+
+#endif /* GL_EXT_texture_env_add */
+
+
+
+/*
+ * GL_ARB_multitexture (no number)
+ */
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+
+#define GL_TEXTURE0_ARB 0x84C0
+#define GL_TEXTURE1_ARB 0x84C1
+#define GL_TEXTURE2_ARB 0x84C2
+#define GL_TEXTURE3_ARB 0x84C3
+#define GL_TEXTURE4_ARB 0x84C4
+#define GL_TEXTURE5_ARB 0x84C5
+#define GL_TEXTURE6_ARB 0x84C6
+#define GL_TEXTURE7_ARB 0x84C7
+#define GL_TEXTURE8_ARB 0x84C8
+#define GL_TEXTURE9_ARB 0x84C9
+#define GL_TEXTURE10_ARB 0x84CA
+#define GL_TEXTURE11_ARB 0x84CB
+#define GL_TEXTURE12_ARB 0x84CC
+#define GL_TEXTURE13_ARB 0x84CD
+#define GL_TEXTURE14_ARB 0x84CE
+#define GL_TEXTURE15_ARB 0x84CF
+#define GL_TEXTURE16_ARB 0x84D0
+#define GL_TEXTURE17_ARB 0x84D1
+#define GL_TEXTURE18_ARB 0x84D2
+#define GL_TEXTURE19_ARB 0x84D3
+#define GL_TEXTURE20_ARB 0x84D4
+#define GL_TEXTURE21_ARB 0x84D5
+#define GL_TEXTURE22_ARB 0x84D6
+#define GL_TEXTURE23_ARB 0x84D7
+#define GL_TEXTURE24_ARB 0x84D8
+#define GL_TEXTURE25_ARB 0x84D9
+#define GL_TEXTURE26_ARB 0x84DA
+#define GL_TEXTURE27_ARB 0x84DB
+#define GL_TEXTURE28_ARB 0x84DC
+#define GL_TEXTURE29_ARB 0x84DD
+#define GL_TEXTURE30_ARB 0x84DE
+#define GL_TEXTURE31_ARB 0x84DF
+#define GL_ACTIVE_TEXTURE_ARB 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
+
+GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture);
+GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture);
+GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s);
+GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s);
+GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s);
+GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s);
+GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t);
+GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);
+GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t);
+GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t);
+GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r);
+GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v);
+
+#endif /* GL_ARB_multitexture */
+
+
+
+/*
+ * GL_MESA_window_pos (no number)
+ */
+#ifndef GL_MESA_window_pos
+#define GL_MESA_window_pos 1
+
+GLAPI void GLAPIENTRY glWindowPos2iMESA( GLint x, GLint y );
+GLAPI void GLAPIENTRY glWindowPos2sMESA( GLshort x, GLshort y );
+GLAPI void GLAPIENTRY glWindowPos2fMESA( GLfloat x, GLfloat y );
+GLAPI void GLAPIENTRY glWindowPos2dMESA( GLdouble x, GLdouble y );
+GLAPI void GLAPIENTRY glWindowPos2ivMESA( const GLint *p );
+GLAPI void GLAPIENTRY glWindowPos2svMESA( const GLshort *p );
+GLAPI void GLAPIENTRY glWindowPos2fvMESA( const GLfloat *p );
+GLAPI void GLAPIENTRY glWindowPos2dvMESA( const GLdouble *p );
+GLAPI void GLAPIENTRY glWindowPos3iMESA( GLint x, GLint y, GLint z );
+GLAPI void GLAPIENTRY glWindowPos3sMESA( GLshort x, GLshort y, GLshort z );
+GLAPI void GLAPIENTRY glWindowPos3fMESA( GLfloat x, GLfloat y, GLfloat z );
+GLAPI void GLAPIENTRY glWindowPos3dMESA( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glWindowPos3ivMESA( const GLint *p );
+GLAPI void GLAPIENTRY glWindowPos3svMESA( const GLshort *p );
+GLAPI void GLAPIENTRY glWindowPos3fvMESA( const GLfloat *p );
+GLAPI void GLAPIENTRY glWindowPos3dvMESA( const GLdouble *p );
+GLAPI void GLAPIENTRY glWindowPos4iMESA( GLint x, GLint y, GLint z, GLint w );
+GLAPI void GLAPIENTRY glWindowPos4sMESA( GLshort x, GLshort y, GLshort z, GLshort w );
+GLAPI void GLAPIENTRY glWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+GLAPI void GLAPIENTRY glWindowPos4dMESA( GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void GLAPIENTRY glWindowPos4ivMESA( const GLint *p );
+GLAPI void GLAPIENTRY glWindowPos4svMESA( const GLshort *p );
+GLAPI void GLAPIENTRY glWindowPos4fvMESA( const GLfloat *p );
+GLAPI void GLAPIENTRY glWindowPos4dvMESA( const GLdouble *p );
+
+#endif /* GL_MESA_window_pos */
+
+
+
+/*
+ * GL_MESA_resize_bufffers (no number)
+ */
+#ifndef GL_MESA_resize_bufffers
+#define GL_MESA_resize_buffers 1
+
+GLAPI void GLAPIENTRY glResizeBuffersMESA( void );
+
+#endif /* GL_MESA_resize_bufffers */
+
+
+
+/*
+ * GL_ARB_tranpose_matrix (number ?)
+ */
+#ifndef GL_ARB_transpose_matrix
+#define GL_ARB_transpose_matrix 1
+
+#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6
+
+GLAPI void GLAPIENTRY glLoadTransposeMatrixdARB( const GLdouble m[16] );
+GLAPI void GLAPIENTRY glLoadTransposeMatrixfARB( const GLfloat m[16] );
+GLAPI void GLAPIENTRY glMultTransposeMatrixdARB( const GLdouble m[16] );
+GLAPI void GLAPIENTRY glMultTransposeMatrixfARB( const GLfloat m[16] );
+
+#endif
+
+
+
+#if defined(__BEOS__) || defined(__QUICKDRAW__)
+#pragma export off
+#endif
#ifdef macintosh
@@ -2243,4 +2364,4 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void );
}
#endif
-#endif
+#endif /* __gl_h_ */
diff --git a/xc/extras/Mesa/include/GL/glx.h b/xc/extras/Mesa/include/GL/glx.h
index fdbdf3db9..c33a2e9d8 100644
--- a/xc/extras/Mesa/include/GL/glx.h
+++ b/xc/extras/Mesa/include/GL/glx.h
@@ -1,8 +1,8 @@
-/* $Id: glx.h,v 1.1 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: glx.h,v 1.2 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -49,39 +49,33 @@ extern "C" {
#define GLX_VERSION_1_1 1
+#define GLX_VERSION_1_2 1
+#define GLX_VERSION_1_3 1
+
+#define GLX_EXTENSION_NAME "GLX"
+
/*
* Tokens for glXChooseVisual and glXGetConfig:
*/
-enum _GLX_CONFIGS {
- GLX_USE_GL = 1,
- GLX_BUFFER_SIZE = 2,
- GLX_LEVEL = 3,
- GLX_RGBA = 4,
- GLX_DOUBLEBUFFER = 5,
- GLX_STEREO = 6,
- GLX_AUX_BUFFERS = 7,
- GLX_RED_SIZE = 8,
- GLX_GREEN_SIZE = 9,
- GLX_BLUE_SIZE = 10,
- GLX_ALPHA_SIZE = 11,
- GLX_DEPTH_SIZE = 12,
- GLX_STENCIL_SIZE = 13,
- GLX_ACCUM_RED_SIZE = 14,
- GLX_ACCUM_GREEN_SIZE = 15,
- GLX_ACCUM_BLUE_SIZE = 16,
- GLX_ACCUM_ALPHA_SIZE = 17,
-
- /* GLX_EXT_visual_info extension */
- GLX_X_VISUAL_TYPE_EXT = 0x22,
- GLX_TRANSPARENT_TYPE_EXT = 0x23,
- GLX_TRANSPARENT_INDEX_VALUE_EXT = 0x24,
- GLX_TRANSPARENT_RED_VALUE_EXT = 0x25,
- GLX_TRANSPARENT_GREEN_VALUE_EXT = 0x26,
- GLX_TRANSPARENT_BLUE_VALUE_EXT = 0x27,
- GLX_TRANSPARENT_ALPHA_VALUE_EXT = 0x28
-};
+#define GLX_USE_GL 1
+#define GLX_BUFFER_SIZE 2
+#define GLX_LEVEL 3
+#define GLX_RGBA 4
+#define GLX_DOUBLEBUFFER 5
+#define GLX_STEREO 6
+#define GLX_AUX_BUFFERS 7
+#define GLX_RED_SIZE 8
+#define GLX_GREEN_SIZE 9
+#define GLX_BLUE_SIZE 10
+#define GLX_ALPHA_SIZE 11
+#define GLX_DEPTH_SIZE 12
+#define GLX_STENCIL_SIZE 13
+#define GLX_ACCUM_RED_SIZE 14
+#define GLX_ACCUM_GREEN_SIZE 15
+#define GLX_ACCUM_BLUE_SIZE 16
+#define GLX_ACCUM_ALPHA_SIZE 17
/*
@@ -105,6 +99,75 @@ enum _GLX_CONFIGS {
/*
+ * GLX 1.3 and later:
+ * XXX don't know the values of some of these enums!
+ * XXX some 1.3 enums may be missing!
+ */
+#define GLX_CONFIG_CAVEAT ?
+#define GLX_DONT_CARE ?
+#define GLX_SLOW_CONFIG ?
+#define GLX_NON_CONFORMANT_CONFIG ?
+#define GLX_X_VISUAL_TYPE 0x22
+#define GLX_TRANSPARENT_TYPE 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE 0x24
+#define GLX_TRANSPARENT_RED_VALUE 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
+#define GLX_MAX_PBUFFER_WIDTH ?
+#define GLX_MAX_PBUFFER_HEIGHT ?
+#define GLX_MAX_PBUFFER_PIXELS ?
+#define GLX_PRESERVED_CONTENTS ?
+#define GLX_LARGEST_BUFFER ?
+#define GLX_DRAWABLE_TYPE ?
+#define GLX_FBCONFIG_ID ?
+#define GLX_VISUAL_ID ?
+#define GLX_WINDOW_BIT ?
+#define GLX_PIXMAP_BIT ?
+#define GLX_PBUFFER_BIT ?
+#define GLX_AUX_BUFFERS_BIT ?
+#define GLX_FRONT_LEFT_BUFFER_BIT ?
+#define GLX_FRONT_RIGHT_BUFFER_BIT ?
+#define GLX_BACK_LEFT_BUFFER_BIT ?
+#define GLX_BACK_RIGHT_BUFFER_BIT ?
+#define GLX_AUX_BUFFERS_BIT ?
+#define GLX_DEPTH_BUFFER_BIT ?
+#define GLX_STENCIL_BUFFER_BIT ?
+#define GLX_ACCUM_BUFFER_BIT ?
+#define GLX_RENDER_TYPE ?
+#define GLX_DRAWABLE_TYPE ?
+#define GLX_X_RENDERABLE ?
+#define GLX_NONE 0x8000
+#define GLX_TRUE_COLOR 0x8002
+#define GLX_DIRECT_COLOR 0x8003
+#define GLX_PSEUDO_COLOR 0x8004
+#define GLX_STATIC_COLOR 0x8005
+#define GLX_GRAY_SCALE 0x8006
+#define GLX_STATIC_GRAY 0x8007
+#define GLX_TRANSPARENT_INDEX 0x8009
+#define GLX_COLOR_INDEX_TYPE ?
+#define GLX_COLOR_INDEX_BIT ?
+#define GLX_SCREEN ?
+#define GLX_PBUFFER_CLOBBER_MASK ?
+#define GLX_DAMAGED ?
+#define GLX_SAVED ?
+#define GLX_WINDOW ?
+#define GLX_PBUFFER ?
+
+
+/*
+ * GLX_EXT_visual_info extension
+ */
+#define GLX_X_VISUAL_TYPE_EXT 0x22
+#define GLX_TRANSPARENT_TYPE_EXT 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
+#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
+
+
+/*
* GLX_visual_info extension
*/
#define GLX_TRUE_COLOR_EXT 0x8002
@@ -139,6 +202,12 @@ enum _GLX_CONFIGS {
typedef void * GLXContext;
typedef XID GLXPixmap;
typedef XID GLXDrawable;
+ /* GLX 1.3 and later */
+ typedef XID GLXFBConfigID;
+ typedef XID GLXPfuffer;
+ typedef XID GLXWindow;
+ typedef XID GLXPbuffer;
+ typedef XID GLXFBConfig;
#endif
typedef XID GLXContextID;
@@ -194,6 +263,57 @@ extern const char *glXQueryServerString( Display *dpy, int screen, int name );
extern const char *glXGetClientString( Display *dpy, int name );
+/* GLX 1.2 and later */
+extern Display *glXGetCurrentDisplay( void );
+
+
+/* GLX 1.3 and later */
+extern GLXFBConfig glXChooseFBConfig( Display *dpy, int screen,
+ const int *attribList, int *nitems );
+
+extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
+ int attribute, int *value );
+
+extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
+ GLXFBConfig config );
+
+extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
+ Window win, const int *attribList );
+
+extern void glXDestroyWindow( Display *dpy, GLXWindow window );
+
+extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
+ Pixmap pixmap, const int *attribList );
+
+extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
+
+extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
+ const int *attribList );
+
+extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
+
+extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
+ unsigned int *value );
+
+extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
+ int renderType, GLXContext shareList,
+ Bool direct );
+
+extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
+ GLXDrawable read, GLXContext ctx );
+
+extern GLXDrawable glXGetCurrentReadDrawable( void );
+
+extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
+ int *value );
+
+extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
+ unsigned long mask );
+
+extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
+ unsigned long *mask );
+
+
/* GLX_MESA_pixmap_colormap */
extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
diff --git a/xc/extras/Mesa/include/GL/xmesa.h b/xc/extras/Mesa/include/GL/xmesa.h
index d90d43e65..211a6de94 100644
--- a/xc/extras/Mesa/include/GL/xmesa.h
+++ b/xc/extras/Mesa/include/GL/xmesa.h
@@ -1,10 +1,10 @@
-/* $Id: xmesa.h,v 1.1 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: xmesa.h,v 1.2 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -26,33 +26,6 @@
/*
- * $Log: xmesa.h,v $
- * Revision 1.1 1999/12/14 02:39:38 daryll
- *
- * Upgrade to the latest Mesa 3.2 code.
- * Fixed several driver texture management bugs in the tdfx driver.
- * Fix a problem with unbinding a context (performer).
- * Included the Mesa header files in the X tree instead of making copies.
- *
- * Revision 1.1.1.1.2.1 1999/11/24 18:41:37 brianp
- * bumped version to 3.1
- *
- * Revision 1.1.1.1 1999/08/19 00:55:40 jtg
- * Imported sources
- *
- * Revision 1.3 1999/02/24 22:43:27 jens
- * Name changes to get XMesa to compile standalone inside XFree86
- *
- * Revision 1.2 1999/02/14 03:39:09 brianp
- * new copyright
- *
- * Revision 1.1 1998/02/13 03:17:32 brianp
- * Initial revision
- *
- */
-
-
-/*
* Mesa/X11 interface. This header file serves as the documentation for
* the Mesa/X11 interface functions.
*
@@ -119,7 +92,7 @@ extern struct Library *XLibBase;
#define XMESA_MAJOR_VERSION 3
-#define XMESA_MINOR_VERSION 1
+#define XMESA_MINOR_VERSION 3
@@ -157,6 +130,7 @@ extern void XMesaResetDriver( __DRIscreenPrivate *driScrnPriv );
#endif
+
/*
* Create a new X/Mesa visual.
* Input: display - X11 display
@@ -226,7 +200,6 @@ extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v,
);
-
/*
* Create an XMesaBuffer from an X pixmap.
*/
@@ -239,7 +212,6 @@ extern XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v,
);
-
/*
* Destroy an XMesaBuffer, but not the corresponding window or pixmap.
*/
@@ -264,18 +236,35 @@ extern GLboolean XMesaMakeCurrent( XMesaContext c,
/*
+ * Bind two buffers (read and draw) to a context and make the
+ * context the current one.
+ * New in Mesa 3.3
+ */
+extern GLboolean XMesaMakeCurrent2( XMesaContext c,
+ XMesaBuffer drawBuffer,
+ XMesaBuffer readBuffer );
+
+
+/*
* Return a handle to the current context.
*/
extern XMesaContext XMesaGetCurrentContext( void );
/*
- * Return handle to the current buffer.
+ * Return handle to the current (draw) buffer.
*/
extern XMesaBuffer XMesaGetCurrentBuffer( void );
/*
+ * Return handle to the current read buffer.
+ * New in Mesa 3.3
+ */
+extern XMesaBuffer XMesaGetCurrentReadBuffer( void );
+
+
+/*
* Swap the front and back buffers for the given buffer. No action is
* taken if the buffer is not double buffered.
*/
diff --git a/xc/extras/Mesa/include/GL/xmesa_x.h b/xc/extras/Mesa/include/GL/xmesa_x.h
index ee9951855..b0344d0d6 100644
--- a/xc/extras/Mesa/include/GL/xmesa_x.h
+++ b/xc/extras/Mesa/include/GL/xmesa_x.h
@@ -30,7 +30,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
*
- * $Header: /home/ajax/dri-backup/xc/xc/extras/Mesa/include/GL/Attic/xmesa_x.h,v 1.1 1999/12/14 02:39:38 daryll Exp $
+ * $Header: /home/ajax/dri-backup/xc/xc/extras/Mesa/include/GL/Attic/xmesa_x.h,v 1.2 2000/01/30 00:27:01 brianp Exp $
*/
#ifndef _XMESA_X_H_
diff --git a/xc/extras/Mesa/include/GL/xmesa_xf86.h b/xc/extras/Mesa/include/GL/xmesa_xf86.h
index 5b4a5f299..f0c98b168 100644
--- a/xc/extras/Mesa/include/GL/xmesa_xf86.h
+++ b/xc/extras/Mesa/include/GL/xmesa_xf86.h
@@ -30,7 +30,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
*
- * $Header: /home/ajax/dri-backup/xc/xc/extras/Mesa/include/GL/Attic/xmesa_xf86.h,v 1.1 1999/12/14 02:39:38 daryll Exp $
+ * $Header: /home/ajax/dri-backup/xc/xc/extras/Mesa/include/GL/Attic/xmesa_xf86.h,v 1.2 2000/01/30 00:27:01 brianp Exp $
*/
#ifndef _XMESA_XF86_H_
@@ -179,7 +179,13 @@ do { \
#define GET_REDMASK(__v) __v->visinfo->redMask
#define GET_GREENMASK(__v) __v->visinfo->greenMask
#define GET_BLUEMASK(__v) __v->visinfo->blueMask
-#define GET_BITS_PER_PIXEL(__v) __v->visinfo->bitsPerRGBValue
+
+/*XXX this was wrong. However, using nplanes instead may fail when
+ * we have overlay planes in the future!
+ */
+/*#define GET_BITS_PER_PIXEL(__v) __v->visinfo->bitsPerRGBValue*/
+#define GET_BITS_PER_PIXEL(__v) __v->visinfo->nplanes
+
#define GET_VISUAL_CLASS(__v) __v->visinfo->class
#define GET_VISUAL_DEPTH(__v) __v->visinfo->nplanes
#define GET_BLACK_PIXEL(__v) __v->display->blackPixel
diff --git a/xc/extras/Mesa/src/FX/fxapi.c b/xc/extras/Mesa/src/FX/fxapi.c
index 6ba7f1d94..7a2272e65 100644
--- a/xc/extras/Mesa/src/FX/fxapi.c
+++ b/xc/extras/Mesa/src/FX/fxapi.c
@@ -957,22 +957,20 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win,
fxMesa->verbose=verbose;
fxMesa->board=glbCurrentBoard;
-#if FXMESA_USE_ARGB
+
fxMesa->glideContext = FX_grSstWinOpen((FxU32)win,res,ref,
- GR_COLORFORMAT_ARGB,
- GR_ORIGIN_LOWER_LEFT,
- 2,aux);
+#if FXMESA_USE_ARGB
+ GR_COLORFORMAT_ARGB,
#else
- fxMesa->glideContext = FX_grSstWinOpen((FxU32)win,res,ref,
- GR_COLORFORMAT_ABGR,
- GR_ORIGIN_LOWER_LEFT,
- 2,aux);
+ GR_COLORFORMAT_ABGR,
#endif
+ GR_ORIGIN_LOWER_LEFT,
+ 2,aux);
if (!fxMesa->glideContext){
errorstr = "grSstWinOpen";
goto errorhandler;
}
-
+
/* Pixel tables are use during pixel read-back */
#if FXMESA_USE_ARGB
fxInitPixelTables(fxMesa, GL_FALSE); /* Force RGB pixel order */
@@ -1045,7 +1043,11 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win,
}
- fxMesa->glBuffer=gl_create_framebuffer(fxMesa->glVis);
+ fxMesa->glBuffer=gl_create_framebuffer(fxMesa->glVis,
+ GL_FALSE, /* no software depth */
+ fxMesa->glVis->StencilBits > 0,
+ fxMesa->glVis->AccumBits > 0,
+ fxMesa->glVis->AlphaBits > 0 );
if (!fxMesa->glBuffer) {
errorstr = "gl_create_framebuffer";
goto errorhandler;
diff --git a/xc/extras/Mesa/src/FX/fxdd.c b/xc/extras/Mesa/src/FX/fxdd.c
index d1f0f6ca6..9c0fc4de5 100644
--- a/xc/extras/Mesa/src/FX/fxdd.c
+++ b/xc/extras/Mesa/src/FX/fxdd.c
@@ -174,78 +174,82 @@ static GLbitfield fxDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
- GLbitfield newmask;
+ const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
+ GLbitfield softwareMask = mask & (DD_STENCIL_BIT | DD_ACCUM_BIT);
+ GLbitfield newMask = mask & ~(DD_STENCIL_BIT | DD_ACCUM_BIT);
+
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDClear(%d,%d,%d,%d)\n",x,y,width,height);
}
- switch(mask & (GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)) {
- case (GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT):
- /* clear color and depth buffer */
+ if (mask == (DD_BACK_LEFT_BIT | DD_DEPTH_BIT)
+ && colorMask == 0xffffffff) {
+ /* common case: clear back color buffer and depth buffer */
+ FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ FX_grBufferClear(fxMesa->clearC, fxMesa->clearA,
+ (FxU16)(ctx->Depth.Clear*0xffff));
+ return 0;
+ }
- if (ctx->Color.DrawDestMask & BACK_LEFT_BIT) {
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
- FX_grBufferClear(fxMesa->clearC, fxMesa->clearA,
- (FxU16)(ctx->Depth.Clear*0xffff));
- }
- if (ctx->Color.DrawDestMask & FRONT_LEFT_BIT) {
+ /* depth masking */
+ if (newMask & DD_DEPTH_BIT) {
+ FX_grDepthMask(FXTRUE);
+ CLEAR_BITS(newMask, DD_DEPTH_BIT);
+ }
+ else {
+ FX_grDepthMask(FXFALSE);
+ }
+
+ if (colorMask != 0xffffffff) {
+ /* do masked color clear in software */
+ softwareMask |= (newMask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT));
+ CLEAR_BITS(newMask, (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT));
+ }
+
+ if (newMask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) {
+ if (newMask & DD_FRONT_LEFT_BIT) {
FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA,
- (FxU16)(ctx->Depth.Clear*0xffff));
+ (FxU16)(ctx->Depth.Clear*0xffff));
}
- newmask=mask & (~(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT));
- break;
- case (GL_COLOR_BUFFER_BIT):
- /* clear color buffer */
-
- if(ctx->Color.ColorMask) {
- FX_grDepthMask(FXFALSE);
-
- if (ctx->Color.DrawDestMask & BACK_LEFT_BIT) {
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
- FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, 0);
- }
- if (ctx->Color.DrawDestMask & FRONT_LEFT_BIT) {
- FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
- FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, 0);
- }
-
- if(ctx->Depth.Mask) {
- FX_grDepthMask(FXTRUE);
- }
+ if (newMask & DD_BACK_LEFT_BIT) {
+ FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ FX_grBufferClear(fxMesa->clearC, fxMesa->clearA,
+ (FxU16)(ctx->Depth.Clear*0xffff));
}
- newmask=mask & (~(GL_COLOR_BUFFER_BIT));
- break;
- case (GL_DEPTH_BUFFER_BIT):
- /* clear depth buffer */
-
- if(ctx->Depth.Mask) {
- FX_grColorMask(FXFALSE,FXFALSE);
- FX_grBufferClear(fxMesa->clearC, fxMesa->clearA,
- (FxU16)(ctx->Depth.Clear*0xffff));
+ CLEAR_BITS(newMask, (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT));
+ }
+ else if (mask & DD_DEPTH_BIT) {
+ /* clear depth but not color */
+ FX_grColorMask(FXFALSE,FXFALSE);
+ FX_grBufferClear(fxMesa->clearC, fxMesa->clearA,
+ (FxU16)(ctx->Depth.Clear*0xffff));
+ FX_grColorMask(ctx->Color.ColorMask[RCOMP] ||
+ ctx->Color.ColorMask[GCOMP] ||
+ ctx->Color.ColorMask[BCOMP],
+ ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer);
+ }
- FX_grColorMask(ctx->Color.ColorMask[RCOMP] ||
- ctx->Color.ColorMask[GCOMP] ||
- ctx->Color.ColorMask[BCOMP],
- ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer);
+ /* Restore depth mask state */
+ if (mask & DD_DEPTH_BIT) {
+ if (ctx->Depth.Mask) {
+ FX_grDepthMask(FXTRUE);
+ }
+ else {
+ FX_grDepthMask(FXFALSE);
}
-
- newmask=mask & (~(GL_DEPTH_BUFFER_BIT));
- break;
- default:
- newmask=mask;
- break;
}
-
- return newmask;
+
+ return newMask | softwareMask;
}
-/* Set the buffer used in double buffering */
-static GLboolean fxDDSetBuffer(GLcontext *ctx, GLenum mode )
+/* Set the buffer used for drawing */
+/* XXX support for separate read/draw buffers hasn't been tested */
+static GLboolean fxDDSetDrawBuffer(GLcontext *ctx, GLenum mode )
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
@@ -269,6 +273,29 @@ static GLboolean fxDDSetBuffer(GLcontext *ctx, GLenum mode )
}
+/* Set the buffer used for reading */
+/* XXX support for separate read/draw buffers hasn't been tested */
+static void fxDDSetReadBuffer(GLcontext *ctx, GLframebuffer *buffer,
+ GLenum mode )
+{
+ fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
+ (void) buffer;
+
+ if (MESA_VERBOSE&VERBOSE_DRIVER) {
+ fprintf(stderr,"fxmesa: fxDDSetBuffer(%x)\n",mode);
+ }
+
+ if (mode == GL_FRONT_LEFT) {
+ fxMesa->currentFB = GR_BUFFER_FRONTBUFFER;
+ FX_grRenderBuffer(fxMesa->currentFB);
+ }
+ else if (mode == GL_BACK_LEFT) {
+ fxMesa->currentFB = GR_BUFFER_BACKBUFFER;
+ FX_grRenderBuffer(fxMesa->currentFB);
+ }
+}
+
+
#ifdef XF86DRI
static GLboolean inClipRects(fxMesaContext fxMesa, int px, int py)
{
@@ -795,11 +822,10 @@ void fxSetupDDPointers(GLcontext *ctx)
ctx->Driver.UpdateState=fxDDUpdateDDPointers;
- ctx->Driver.AllocDepthBuffer=fxAllocDepthBuffer;
- ctx->Driver.DepthTestSpan=fxDDDepthTestSpanGeneric;
- ctx->Driver.DepthTestPixels=fxDDDepthTestPixelsGeneric;
- ctx->Driver.ReadDepthSpanFloat=fxDDReadDepthSpanFloat;
- ctx->Driver.ReadDepthSpanInt=fxDDReadDepthSpanInt;
+ ctx->Driver.WriteDepthSpan=fxDDWriteDepthSpan;
+ ctx->Driver.WriteDepthPixels=fxDDWriteDepthPixels;
+ ctx->Driver.ReadDepthSpan=fxDDReadDepthSpan;
+ ctx->Driver.ReadDepthPixels=fxDDReadDepthPixels;
ctx->Driver.GetString=fxDDGetString;
@@ -816,7 +842,8 @@ void fxSetupDDPointers(GLcontext *ctx)
ctx->Driver.Index=NULL;
ctx->Driver.Color=fxDDSetColor;
- ctx->Driver.SetBuffer=fxDDSetBuffer;
+ ctx->Driver.SetDrawBuffer=fxDDSetDrawBuffer;
+ ctx->Driver.SetReadBuffer=fxDDSetReadBuffer;
ctx->Driver.GetBufferSize=fxDDBufferSize;
ctx->Driver.Bitmap=fxDDDrawBitMap;
diff --git a/xc/extras/Mesa/src/FX/fxddspan.c b/xc/extras/Mesa/src/FX/fxddspan.c
index b120ff689..b950b3f1c 100644
--- a/xc/extras/Mesa/src/FX/fxddspan.c
+++ b/xc/extras/Mesa/src/FX/fxddspan.c
@@ -72,11 +72,6 @@
static FxBool writeRegionClipped(fxMesaContext fxMesa, GrBuffer_t dst_buffer,
FxU32 dst_x, FxU32 dst_y, GrLfbSrcFmt_t src_format,
FxU32 src_width, FxU32 src_height, FxI32 src_stride,
- void *src_data);
-
-FxBool writeRegionClipped(fxMesaContext fxMesa, GrBuffer_t dst_buffer,
- FxU32 dst_x, FxU32 dst_y, GrLfbSrcFmt_t src_format,
- FxU32 src_width, FxU32 src_height, FxI32 src_stride,
void *src_data)
{
int i, x, w, srcElt;
@@ -401,7 +396,7 @@ static void fxDDReadRGBAPixels(const GLcontext *ctx,
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLuint i;
- GLint bottom=fxMesa->height+fxMesa->y_offset-1;
+ GLint bottom=fxMesa->y_delta-1;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDReadRGBAPixels(...)\n");
@@ -424,30 +419,37 @@ static void fxDDReadRGBAPixels(const GLcontext *ctx,
/***** Depth functions *****/
/************************************************************************/
-void fxDDReadDepthSpanFloat(GLcontext *ctx,
- GLuint n, GLint x, GLint y, GLfloat depth[])
+void fxDDWriteDepthSpan(GLcontext *ctx,
+ GLuint n, GLint x, GLint y, const GLdepth depth[],
+ const GLubyte mask[])
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
- GLuint i;
GLint bottom=fxMesa->height+fxMesa->y_offset-1;
- GLushort data[MAX_WIDTH];
if (MESA_VERBOSE&VERBOSE_DRIVER) {
- fprintf(stderr,"fxmesa: fxDDReadDepthSpanFloat(...)\n");
+ fprintf(stderr,"fxmesa: fxDDReadDepthSpanInt(...)\n");
}
- x+=fxMesa->x_offset;
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x,bottom-y,n,1,0,data);
+ x += fxMesa->x_offset;
- /*
- convert the read values to float values [0.0 .. 1.0].
- */
- for(i=0;i<n;i++)
- depth[i]=data[i]/65535.0f;
+ if (mask) {
+ GLint i;
+ for (i = 0; i < n; i++) {
+ if (mask[i]) {
+ writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, x + i, bottom-y,
+ GR_LFB_SRC_FMT_ZA16, 1, 1, 0, (void *) &depth[i]);
+ }
+ }
+ }
+ else {
+ writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, x, bottom-y,
+ GR_LFB_SRC_FMT_ZA16, n, 1, 0, (void *) depth);
+ }
}
-void fxDDReadDepthSpanInt(GLcontext *ctx,
- GLuint n, GLint x, GLint y, GLdepth depth[])
+
+void fxDDReadDepthSpan(GLcontext *ctx,
+ GLuint n, GLint x, GLint y, GLdepth depth[])
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLint bottom=fxMesa->height+fxMesa->y_offset-1;
@@ -460,440 +462,53 @@ void fxDDReadDepthSpanInt(GLcontext *ctx,
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x,bottom-y,n,1,0,depth);
}
-GLuint fxDDDepthTestSpanGeneric(GLcontext *ctx,
- GLuint n, GLint x, GLint y, const GLdepth z[],
- GLubyte mask[])
+
+
+void fxDDWriteDepthPixels(GLcontext *ctx,
+ GLuint n, const GLint x[], const GLint y[],
+ const GLdepth depth[], const GLubyte mask[])
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
- GLushort depthdata[MAX_WIDTH];
- GLdepth *zptr=depthdata;
- GLubyte *m=mask;
- GLuint i;
- GLuint passed=0;
GLint bottom=fxMesa->height+fxMesa->y_offset-1;
+ GLuint i;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
- fprintf(stderr,"fxmesa: fxDDDepthTestSpanGeneric(...)\n");
+ fprintf(stderr,"fxmesa: fxDDReadDepthSpanInt(...)\n");
}
- x+=fxMesa->x_offset;
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x,bottom-y,n,1,0,depthdata);
-
- /* switch cases ordered from most frequent to less frequent */
- switch (ctx->Depth.Func) {
- case GL_LESS:
- if (ctx->Depth.Mask) {
- /* Update Z buffer */
- for (i=0; i<n; i++,zptr++,m++) {
- if (*m) {
- if (z[i] < *zptr) {
- /* pass */
- *zptr = z[i];
- passed++;
- } else {
- /* fail */
- *m = 0;
- }
- }
- }
- } else {
- /* Don't update Z buffer */
- for (i=0; i<n; i++,zptr++,m++) {
- if (*m) {
- if (z[i] < *zptr) {
- /* pass */
- passed++;
- } else {
- *m = 0;
- }
- }
- }
+ for (i = 0; i < n; i++) {
+ if (mask[i]) {
+ int xpos = x[i] + fxMesa->x_offset;
+ int ypos = bottom - y[i];
+ writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, xpos, ypos,
+ GR_LFB_SRC_FMT_ZA16, 1, 1, 0, (void *) &depth[i]);
}
- break;
- case GL_LEQUAL:
- if (ctx->Depth.Mask) {
- /* Update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] <= *zptr) {
- *zptr = z[i];
- passed++;
- } else {
- *m = 0;
- }
- }
- }
- } else {
- /* Don't update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] <= *zptr) {
- /* pass */
- passed++;
- } else {
- *m = 0;
- }
- }
- }
- }
- break;
- case GL_GEQUAL:
- if (ctx->Depth.Mask) {
- /* Update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] >= *zptr) {
- *zptr = z[i];
- passed++;
- } else {
- *m = 0;
- }
- }
- }
- } else {
- /* Don't update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] >= *zptr) {
- /* pass */
- passed++;
- } else {
- *m = 0;
- }
- }
- }
- }
- break;
- case GL_GREATER:
- if (ctx->Depth.Mask) {
- /* Update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] > *zptr) {
- *zptr = z[i];
- passed++;
- } else {
- *m = 0;
- }
- }
- }
- } else {
- /* Don't update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] > *zptr) {
- /* pass */
- passed++;
- } else {
- *m = 0;
- }
- }
- }
- }
- break;
- case GL_NOTEQUAL:
- if (ctx->Depth.Mask) {
- /* Update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] != *zptr) {
- *zptr = z[i];
- passed++;
- } else {
- *m = 0;
- }
- }
- }
- } else {
- /* Don't update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] != *zptr) {
- /* pass */
- passed++;
- } else {
- *m = 0;
- }
- }
- }
- }
- break;
- case GL_EQUAL:
- if (ctx->Depth.Mask) {
- /* Update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] == *zptr) {
- *zptr = z[i];
- passed++;
- } else {
- *m =0;
- }
- }
- }
- } else {
- /* Don't update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] == *zptr) {
- /* pass */
- passed++;
- } else {
- *m =0;
- }
- }
- }
- }
- break;
- case GL_ALWAYS:
- if (ctx->Depth.Mask) {
- /* Update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- *zptr = z[i];
- passed++;
- }
- }
- } else {
- /* Don't update Z buffer or mask */
- passed = n;
- }
- break;
- case GL_NEVER:
- for (i=0;i<n;i++) {
- mask[i] = 0;
- }
- break;
- default:
- ;
- } /*switch*/
-
- if(passed)
- writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x,bottom-y,GR_LFB_SRC_FMT_ZA16,n,1,0,depthdata);
-
- return passed;
+ }
}
-void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLdepth z[], GLubyte mask[])
+
+void fxDDReadDepthPixels(GLcontext *ctx, GLuint n,
+ const GLint x[], const GLint y[], GLdepth depth[])
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
- GLdepth zval;
- GLuint i;
GLint bottom=fxMesa->height+fxMesa->y_offset-1;
+ GLuint i;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
- fprintf(stderr,"fxmesa: fxDDDepthTestPixelsGeneric(...)\n");
+ fprintf(stderr,"fxmesa: fxDDReadDepthSpanInt(...)\n");
}
- /* switch cases ordered from most frequent to less frequent */
- switch (ctx->Depth.Func) {
- case GL_LESS:
- if (ctx->Depth.Mask) {
- /* Update Z buffer */
- for (i=0; i<n; i++) {
- if (mask[i]) {
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
- if (z[i] < zval) {
- /* pass */
- writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
- } else {
- /* fail */
- mask[i] = 0;
- }
- }
- }
- } else {
- /* Don't update Z buffer */
- for (i=0; i<n; i++) {
- if (mask[i]) {
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
- if (z[i] < zval) {
- /* pass */
- }
- else {
- /* fail */
- mask[i] = 0;
- }
- }
- }
- }
- break;
- case GL_LEQUAL:
- if (ctx->Depth.Mask) {
- /* Update Z buffer */
- for (i=0; i<n; i++) {
- if (mask[i]) {
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
- if (z[i] <= zval) {
- /* pass */
- writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
- } else {
- /* fail */
- mask[i] = 0;
- }
- }
- }
- } else {
- /* Don't update Z buffer */
- for (i=0; i<n; i++) {
- if (mask[i]) {
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
- if (z[i] <= zval) {
- /* pass */
- } else {
- /* fail */
- mask[i] = 0;
- }
- }
- }
- }
- break;
- case GL_GEQUAL:
- if (ctx->Depth.Mask) {
- /* Update Z buffer */
- for (i=0; i<n; i++) {
- if (mask[i]) {
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
- if (z[i] >= zval) {
- /* pass */
- writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
- } else {
- /* fail */
- mask[i] = 0;
- }
- }
- }
- } else {
- /* Don't update Z buffer */
- for (i=0; i<n; i++) {
- if (mask[i]) {
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
- if (z[i] >= zval) {
- /* pass */
- } else {
- /* fail */
- mask[i] = 0;
- }
- }
- }
- }
- break;
- case GL_GREATER:
- if (ctx->Depth.Mask) {
- /* Update Z buffer */
- for (i=0; i<n; i++) {
- if (mask[i]) {
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
- if (z[i] > zval) {
- /* pass */
- writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
- } else {
- /* fail */
- mask[i] = 0;
- }
- }
- }
- } else {
- /* Don't update Z buffer */
- for (i=0; i<n; i++) {
- if (mask[i]) {
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
- if (z[i] > zval) {
- /* pass */
- } else {
- /* fail */
- mask[i] = 0;
- }
- }
- }
- }
- break;
- case GL_NOTEQUAL:
- if (ctx->Depth.Mask) {
- /* Update Z buffer */
- for (i=0; i<n; i++) {
- if (mask[i]) {
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
- if (z[i] != zval) {
- /* pass */
- writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
- } else {
- /* fail */
- mask[i] = 0;
- }
- }
- }
- } else {
- /* Don't update Z buffer */
- for (i=0; i<n; i++) {
- if (mask[i]) {
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
- if (z[i] != zval) {
- /* pass */
- }
- else {
- /* fail */
- mask[i] = 0;
- }
- }
- }
- }
- break;
- case GL_EQUAL:
- if (ctx->Depth.Mask) {
- /* Update Z buffer */
- for (i=0; i<n; i++) {
- if (mask[i]) {
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
- if (z[i] == zval) {
- /* pass */
- writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
- } else {
- /* fail */
- mask[i] = 0;
- }
- }
- }
- } else {
- /* Don't update Z buffer */
- for (i=0; i<n; i++) {
- if (mask[i]) {
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
- if (z[i] == zval) {
- /* pass */
- } else {
- /* fail */
- mask[i] = 0;
- }
- }
- }
- }
- break;
- case GL_ALWAYS:
- if (ctx->Depth.Mask) {
- /* Update Z buffer */
- for (i=0; i<n; i++) {
- if (mask[i]) {
- writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
- }
- }
- } else {
- /* Don't update Z buffer or mask */
- }
- break;
- case GL_NEVER:
- /* depth test never passes */
- for (i=0;i<n;i++) {
- mask[i] = 0;
- }
- break;
- default:
- ;
- } /*switch*/
+
+ for (i = 0; i < n; i++) {
+ int xpos = x[i] + fxMesa->x_offset;
+ int ypos = bottom - y[i];
+ FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,xpos,ypos,1,1,0,&depth[i]);
+ }
}
+
+
+
/************************************************************************/
diff --git a/xc/extras/Mesa/src/FX/fxddtex.c b/xc/extras/Mesa/src/FX/fxddtex.c
index db0120a03..747d2555c 100644
--- a/xc/extras/Mesa/src/FX/fxddtex.c
+++ b/xc/extras/Mesa/src/FX/fxddtex.c
@@ -342,14 +342,14 @@ void fxDDTexPalette(GLcontext *ctx, struct gl_texture_object *tObj)
fprintf(stderr,"fxmesa: fxDDTexPalette(%d,%x)\n",tObj->Name,(GLuint)tObj->DriverData);
}
- if(tObj->PaletteFormat!=GL_RGBA) {
+ if(tObj->Palette.Format!=GL_RGBA) {
#ifndef FX_SILENT
fprintf(stderr,"fx Driver: unsupported palette format in texpalette()\n");
#endif
return;
}
- if(tObj->PaletteSize>256) {
+ if(tObj->Palette.Size>256) {
#ifndef FX_SILENT
fprintf(stderr,"fx Driver: unsupported palette size in texpalette()\n");
#endif
@@ -361,11 +361,11 @@ void fxDDTexPalette(GLcontext *ctx, struct gl_texture_object *tObj)
ti=fxTMGetTexInfo(tObj);
- for(i=0;i<tObj->PaletteSize;i++) {
- r=tObj->Palette[i*4];
- g=tObj->Palette[i*4+1];
- b=tObj->Palette[i*4+2];
- a=tObj->Palette[i*4+3];
+ for(i=0;i<tObj->Palette.Size;i++) {
+ r=tObj->Palette.Table[i*4];
+ g=tObj->Palette.Table[i*4+1];
+ b=tObj->Palette.Table[i*4+2];
+ a=tObj->Palette.Table[i*4+3];
ti->palette.data[i]=(a<<24)|(r<<16)|(g<<8)|b;
}
@@ -374,25 +374,25 @@ void fxDDTexPalette(GLcontext *ctx, struct gl_texture_object *tObj)
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDTexPalette(global)\n");
}
- if(ctx->Texture.PaletteFormat!=GL_RGBA) {
+ if(ctx->Texture.Palette.Format!=GL_RGBA) {
#ifndef FX_SILENT
fprintf(stderr,"fx Driver: unsupported palette format in texpalette()\n");
#endif
return;
}
- if(ctx->Texture.PaletteSize>256) {
+ if(ctx->Texture.Palette.Size>256) {
#ifndef FX_SILENT
fprintf(stderr,"fx Driver: unsupported palette size in texpalette()\n");
#endif
return;
}
- for(i=0;i<ctx->Texture.PaletteSize;i++) {
- r=ctx->Texture.Palette[i*4];
- g=ctx->Texture.Palette[i*4+1];
- b=ctx->Texture.Palette[i*4+2];
- a=ctx->Texture.Palette[i*4+3];
+ for(i=0;i<ctx->Texture.Palette.Size;i++) {
+ r=ctx->Texture.Palette.Table[i*4];
+ g=ctx->Texture.Palette.Table[i*4+1];
+ b=ctx->Texture.Palette.Table[i*4+2];
+ a=ctx->Texture.Palette.Table[i*4+3];
fxMesa->glbPalette.data[i]=(a<<24)|(r<<16)|(g<<8)|b;
}
@@ -916,10 +916,10 @@ static void fxTexBuildImageMap(const struct gl_texture_image *image,
if(wscale==hscale==1) {
int i=0;
- int length=h*w;
+ int lenght=h*w;
unsigned short a,l;
- while(i++<length) {
+ while(i++<lenght) {
l=*data++;
a=*data++;
@@ -960,10 +960,10 @@ static void fxTexBuildImageMap(const struct gl_texture_image *image,
if(wscale==hscale==1) {
int i=0;
- int length=h*w;
+ int lenght=h*w;
unsigned short r,g,b;
- while(i++<length) {
+ while(i++<lenght) {
r=*data++;
g=*data++;
b=*data++;
@@ -1010,10 +1010,10 @@ static void fxTexBuildImageMap(const struct gl_texture_image *image,
if(wscale==hscale==1) {
int i=0;
- int length=h*w;
+ int lenght=h*w;
unsigned short r,g,b,a;
- while(i++<length) {
+ while(i++<lenght) {
r=*data++;
g=*data++;
b=*data++;
diff --git a/xc/extras/Mesa/src/FX/fxdrv.h b/xc/extras/Mesa/src/FX/fxdrv.h
index 20ed86c03..382ec61a0 100644
--- a/xc/extras/Mesa/src/FX/fxdrv.h
+++ b/xc/extras/Mesa/src/FX/fxdrv.h
@@ -68,6 +68,7 @@
#include "context.h"
#include "macros.h"
#include "matrix.h"
+#include "mem.h"
#include "texture.h"
#include "types.h"
#include "vb.h"
@@ -636,22 +637,19 @@ extern GLboolean fxDDColorMask(GLcontext *ctx,
GLboolean r, GLboolean g,
GLboolean b, GLboolean a );
-extern GLuint fxDDDepthTestSpanGeneric(GLcontext *ctx,
- GLuint n, GLint x, GLint y,
- const GLdepth z[],
- GLubyte mask[]);
+extern void fxDDWriteDepthSpan(GLcontext *ctx, GLuint n, GLint x, GLint y,
+ const GLdepth depth[], const GLubyte mask[]);
-extern void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
- GLuint n,
- const GLint x[], const GLint y[],
- const GLdepth z[], GLubyte mask[]);
+extern void fxDDReadDepthSpan(GLcontext *ctx, GLuint n, GLint x, GLint y,
+ GLdepth depth[]);
-extern void fxDDReadDepthSpanFloat(GLcontext *ctx,
- GLuint n, GLint x, GLint y, GLfloat depth[]);
-
-extern void fxDDReadDepthSpanInt(GLcontext *ctx,
- GLuint n, GLint x, GLint y, GLdepth depth[]);
+extern void fxDDWriteDepthPixels(GLcontext *ctx, GLuint n,
+ const GLint x[], const GLint y[],
+ const GLdepth depth[], const GLubyte mask[]);
+extern void fxDDReadDepthPixels(GLcontext *ctx, GLuint n,
+ const GLint x[], const GLint y[],
+ GLdepth depth[]);
extern void fxDDFastPath( struct vertex_buffer *VB );
diff --git a/xc/extras/Mesa/src/FX/fxsanity.c b/xc/extras/Mesa/src/FX/fxsanity.c
index cd94b59fb..ff6066e56 100644
--- a/xc/extras/Mesa/src/FX/fxsanity.c
+++ b/xc/extras/Mesa/src/FX/fxsanity.c
@@ -115,4 +115,10 @@ void fx_sanity_triangle( GrVertex *v1, GrVertex *v2, GrVertex *v3 )
fprintf(stderr, "\n\n\n");
}
+#else
+
+void gl_fxsanity_dummy()
+{
+}
+
#endif
diff --git a/xc/extras/Mesa/src/FX/fxsetup.c b/xc/extras/Mesa/src/FX/fxsetup.c
index af1697db7..e13e8c3b0 100644
--- a/xc/extras/Mesa/src/FX/fxsetup.c
+++ b/xc/extras/Mesa/src/FX/fxsetup.c
@@ -120,6 +120,8 @@ static void fxTexValidate(GLcontext *ctx, struct gl_texture_object *tObj)
case GL_REPEAT:
ti->sClamp=0;
break;
+ default:
+ ; /* silence compiler warning */
}
switch (tObj->WrapT) {
case GL_CLAMP_TO_EDGE:
@@ -130,6 +132,8 @@ static void fxTexValidate(GLcontext *ctx, struct gl_texture_object *tObj)
case GL_REPEAT:
ti->tClamp=0;
break;
+ default:
+ ; /* silence compiler warning */
}
ti->validated=GL_TRUE;
@@ -1396,7 +1400,7 @@ GLboolean fxDDColorMask(GLcontext *ctx,
fxMesa->new_state |= FX_NEW_COLOR_MASK;
ctx->Driver.RenderStart = fxSetupFXUnits;
(void) r; (void) g; (void) b; (void) a;
- return 1;
+ return GL_FALSE;
}
static void fxSetupColorMask(GLcontext *ctx)
diff --git a/xc/extras/Mesa/src/X/fakeglx.c b/xc/extras/Mesa/src/X/fakeglx.c
index 8b818e0ac..f35b1e808 100644
--- a/xc/extras/Mesa/src/X/fakeglx.c
+++ b/xc/extras/Mesa/src/X/fakeglx.c
@@ -1,8 +1,8 @@
-/* $Id: fakeglx.c,v 1.1 1999/12/05 23:10:27 daryll Exp $ */
+/* $Id: fakeglx.c,v 1.2 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,12 +25,9 @@
*/
-
-
-
/*
- * A pseudo-GLX implementation to allow OpenGL/GLX programs to work with Mesa.
- * The Fake_glX*() functions implemented here are called from glxapi.c
+ * This is an emulation of the GLX API which allows Mesa/GLX-based programs
+ * to run on X servers which do not have the real GLX extension.
*
* Thanks to the contributors:
*
@@ -45,25 +42,33 @@
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include "GL/gl.h"
+#include "glxheader.h"
+#include "glxapi.h"
#include "GL/xmesa.h"
#include "context.h"
#include "config.h"
-#include "fakeglx.h"
#include "macros.h"
#include "types.h"
#include "xmesaP.h"
+/* This indicates the client-side GLX API and GLX encoder version. */
+#define CLIENT_MAJOR_VERSION 1
+#define CLIENT_MINOR_VERSION 2
+
+/* This indicates the server-side GLX decoder version.
+ * GLX 1.3 indicates OpenGL 1.2 support
+ */
+#define SERVER_MAJOR_VERSION 1
+#define SERVER_MINOR_VERSION 3
+
+/* This is appended onto the glXGetClient/ServerString version strings. */
+#define MESA_GLX_VERSION "Mesa 3.1"
+
+/* Who implemented this GLX? */
+#define VENDOR "Brian Paul"
+
+
/* Silence compiler warnings */
void Fake_glXDummyFunc( void )
@@ -267,7 +272,7 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo,
&& (v->gl_visual->StencilBits >= stencil_size || stencil_size == 0)
&& (v->gl_visual->AccumBits >= accum_size || accum_size == 0)) {
/* now either compare XVisualInfo pointers or visual IDs */
- if ((!comparePointers && v->vishandle->visualid == vinfo->visualid)
+ if ((!comparePointers && v->visinfo->visualid == vinfo->visualid)
|| (comparePointers && v->vishandle == vinfo)) {
return v;
}
@@ -843,7 +848,8 @@ static XVisualInfo *choose_x_overlay_visual( Display *dpy, int scr,
-XVisualInfo *Fake_glXChooseVisual( Display *dpy, int screen, int *list )
+static XVisualInfo *
+Fake_glXChooseVisual( Display *dpy, int screen, int *list )
{
int *parselist;
XVisualInfo *vis;
@@ -1020,8 +1026,9 @@ XVisualInfo *Fake_glXChooseVisual( Display *dpy, int screen, int *list )
-GLXContext Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo,
- GLXContext share_list, Bool direct )
+static GLXContext
+Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo,
+ GLXContext share_list, Bool direct )
{
XMesaVisual glxvis;
XMesaContext xmctx;
@@ -1048,54 +1055,94 @@ GLXContext Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo,
}
-static GLXDrawable MakeCurrent_PrevDrawable = 0;
static GLXContext MakeCurrent_PrevContext = 0;
-static XMesaBuffer MakeCurrent_PrevBuffer = 0;
-
-Bool Fake_glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx )
+static GLXDrawable MakeCurrent_PrevDrawable = 0;
+static GLXDrawable MakeCurrent_PrevReadable = 0;
+static XMesaBuffer MakeCurrent_PrevDrawBuffer = 0;
+static XMesaBuffer MakeCurrent_PrevReadBuffer = 0;
+
+/* GLX 1.3 and later */
+static Bool
+Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
+ GLXDrawable read, GLXContext ctx )
{
- if (ctx && drawable) {
- XMesaBuffer buffer;
+ if (ctx && draw && read) {
+ XMesaBuffer drawBuffer, readBuffer;
+ XMesaContext xmctx = (XMesaContext) ctx;
+
+ /* Find the XMesaBuffer which corresponds to the GLXDrawable 'draw' */
+ if (ctx == MakeCurrent_PrevContext
+ && draw == MakeCurrent_PrevDrawable) {
+ drawBuffer = MakeCurrent_PrevDrawBuffer;
+ }
+ else {
+ drawBuffer = XMesaFindBuffer( dpy, draw );
+ }
+ if (!drawBuffer) {
+ /* drawable must be a new window! */
+ drawBuffer = XMesaCreateWindowBuffer2( xmctx->xm_visual, draw, ctx );
+ if (!drawBuffer) {
+ /* Out of memory, or context/drawable depth mismatch */
+ return False;
+ }
+ }
- if (drawable==MakeCurrent_PrevDrawable && ctx==MakeCurrent_PrevContext) {
- buffer = MakeCurrent_PrevBuffer;
+ /* Find the XMesaBuffer which corresponds to the GLXDrawable 'read' */
+ if (ctx == MakeCurrent_PrevContext
+ && read == MakeCurrent_PrevReadable) {
+ readBuffer = MakeCurrent_PrevReadBuffer;
}
else {
- buffer = XMesaFindBuffer( dpy, drawable );
+ readBuffer = XMesaFindBuffer( dpy, read );
}
- if (!buffer) {
+ if (!readBuffer) {
/* drawable must be a new window! */
- buffer = XMesaCreateWindowBuffer2( ctx->xm_visual, drawable, ctx );
- if (!buffer) {
+ readBuffer = XMesaCreateWindowBuffer2( xmctx->xm_visual, read, ctx );
+ if (!readBuffer) {
/* Out of memory, or context/drawable depth mismatch */
return False;
}
}
+
MakeCurrent_PrevContext = ctx;
- MakeCurrent_PrevDrawable = drawable;
- MakeCurrent_PrevBuffer = buffer;
+ MakeCurrent_PrevDrawable = draw;
+ MakeCurrent_PrevReadable = read;
+ MakeCurrent_PrevDrawBuffer = drawBuffer;
+ MakeCurrent_PrevReadBuffer = readBuffer;
/* Now make current! */
- return (Bool) XMesaMakeCurrent( (XMesaContext) ctx, buffer );
+ return (Bool) XMesaMakeCurrent2((XMesaContext) ctx, drawBuffer, readBuffer);
}
- else if (!ctx && !drawable) {
+ else if (!ctx && !draw && !read) {
/* release current context w/out assigning new one. */
XMesaMakeCurrent( NULL, NULL );
MakeCurrent_PrevContext = 0;
MakeCurrent_PrevDrawable = 0;
- MakeCurrent_PrevBuffer = 0;
+ MakeCurrent_PrevReadable = 0;
+ MakeCurrent_PrevDrawBuffer = 0;
+ MakeCurrent_PrevReadBuffer = 0;
return True;
}
else {
- /* ctx XOR drawable is NULL, this is an error */
+ /* The args must either all be non-zero or all zero.
+ * This is an error.
+ */
return False;
}
}
-GLXPixmap Fake_glXCreateGLXPixmap( Display *dpy, XVisualInfo *visinfo,
- Pixmap pixmap )
+static Bool
+Fake_glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx )
+{
+ return Fake_glXMakeContextCurrent( dpy, drawable, drawable, ctx );
+}
+
+
+
+static GLXPixmap
+Fake_glXCreateGLXPixmap( Display *dpy, XVisualInfo *visinfo, Pixmap pixmap )
{
XMesaVisual v;
XMesaBuffer b;
@@ -1119,8 +1166,9 @@ GLXPixmap Fake_glXCreateGLXPixmap( Display *dpy, XVisualInfo *visinfo,
#ifdef GLX_MESA_pixmap_colormap
-GLXPixmap Fake_glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visinfo,
- Pixmap pixmap, Colormap cmap )
+static GLXPixmap
+Fake_glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visinfo,
+ Pixmap pixmap, Colormap cmap )
{
XMesaVisual v;
XMesaBuffer b;
@@ -1144,7 +1192,8 @@ GLXPixmap Fake_glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visinfo,
#endif
-void Fake_glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap )
+static void
+Fake_glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap )
{
XMesaBuffer b = XMesaFindBuffer(dpy, pixmap);
if (b) {
@@ -1156,8 +1205,9 @@ void Fake_glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap )
}
-void Fake_glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
- GLuint mask )
+static void
+Fake_glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
+ GLuint mask )
{
XMesaContext xm_src = (XMesaContext) src;
XMesaContext xm_dst = (XMesaContext) dst;
@@ -1167,7 +1217,8 @@ void Fake_glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
-Bool Fake_glXQueryExtension( Display *dpy, int *errorb, int *event )
+static Bool
+Fake_glXQueryExtension( Display *dpy, int *errorb, int *event )
{
/* Mesa's GLX isn't really an X extension but we try to act like one. */
(void) dpy;
@@ -1184,19 +1235,23 @@ void _kw_ungrab_all( Display *dpy )
}
-void Fake_glXDestroyContext( Display *dpy, GLXContext ctx )
+static void
+Fake_glXDestroyContext( Display *dpy, GLXContext ctx )
{
(void) dpy;
MakeCurrent_PrevContext = 0;
MakeCurrent_PrevDrawable = 0;
- MakeCurrent_PrevBuffer = 0;
+ MakeCurrent_PrevReadable = 0;
+ MakeCurrent_PrevDrawBuffer = 0;
+ MakeCurrent_PrevReadBuffer = 0;
XMesaDestroyContext( (XMesaContext) ctx );
XMesaGarbageCollect();
}
-Bool Fake_glXIsDirect( Display *dpy, GLXContext ctx )
+static Bool
+Fake_glXIsDirect( Display *dpy, GLXContext ctx )
{
(void) dpy;
return ((XMesaContext) ctx)->direct;
@@ -1204,7 +1259,8 @@ Bool Fake_glXIsDirect( Display *dpy, GLXContext ctx )
-void Fake_glXSwapBuffers( Display *dpy, GLXDrawable drawable )
+static void
+Fake_glXSwapBuffers( Display *dpy, GLXDrawable drawable )
{
XMesaBuffer buffer = XMesaFindBuffer( dpy, drawable );
@@ -1217,8 +1273,9 @@ void Fake_glXSwapBuffers( Display *dpy, GLXDrawable drawable )
}
-void Fake_glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
- int x, int y, int width, int height )
+static void
+Fake_glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
+ int x, int y, int width, int height )
{
XMesaBuffer buffer = XMesaFindBuffer( dpy, drawable );
if (buffer) {
@@ -1231,12 +1288,14 @@ void Fake_glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
-Bool Fake_glXQueryVersion( Display *dpy, int *maj, int *min )
+static Bool
+Fake_glXQueryVersion( Display *dpy, int *maj, int *min )
{
(void) dpy;
/* Return GLX version, not Mesa version */
- *maj = 1;
- *min = 1;
+ assert(CLIENT_MAJOR_VERSION == SERVER_MAJOR_VERSION);
+ *maj = CLIENT_MAJOR_VERSION;
+ *min = MIN2( CLIENT_MINOR_VERSION, SERVER_MINOR_VERSION );
return True;
}
@@ -1245,8 +1304,9 @@ Bool Fake_glXQueryVersion( Display *dpy, int *maj, int *min )
/*
* Query the GLX attributes of the given XVisualInfo.
*/
-int Fake_glXGetConfig( Display *dpy, XVisualInfo *visinfo,
- int attrib, int *value )
+static int
+Fake_glXGetConfig( Display *dpy, XVisualInfo *visinfo,
+ int attrib, int *value )
{
XMesaVisual glxvis;
@@ -1388,26 +1448,8 @@ int Fake_glXGetConfig( Display *dpy, XVisualInfo *visinfo,
-GLXContext Fake_glXGetCurrentContext( void )
-{
- return (GLXContext) XMesaGetCurrentContext();
-}
-
-
-
-GLXDrawable Fake_glXGetCurrentDrawable( void )
-{
- XMesaBuffer b = XMesaGetCurrentBuffer();
- if (b) {
- return b->frontbuffer;
- }
- else {
- return 0;
- }
-}
-
-
-void Fake_glXWaitGL( void )
+static void
+Fake_glXWaitGL( void )
{
XMesaContext xmesa = XMesaGetCurrentContext();
XMesaFlush( xmesa );
@@ -1415,7 +1457,8 @@ void Fake_glXWaitGL( void )
-void Fake_glXWaitX( void )
+static void
+Fake_glXWaitX( void )
{
XMesaContext xmesa = XMesaGetCurrentContext();
XMesaFlush( xmesa );
@@ -1430,16 +1473,17 @@ static const char *get_extensions( void )
#ifdef FX
const char *fx = getenv("MESA_GLX_FX");
if (fx && fx[0] != 'd') {
- return "GLX_MESA_pixmap_colormap GLX_EXT_visual_info GLX_MESA_release_buffers GLX_MESA_copy_sub_buffer GLX_SGI_video_sync GLX_EXT_get_proc_address GLX_MESA_set_3dfx_mode";
+ return "GLX_MESA_pixmap_colormap GLX_EXT_visual_info GLX_MESA_release_buffers GLX_MESA_copy_sub_buffer GLX_SGI_video_sync GLX_MESA_set_3dfx_mode GLX_ARB_get_proc_address";
}
#endif
- return "GLX_MESA_pixmap_colormap GLX_EXT_visual_info GLX_MESA_release_buffers GLX_MESA_copy_sub_buffer GLX_SGI_video_sync GL_EXT_get_proc_address";
+ return "GLX_MESA_pixmap_colormap GLX_EXT_visual_info GLX_MESA_release_buffers GLX_MESA_copy_sub_buffer GLX_SGI_video_sync GLX_ARB_get_proc_address";
}
/* GLX 1.1 and later */
-const char *Fake_glXQueryExtensionsString( Display *dpy, int screen )
+static const char *
+Fake_glXQueryExtensionsString( Display *dpy, int screen )
{
(void) dpy;
(void) screen;
@@ -1449,10 +1493,12 @@ const char *Fake_glXQueryExtensionsString( Display *dpy, int screen )
/* GLX 1.1 and later */
-const char *Fake_glXQueryServerString( Display *dpy, int screen, int name )
+static const char *
+Fake_glXQueryServerString( Display *dpy, int screen, int name )
{
- static char *vendor = "Brian Paul";
- static char *version = "1.1 Mesa 3.1";
+ static char version[1000];
+ sprintf(version, "%d.%d %s", SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION,
+ MESA_GLX_VERSION);
(void) dpy;
(void) screen;
@@ -1461,7 +1507,7 @@ const char *Fake_glXQueryServerString( Display *dpy, int screen, int name )
case GLX_EXTENSIONS:
return get_extensions();
case GLX_VENDOR:
- return vendor;
+ return VENDOR;
case GLX_VERSION:
return version;
default:
@@ -1472,10 +1518,12 @@ const char *Fake_glXQueryServerString( Display *dpy, int screen, int name )
/* GLX 1.1 and later */
-const char *Fake_glXGetClientString( Display *dpy, int name )
+static const char *
+Fake_glXGetClientString( Display *dpy, int name )
{
- static char *vendor = "Brian Paul";
- static char *version = "1.1 Mesa 3.1";
+ static char version[1000];
+ sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION, CLIENT_MINOR_VERSION,
+ MESA_GLX_VERSION);
(void) dpy;
@@ -1483,7 +1531,7 @@ const char *Fake_glXGetClientString( Display *dpy, int name )
case GLX_EXTENSIONS:
return get_extensions();
case GLX_VENDOR:
- return vendor;
+ return VENDOR;
case GLX_VERSION:
return version;
default:
@@ -1494,10 +1542,164 @@ const char *Fake_glXGetClientString( Display *dpy, int name )
/*
+ * GLX 1.3 and later
+ */
+
+static GLXFBConfig
+Fake_glXChooseFBConfig( Display *dpy, int screen,
+ const int *attribList, int *nitems )
+{
+ (void) dpy;
+ (void) screen;
+ (void) attribList;
+ (void) nitems;
+ return 0;
+}
+
+
+static int
+Fake_glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
+ int attribute, int *value )
+{
+ (void) dpy;
+ (void) config;
+ (void) attribute;
+ (void) value;
+ return 0;
+}
+
+
+static XVisualInfo *
+Fake_glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config )
+{
+ (void) dpy;
+ (void) config;
+ return 0;
+}
+
+
+static GLXWindow
+Fake_glXCreateWindow( Display *dpy, GLXFBConfig config, Window win,
+ const int *attribList )
+{
+ (void) dpy;
+ (void) config;
+ (void) win;
+ (void) attribList;
+ return 0;
+}
+
+
+static void
+Fake_glXDestroyWindow( Display *dpy, GLXWindow window )
+{
+ (void) dpy;
+ (void) window;
+ return;
+}
+
+
+static GLXPixmap
+Fake_glXCreatePixmap( Display *dpy, GLXFBConfig config, Pixmap pixmap,
+ const int *attribList )
+{
+ (void) dpy;
+ (void) config;
+ (void) pixmap;
+ (void) attribList;
+ return 0;
+}
+
+
+static void
+Fake_glXDestroyPixmap( Display *dpy, GLXPixmap pixmap )
+{
+ (void) dpy;
+ (void) pixmap;
+ return;
+}
+
+
+static GLXPbuffer
+Fake_glXCreatePbuffer( Display *dpy, GLXFBConfig config,
+ const int *attribList )
+{
+ (void) dpy;
+ (void) config;
+ (void) attribList;
+ return 0;
+}
+
+
+static void
+Fake_glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf )
+{
+ (void) dpy;
+ (void) pbuf;
+}
+
+
+static void
+Fake_glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
+ unsigned int *value )
+{
+ (void) dpy;
+ (void) draw;
+ (void) attribute;
+ (void) value;
+}
+
+
+static GLXContext
+Fake_glXCreateNewContext( Display *dpy, GLXFBConfig config,
+ int renderType, GLXContext shareList, Bool direct )
+{
+ (void) dpy;
+ (void) config;
+ (void) renderType;
+ (void) shareList;
+ (void) direct;
+ return 0;
+}
+
+
+static int
+Fake_glXQueryContext( Display *dpy, GLXContext ctx, int attribute, int *value )
+{
+ (void) dpy;
+ (void) ctx;
+ (void) attribute;
+ (void) value;
+ return 0;
+}
+
+
+static void
+Fake_glXSelectEvent( Display *dpy, GLXDrawable drawable, unsigned long mask )
+{
+ (void) dpy;
+ (void) drawable;
+ (void) mask;
+}
+
+
+static void
+Fake_glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
+ unsigned long *mask )
+{
+ (void) dpy;
+ (void) drawable;
+ (void) mask;
+}
+
+
+
+/*
* Release the depth, stencil, accum buffers attached to a GLXDrawable
* (a window or pixmap) prior to destroying the GLXDrawable.
*/
-Bool Fake_glXReleaseBuffersMESA( Display *dpy, GLXDrawable d )
+static Bool
+Fake_glXReleaseBuffersMESA( Display *dpy, GLXDrawable d )
{
XMesaBuffer b = XMesaFindBuffer(dpy, d);
if (b) {
@@ -1511,44 +1713,121 @@ Bool Fake_glXReleaseBuffersMESA( Display *dpy, GLXDrawable d )
/*
* GLX_MESA_set_3dfx_mode
*/
-GLboolean Fake_glXSet3DfxModeMESA( GLint mode )
+static GLboolean
+Fake_glXSet3DfxModeMESA( GLint mode )
{
return XMesaSetFXmode( mode );
}
+/*
+ * GLX_SGI_video_sync
+ */
+
+#ifdef GLX_SGI_video_sync
-#if 0
-/*GLfunction Fake_glXGetProcAddress( const GLubyte *procName )*/
-void (*Fake_glXGetProcAddress( const GLubyte *procName ))()
+static int
+Fake_glXGetVideoSyncSGI(unsigned int *count)
{
- typedef void (*GLfunction)();
- struct proc {
- const char *name;
- GLfunction address;
- };
- static struct proc procTable[] = {
- { "glXGetProcAddressEXT", (GLfunction) glXGetProcAddressEXT },
- { "glXCreateGLXPixmapMESA", (GLfunction) glXCreateGLXPixmapMESA },
- { "glXReleaseBuffersMESA", (GLfunction) glXReleaseBuffersMESA },
- { "glXCopySubBufferMESA", (GLfunction) glXCopySubBufferMESA },
- { "glXSet3DfxModeMESA", (GLfunction) glXSet3DfxModeMESA },
- /* NOTE: GLX_SGI_video_sync not implemented in Mesa */
- { NULL, NULL } /* end of list token */
- };
- GLuint i;
-
- /* First, look for core library functions */
- GLfunction f = (GLfunction) gl_get_proc_address(procName);
- if (f)
- return f;
-
- /* Second, look for GLX funtion */
- for (i = 0; procTable[i].address; i++) {
- if (strcmp((const char *) procName, procTable[i].name) == 0)
- return (GLfunction) procTable[i].address;
- }
+ return 0;
+}
- return NULL;
+
+static int
+Fake_glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
+{
+ return 0;
}
+
+#endif
+
+
+
+extern void Fake_glXUseXFont( Font font, int first, int count, int listbase );
+
+
+struct _glxapi_table *_mesa_GetGLXDispatchTable(void)
+{
+ static struct _glxapi_table glx;
+
+ /* be sure our dispatch table size <= libGL's table */
+ {
+ int size = sizeof(struct _glxapi_table) / sizeof(void *);
+ (void) size;
+ assert(_glxapi_get_dispatch_table_size() >= size);
+ }
+
+ /* initialize the whole table to no-ops */
+ _glxapi_set_no_op_table(&glx);
+
+ /* now initialize the table with the functions I implement */
+ glx.ChooseVisual = Fake_glXChooseVisual;
+ glx.CopyContext = Fake_glXCopyContext;
+ glx.CreateContext = Fake_glXCreateContext;
+ glx.CreateGLXPixmap = Fake_glXCreateGLXPixmap;
+ glx.DestroyContext = Fake_glXDestroyContext;
+ glx.DestroyGLXPixmap = Fake_glXDestroyGLXPixmap;
+ glx.GetConfig = Fake_glXGetConfig;
+ /*glx.GetCurrentContext = Fake_glXGetCurrentContext;*/
+ /*glx.GetCurrentDrawable = Fake_glXGetCurrentDrawable;*/
+ glx.IsDirect = Fake_glXIsDirect;
+ glx.MakeCurrent = Fake_glXMakeCurrent;
+ glx.QueryExtension = Fake_glXQueryExtension;
+ glx.QueryVersion = Fake_glXQueryVersion;
+ glx.SwapBuffers = Fake_glXSwapBuffers;
+ glx.UseXFont = Fake_glXUseXFont;
+ glx.WaitGL = Fake_glXWaitGL;
+ glx.WaitX = Fake_glXWaitX;
+
+#ifdef _GLXAPI_VERSION_1_1
+ glx.GetClientString = Fake_glXGetClientString;
+ glx.QueryExtensionsString = Fake_glXQueryExtensionsString;
+ glx.QueryServerString = Fake_glXQueryServerString;
+#endif
+
+#ifdef _GLXAPI_VERSION_1_2
+ /*glx.GetCurrentDisplay = Fake_glXGetCurrentDisplay;*/
+#endif
+
+#ifdef _GLXAPI_VERSION_1_3
+ glx.ChooseFBConfig = Fake_glXChooseFBConfig;
+ glx.CreateNewContext = Fake_glXCreateNewContext;
+ glx.CreatePbuffer = Fake_glXCreatePbuffer;
+ glx.CreatePixmap = Fake_glXCreatePixmap;
+ glx.CreateWindow = Fake_glXCreateWindow;
+ glx.DestroyPbuffer = Fake_glXDestroyPbuffer;
+ glx.DestroyPixmap = Fake_glXDestroyPixmap;
+ glx.DestroyWindow = Fake_glXDestroyWindow;
+ /*glx.GetCurrentReadDrawable = Fake_glXGetCurrentReadDrawable;*/
+ glx.GetFBConfigAttrib = Fake_glXGetFBConfigAttrib;
+ glx.GetSelectedEvent = Fake_glXGetSelectedEvent;
+ glx.GetVisualFromFBConfig = Fake_glXGetVisualFromFBConfig;
+ glx.MakeContextCurrent = Fake_glXMakeContextCurrent;
+ glx.QueryContext = Fake_glXQueryContext;
+ glx.QueryDrawable = Fake_glXQueryDrawable;
+ glx.SelectEvent = Fake_glXSelectEvent;
+#endif
+
+#ifdef _GLXAPI_SGI_video_sync
+ glx.GetVideoSyncSGI = Fake_glXGetVideoSyncSGI;
+ glx.WaitVideoSyncSGI = Fake_glXWaitVideoSyncSGI;
#endif
+
+#ifdef _GLXAPI_MESA_copy_sub_buffer
+ glx.CopySubBufferMESA = Fake_glXCopySubBufferMESA;
+#endif
+
+#ifdef _GLXAPI_MESA_release_buffers
+ glx.ReleaseBuffersMESA = Fake_glXReleaseBuffersMESA;
+#endif
+
+#ifdef _GLXAPI_MESA_pixmap_colormap
+ glx.CreateGLXPixmapMESA = Fake_glXCreateGLXPixmapMESA;
+#endif
+
+#ifdef _GLXAPI_MESA_set_3dfx_mode
+ glx.Set3DfxModeMESA = Fake_glXSet3DfxModeMESA;
+#endif
+
+ return &glx;
+}
diff --git a/xc/extras/Mesa/src/X/glxapi.c b/xc/extras/Mesa/src/X/glxapi.c
index de04dd56c..7f4eeb3d1 100644
--- a/xc/extras/Mesa/src/X/glxapi.c
+++ b/xc/extras/Mesa/src/X/glxapi.c
@@ -1,8 +1,8 @@
-/* $Id: glxapi.c,v 1.1 1999/12/05 23:10:27 daryll Exp $ */
+/* $Id: glxapi.c,v 1.2 2000/01/30 00:27:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,407 +25,800 @@
*/
+/*
+ * This is the GLX API dispatcher. Calls to the glX* functions are
+ * either routed to real (SGI / Utah) GLX encoders or to Mesa's
+ * pseudo-GLX module.
+ */
+#include <assert.h>
+#include <stdlib.h>
+#include "glapi.h"
+#include "glxapi.h"
+
/*
- * GLX API functions which either call fake or real GLX implementations
- *
- * To enable real GLX encoding the REALGLX preprocessor symbol should be
- * defined on the command line.
+ * XXX - this really shouldn't be here.
+ * Instead, add -DUSE_MESA_GLX to the compiler flags when needed.
*/
+#define USE_MESA_GLX 1
+
+
+/* Rather than include possibly non-existant headers... */
+#ifdef USE_SGI_GLX
+extern struct _glxapi_table *_sgi_GetGLXDispatchtable(void);
+#endif
+#ifdef USE_UTAH_GLX
+extern struct _glxapi_table *_utah_GetGLXDispatchTable(void);
+#endif
+#ifdef USE_MESA_GLX
+extern struct _glxapi_table *_mesa_GetGLXDispatchTable(void);
+#endif
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
+struct display_dispatch {
+ Display *Dpy;
+ struct _glxapi_table *Table;
+ struct display_dispatch *Next;
+};
+
+static struct display_dispatch *DispatchList = NULL;
+
+
+static struct _glxapi_table *
+get_dispatch(Display *dpy)
+{
+ static Display *prevDisplay = NULL;
+ static struct _glxapi_table *prevTable = NULL;
+
+ if (!dpy)
+ return NULL;
+
+ /* try cached display */
+ if (dpy == prevDisplay) {
+ return prevTable;
+ }
+
+ /* search list of display/dispatch pairs for this display */
+ {
+ const struct display_dispatch *d = DispatchList;
+ while (d) {
+ if (d->Dpy == dpy) {
+ prevDisplay = dpy;
+ prevTable = d->Table;
+ return d->Table; /* done! */
+ }
+ d = d->Next;
+ }
+ }
+
+ /* A new display, determine if we should use real GLX (SGI / Utah)
+ * or Mesa's pseudo-GLX.
+ */
+ {
+ struct _glxapi_table *t = NULL;
+
+#if defined(USE_SGI_GLX) || defined(USE_UTAH_GLX)
+ if (!getenv("MESA_FORCE_SOFTX")) {
+ int ignore;
+ if (XQueryExtension( dpy, "GLX", &ignore, &ignore, &ignore )) {
+ /* the X server has the GLX extension */
+#if defined(USE_SGI_GLX)
+ t = _sgi_GetGLXDispatchtable();
+#elif defined(USE_UTAH_GLX)
+ t = _utah_GetGLXDispatchTable();
+#endif
+ }
+ }
+#endif
+
+#if defined(USE_MESA_GLX)
+ if (!t) {
+ t = _mesa_GetGLXDispatchTable();
+ assert(t); /* this has to work */
+ }
#endif
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include "GL/glx.h"
-#include "fakeglx.h"
-#include "realglx.h"
+ if (t) {
+ struct display_dispatch *d;
+ d = (struct display_dispatch *) malloc(sizeof(struct display_dispatch));
+ if (d) {
+ d->Dpy = dpy;
+ d->Table = t;
+ /* insert at head of list */
+ d->Next = DispatchList;
+ DispatchList = d;
+ /* update cache */
+ prevDisplay = dpy;
+ prevTable = t;
+ return t;
+ }
+ }
+ }
+
+ /* If we get here that means we can't use real GLX on this display
+ * and the Mesa pseudo-GLX software renderer wasn't compiled in.
+ * Or, we ran out of memory!
+ */
+ return NULL;
+}
+
-#ifdef REALGLX
+/* Set by glXMakeCurrent() and glXMakeContextCurrent() only */
static Display *CurrentDisplay = NULL;
-#endif
+static GLXContext CurrentContext = 0;
+static GLXDrawable CurrentDrawable = 0;
+static GLXDrawable CurrentReadDrawable = 0;
+
/*
- * This functions determines whether a call to a glX*() function should
- * be routed to the "fake" (Mesa) or "real" (GLX-encoder) functions.
- * Input: dpy - the X display.
- * Return: GL_TRUE if the given display supports the real GLX extension,
- * GL_FALSE otherwise.
+ * GLX API entrypoints
*/
-static GLboolean display_has_glx( Display *dpy )
+
+
+XVisualInfo *glXChooseVisual(Display *dpy, int screen, int *list)
{
- /* TODO: we should use a lookup table to avoid calling XQueryExtension
- * every time.
- */
- int ignore;
- if (XQueryExtension( dpy, "GLX", &ignore, &ignore, &ignore )) {
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return NULL;
+ return (t->ChooseVisual)(dpy, screen, list);
}
+void glXCopyContext(Display *dpy, GLXContext src, GLXContext dst, GLuint mask)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return;
+ (t->CopyContext)(dpy, src, dst, mask);
+}
+
-XVisualInfo *glXChooseVisual( Display *dpy, int screen, int *list )
+GLXContext glXCreateContext(Display *dpy, XVisualInfo *visinfo, GLXContext shareList, Bool direct)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
- return Real_glXChooseVisual( dpy, screen, list );
- else
-#endif
- return Fake_glXChooseVisual( dpy, screen, list );
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return 0;
+ return (t->CreateContext)(dpy, visinfo, shareList, direct);
}
+GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return 0;
+ return (t->CreateGLXPixmap)(dpy, visinfo, pixmap);
+}
-int glXGetConfig( Display *dpy, XVisualInfo *visinfo, int attrib, int *value )
+
+void glXDestroyContext(Display *dpy, GLXContext ctx)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
- return Real_glXGetConfig( dpy, visinfo, attrib, value );
- else
-#endif
- return Fake_glXGetConfig( dpy, visinfo, attrib, value );
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return;
+ (t->DestroyContext)(dpy, ctx);
}
+void glXDestroyGLXPixmap(Display *dpy, GLXPixmap pixmap)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return;
+ (t->DestroyGLXPixmap)(dpy, pixmap);
+}
+
-GLXContext glXCreateContext( Display *dpy, XVisualInfo *visinfo,
- GLXContext shareList, Bool direct )
+int glXGetConfig(Display *dpy, XVisualInfo *visinfo, int attrib, int *value)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
- return Real_glXCreateContext( dpy, visinfo, shareList, direct );
- else
-#endif
- return Fake_glXCreateContext( dpy, visinfo, shareList, direct );
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return GLX_NO_EXTENSION;
+ return (t->GetConfig)(dpy, visinfo, attrib, value);
}
+GLXContext glXGetCurrentContext(void)
+{
+ return CurrentContext;
+}
+
-void glXDestroyContext( Display *dpy, GLXContext ctx )
+GLXDrawable glXGetCurrentDrawable(void)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
- Real_glXDestroyContext( dpy, ctx );
- else
-#endif
- Fake_glXDestroyContext( dpy, ctx );
+ return CurrentDrawable;
}
+Bool glXIsDirect(Display *dpy, GLXContext ctx)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return False;
+ return (t->IsDirect)(dpy, ctx);
+}
+
-void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
- GLuint mask )
+Bool glXMakeCurrent(Display *dpy, GLXDrawable drawable, GLXContext ctx)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
- Real_glXCopyContext( dpy, src, dst, mask );
- else
-#endif
- Fake_glXCopyContext( dpy, src, dst, mask );
+ Bool b;
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return False;
+ b = (*t->MakeCurrent)(dpy, drawable, ctx);
+ if (b) {
+ CurrentDisplay = dpy;
+ CurrentContext = ctx;
+ CurrentDrawable = drawable;
+ CurrentReadDrawable = drawable;
+ }
+ return b;
}
+Bool glXQueryExtension(Display *dpy, int *errorb, int *event)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return False;
+ return (t->QueryExtension)(dpy, errorb, event);
+}
+
-Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx )
+Bool glXQueryVersion(Display *dpy, int *maj, int *min)
{
-#ifdef REALGLX
- if (display_has_glx(dpy)) {
- if (Real_glXMakeCurrent( dpy, drawable, ctx )) {
- CurrentDisplay = dpy;
- return True;
- }
- else {
- return False;
- }
- }
- else {
- if (Fake_glXMakeCurrent( dpy, drawable, ctx )) {
- CurrentDisplay = dpy;
- return True;
- }
- else {
- return False;
- }
- }
-#else
- return Fake_glXMakeCurrent( dpy, drawable, ctx );
-#endif
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return False;
+ return (t->QueryVersion)(dpy, maj, min);
}
+void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return;
+ (t->SwapBuffers)(dpy, drawable);
+}
-GLXContext glXGetCurrentContext( void )
+
+void glXUseXFont(Font font, int first, int count, int listBase)
{
-#ifdef REALGLX
- if (display_has_glx(CurrentDisplay))
- return Real_glXGetCurrentContext();
- else
-#endif
- return Fake_glXGetCurrentContext();
+ struct _glxapi_table *t = get_dispatch(CurrentDisplay);
+ if (!t)
+ return;
+ (t->UseXFont)(font, first, count, listBase);
}
+void glXWaitGL(void)
+{
+ struct _glxapi_table *t = get_dispatch(CurrentDisplay);
+ if (!t)
+ return;
+ (t->WaitGL)();
+}
-GLXDrawable glXGetCurrentDrawable( void )
+
+void glXWaitX(void)
{
-#ifdef REALGLX
- if (display_has_glx(CurrentDisplay))
- return Real_glXGetCurrentDrawable();
- else
-#endif
- return Fake_glXGetCurrentDrawable();
+ struct _glxapi_table *t = get_dispatch(CurrentDisplay);
+ if (!t)
+ return;
+ (t->WaitX)();
}
-GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visinfo,
- Pixmap pixmap )
+#ifdef _GLXAPI_VERSION_1_1
+
+const char *glXGetClientString(Display *dpy, int name)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
- return Real_glXCreateGLXPixmap( dpy, visinfo, pixmap );
- else
-#endif
- return Fake_glXCreateGLXPixmap( dpy, visinfo, pixmap );
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return NULL;
+ return (t->GetClientString)(dpy, name);
}
-void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap )
+const char *glXQueryExtensionsString(Display *dpy, int screen)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
- Real_glXDestroyGLXPixmap( dpy, pixmap );
- else
-#endif
- Fake_glXDestroyGLXPixmap( dpy, pixmap );
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return NULL;
+ return (t->QueryExtensionsString)(dpy, screen);
}
+const char *glXQueryServerString(Display *dpy, int screen, int name)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return NULL;
+ return (t->QueryServerString)(dpy, screen, name);
+}
+
+#endif
+
+
-Bool glXQueryExtension( Display *dpy, int *errorb, int *event )
+#ifdef _GLXAPI_VERSION_1_2
+Display *glXGetCurrentDisplay(void)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
- return Real_glXQueryExtension( dpy, errorb, event );
- else
+ return CurrentDisplay;
+}
#endif
- return Fake_glXQueryExtension( dpy, errorb, event );
+
+
+
+#ifdef _GLXAPI_VERSION_1_3
+
+GLXFBConfig glXChooseFBConfig(Display *dpy, int screen, const int *attribList, int *nitems)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return 0;
+ return (t->ChooseFBConfig)(dpy, screen, attribList, nitems);
}
+GLXContext glXCreateNewContext(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return 0;
+ return (t->CreateNewContext)(dpy, config, renderType, shareList, direct);
+}
+
-Bool glXIsDirect( Display *dpy, GLXContext ctx )
+GLXPbuffer glXCreatePbuffer(Display *dpy, GLXFBConfig config, const int *attribList)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
- return Real_glXIsDirect( dpy, ctx );
- else
-#endif
- return Fake_glXIsDirect( dpy, ctx );
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return 0;
+ return (t->CreatePbuffer)(dpy, config, attribList);
}
+GLXPixmap glXCreatePixmap(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return 0;
+ return (t->CreatePixmap)(dpy, config, pixmap, attribList);
+}
-void glXSwapBuffers( Display *dpy, GLXDrawable drawable )
+
+GLXWindow glXCreateWindow(Display *dpy, GLXFBConfig config, Window win, const int *attribList)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
- Real_glXSwapBuffers( dpy, drawable );
- else
-#endif
- Fake_glXSwapBuffers( dpy, drawable );
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return 0;
+ return (t->CreateWindow)(dpy, config, win, attribList);
}
+void glXDestroyPbuffer(Display *dpy, GLXPbuffer pbuf)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return;
+ (t->DestroyPbuffer)(dpy, pbuf);
+}
+
-void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
- int x, int y, int width, int height )
+void glXDestroyPixmap(Display *dpy, GLXPixmap pixmap)
{
-#ifdef REALGLX
- /* can't implement! */
- return;
-#endif
- Fake_glXCopySubBufferMESA( dpy, drawable, x, y, width, height );
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return;
+ (t->DestroyPixmap)(dpy, pixmap);
}
+void glXDestroyWindow(Display *dpy, GLXWindow window)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return;
+ (t->DestroyWindow)(dpy, window);
+}
-Bool glXQueryVersion( Display *dpy, int *maj, int *min )
+
+GLXDrawable glXGetCurrentReadDrawable(void)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
- return Real_glXQueryVersion( dpy, maj, min );
- else
-#endif
- return Fake_glXQueryVersion( dpy, maj, min );
+ return CurrentReadDrawable;
}
+int glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config, int attribute, int *value)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return GLX_NO_EXTENSION;
+ return (t->GetFBConfigAttrib)(dpy, config, attribute, value);
+}
+
-void glXUseXFont( Font font, int first, int count, int listBase )
+void glXGetSelectedEvent(Display *dpy, GLXDrawable drawable, unsigned long *mask)
{
-#ifdef REALGLX
- if (display_has_glx(CurrentDisplay))
- Real_glXUseXFont( font, first, count, listBase );
- else
-#endif
- Fake_glXUseXFont( font, first, count, listBase );
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return;
+ (t->GetSelectedEvent)(dpy, drawable, mask);
}
-void glXWaitGL( void )
+XVisualInfo *glXGetVisualFromFBConfig(Display *dpy, GLXFBConfig config)
{
-#ifdef REALGLX
- if (display_has_glx(CurrentDisplay))
- Real_glXWaitGL();
- else
-#endif
- Fake_glXWaitGL();
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return NULL;
+ return (t->GetVisualFromFBConfig)(dpy, config);
}
+Bool glXMakeContextCurrent(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ Bool b;
+ if (!t)
+ return False;
+ b = (t->MakeContextCurrent)(dpy, draw, read, ctx);
+ if (b) {
+ CurrentDisplay = dpy;
+ CurrentContext = ctx;
+ CurrentDrawable = draw;
+ CurrentReadDrawable = read;
+ }
+ return b;
+}
+
-void glXWaitX( void )
+int glXQueryContext(Display *dpy, GLXContext ctx, int attribute, int *value)
{
-#ifdef REALGLX
- if (display_has_glx(CurrentDisplay))
- Real_glXWaitX();
- else
-#endif
- Fake_glXWaitX();
+ struct _glxapi_table *t = get_dispatch(dpy);
+ assert(t);
+ if (!t)
+ return 0; /* XXX correct? */
+ return (t->QueryContext)(dpy, ctx, attribute, value);
}
+void glXQueryDrawable(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return;
+ (t->QueryDrawable)(dpy, draw, attribute, value);
+}
+
-/* GLX 1.1 and later */
-const char *glXQueryExtensionsString( Display *dpy, int screen )
+void glXSelectEvent(Display *dpy, GLXDrawable drawable, unsigned long mask)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
- return Real_glXQueryExtensionsString( dpy, screen );
- else
-#endif
- return Fake_glXQueryExtensionsString( dpy, screen );
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return;
+ (t->SelectEvent)(dpy, drawable, mask);
}
+#endif /* _GLXAPI_VERSION_1_3 */
+
+#ifdef _GLXAPI_EXT_import_context
-/* GLX 1.1 and later */
-const char *glXQueryServerString( Display *dpy, int screen, int name )
+void glXFreeContextEXT(Display *dpy, GLXContext context)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
- return Real_glXQueryServerString( dpy, screen, name );
- else
-#endif
- return Fake_glXQueryServerString( dpy, screen, name );
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return;
+ (t->FreeContextEXT)(dpy, context);
}
+GLXContextID glXGetContextIDEXT(const GLXContext context)
+{
+ /* XXX is this function right? */
+ struct _glxapi_table *t = get_dispatch(CurrentDisplay);
+ if (!t)
+ return 0;
+ return (t->GetContextIDEXT)(context);
+}
+
+
+Display *glXGetCurrentDisplayEXT(void)
+{
+ return CurrentDisplay;
+}
-/* GLX 1.1 and later */
-const char *glXGetClientString( Display *dpy, int name )
+
+GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
- return Real_glXGetClientString( dpy, name );
- else
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return 0;
+ return (t->ImportContextEXT)(dpy, contextID);
+}
+
+int glXQueryContextInfoEXT(Display *dpy, GLXContext context, int attribute,int *value)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return 0; /* XXX ok? */
+ return (t->QueryContextInfoEXT)(dpy, context, attribute, value);
+}
+
#endif
- return Fake_glXGetClientString( dpy, name );
+
+
+#ifdef _GLXAPI_SGI_video_sync
+
+int glXGetVideoSyncSGI(unsigned int *count)
+{
+ struct _glxapi_table *t = get_dispatch(CurrentDisplay);
+ if (!t)
+ return 0;
+ return (t->GetVideoSyncSGI)(count);
}
+int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
+{
+ struct _glxapi_table *t = get_dispatch(CurrentDisplay);
+ if (!t)
+ return 0;
+ return (t->WaitVideoSyncSGI)(divisor, remainder, count);
+}
+
+#endif
-#ifdef GLX_MESA_release_buffers
-Bool glXReleaseBuffersMESA( Display *dpy, Window w )
+
+#ifdef _GLXAPI_MESA_copy_sub_buffer
+
+void glXCopySubBufferMESA(Display *dpy, GLXDrawable drawable, int x, int y, int width, int height)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
- return GL_FALSE;
- else
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return;
+ (t->CopySubBufferMESA)(dpy, drawable, x, y, width, height);
+}
+
#endif
- return Fake_glXReleaseBuffersMESA( dpy, w );
+
+
+#ifdef _GLXAPI_MESA_release_buffers
+
+Bool glXReleaseBuffersMESA(Display *dpy, Window w)
+{
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
+ return False;
+ return (t->ReleaseBuffersMESA)(dpy, w);
}
+
#endif
-#ifdef GLX_MESA_pixmap_colormap
-GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visinfo,
- Pixmap pixmap, Colormap cmap )
+#ifdef _GLXAPI_MESA_pixmap_colormap
+
+GLXPixmap glXCreateGLXPixmapMESA(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap, Colormap cmap)
{
-#ifdef REALGLX
- if (display_has_glx(dpy))
+ struct _glxapi_table *t = get_dispatch(dpy);
+ if (!t)
return 0;
- else
+ return (t->CreateGLXPixmapMESA)(dpy, visinfo, pixmap, cmap);
+}
+
#endif
- return Fake_glXCreateGLXPixmapMESA( dpy, visinfo, pixmap, cmap );
+
+
+#ifdef _GLXAPI_MESA_set_3dfx_mode
+
+GLboolean glXSet3DfxModeMESA(GLint mode)
+{
+ struct _glxapi_table *t = get_dispatch(CurrentDisplay);
+ if (!t)
+ return False;
+ return (t->Set3DfxModeMESA)(mode);
}
+
#endif
-#ifdef GLX_SGI_video_sync
+/**********************************************************************/
+/* GLX API management functions */
+/**********************************************************************/
+
+
+const char *
+_glxapi_get_version(void)
+{
+ return "1.3";
+}
+
/*
- * This function doesn't really do anything. But, at least one
- * application uses the function so this stub is useful.
+ * Return array of extension strings.
*/
-int glXGetVideoSyncSGI(unsigned int *count)
+const char **
+_glxapi_get_extensions(void)
{
- static unsigned int counter = 0;
- *count = counter++;
- return 0;
+ static const char *extensions[] = {
+#ifdef _GLXAPI_EXT_import_context
+ "GLX_EXT_import_context",
+#endif
+#ifdef _GLXAPI_SGI_video_sync
+ "GLX_SGI_video_sync",
+#endif
+#ifdef _GLXAPI_MESA_copy_sub_buffer
+ "GLX_MESA_copy_sub_buffer",
+#endif
+#ifdef _GLXAPI_MESA_release_buffers
+ "GLX_MESA_release_buffers",
+#endif
+#ifdef _GLXAPI_MESA_pixmap_colormap
+ "GLX_MESA_pixmap_colormap",
+#endif
+#ifdef _GLXAPI_MESA_set_3dfx_mode
+ "GLX_MESA_set_3dfx_mode",
+#endif
+ NULL
+ };
+ return extensions;
}
/*
- * Again, this is really just a stub function.
+ * Return size of the GLX dispatch table, in entries, not bytes.
*/
-int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
+GLuint
+_glxapi_get_dispatch_table_size(void)
+{
+ return sizeof(struct _glxapi_table) / sizeof(void *);
+}
+
+
+static int
+generic_no_op_func(void)
{
- static unsigned int counter = 0;
- while (counter % divisor != remainder)
- counter++;
- *count = counter;
return 0;
}
+
+/*
+ * Initialize all functions in given dispatch table to be no-ops
+ */
+void
+_glxapi_set_no_op_table(struct _glxapi_table *t)
+{
+ GLuint n = _glxapi_get_dispatch_table_size();
+ GLuint i;
+ void **dispatch = (void **) t;
+ for (i = 0; i < n; i++) {
+ dispatch[i] = (void *) generic_no_op_func;
+ }
+}
+
+
+
+struct name_address_pair {
+ const char *Name;
+ GLvoid *Address;
+};
+
+static struct name_address_pair GLX_functions[] = {
+ { "glXChooseVisual", (GLvoid *) glXChooseVisual },
+ { "glXCopyContext", (GLvoid *) glXCopyContext },
+ { "glXCreateContext", (GLvoid *) glXCreateContext },
+ { "glXCreateGLXPixmap", (GLvoid *) glXCreateGLXPixmap },
+ { "glXDestroyContext", (GLvoid *) glXDestroyContext },
+ { "glXDestroyGLXPixmap", (GLvoid *) glXDestroyGLXPixmap },
+ { "glXGetConfig", (GLvoid *) glXGetConfig },
+ { "glXGetCurrentContext", (GLvoid *) glXGetCurrentContext },
+ { "glXGetCurrentDrawable", (GLvoid *) glXGetCurrentDrawable },
+ { "glXIsDirect", (GLvoid *) glXIsDirect },
+ { "glXMakeCurrent", (GLvoid *) glXMakeCurrent },
+ { "glXQueryExtension", (GLvoid *) glXQueryExtension },
+ { "glXQueryVersion", (GLvoid *) glXQueryVersion },
+ { "glXSwapBuffers", (GLvoid *) glXSwapBuffers },
+ { "glXUseXFont", (GLvoid *) glXUseXFont },
+ { "glXWaitGL", (GLvoid *) glXWaitGL },
+ { "glXWaitX", (GLvoid *) glXWaitX },
+
+#ifdef _GLXAPI_VERSION_1_1
+ { "glXGetClientString", (GLvoid *) glXGetClientString },
+ { "glXQueryExtensionsString", (GLvoid *) glXQueryExtensionsString },
+ { "glXQueryServerString", (GLvoid *) glXQueryServerString },
#endif
+#ifdef _GLXAPI_VERSION_1_2
+ { "glXGetCurrentDisplay", (GLvoid *) glXGetCurrentDisplay },
+#endif
+#ifdef _GLXAPI_VERSION_1_3
+ { "glXChooseFBConfig", (GLvoid *) glXChooseFBConfig },
+ { "glXCreateNewContext", (GLvoid *) glXCreateNewContext },
+ { "glXCreatePbuffer", (GLvoid *) glXCreatePbuffer },
+ { "glXCreatePixmap", (GLvoid *) glXCreatePixmap },
+ { "glXCreateWindow", (GLvoid *) glXCreateWindow },
+ { "glXDestroyPbuffer", (GLvoid *) glXDestroyPbuffer },
+ { "glXDestroyPixmap", (GLvoid *) glXDestroyPixmap },
+ { "glXDestroyWindow", (GLvoid *) glXDestroyWindow },
+ { "glXGetCurrentReadDrawable", (GLvoid *) glXGetCurrentReadDrawable },
+ { "glXGetFBConfigAttrib", (GLvoid *) glXGetFBConfigAttrib },
+ { "glXGetSelectedEvent", (GLvoid *) glXGetSelectedEvent },
+ { "glXGetVisualFromFBConfig", (GLvoid *) glXGetVisualFromFBConfig },
+ { "glXMakeContextCurrent", (GLvoid *) glXMakeContextCurrent },
+ { "glXQueryContext", (GLvoid *) glXQueryContext },
+ { "glXQueryDrawable", (GLvoid *) glXQueryDrawable },
+ { "glXSelectEvent", (GLvoid *) glXSelectEvent },
+#endif
-#ifdef GLX_MESA_set_3dfx_mode
-GLboolean glXSet3DfxModeMESA( GLint mode )
-{
-#ifdef REALGLX
- return GL_FALSE;
-#else
- return Fake_glXSet3DfxModeMESA( mode );
+#ifdef _GLXAPI_SGI_video_sync
+ { "glXGetVideoSyncSGI", (GLvoid *) glXGetVideoSyncSGI },
+ { "glXWaitVideoSyncSGI", (GLvoid *) glXWaitVideoSyncSGI },
#endif
-}
+
+#ifdef _GLXAPI_MESA_copy_sub_buffer
+ { "glXCopySubBufferMESA", (GLvoid *) glXCopySubBufferMESA },
+#endif
+
+#ifdef _GLXAPI_MESA_release_buffers
+ { "glXReleaseBuffersMESA", (GLvoid *) glXReleaseBuffersMESA },
#endif
+#ifdef _GLXAPI_MESA_pixmap_colormap
+ { "glXCreateGLXPixmapMESA", (GLvoid *) glXCreateGLXPixmapMESA },
+#endif
+
+#ifdef _GLXAPI_MESA_set_3dfx_mode
+ { "glXSet3DfxModeMESA", (GLvoid *) glXSet3DfxModeMESA },
+#endif
+
+ { "glXGetProcAddressARB", (GLvoid *) glXGetProcAddressARB },
+ { NULL, NULL } /* end of list */
+};
-#if 0 /* spec for this not finalized yet */
-void (*glXGetProcAddressEXT( const GLubyte *procName ))()
+
+
+/*
+ * Return address of named glX function, or NULL if not found.
+ */
+const GLvoid *
+_glxapi_get_proc_address(const char *funcName)
{
-#ifdef REALGLX
+ GLuint i;
+ for (i = 0; GLX_functions[i].Name; i++) {
+ if (strcmp(GLX_functions[i].Name, funcName) == 0)
+ return GLX_functions[i].Address;
+ }
return NULL;
-#else
- return Fake_glXGetProcAddress( procName );
-#endif
}
-#endif
+
+
+
+/*
+ * This function does not get dispatched through the dispatch table
+ * since it's really a "meta" function.
+ */
+void (*glXGetProcAddressARB(const GLubyte *procName))()
+{
+ typedef void (*gl_function)();
+ gl_function f;
+
+ f = (gl_function) _glxapi_get_proc_address((const char *) procName);
+ if (f) {
+ return f;
+ }
+
+ f = (gl_function) _glapi_get_proc_address((const char *) procName);
+ return f;
+}
diff --git a/xc/extras/Mesa/src/X/glxapi.h b/xc/extras/Mesa/src/X/glxapi.h
new file mode 100644
index 000000000..893a70683
--- /dev/null
+++ b/xc/extras/Mesa/src/X/glxapi.h
@@ -0,0 +1,162 @@
+/* $Id: glxapi.h,v 1.2 2000/01/30 00:27:03 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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 _glxapi_h_
+#define _glxapi_h_
+
+
+#include "GL/glx.h"
+
+
+#define _GLXAPI_VERSION_1_1 1
+#define _GLXAPI_VERSION_1_2 1
+#define _GLXAPI_VERSION_1_3 1
+
+#define _GLXAPI_EXT_import_context 1
+#define _GLXAPI_SGI_video_sync 1
+#define _GLXAPI_MESA_copy_sub_buffer 1
+#define _GLXAPI_MESA_release_buffers 1
+#define _GLXAPI_MESA_pixmap_colormap 1
+#define _GLXAPI_MESA_set_3dfx_mode 1
+
+
+/*
+ * Almost all the GLX API functions get routed through this dispatch table.
+ * The exceptions are the glXGetCurrentXXX() functions.
+ *
+ * This dispatch table allows multiple GLX client-side modules to coexist.
+ * Specifically, a real GLX library (like SGI's or the Utah GLX) and Mesa's
+ * pseudo-GLX can be present at the same time. The former being used on
+ * GLX-enabled X servers and the later on non-GLX X servers.
+ */
+struct _glxapi_table {
+ /* GLX 1.0 functions */
+ XVisualInfo *(*ChooseVisual)(Display *dpy, int screen, int *list);
+ void (*CopyContext)(Display *dpy, GLXContext src, GLXContext dst, GLuint mask);
+ GLXContext (*CreateContext)(Display *dpy, XVisualInfo *visinfo, GLXContext shareList, Bool direct);
+ GLXPixmap (*CreateGLXPixmap)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap);
+ void (*DestroyContext)(Display *dpy, GLXContext ctx);
+ void (*DestroyGLXPixmap)(Display *dpy, GLXPixmap pixmap);
+ int (*GetConfig)(Display *dpy, XVisualInfo *visinfo, int attrib, int *value);
+ /*GLXContext (*GetCurrentContext)(void);*/
+ /*GLXDrawable (*GetCurrentDrawable)(void);*/
+ Bool (*IsDirect)(Display *dpy, GLXContext ctx);
+ Bool (*MakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx);
+ Bool (*QueryExtension)(Display *dpy, int *errorb, int *event);
+ Bool (*QueryVersion)(Display *dpy, int *maj, int *min);
+ void (*SwapBuffers)(Display *dpy, GLXDrawable drawable);
+ void (*UseXFont)(Font font, int first, int count, int listBase);
+ void (*WaitGL)(void);
+ void (*WaitX)(void);
+
+#ifdef _GLXAPI_VERSION_1_1
+ const char *(*GetClientString)(Display *dpy, int name);
+ const char *(*QueryExtensionsString)(Display *dpy, int screen);
+ const char *(*QueryServerString)(Display *dpy, int screen, int name);
+#endif
+
+#ifdef _GLXAPI_VERSION_1_2
+ /*Display *(*GetCurrentDisplay)(void);*/
+#endif
+
+#ifdef _GLXAPI_VERSION_1_3
+ GLXFBConfig (*ChooseFBConfig)(Display *dpy, int screen, const int *attribList, int *nitems);
+ GLXContext (*CreateNewContext)(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct);
+ GLXPbuffer (*CreatePbuffer)(Display *dpy, GLXFBConfig config, const int *attribList);
+ GLXPixmap (*CreatePixmap)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList);
+ GLXWindow (*CreateWindow)(Display *dpy, GLXFBConfig config, Window win, const int *attribList);
+ void (*DestroyPbuffer)(Display *dpy, GLXPbuffer pbuf);
+ void (*DestroyPixmap)(Display *dpy, GLXPixmap pixmap);
+ void (*DestroyWindow)(Display *dpy, GLXWindow window);
+ /*GLXDrawable (*GetCurrentReadDrawable)(void);*/
+ int (*GetFBConfigAttrib)(Display *dpy, GLXFBConfig config, int attribute, int *value);
+ void (*GetSelectedEvent)(Display *dpy, GLXDrawable drawable, unsigned long *mask);
+ XVisualInfo *(*GetVisualFromFBConfig)(Display *dpy, GLXFBConfig config);
+ Bool (*MakeContextCurrent)(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+ int (*QueryContext)(Display *dpy, GLXContext ctx, int attribute, int *value);
+ void (*QueryDrawable)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+ void (*SelectEvent)(Display *dpy, GLXDrawable drawable, unsigned long mask);
+#endif
+
+#ifdef _GLXAPI_EXT_import_context
+ void (*FreeContextEXT)(Display *dpy, GLXContext context);
+ GLXContextID (*GetContextIDEXT)(const GLXContext context);
+ Display *(*GetCurrentDisplayEXT)(void);
+ GLXContext (*ImportContextEXT)(Display *dpy, GLXContextID contextID);
+ int (*QueryContextInfoEXT)(Display *dpy, GLXContext context, int attribute,int *value);
+#endif
+
+#ifdef _GLXAPI_SGI_video_sync
+ int (*GetVideoSyncSGI)(unsigned int *count);
+ int (*WaitVideoSyncSGI)(int divisor, int remainder, unsigned int *count);
+#endif
+
+ /*
+ * XXX thesa Mesa-specific functions might not belong here
+ */
+
+#ifdef _GLXAPI_MESA_copy_sub_buffer
+ void (*CopySubBufferMESA)(Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
+#endif
+
+#ifdef _GLXAPI_MESA_release_buffers
+ Bool (*ReleaseBuffersMESA)(Display *dpy, Window w);
+#endif
+
+#ifdef _GLXAPI_MESA_pixmap_colormap
+ GLXPixmap (*CreateGLXPixmapMESA)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap, Colormap cmap);
+#endif
+
+#ifdef _GLXAPI_MESA_set_3dfx_mode
+ GLboolean (*Set3DfxModeMESA)(GLint mode);
+#endif
+
+};
+
+
+
+extern const char *
+_glxapi_get_version(void);
+
+
+extern const char **
+_glxapi_get_extensions(void);
+
+
+extern GLuint
+_glxapi_get_dispatch_table_size(void);
+
+
+extern void
+_glxapi_set_no_op_table(struct _glxapi_table *t);
+
+
+extern const GLvoid *
+_glxapi_get_proc_address(const char *funcName);
+
+
+#endif
diff --git a/xc/extras/Mesa/src/X/glxheader.h b/xc/extras/Mesa/src/X/glxheader.h
new file mode 100644
index 000000000..74e9c0e9b
--- /dev/null
+++ b/xc/extras/Mesa/src/X/glxheader.h
@@ -0,0 +1,71 @@
+/* $Id: glxheader.h,v 1.2 2000/01/30 00:27:03 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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 GLX_HEADER_H
+#define GLX_HEADER_H
+
+
+#ifdef HAVE_CONFIG_H
+#include "conf.h"
+#endif
+
+
+#include "glheader.h"
+
+
+#ifdef XFree86Server
+
+# include "resource.h"
+# include "windowstr.h"
+# include "gcstruct.h"
+# include "GL/xf86glx.h"
+# include "xf86glx_util.h"
+
+#else
+
+# ifdef GLX_DIRECT_RENDERING
+# include "dri_mesaint.h"
+# endif
+# include <X11/Xlib.h>
+# include <X11/Xutil.h>
+# ifdef USE_XSHM /* was SHM */
+# include <sys/ipc.h>
+# include <sys/shm.h>
+# include <X11/extensions/XShm.h>
+# endif
+
+#endif
+
+
+
+/* this silences a compiler warning on several systems */
+struct timespec;
+struct itimerspec;
+
+
+
+#endif /*GLX_HEADER*/
diff --git a/xc/extras/Mesa/src/X/xfonts.c b/xc/extras/Mesa/src/X/xfonts.c
index c21ce68a3..5e6542c23 100644
--- a/xc/extras/Mesa/src/X/xfonts.c
+++ b/xc/extras/Mesa/src/X/xfonts.c
@@ -1,8 +1,8 @@
-/* $Id: xfonts.c,v 1.1 1999/12/05 23:10:27 daryll Exp $ */
+/* $Id: xfonts.c,v 1.2 2000/01/30 00:27:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -43,8 +43,7 @@
#include "GL/glx.h"
#include "GL/xmesa.h"
#include "context.h"
-#include "fakeglx.h"
-#include "macros.h"
+#include "mem.h"
#include "xmesaP.h"
/* Some debugging info. */
@@ -338,7 +337,8 @@ void Fake_glXUseXFont( Font font, int first, int count, int listbase )
width = ch->rbearing - ch->lbearing;
height = ch->ascent + ch->descent;
x0 = - ch->lbearing;
- y0 = ch->descent - 1;
+ y0 = ch->descent - 0; /* XXX used to subtract 1 here */
+ /* but that caused a conformace failure */
dx = ch->width;
dy = 0;
diff --git a/xc/extras/Mesa/src/X/xmesa1.c b/xc/extras/Mesa/src/X/xmesa1.c
index 8f0f9798d..07951ac00 100644
--- a/xc/extras/Mesa/src/X/xmesa1.c
+++ b/xc/extras/Mesa/src/X/xmesa1.c
@@ -1,10 +1,10 @@
-/* $Id: xmesa1.c,v 1.1 1999/12/05 23:10:27 daryll Exp $ */
+/* $Id: xmesa1.c,v 1.2 2000/01/30 00:27:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,7 +25,6 @@
*/
-
/*
* Mesa/X11 interface, part 1.
*
@@ -39,10 +38,10 @@
* corner of the window. Therefore, most drawing functions in this
* file have to flip Y coordinates.
*
- * Define SHM in the Makefile with -DSHM if you want to compile in support
- * for the MIT Shared Memory extension. If enabled, when you use an Ximage
- * for the back buffer in double buffered mode, the "swap" operation will
- * be faster. You must also link with -lXext.
+ * Define USE_XSHM in the Makefile with -DUSE_XSHM if you want to compile
+ * in support for the MIT Shared Memory extension. If enabled, when you
+ * use an Ximage for the back buffer in double buffered mode, the "swap"
+ * operation will be faster. You must also link with -lXext.
*
* Byte swapping: If the Mesa host and the X display use a different
* byte order then there's some trickiness to be aware of when using
@@ -60,44 +59,17 @@
* the clear pixel value if needed.
*
*/
-/* $XFree86: xc/lib/GL/mesa/src/X/xmesa1.c,v 1.4 1999/06/27 14:07:27 dawes Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-#ifndef XFree86Server
-# include <assert.h>
-# include <ctype.h>
-# include <math.h>
-# include <stdio.h>
-# include <stdlib.h>
-# include <string.h>
-# include <X11/Xlib.h>
-# include <X11/Xutil.h>
-# ifdef SHM
-# include <sys/ipc.h>
-# include <sys/shm.h>
-# include <X11/extensions/XShm.h>
-# endif
-#endif
+#include "glxheader.h"
#include "GL/xmesa.h"
#include "xmesaP.h"
#include "context.h"
-#include "macros.h"
#include "matrix.h"
+#include "mem.h"
#include "types.h"
-#ifdef XFree86Server
-# include "resource.h"
-# include "windowstr.h"
-# include "gcstruct.h"
-# include "GL/xf86glx.h"
-# include "xf86glx_util.h"
-#else
-# ifdef GLX_DIRECT_RENDERING
-# include "dri_mesaint.h"
-# endif
+#ifdef HAVE_CONFIG_H
+#include "conf.h"
#endif
@@ -222,7 +194,7 @@ static int mesaHandleXError( XMesaDisplay *dpy, XErrorEvent *event )
#ifndef XFree86Server
static int check_for_xshm( XMesaDisplay *display )
{
-#ifdef SHM
+#ifdef USE_XSHM
int major, minor, ignore;
Bool pixmaps;
@@ -470,7 +442,7 @@ static int bitcount( unsigned long n )
#ifndef XFree86Server
static GLboolean alloc_shm_back_buffer( XMesaBuffer b )
{
-#ifdef SHM
+#ifdef USE_XSHM
/*
* We have to do a _lot_ of error checking here to be sure we can
* really use the XSHM extension. It seems different servers trigger
@@ -575,7 +547,7 @@ void xmesa_alloc_back_buffer( XMesaBuffer b )
if (b->db_state==BACK_XIMAGE) {
/* Deallocate the old backimage, if any */
if (b->backimage) {
-#if defined(SHM) && !defined(XFree86Server)
+#if defined(USE_XSHM) && !defined(XFree86Server)
if (b->shm) {
XShmDetach( b->xm_visual->display, &b->shminfo );
XDestroyImage( b->backimage );
@@ -664,7 +636,11 @@ noFaultXAllocColor( int client,
Pixel *ppixIn;
xrgb *ctable;
#else
- XMesaColor *ctable;
+ /* we'll try to cache ctable for better remote display performance */
+ static Display *prevDisplay = NULL;
+ static XMesaColormap prevCmap = 0;
+ static int prevCmapSize = 0;
+ static XMesaColor *ctable = NULL;
#endif
XMesaColor subColor;
int i, bestmatch;
@@ -698,11 +674,22 @@ noFaultXAllocColor( int client,
}
QueryColors(cmap, cmapSize, ppixIn, ctable);
#else
- ctable = (XMesaColor *) MALLOC(cmapSize * sizeof(XMesaColor));
- for (i = 0; i < cmapSize; i++) {
- ctable[i].pixel = i;
+ if (prevDisplay != dpy || prevCmap != cmap
+ || prevCmapSize != cmapSize || !ctable) {
+ /* free previously cached color table */
+ if (ctable)
+ FREE(ctable);
+ /* Get the color table from X */
+ ctable = (XMesaColor *) MALLOC(cmapSize * sizeof(XMesaColor));
+ assert(ctable);
+ for (i = 0; i < cmapSize; i++) {
+ ctable[i].pixel = i;
+ }
+ XQueryColors(dpy, cmap, ctable, cmapSize);
+ prevDisplay = dpy;
+ prevCmap = cmap;
+ prevCmapSize = cmapSize;
}
- XQueryColors(dpy, cmap, ctable, cmapSize);
#endif
/* Find best match. */
@@ -748,14 +735,18 @@ noFaultXAllocColor( int client,
}
#ifdef XFree86Server
FREE(ppixIn);
-#endif
FREE(ctable);
+#else
+ /* don't free table, save it for next time */
+#endif
+
*color = subColor;
*exact = 0;
}
+
/*
* Do setup for PF_GRAYSCALE pixel format.
* Note that buffer may be NULL.
@@ -960,16 +951,15 @@ static void setup_8bit_hpcr( XMesaVisual v )
/* which method should I use to clear */
/* GL_FALSE: keep the ordinary method */
/* GL_TRUE : clear with dither pattern */
- v->hpcr_clear_flag =
- (NULL!=getenv("MESA_HPCR_CLEAR")) ? GL_TRUE : GL_FALSE;
+ v->hpcr_clear_flag = getenv("MESA_HPCR_CLEAR") ? GL_TRUE : GL_FALSE;
- if (v->hpcr_clear_flag)
- {
- v->hpcr_clear_pixmap =
- XMesaCreatePixmap(v->display, DefaultRootWindow(v->display), 16, 2, 8);
+ if (v->hpcr_clear_flag) {
+ v->hpcr_clear_pixmap = XMesaCreatePixmap(v->display,
+ DefaultRootWindow(v->display),
+ 16, 2, 8);
#ifndef XFree86Server
- v->hpcr_clear_ximage =
- XGetImage(v->display, v->hpcr_clear_pixmap, 0, 0, 16, 2, AllPlanes, ZPixmap);
+ v->hpcr_clear_ximage = XGetImage(v->display, v->hpcr_clear_pixmap,
+ 0, 0, 16, 2, AllPlanes, ZPixmap);
#endif
}
}
@@ -1203,18 +1193,22 @@ static GLboolean initialize_visual_and_buffer( int client,
}
+ /* Save true bits/pixel */
+ v->BitsPerPixel = GET_BITS_PER_PIXEL(v);
+ assert(v->BitsPerPixel > 0);
+
/*
* If MESA_INFO env var is set print out some debugging info
* which can help Brian figure out what's going on when a user
* reports bugs.
*/
if (getenv("MESA_INFO")) {
- printf("v = %p\n", v);
- printf("dithered pf = %u\n", v->dithered_pf);
- printf("undithered pf = %u\n", v->undithered_pf);
- printf("level = %d\n", v->level);
- printf("depth = %d\n", GET_VISUAL_DEPTH(v));
- printf("bits per pixel = %d\n", GET_BITS_PER_PIXEL(v));
+ fprintf(stderr, "X/Mesa visual = %p\n", v);
+ fprintf(stderr, "X/Mesa dithered pf = %u\n", v->dithered_pf);
+ fprintf(stderr, "X/Mesa undithered pf = %u\n", v->undithered_pf);
+ fprintf(stderr, "X/Mesa level = %d\n", v->level);
+ fprintf(stderr, "X/Mesa depth = %d\n", GET_VISUAL_DEPTH(v));
+ fprintf(stderr, "X/Mesa bits per pixel = %d\n", GET_BITS_PER_PIXEL(v));
}
if (b && window) {
@@ -1718,7 +1712,11 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v,
b->db_state = 0;
}
- b->gl_buffer = gl_create_framebuffer( v->gl_visual );
+ b->gl_buffer = gl_create_framebuffer( v->gl_visual,
+ v->gl_visual->DepthBits > 0,
+ v->gl_visual->StencilBits > 0,
+ v->gl_visual->AccumBits > 0,
+ v->gl_visual->AlphaBits > 0 );
if (!b->gl_buffer) {
free_xmesa_buffer(client, b);
return NULL;
@@ -1783,8 +1781,8 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v,
b->FXisHackUsable = GL_FALSE;
b->FXwindowHack = GL_FALSE;
}
-/* printf("voodoo %d, wid %d height %d hack: usable %d active %d\n", */
-/* hw, b->width, b->height, b->FXisHackUsable, b->FXwindowHack); */
+ fprintf(stderr, "voodoo %d, wid %d height %d hack: usable %d active %d\n",
+ hw, b->width, b->height, b->FXisHackUsable, b->FXwindowHack);
}
} else {
fprintf(stderr,"WARNING: This Mesa Library includes the Glide driver but\n");
@@ -1857,7 +1855,11 @@ XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v,
b->db_state = 0;
}
- b->gl_buffer = gl_create_framebuffer( v->gl_visual );
+ b->gl_buffer = gl_create_framebuffer( v->gl_visual,
+ v->gl_visual->DepthBits > 0,
+ v->gl_visual->StencilBits > 0,
+ v->gl_visual->AccumBits > 0,
+ v->gl_visual->AlphaBits > 0 );
if (!b->gl_buffer) {
free_xmesa_buffer(client, b);
return NULL;
@@ -1896,7 +1898,7 @@ void XMesaDestroyBuffer( XMesaBuffer b )
if (b->cleargc) XMesaFreeGC( b->xm_visual->display, b->cleargc );
if (b->backimage) {
-#if defined(SHM) && !defined(XFree86Server)
+#if defined(USE_XSHM) && !defined(XFree86Server)
if (b->shm) {
XShmDetach( b->xm_visual->display, &b->shminfo );
XDestroyImage( b->backimage );
@@ -1934,26 +1936,42 @@ void XMesaDestroyBuffer( XMesaBuffer b )
*/
GLboolean XMesaMakeCurrent( XMesaContext c, XMesaBuffer b )
{
- if ((c && !b) || (!c && b)) {
- return GL_FALSE;
- }
+ return XMesaMakeCurrent2( c, b, b );
+}
+
+/*
+ * Bind buffer b to context c and make c the current rendering context.
+ */
+GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
+ XMesaBuffer readBuffer )
+{
if (c) {
+ if (!drawBuffer || !readBuffer)
+ return GL_FALSE; /* must specify buffers! */
+
#ifdef FX
- if (b->FXctx) {
- fxMesaMakeCurrent(b->FXctx);
+ if (drawBuffer->FXctx) {
+ fxMesaMakeCurrent(drawBuffer->FXctx);
XMesa = c;
- /* Disassociate old buffer with this context */
- if (c->xm_buffer)
- c->xm_buffer->xm_context = NULL;
- b->xm_context = c; /* Associate the context with this buffer */
+ /* Disassociate old buffer from this context */
+ if (c->xm_buffer)
+ c->xm_buffer->xm_context = NULL;
+
+ /* Associate the context with this buffer */
+ drawBuffer->xm_context = c;
+
+ c->xm_buffer = drawBuffer;
+ c->xm_read_buffer = readBuffer;
+ c->use_read_buffer = (drawBuffer != readBuffer);
- c->xm_buffer = b;
return GL_TRUE;
}
#endif
- if (c->gl_ctx == gl_get_current_context() && c->xm_buffer == b
+ if (c->gl_ctx == gl_get_current_context()
+ && c->xm_buffer == drawBuffer
+ && c->xm_read_buffer == readBuffer
&& c->xm_buffer->wasCurrent) {
/* same context and buffer, do nothing */
return GL_TRUE;
@@ -1962,18 +1980,20 @@ GLboolean XMesaMakeCurrent( XMesaContext c, XMesaBuffer b )
/* Disassociate old buffer with this context */
if (c->xm_buffer)
c->xm_buffer->xm_context = NULL;
- b->xm_context = c; /* Associate the context with this buffer */
+ drawBuffer->xm_context = c; /* Associate the context with this buffer */
- c->xm_buffer = b;
+ c->xm_buffer = drawBuffer;
+ c->xm_read_buffer = readBuffer;
+ c->use_read_buffer = (drawBuffer != readBuffer);
- gl_make_current( c->gl_ctx, b->gl_buffer );
+ gl_make_current2(c->gl_ctx, drawBuffer->gl_buffer, readBuffer->gl_buffer);
XMesa = c;
- if (c->gl_ctx->Viewport.Width==0) {
+ if (c->gl_ctx->Viewport.Width == 0) {
/* initialize viewport to window size */
- gl_Viewport( c->gl_ctx, 0, 0, b->width, b->height );
- c->gl_ctx->Scissor.Width = b->width;
- c->gl_ctx->Scissor.Height = b->height;
+ _mesa_Viewport( 0, 0, drawBuffer->width, drawBuffer->height );
+ c->gl_ctx->Scissor.Width = drawBuffer->width;
+ c->gl_ctx->Scissor.Height = drawBuffer->height;
}
if (c->xm_visual->gl_visual->RGBAflag) {
@@ -1989,7 +2009,7 @@ GLboolean XMesaMakeCurrent( XMesaContext c, XMesaBuffer b )
c->clearcolor[1],
c->clearcolor[2],
c->clearcolor[3] );
- XMesaSetForeground( c->display, c->xm_buffer->cleargc, c->clearpixel );
+ XMesaSetForeground(c->display, c->xm_buffer->cleargc, c->clearpixel);
}
/* Solution to Stephane Rehel's problem with glXReleaseBuffersMESA(): */
@@ -1997,13 +2017,14 @@ GLboolean XMesaMakeCurrent( XMesaContext c, XMesaBuffer b )
}
else {
/* Detach */
- gl_make_current( NULL, NULL );
+ gl_make_current2( NULL, NULL, NULL );
XMesa = NULL;
}
return GL_TRUE;
}
+
XMesaContext XMesaGetCurrentContext( void )
{
return XMesa;
@@ -2021,6 +2042,18 @@ XMesaBuffer XMesaGetCurrentBuffer( void )
}
+/* New in Mesa 3.1 */
+XMesaBuffer XMesaGetCurrentReadBuffer( void )
+{
+ if (XMesa) {
+ return XMesa->xm_buffer;
+ }
+ else {
+ return 0;
+ }
+}
+
+
GLboolean XMesaForceCurrent(XMesaContext c)
{
if (c) {
@@ -2055,10 +2088,14 @@ GLboolean XMesaSetFXmode( GLint mode )
const char *fx = getenv("MESA_GLX_FX");
if (fx && fx[0] != 'd') {
GrHwConfiguration hw;
- if (!grSstQueryHardware(&hw))
+ if (!grSstQueryHardware(&hw)) {
+ fprintf(stderr, "!grSstQueryHardware\n");
return GL_FALSE;
- if (hw.num_sst < 1)
+ }
+ if (hw.num_sst < 1) {
+ fprintf(stderr, "hw.num_sst < 1\n");
return GL_FALSE;
+ }
if (XMesa) {
if (mode == XMESA_FX_WINDOW) {
if (XMesa->xm_buffer->FXisHackUsable) {
@@ -2077,6 +2114,7 @@ GLboolean XMesaSetFXmode( GLint mode )
}
}
}
+ fprintf(stderr, "fallthrough\n");
#else
(void) mode;
#endif
@@ -2186,7 +2224,7 @@ void XMesaSwapBuffers( XMesaBuffer b )
GLdouble t0 = gl_time();
#endif
- FLUSH_VB( XMesa->gl_ctx, "swap buffers" );
+ _mesa_swapbuffers(XMesa->gl_ctx);
if (b->db_state) {
#ifdef FX
@@ -2201,7 +2239,7 @@ void XMesaSwapBuffers( XMesaBuffer b )
#endif
if (b->backimage) {
/* Copy Ximage from host's memory to server's window */
-#if defined(SHM) && !defined(XFree86Server)
+#if defined(USE_XSHM) && !defined(XFree86Server)
if (b->shm) {
XShmPutImage( b->xm_visual->display, b->frontbuffer,
b->cleargc,
@@ -2270,7 +2308,7 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height )
#endif
if (b->backimage) {
/* Copy Ximage from host's memory to server's window */
-#if defined(SHM) && !defined(XFree86Server)
+#if defined(USE_XSHM) && !defined(XFree86Server)
if (b->shm) {
/* XXX assuming width and height aren't too large! */
XShmPutImage( b->xm_visual->display, b->frontbuffer,
diff --git a/xc/extras/Mesa/src/X/xmesa2.c b/xc/extras/Mesa/src/X/xmesa2.c
index f5b9377a0..0ac721b86 100644
--- a/xc/extras/Mesa/src/X/xmesa2.c
+++ b/xc/extras/Mesa/src/X/xmesa2.c
@@ -1,10 +1,10 @@
-/* $Id: xmesa2.c,v 1.1 1999/12/05 23:10:27 daryll Exp $ */
+/* $Id: xmesa2.c,v 1.2 2000/01/30 00:27:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,37 +25,19 @@
*/
-
-
-
/*
* Mesa/X11 interface, part 2.
*
* This file contains the implementations of all the device driver functions.
*/
-/* $XFree86: xc/lib/GL/mesa/src/X/xmesa2.c,v 1.2 1999/03/14 03:21:02 dawes Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-#ifndef XFree86Server
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <X11/Xlib.h>
-#endif
-#include "GL/xmesa.h"
+#include "glxheader.h"
#include "context.h"
-#include "macros.h"
+#include "drawpix.h"
+#include "mem.h"
#include "types.h"
#include "xmesaP.h"
-#ifdef XFree86Server
-#include "gcstruct.h"
-#include "GL/xf86glx.h"
-#endif
-
/*
@@ -238,7 +220,7 @@ static void flush( GLcontext *ctx )
}
-
+#if 0
static GLboolean set_buffer( GLcontext *ctx, GLenum mode )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
@@ -270,6 +252,90 @@ static GLboolean set_buffer( GLcontext *ctx, GLenum mode )
return GL_FALSE;
}
}
+#endif
+
+
+static GLboolean set_draw_buffer( GLcontext *ctx, GLenum mode )
+{
+ const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ if (mode == GL_FRONT_LEFT) {
+ /* write to front buffer */
+ xmesa->xm_buffer->buffer = xmesa->xm_buffer->frontbuffer;
+ /*
+ ctx->NewState |= NEW_RASTER_OPS;
+ gl_update_state(ctx);
+ */
+ xmesa_update_state(ctx);
+ return GL_TRUE;
+ }
+ else if (mode==GL_BACK_LEFT && xmesa->xm_buffer->db_state) {
+ /* write to back buffer */
+ if (xmesa->xm_buffer->backpixmap) {
+ xmesa->xm_buffer->buffer =
+ (XMesaDrawable)xmesa->xm_buffer->backpixmap;
+ }
+ else if (xmesa->xm_buffer->backimage) {
+ xmesa->xm_buffer->buffer = None;
+ }
+ else {
+ /* just in case there wasn't enough memory for back buffer */
+ xmesa->xm_buffer->buffer = xmesa->xm_buffer->frontbuffer;
+ }
+ ctx->NewState |= NEW_RASTER_OPS;
+ gl_update_state(ctx);
+ return GL_TRUE;
+ }
+ else {
+ return GL_FALSE;
+ }
+}
+
+
+static void set_read_buffer( GLcontext *ctx, GLframebuffer *buffer,
+ GLenum mode )
+{
+ XMesaBuffer target;
+ const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+
+ if (buffer == ctx->DrawBuffer) {
+ target = xmesa->xm_buffer;
+ xmesa->use_read_buffer = GL_FALSE;
+ }
+ else {
+ ASSERT(buffer == ctx->ReadBuffer);
+ target = xmesa->xm_read_buffer;
+ xmesa->use_read_buffer = GL_TRUE;
+ }
+
+ if (mode == GL_FRONT_LEFT) {
+ target->buffer = target->frontbuffer;
+ /*
+ ctx->NewState |= NEW_RASTER_OPS;
+ gl_update_state(ctx);
+ */
+ xmesa_update_state(ctx);
+ }
+ else if (mode==GL_BACK_LEFT && xmesa->xm_read_buffer->db_state) {
+ if (target->backpixmap) {
+ target->buffer = (XMesaDrawable)xmesa->xm_buffer->backpixmap;
+ }
+ else if (target->backimage) {
+ target->buffer = None;
+ }
+ else {
+ /* just in case there wasn't enough memory for back buffer */
+ target->buffer = target->frontbuffer;
+ }
+ /*
+ ctx->NewState |= NEW_RASTER_OPS;
+ gl_update_state(ctx);
+ */
+ xmesa_update_state(ctx);
+ }
+ else {
+ gl_problem(ctx, "invalid buffer in set_read_buffer() in xmesa2.c");
+ }
+}
@@ -278,7 +344,7 @@ static void clear_index( GLcontext *ctx, GLuint index )
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
xmesa->clearpixel = (unsigned long) index;
XMesaSetForeground( xmesa->display, xmesa->xm_buffer->cleargc,
- (unsigned long) index );
+ (unsigned long) index );
}
@@ -292,7 +358,7 @@ static void clear_color( GLcontext *ctx,
xmesa->clearcolor[3] = a;
xmesa->clearpixel = xmesa_color_to_pixel( xmesa, r, g, b, a );
XMesaSetForeground( xmesa->display, xmesa->xm_buffer->cleargc,
- xmesa->clearpixel );
+ xmesa->clearpixel );
}
@@ -306,26 +372,25 @@ static void clear_color_HPCR_ximage( GLcontext *ctx,
xmesa->clearcolor[2] = b;
xmesa->clearcolor[3] = a;
- if (0x0==r && 0x0==g && 0x0==b)
- {
- /* black is black */
- MEMSET( xmesa->xm_visual->hpcr_clear_ximage_pattern, 0x0 ,
- sizeof(xmesa->xm_visual->hpcr_clear_ximage_pattern));
+ if (r == 0 && g == 0 && b == 0) {
+ /* black is black */
+ MEMSET( xmesa->xm_visual->hpcr_clear_ximage_pattern, 0x0 ,
+ sizeof(xmesa->xm_visual->hpcr_clear_ximage_pattern));
}
else {
- /* build clear pattern */
- for (i=0; i<16; i++) {
- xmesa->xm_visual->hpcr_clear_ximage_pattern[0][i] =
- DITHER_HPCR(i, 0, r, g, b);
- xmesa->xm_visual->hpcr_clear_ximage_pattern[1][i] =
- DITHER_HPCR(i, 1, r, g, b);
- }
+ /* build clear pattern */
+ for (i=0; i<16; i++) {
+ xmesa->xm_visual->hpcr_clear_ximage_pattern[0][i] =
+ DITHER_HPCR(i, 0, r, g, b);
+ xmesa->xm_visual->hpcr_clear_ximage_pattern[1][i] =
+ DITHER_HPCR(i, 1, r, g, b);
+ }
}
}
static void clear_color_HPCR_pixmap( GLcontext *ctx,
- GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+ GLubyte r, GLubyte g, GLubyte b, GLubyte a )
{
int i;
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
@@ -335,21 +400,18 @@ static void clear_color_HPCR_pixmap( GLcontext *ctx,
xmesa->clearcolor[3] = a;
- if (0x0==r && 0x0==g && 0x0==b)
- {
- /* black is black */
- for (i=0; i<16; i++)
- {
- XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 0, 0);
- XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 1, 0);
- }
+ if (0x0==r && 0x0==g && 0x0==b) {
+ /* black is black */
+ for (i=0; i<16; i++) {
+ XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 0, 0);
+ XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 1, 0);
+ }
}
else {
- for (i=0; i<16; i++)
- {
- XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 0, DITHER_HPCR(i, 0, r, g, b));
- XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 1, DITHER_HPCR(i, 1, r, g, b));
- }
+ for (i=0; i<16; i++) {
+ XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 0, DITHER_HPCR(i, 0, r, g, b));
+ XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 1, DITHER_HPCR(i, 1, r, g, b));
+ }
}
/* change tile pixmap content */
XMesaPutImage(xmesa->display,
@@ -496,195 +558,266 @@ static void dither( GLcontext *ctx, GLboolean enable )
/*** glClear implementations ***/
/**********************************************************************/
-static GLbitfield clear_pixmap( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
+
+/* Clear a pixmap color buffer, may be the front or back buffer */
+static void
+clear_pixmap( GLcontext *ctx, GLboolean all,
+ GLint x, GLint y, GLint width, GLint height )
{
- if (mask & GL_COLOR_BUFFER_BIT) {
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- if (all) {
- XMesaFillRectangle( xmesa->display, xmesa->xm_buffer->buffer,
- xmesa->xm_buffer->cleargc,
- 0, 0,
- xmesa->xm_buffer->width+1,
- xmesa->xm_buffer->height+1 );
- }
- else {
- XMesaFillRectangle( xmesa->display, xmesa->xm_buffer->buffer,
- xmesa->xm_buffer->cleargc,
- x, xmesa->xm_buffer->height - y - height,
- width, height );
- }
+ const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ if (all) {
+ XMesaFillRectangle( xmesa->display, xmesa->xm_buffer->buffer,
+ xmesa->xm_buffer->cleargc,
+ 0, 0,
+ xmesa->xm_buffer->width+1,
+ xmesa->xm_buffer->height+1 );
+ }
+ else {
+ XMesaFillRectangle( xmesa->display, xmesa->xm_buffer->buffer,
+ xmesa->xm_buffer->cleargc,
+ x, xmesa->xm_buffer->height - y - height,
+ width, height );
}
- return mask & (~GL_COLOR_BUFFER_BIT);
}
-static GLbitfield clear_8bit_ximage( GLcontext *ctx, GLbitfield mask,
- GLboolean all, GLint x, GLint y,
- GLint width, GLint height )
+static void
+clear_8bit_ximage( GLcontext *ctx, GLboolean all,
+ GLint x, GLint y, GLint width, GLint height )
{
- if (mask & GL_COLOR_BUFFER_BIT) {
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- if (all) {
- size_t n = xmesa->xm_buffer->backimage->bytes_per_line
- * xmesa->xm_buffer->backimage->height;
- MEMSET( xmesa->xm_buffer->backimage->data, xmesa->clearpixel, n );
- }
- else {
- GLint i;
- for (i=0;i<height;i++) {
- GLubyte *ptr = PIXELADDR1( x, y+i );
- MEMSET( ptr, xmesa->clearpixel, width );
- }
+ const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ if (all) {
+ size_t n = xmesa->xm_buffer->backimage->bytes_per_line
+ * xmesa->xm_buffer->backimage->height;
+ MEMSET( xmesa->xm_buffer->backimage->data, xmesa->clearpixel, n );
+ }
+ else {
+ GLint i;
+ for (i=0;i<height;i++) {
+ GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y+i );
+ MEMSET( ptr, xmesa->clearpixel, width );
}
}
- return mask & (~GL_COLOR_BUFFER_BIT);
}
-static GLbitfield clear_HPCR_ximage( GLcontext *ctx, GLbitfield mask,
- GLboolean all, GLint x, GLint y,
- GLint width, GLint height )
+static void
+clear_HPCR_ximage( GLcontext *ctx, GLboolean all,
+ GLint x, GLint y, GLint width, GLint height )
{
- if (mask & GL_COLOR_BUFFER_BIT) {
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- if (all) {
- GLint i, c16 = (xmesa->xm_buffer->backimage->bytes_per_line>>4)<<4;
- GLubyte *ptr = (GLubyte *)xmesa->xm_buffer->backimage->data;
- for (i=0; i<xmesa->xm_buffer->backimage->height; i++) {
- GLint j;
- GLubyte *sptr = xmesa->xm_visual->hpcr_clear_ximage_pattern[0];
- if (i&1) {
- sptr += 16;
- }
- for (j=0; j<c16; j+=16) {
- ptr[0] = sptr[0];
- ptr[1] = sptr[1];
- ptr[2] = sptr[2];
- ptr[3] = sptr[3];
- ptr[4] = sptr[4];
- ptr[5] = sptr[5];
- ptr[6] = sptr[6];
- ptr[7] = sptr[7];
- ptr[8] = sptr[8];
- ptr[9] = sptr[9];
- ptr[10] = sptr[10];
- ptr[11] = sptr[11];
- ptr[12] = sptr[12];
- ptr[13] = sptr[13];
- ptr[14] = sptr[14];
- ptr[15] = sptr[15];
- ptr += 16;
- }
- for (; j<xmesa->xm_buffer->backimage->bytes_per_line; j++) {
- *ptr = sptr[j&15];
- ptr++;
- }
- }
+ const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ if (all) {
+ GLint i, c16 = (xmesa->xm_buffer->backimage->bytes_per_line>>4)<<4;
+ GLubyte *ptr = (GLubyte *)xmesa->xm_buffer->backimage->data;
+ for (i=0; i<xmesa->xm_buffer->backimage->height; i++) {
+ GLint j;
+ GLubyte *sptr = xmesa->xm_visual->hpcr_clear_ximage_pattern[0];
+ if (i&1) {
+ sptr += 16;
+ }
+ for (j=0; j<c16; j+=16) {
+ ptr[0] = sptr[0];
+ ptr[1] = sptr[1];
+ ptr[2] = sptr[2];
+ ptr[3] = sptr[3];
+ ptr[4] = sptr[4];
+ ptr[5] = sptr[5];
+ ptr[6] = sptr[6];
+ ptr[7] = sptr[7];
+ ptr[8] = sptr[8];
+ ptr[9] = sptr[9];
+ ptr[10] = sptr[10];
+ ptr[11] = sptr[11];
+ ptr[12] = sptr[12];
+ ptr[13] = sptr[13];
+ ptr[14] = sptr[14];
+ ptr[15] = sptr[15];
+ ptr += 16;
+ }
+ for (; j<xmesa->xm_buffer->backimage->bytes_per_line; j++) {
+ *ptr = sptr[j&15];
+ ptr++;
+ }
}
- else {
- GLint i;
- for (i=y; i<y+height; i++) {
- GLubyte *ptr = PIXELADDR1( x, i );
- int j;
- GLubyte *sptr = xmesa->xm_visual->hpcr_clear_ximage_pattern[0];
- if (i&1) {
- sptr += 16;
- }
- for (j=x; j<x+width; j++) {
- *ptr = sptr[j&15];
- ptr++;
- }
+ }
+ else {
+ GLint i;
+ for (i=y; i<y+height; i++) {
+ GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, i );
+ int j;
+ GLubyte *sptr = xmesa->xm_visual->hpcr_clear_ximage_pattern[0];
+ if (i&1) {
+ sptr += 16;
+ }
+ for (j=x; j<x+width; j++) {
+ *ptr = sptr[j&15];
+ ptr++;
}
}
}
- return mask & (~GL_COLOR_BUFFER_BIT);
}
-static GLbitfield clear_16bit_ximage( GLcontext *ctx, GLbitfield mask,
- GLboolean all, GLint x, GLint y,
- GLint width, GLint height )
+static void
+clear_16bit_ximage( GLcontext *ctx, GLboolean all,
+ GLint x, GLint y, GLint width, GLint height )
{
- if (mask & GL_COLOR_BUFFER_BIT) {
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- if (all) {
- register GLuint n;
- register GLuint *ptr4 = (GLuint *) xmesa->xm_buffer->backimage->data;
- register GLuint pixel = (GLuint) xmesa->clearpixel;
- if (xmesa->swapbytes) {
- pixel = ((pixel >> 8) & 0x00ff)
- | ((pixel << 8) & 0xff00);
- }
- if ((pixel & 0xff) == ((pixel >> 8) & 0xff)) {
- /* low and high bytes are equal so use memset() */
- n = xmesa->xm_buffer->backimage->bytes_per_line
- * xmesa->xm_buffer->height;
- MEMSET( ptr4, pixel & 0xff, n );
- }
- else {
- pixel = pixel | (pixel<<16);
- n = xmesa->xm_buffer->backimage->bytes_per_line
- * xmesa->xm_buffer->height / 4;
- do {
- *ptr4++ = pixel;
- n--;
- } while (n!=0);
-
- if ((xmesa->xm_buffer->backimage->bytes_per_line *
- xmesa->xm_buffer->height) & 0x2)
- *(GLushort *)ptr4 = pixel & 0xffff;
- }
+ const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ register GLuint pixel = (GLuint) xmesa->clearpixel;
+ if (xmesa->swapbytes) {
+ pixel = ((pixel >> 8) & 0x00ff) | ((pixel << 8) & 0xff00);
+ }
+ if (all) {
+ register GLuint n;
+ register GLuint *ptr4 = (GLuint *) xmesa->xm_buffer->backimage->data;
+ if ((pixel & 0xff) == ((pixel >> 8) & 0xff)) {
+ /* low and high bytes are equal so use memset() */
+ n = xmesa->xm_buffer->backimage->bytes_per_line
+ * xmesa->xm_buffer->height;
+ MEMSET( ptr4, pixel & 0xff, n );
}
else {
- register int i, j;
- register GLushort pixel = (GLushort) xmesa->clearpixel;
- for (j=0;j<height;j++) {
- register GLushort *ptr2 = PIXELADDR2( x, y+j );
- for (i=0;i<width;i++) {
- *ptr2++ = pixel;
- }
+ pixel = pixel | (pixel<<16);
+ n = xmesa->xm_buffer->backimage->bytes_per_line
+ * xmesa->xm_buffer->height / 4;
+ do {
+ *ptr4++ = pixel;
+ n--;
+ } while (n!=0);
+
+ if ((xmesa->xm_buffer->backimage->bytes_per_line *
+ xmesa->xm_buffer->height) & 0x2)
+ *(GLushort *)ptr4 = pixel & 0xffff;
+ }
+ }
+ else {
+ register int i, j;
+ for (j=0;j<height;j++) {
+ register GLushort *ptr2 = PIXELADDR2( xmesa->xm_buffer, x, y+j );
+ for (i=0;i<width;i++) {
+ *ptr2++ = pixel;
}
}
}
- return mask & (~GL_COLOR_BUFFER_BIT);
}
/* Optimized code provided by Nozomi Ytow <nozomi@biol.tsukuba.ac.jp> */
-static GLbitfield clear_24bit_ximage( GLcontext *ctx, GLbitfield mask,
- GLboolean all, GLint x, GLint y,
- GLint width, GLint height )
-{
- if (mask & GL_COLOR_BUFFER_BIT) {
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte r = xmesa->clearcolor[0];
- const GLubyte g = xmesa->clearcolor[1];
- const GLubyte b = xmesa->clearcolor[2];
- register GLuint clearPixel;
- if (xmesa->swapbytes) {
- clearPixel = (b << 16) | (g << 8) | r;
+static void
+clear_24bit_ximage( GLcontext *ctx, GLboolean all,
+ GLint x, GLint y, GLint width, GLint height )
+{
+ const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const GLubyte r = xmesa->clearcolor[0];
+ const GLubyte g = xmesa->clearcolor[1];
+ const GLubyte b = xmesa->clearcolor[2];
+ register GLuint clearPixel;
+ if (xmesa->swapbytes) {
+ clearPixel = (b << 16) | (g << 8) | r;
+ }
+ else {
+ clearPixel = (r << 16) | (g << 8) | b;
+ }
+
+ if (all) {
+ register GLint n = xmesa->xm_buffer->width * xmesa->xm_buffer->height;
+ register bgr_t *ptr3 = (bgr_t *) xmesa->xm_buffer->backimage->data;
+ if (r==g && g==b) {
+ /* same value for all three components (gray) */
+ MEMSET(ptr3, r, 3 * n);
}
else {
- clearPixel = (r << 16) | (g << 8) | b;
+ /* the usual case */
+ register GLuint *ptr4 = (GLuint *) ptr3;
+ register GLuint px;
+ GLuint pixel4[3];
+ register GLuint *p = pixel4;
+ pixel4[0] = clearPixel | (clearPixel << 24);
+ pixel4[1] = (clearPixel << 16) | (clearPixel >> 8);
+ pixel4[2] = (clearPixel << 8) | (clearPixel >> 16);
+ switch (3 & (int)(ptr3 - (bgr_t*) ptr4)){
+ case 0:
+ break;
+ case 1:
+ px = *ptr4 & 0x00ffffff;
+ px |= pixel4[0] & 0xff000000;
+ *ptr4++ = px;
+ px = *ptr4 & 0xffff0000;
+ px |= pixel4[2] & 0x0000ffff;
+ *ptr4 = px;
+ if (0 == --n)
+ break;
+ case 2:
+ px = *ptr4 & 0x0000fffff;
+ px |= pixel4[1] & 0xffff0000;
+ *ptr4++ = px;
+ px = *ptr4 & 0xffffff00;
+ px |= pixel4[2] & 0x000000ff;
+ *ptr4 = px;
+ if (0 == --n)
+ break;
+ case 3:
+ px = *ptr4 & 0x000000ff;
+ px |= pixel4[2] & 0xffffff00;
+ *ptr4++ = px;
+ --n;
+ break;
+ }
+ while (n > 3) {
+ p = pixel4;
+ *ptr4++ = *p++;
+ *ptr4++ = *p++;
+ *ptr4++ = *p++;
+ n -= 4;
+ }
+ switch (n) {
+ case 3:
+ p = pixel4;
+ *ptr4++ = *p++;
+ *ptr4++ = *p++;
+ px = *ptr4 & 0xffffff00;
+ px |= clearPixel & 0xff;
+ *ptr4 = px;
+ break;
+ case 2:
+ p = pixel4;
+ *ptr4++ = *p++;
+ px = *ptr4 & 0xffff0000;
+ px |= *p & 0xffff;
+ *ptr4 = px;
+ break;
+ case 1:
+ px = *ptr4 & 0xff000000;
+ px |= *p & 0xffffff;
+ *ptr4 = px;
+ break;
+ case 0:
+ break;
+ }
}
-
- if (all) {
- register GLint n = xmesa->xm_buffer->width * xmesa->xm_buffer->height;
- register bgr_t *ptr3 = (bgr_t *) xmesa->xm_buffer->backimage->data;
- if (r==g && g==b) {
- /* same value for all three components (gray) */
- MEMSET(ptr3, r, 3 * n);
+ }
+ else {
+ /* only clear subrect of color buffer */
+ if (r==g && g==b) {
+ /* same value for all three components (gray) */
+ GLint j;
+ for (j=0;j<height;j++) {
+ bgr_t *ptr3 = PIXELADDR3( xmesa->xm_buffer, x, y+j );
+ MEMSET(ptr3, r, 3 * width);
}
- else{
- /* the usual case */
- register GLuint *ptr4 = (GLuint *) ptr3;
- register GLuint px;
- GLuint pixel4[3];
- register GLuint *p = pixel4;
- pixel4[0] = clearPixel | (clearPixel << 24);
- pixel4[1] = (clearPixel << 16) | (clearPixel >> 8);
- pixel4[2] = (clearPixel << 8) | (clearPixel >> 16);
+ }
+ else {
+ /* non-gray clear color */
+ GLint j;
+ GLuint pixel4[3];
+ pixel4[0] = clearPixel | (clearPixel << 24);
+ pixel4[1] = (clearPixel << 16) | (clearPixel >> 8);
+ pixel4[2] = (clearPixel << 8) | (clearPixel >> 16);
+ for (j=0;j<height;j++) {
+ bgr_t *ptr3 = PIXELADDR3( xmesa->xm_buffer, x, y+j );
+ register GLuint *ptr4 = (GLuint *)ptr3;
+ register GLuint *p, px;
+ GLuint w = width;
switch (3 & (int)(ptr3 - (bgr_t*) ptr4)){
case 0:
break;
@@ -695,7 +828,7 @@ static GLbitfield clear_24bit_ximage( GLcontext *ctx, GLbitfield mask,
px = *ptr4 & 0xffff0000;
px |= pixel4[2] & 0x0000ffff;
*ptr4 = px;
- if (0 == --n)
+ if (0 == --w)
break;
case 2:
px = *ptr4 & 0x0000fffff;
@@ -704,29 +837,29 @@ static GLbitfield clear_24bit_ximage( GLcontext *ctx, GLbitfield mask,
px = *ptr4 & 0xffffff00;
px |= pixel4[2] & 0x000000ff;
*ptr4 = px;
- if (0 == --n)
+ if (0 == --w)
break;
case 3:
px = *ptr4 & 0x000000ff;
px |= pixel4[2] & 0xffffff00;
*ptr4++ = px;
- --n;
+ --w;
break;
}
- while (n > 3) {
+ while (w > 3){
p = pixel4;
*ptr4++ = *p++;
*ptr4++ = *p++;
*ptr4++ = *p++;
- n -= 4;
+ w -= 4;
}
- switch (n) {
+ switch (w) {
case 3:
p = pixel4;
*ptr4++ = *p++;
*ptr4++ = *p++;
px = *ptr4 & 0xffffff00;
- px |= clearPixel & 0xff;
+ px |= *p & 0xff;
*ptr4 = px;
break;
case 2:
@@ -738,7 +871,7 @@ static GLbitfield clear_24bit_ximage( GLcontext *ctx, GLbitfield mask,
break;
case 1:
px = *ptr4 & 0xff000000;
- px |= *p & 0xffffff;
+ px |= pixel4[0] & 0xffffff;
*ptr4 = px;
break;
case 0:
@@ -746,169 +879,103 @@ static GLbitfield clear_24bit_ximage( GLcontext *ctx, GLbitfield mask,
}
}
}
- else {
- /* only clear subrect of color buffer */
- if (r==g && g==b) {
- /* same value for all three components (gray) */
- GLint j;
- for (j=0;j<height;j++) {
- bgr_t *ptr3 = PIXELADDR3( x, y+j );
- MEMSET(ptr3, r, 3 * width);
- }
- }
- else {
- /* non-gray clear color */
- GLint j;
- GLuint pixel4[3];
- pixel4[0] = clearPixel | (clearPixel << 24);
- pixel4[1] = (clearPixel << 16) | (clearPixel >> 8);
- pixel4[2] = (clearPixel << 8) | (clearPixel >> 16);
- for (j=0;j<height;j++) {
- bgr_t *ptr3 = PIXELADDR3( x, y+j );
- register GLuint *ptr4 = (GLuint *)ptr3;
- register GLuint *p, px;
- GLuint w = width;
- switch (3 & (int)(ptr3 - (bgr_t*) ptr4)){
- case 0:
- break;
- case 1:
- px = *ptr4 & 0x00ffffff;
- px |= pixel4[0] & 0xff000000;
- *ptr4++ = px;
- px = *ptr4 & 0xffff0000;
- px |= pixel4[2] & 0x0000ffff;
- *ptr4 = px;
- if (0 == --w)
- break;
- case 2:
- px = *ptr4 & 0x0000fffff;
- px |= pixel4[1] & 0xffff0000;
- *ptr4++ = px;
- px = *ptr4 & 0xffffff00;
- px |= pixel4[2] & 0x000000ff;
- *ptr4 = px;
- if (0 == --w)
- break;
- case 3:
- px = *ptr4 & 0x000000ff;
- px |= pixel4[2] & 0xffffff00;
- *ptr4++ = px;
- --w;
- break;
- }
- while (w > 3){
- p = pixel4;
- *ptr4++ = *p++;
- *ptr4++ = *p++;
- *ptr4++ = *p++;
- w -= 4;
- }
- switch (w) {
- case 3:
- p = pixel4;
- *ptr4++ = *p++;
- *ptr4++ = *p++;
- px = *ptr4 & 0xffffff00;
- px |= *p & 0xff;
- *ptr4 = px;
- break;
- case 2:
- p = pixel4;
- *ptr4++ = *p++;
- px = *ptr4 & 0xffff0000;
- px |= *p & 0xffff;
- *ptr4 = px;
- break;
- case 1:
- px = *ptr4 & 0xff000000;
- px |= pixel4[0] & 0xffffff;
- *ptr4 = px;
- break;
- case 0:
- break;
- }
- }
- }
- }
}
- return mask & (~GL_COLOR_BUFFER_BIT);
}
-static GLbitfield clear_32bit_ximage( GLcontext *ctx, GLbitfield mask,
- GLboolean all, GLint x, GLint y,
- GLint width, GLint height )
+static void
+clear_32bit_ximage( GLcontext *ctx, GLboolean all,
+ GLint x, GLint y, GLint width, GLint height )
{
- if (mask & GL_COLOR_BUFFER_BIT) {
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- if (all) {
- register GLint n = xmesa->xm_buffer->width * xmesa->xm_buffer->height;
- register GLuint *ptr4 = (GLuint *) xmesa->xm_buffer->backimage->data;
- register GLuint pixel = (GLuint) xmesa->clearpixel;
- if (xmesa->swapbytes) {
- pixel = ((pixel >> 24) & 0x000000ff)
- | ((pixel >> 8) & 0x0000ff00)
- | ((pixel << 8) & 0x00ff0000)
- | ((pixel << 24) & 0xff000000);
- }
- if (pixel==0) {
- MEMSET( ptr4, pixel, 4*n );
- }
- else {
- do {
- *ptr4++ = pixel;
- n--;
- } while (n!=0);
- }
+ const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ if (all) {
+ register GLint n = xmesa->xm_buffer->width * xmesa->xm_buffer->height;
+ register GLuint *ptr4 = (GLuint *) xmesa->xm_buffer->backimage->data;
+ register GLuint pixel = (GLuint) xmesa->clearpixel;
+ if (xmesa->swapbytes) {
+ pixel = ((pixel >> 24) & 0x000000ff)
+ | ((pixel >> 8) & 0x0000ff00)
+ | ((pixel << 8) & 0x00ff0000)
+ | ((pixel << 24) & 0xff000000);
+ }
+ if (pixel==0) {
+ MEMSET( ptr4, pixel, 4*n );
}
else {
- register int i, j;
- register GLuint pixel = (GLuint) xmesa->clearpixel;
- for (j=0;j<height;j++) {
- register GLuint *ptr4 = PIXELADDR4( x, y+j );
- for (i=0;i<width;i++) {
- *ptr4++ = pixel;
- }
+ do {
+ *ptr4++ = pixel;
+ n--;
+ } while (n!=0);
+ }
+ }
+ else {
+ register int i, j;
+ register GLuint pixel = (GLuint) xmesa->clearpixel;
+ for (j=0;j<height;j++) {
+ register GLuint *ptr4 = PIXELADDR4( xmesa->xm_buffer, x, y+j );
+ for (i=0;i<width;i++) {
+ *ptr4++ = pixel;
}
}
}
- return mask & (~GL_COLOR_BUFFER_BIT);
}
-static GLbitfield clear_nbit_ximage( GLcontext *ctx, GLbitfield mask,
- GLboolean all, GLint x, GLint y,
- GLint width, GLint height )
+static void
+clear_nbit_ximage( GLcontext *ctx, GLboolean all,
+ GLint x, GLint y, GLint width, GLint height )
{
- if (mask & GL_COLOR_BUFFER_BIT) {
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- XMesaImage *img = xmesa->xm_buffer->backimage;
- if (all) {
- register int i, j;
- width = xmesa->xm_buffer->width;
- height = xmesa->xm_buffer->height;
- for (j=0;j<height;j++) {
- for (i=0;i<width;i++) {
- XMesaPutPixel( img, i, j, xmesa->clearpixel );
- }
+ const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaImage *img = xmesa->xm_buffer->backimage;
+ if (all) {
+ register int i, j;
+ width = xmesa->xm_buffer->width;
+ height = xmesa->xm_buffer->height;
+ for (j=0;j<height;j++) {
+ for (i=0;i<width;i++) {
+ XMesaPutPixel( img, i, j, xmesa->clearpixel );
}
}
- else {
- /* TODO: optimize this */
- register int i, j;
- y = FLIP(y);
- for (j=0;j<height;j++) {
- for (i=0;i<width;i++) {
- XMesaPutPixel( img, x+i, y-j, xmesa->clearpixel );
- }
+ }
+ else {
+ /* TODO: optimize this */
+ register int i, j;
+ y = FLIP(xmesa->xm_buffer, y);
+ for (j=0;j<height;j++) {
+ for (i=0;i<width;i++) {
+ XMesaPutPixel( img, x+i, y-j, xmesa->clearpixel );
}
}
}
- return mask & (~GL_COLOR_BUFFER_BIT);
}
+static GLbitfield
+clear_buffers( GLcontext *ctx, GLbitfield mask,
+ GLboolean all, GLint x, GLint y, GLint width, GLint height )
+{
+ const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask;
+
+ /* we can't handle color or index masking */
+ if (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) {
+ if (*colorMask != 0xffffffff || ctx->Color.IndexMask != 0xffffffff)
+ return mask;
+ }
+
+ if (mask & DD_FRONT_LEFT_BIT) {
+ ASSERT(xmesa->xm_buffer->front_clear_func);
+ (*xmesa->xm_buffer->front_clear_func)( ctx, all, x, y, width, height );
+ }
+ if (mask & DD_BACK_LEFT_BIT) {
+ ASSERT(xmesa->xm_buffer->back_clear_func);
+ (*xmesa->xm_buffer->back_clear_func)( ctx, all, x, y, width, height );
+ }
+ return mask & (~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT));
+}
+
+
/*
* The Mesa library needs to be able to draw pixels in a number of ways:
@@ -973,7 +1040,7 @@ static void write_span_TRUECOLOR_pixmap( RGBA_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1007,7 +1074,7 @@ static void write_span_rgb_TRUECOLOR_pixmap( RGB_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1041,7 +1108,7 @@ static void write_span_TRUEDITHER_pixmap( RGBA_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1074,7 +1141,7 @@ static void write_span_rgb_TRUEDITHER_pixmap( RGB_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1108,7 +1175,7 @@ static void write_span_8A8B8G8R_pixmap( RGBA_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1140,7 +1207,7 @@ static void write_span_rgb_8A8B8G8R_pixmap( RGB_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1172,7 +1239,7 @@ static void write_span_8R8G8B_pixmap( RGBA_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1202,7 +1269,7 @@ static void write_span_8R8G8B24_pixmap( RGBA_SPAN_ARGS )
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
register GLuint i;
for (i=0;i<n;i++,x++) {
@@ -1297,7 +1364,7 @@ static void write_span_rgb_8R8G8B_pixmap( RGB_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1327,7 +1394,7 @@ static void write_span_rgb_8R8G8B24_pixmap( RGB_SPAN_ARGS )
XMesaDisplay *dpy = xmesa->xm_visual->display;
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
register GLuint i;
for (i=0;i<n;i++,x++) {
@@ -1427,7 +1494,7 @@ static void write_span_5R6G5B_pixmap( RGBA_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1458,7 +1525,7 @@ static void write_span_DITHER_5R6G5B_pixmap( RGBA_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1491,7 +1558,7 @@ static void write_span_rgb_5R6G5B_pixmap( RGB_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1522,7 +1589,7 @@ static void write_span_rgb_DITHER_5R6G5B_pixmap( RGB_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1557,7 +1624,7 @@ static void write_span_DITHER_pixmap( RGBA_SPAN_ARGS )
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
XDITHER_SETUP(y);
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1588,7 +1655,7 @@ static void write_span_rgb_DITHER_pixmap( RGB_SPAN_ARGS )
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
XDITHER_SETUP(y);
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1619,7 +1686,7 @@ static void write_span_1BIT_pixmap( RGBA_SPAN_ARGS )
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
SETUP_1BIT;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1652,7 +1719,7 @@ static void write_span_rgb_1BIT_pixmap( RGB_SPAN_ARGS )
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
SETUP_1BIT;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1684,7 +1751,7 @@ static void write_span_HPCR_pixmap( RGBA_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1715,7 +1782,7 @@ static void write_span_rgb_HPCR_pixmap( RGB_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1747,7 +1814,7 @@ static void write_span_LOOKUP_pixmap( RGBA_SPAN_ARGS )
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
LOOKUP_SETUP;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1777,7 +1844,7 @@ static void write_span_rgb_LOOKUP_pixmap( RGB_SPAN_ARGS )
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
LOOKUP_SETUP;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1807,7 +1874,7 @@ static void write_span_GRAYSCALE_pixmap( RGBA_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1836,7 +1903,7 @@ static void write_span_rgb_GRAYSCALE_pixmap( RGB_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1863,7 +1930,7 @@ static void write_span_TRUECOLOR_ximage( RGBA_SPAN_ARGS )
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1892,7 +1959,7 @@ static void write_span_rgb_TRUECOLOR_ximage( RGB_SPAN_ARGS )
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1921,7 +1988,7 @@ static void write_span_TRUEDITHER_ximage( RGBA_SPAN_ARGS )
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1950,7 +2017,7 @@ static void write_span_rgb_TRUEDITHER_ximage( RGB_SPAN_ARGS )
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -1978,7 +2045,7 @@ static void write_span_8A8B8G8R_ximage( RGBA_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLuint *ptr = PIXELADDR4( x, y );
+ register GLuint *ptr = PIXELADDR4( xmesa->xm_buffer, x, y );
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2002,7 +2069,7 @@ static void write_span_rgb_8A8B8G8R_ximage( RGB_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLuint *ptr = PIXELADDR4( x, y );
+ register GLuint *ptr = PIXELADDR4( xmesa->xm_buffer, x, y );
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2026,7 +2093,7 @@ static void write_span_8R8G8B_ximage( RGBA_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLuint *ptr = PIXELADDR4( x, y );
+ register GLuint *ptr = PIXELADDR4( xmesa->xm_buffer, x, y );
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2049,7 +2116,7 @@ static void write_span_8R8G8B24_ximage( RGBA_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLubyte *ptr = (GLubyte *) PIXELADDR3( x, y );
+ register GLubyte *ptr = (GLubyte *) PIXELADDR3( xmesa->xm_buffer, x, y );
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2199,7 +2266,7 @@ static void write_span_rgb_8R8G8B_ximage( RGB_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLuint *ptr = PIXELADDR4( x, y );
+ register GLuint *ptr = PIXELADDR4( xmesa->xm_buffer, x, y );
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2223,7 +2290,7 @@ static void write_span_rgb_8R8G8B24_ximage( RGB_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLubyte *ptr = (GLubyte *) PIXELADDR3( x, y );
+ register GLubyte *ptr = (GLubyte *) PIXELADDR3( xmesa->xm_buffer, x, y );
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2254,7 +2321,7 @@ static void write_span_5R6G5B_ximage( RGBA_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLushort *ptr = PIXELADDR2( x, y );
+ register GLushort *ptr = PIXELADDR2( xmesa->xm_buffer, x, y );
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2278,7 +2345,7 @@ static void write_span_DITHER_5R6G5B_ximage( RGBA_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLushort *ptr = PIXELADDR2( x, y );
+ register GLushort *ptr = PIXELADDR2( xmesa->xm_buffer, x, y );
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -2302,7 +2369,7 @@ static void write_span_rgb_5R6G5B_ximage( RGB_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLushort *ptr = PIXELADDR2( x, y );
+ register GLushort *ptr = PIXELADDR2( xmesa->xm_buffer, x, y );
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2326,7 +2393,7 @@ static void write_span_rgb_DITHER_5R6G5B_ximage( RGB_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLushort *ptr = PIXELADDR2( x, y );
+ register GLushort *ptr = PIXELADDR2( xmesa->xm_buffer, x, y );
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -2351,7 +2418,7 @@ static void write_span_DITHER_ximage( RGBA_SPAN_ARGS )
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
- int yy = FLIP(y);
+ int yy = FLIP(xmesa->xm_buffer, y);
XDITHER_SETUP(yy);
if (mask) {
for (i=0;i<n;i++,x++) {
@@ -2377,7 +2444,7 @@ static void write_span_rgb_DITHER_ximage( RGB_SPAN_ARGS )
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
- int yy = FLIP(y);
+ int yy = FLIP(xmesa->xm_buffer, y);
XDITHER_SETUP(yy);
if (mask) {
for (i=0;i<n;i++,x++) {
@@ -2403,7 +2470,7 @@ static void write_span_DITHER8_ximage( RGBA_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLubyte *ptr = PIXELADDR1( x, y );
+ register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
XDITHER_SETUP(y);
if (mask) {
for (i=0;i<n;i++,x++) {
@@ -2424,7 +2491,7 @@ static void write_span_rgb_DITHER8_ximage( RGB_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLubyte *ptr = PIXELADDR1( x, y );
+ register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
XDITHER_SETUP(y);
if (mask) {
for (i=0;i<n;i++,x++) {
@@ -2453,7 +2520,7 @@ static void write_span_1BIT_ximage( RGBA_SPAN_ARGS )
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
SETUP_1BIT;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -2478,7 +2545,7 @@ static void write_span_rgb_1BIT_ximage( RGB_SPAN_ARGS )
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
SETUP_1BIT;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -2501,7 +2568,7 @@ static void write_span_HPCR_ximage( RGBA_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLubyte *ptr = PIXELADDR1( x, y );
+ register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -2525,7 +2592,7 @@ static void write_span_rgb_HPCR_ximage( RGB_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLubyte *ptr = PIXELADDR1( x, y );
+ register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -2551,7 +2618,7 @@ static void write_span_LOOKUP_ximage( RGBA_SPAN_ARGS )
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
LOOKUP_SETUP;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -2577,7 +2644,7 @@ static void write_span_rgb_LOOKUP_ximage( RGB_SPAN_ARGS )
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
LOOKUP_SETUP;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -2601,7 +2668,7 @@ static void write_span_LOOKUP8_ximage( RGBA_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLubyte *ptr = PIXELADDR1( x, y );
+ register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
LOOKUP_SETUP;
if (mask) {
for (i=0;i<n;i++,x++) {
@@ -2626,7 +2693,7 @@ static void write_rgb_LOOKUP8_ximage( const GLcontext *ctx,
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLubyte *ptr = PIXELADDR1( x, y );
+ register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
LOOKUP_SETUP;
if (mask) {
for (i=0;i<n;i++,x++) {
@@ -2654,7 +2721,7 @@ static void write_span_GRAYSCALE_ximage( RGBA_SPAN_ARGS )
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -2679,7 +2746,7 @@ static void write_span_rgb_GRAYSCALE_ximage( RGB_SPAN_ARGS )
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
@@ -2703,7 +2770,7 @@ static void write_span_GRAYSCALE8_ximage( RGBA_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLubyte *ptr = PIXELADDR1( x, y );
+ register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2727,7 +2794,7 @@ static void write_span_rgb_GRAYSCALE8_ximage( RGB_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLubyte *ptr = PIXELADDR1( x, y );
+ register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x, y );
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -2771,7 +2838,7 @@ static void write_pixels_TRUECOLOR_pixmap( RGBA_PIXEL_ARGS )
unsigned long p;
PACK_TRUECOLOR( p, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
XMesaSetForeground( dpy, gc, p );
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -2792,7 +2859,7 @@ static void write_pixels_TRUEDITHER_pixmap( RGBA_PIXEL_ARGS )
unsigned long p;
PACK_TRUEDITHER(p, x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
XMesaSetForeground( dpy, gc, p );
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -2812,7 +2879,7 @@ static void write_pixels_8A8B8G8R_pixmap( RGBA_PIXEL_ARGS )
if (mask[i]) {
XMesaSetForeground( dpy, gc,
PACK_8A8B8G8R( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP], rgba[i][ACOMP] ));
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -2831,7 +2898,7 @@ static void write_pixels_8R8G8B_pixmap( RGBA_PIXEL_ARGS )
for (i=0;i<n;i++) {
if (mask[i]) {
XMesaSetForeground( dpy, gc, PACK_8R8G8B( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ) );
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -2850,7 +2917,7 @@ static void write_pixels_8R8G8B24_pixmap( RGBA_PIXEL_ARGS )
for (i=0;i<n;i++) {
if (mask[i]) {
XMesaSetForeground( dpy, gc, PACK_8R8G8B( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ) );
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -2869,7 +2936,7 @@ static void write_pixels_5R6G5B_pixmap( RGBA_PIXEL_ARGS )
for (i=0;i<n;i++) {
if (mask[i]) {
XMesaSetForeground( dpy, gc, PACK_5R6G5B( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ) );
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -2890,7 +2957,7 @@ static void write_pixels_DITHER_5R6G5B_pixmap( RGBA_PIXEL_ARGS )
unsigned long p;
PACK_TRUEDITHER(p, x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
XMesaSetForeground( dpy, gc, p );
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -2911,7 +2978,7 @@ static void write_pixels_DITHER_pixmap( RGBA_PIXEL_ARGS )
if (mask[i]) {
XMesaSetForeground( dpy, gc,
DITHER(x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]) );
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -2932,7 +2999,7 @@ static void write_pixels_1BIT_pixmap( RGBA_PIXEL_ARGS )
if (mask[i]) {
XMesaSetForeground( dpy, gc,
DITHER_1BIT( x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ));
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -2952,7 +3019,7 @@ static void write_pixels_HPCR_pixmap( RGBA_PIXEL_ARGS )
if (mask[i]) {
XMesaSetForeground( dpy, gc,
DITHER_HPCR( x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ));
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -2972,7 +3039,7 @@ static void write_pixels_LOOKUP_pixmap( RGBA_PIXEL_ARGS )
for (i=0;i<n;i++) {
if (mask[i]) {
XMesaSetForeground( dpy, gc, LOOKUP( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ) );
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -2991,7 +3058,7 @@ static void write_pixels_GRAYSCALE_pixmap( RGBA_PIXEL_ARGS )
for (i=0;i<n;i++) {
if (mask[i]) {
XMesaSetForeground( dpy, gc, GRAY_RGB( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ) );
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -3009,7 +3076,7 @@ static void write_pixels_TRUECOLOR_ximage( RGBA_PIXEL_ARGS )
if (mask[i]) {
unsigned long p;
PACK_TRUECOLOR( p, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
- XMesaPutPixel( img, x[i], FLIP(y[i]), p );
+ XMesaPutPixel( img, x[i], FLIP(xmesa->xm_buffer, y[i]), p );
}
}
}
@@ -3026,8 +3093,8 @@ static void write_pixels_TRUEDITHER_ximage( RGBA_PIXEL_ARGS )
for (i=0;i<n;i++) {
if (mask[i]) {
unsigned long p;
- PACK_TRUEDITHER(p, x[i], FLIP(y[i]), rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
- XMesaPutPixel( img, x[i], FLIP(y[i]), p );
+ PACK_TRUEDITHER(p, x[i], FLIP(xmesa->xm_buffer, y[i]), rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
+ XMesaPutPixel( img, x[i], FLIP(xmesa->xm_buffer, y[i]), p );
}
}
}
@@ -3042,7 +3109,7 @@ static void write_pixels_8A8B8G8R_ximage( RGBA_PIXEL_ARGS )
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLuint *ptr = PIXELADDR4( x[i], y[i] );
+ GLuint *ptr = PIXELADDR4( xmesa->xm_buffer, x[i], y[i] );
*ptr = PACK_8A8B8G8R( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP], rgba[i][ACOMP] );
}
}
@@ -3058,7 +3125,7 @@ static void write_pixels_8R8G8B_ximage( RGBA_PIXEL_ARGS )
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLuint *ptr = PIXELADDR4( x[i], y[i] );
+ GLuint *ptr = PIXELADDR4( xmesa->xm_buffer, x[i], y[i] );
*ptr = PACK_8R8G8B( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
}
}
@@ -3074,7 +3141,7 @@ static void write_pixels_8R8G8B24_ximage( RGBA_PIXEL_ARGS )
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
- bgr_t *ptr = PIXELADDR3( x[i], y[i] );
+ bgr_t *ptr = PIXELADDR3( xmesa->xm_buffer, x[i], y[i] );
ptr->r = rgba[i][RCOMP];
ptr->g = rgba[i][GCOMP];
ptr->b = rgba[i][BCOMP];
@@ -3092,7 +3159,7 @@ static void write_pixels_5R6G5B_ximage( RGBA_PIXEL_ARGS )
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLushort *ptr = PIXELADDR2( x[i], y[i] );
+ GLushort *ptr = PIXELADDR2( xmesa->xm_buffer, x[i], y[i] );
*ptr = PACK_5R6G5B( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
}
}
@@ -3108,7 +3175,7 @@ static void write_pixels_DITHER_5R6G5B_ximage( RGBA_PIXEL_ARGS )
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLushort *ptr = PIXELADDR2( x[i], y[i] );
+ GLushort *ptr = PIXELADDR2( xmesa->xm_buffer, x[i], y[i] );
PACK_TRUEDITHER( *ptr, x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
}
}
@@ -3126,7 +3193,7 @@ static void write_pixels_DITHER_ximage( RGBA_PIXEL_ARGS )
DITHER_SETUP;
for (i=0;i<n;i++) {
if (mask[i]) {
- XMesaPutPixel( img, x[i], FLIP(y[i]),
+ XMesaPutPixel( img, x[i], FLIP(xmesa->xm_buffer, y[i]),
DITHER( x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ) );
}
}
@@ -3143,7 +3210,7 @@ static void write_pixels_DITHER8_ximage( RGBA_PIXEL_ARGS )
DITHER_SETUP;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLubyte *ptr = PIXELADDR1(x[i],y[i]);
+ GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer,x[i],y[i]);
*ptr = (GLubyte) DITHER( x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
}
}
@@ -3161,7 +3228,7 @@ static void write_pixels_1BIT_ximage( RGBA_PIXEL_ARGS )
SETUP_1BIT;
for (i=0;i<n;i++) {
if (mask[i]) {
- XMesaPutPixel( img, x[i], FLIP(y[i]),
+ XMesaPutPixel( img, x[i], FLIP(xmesa->xm_buffer, y[i]),
DITHER_1BIT( x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ));
}
}
@@ -3177,7 +3244,7 @@ static void write_pixels_HPCR_ximage( RGBA_PIXEL_ARGS )
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLubyte *ptr = PIXELADDR1(x[i],y[i]);
+ GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer,x[i],y[i]);
*ptr = (GLubyte) DITHER_HPCR( x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
}
}
@@ -3195,7 +3262,7 @@ static void write_pixels_LOOKUP_ximage( RGBA_PIXEL_ARGS )
LOOKUP_SETUP;
for (i=0;i<n;i++) {
if (mask[i]) {
- XMesaPutPixel( img, x[i], FLIP(y[i]), LOOKUP(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]) );
+ XMesaPutPixel( img, x[i], FLIP(xmesa->xm_buffer, y[i]), LOOKUP(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]) );
}
}
}
@@ -3211,7 +3278,7 @@ static void write_pixels_LOOKUP8_ximage( RGBA_PIXEL_ARGS )
LOOKUP_SETUP;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLubyte *ptr = PIXELADDR1(x[i],y[i]);
+ GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer,x[i],y[i]);
*ptr = (GLubyte) LOOKUP( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
}
}
@@ -3228,7 +3295,7 @@ static void write_pixels_GRAYSCALE_ximage( RGBA_PIXEL_ARGS )
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
- XMesaPutPixel( img, x[i], FLIP(y[i]),
+ XMesaPutPixel( img, x[i], FLIP(xmesa->xm_buffer, y[i]),
GRAY_RGB( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ) );
}
}
@@ -3244,7 +3311,7 @@ static void write_pixels_GRAYSCALE8_ximage( RGBA_PIXEL_ARGS )
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLubyte *ptr = PIXELADDR1( x[i], y[i] );
+ GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer, x[i], y[i] );
*ptr = (GLubyte) GRAY_RGB( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
}
}
@@ -3273,7 +3340,7 @@ static void write_span_mono_pixmap( MONO_SPAN_ARGS )
XMesaGC gc = xmesa->xm_buffer->gc1;
register GLuint i;
register GLboolean write_all;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
write_all = GL_TRUE;
for (i=0;i<n;i++) {
if (!mask[i]) {
@@ -3306,7 +3373,7 @@ static void write_span_mono_TRUEDITHER_pixmap( MONO_SPAN_ARGS )
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
register GLubyte r, g, b;
- int yy = FLIP( y );
+ int yy = FLIP(xmesa->xm_buffer, y);
r = xmesa->red;
g = xmesa->green;
b = xmesa->blue;
@@ -3333,7 +3400,7 @@ static void write_span_mono_DITHER_pixmap( MONO_SPAN_ARGS )
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
register GLubyte r, g, b;
- int yy = FLIP( y );
+ int yy = FLIP(xmesa->xm_buffer, y);
XDITHER_SETUP(yy);
r = xmesa->red;
g = xmesa->green;
@@ -3363,7 +3430,7 @@ static void write_span_mono_1BIT_pixmap( MONO_SPAN_ARGS )
r = xmesa->red;
g = xmesa->green;
b = xmesa->blue;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
for (i=0;i<n;i++,x++) {
if (mask[i]) {
XMesaSetForeground( dpy, gc, DITHER_1BIT( x, y, r, g, b ) );
@@ -3383,7 +3450,7 @@ static void write_span_mono_ximage( MONO_SPAN_ARGS )
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
register unsigned long p = xmesa->pixel;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
for (i=0;i<n;i++,x++) {
if (mask[i]) {
XMesaPutPixel( img, x, y, p );
@@ -3404,7 +3471,7 @@ static void write_span_mono_TRUEDITHER_ximage( MONO_SPAN_ARGS )
GLint r = xmesa->red;
GLint g = xmesa->green;
GLint b = xmesa->blue;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
for (i=0;i<n;i++) {
if (mask[i]) {
unsigned long p;
@@ -3424,7 +3491,7 @@ static void write_span_mono_8A8B8G8R_ximage( MONO_SPAN_ARGS )
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
GLuint i, p, *ptr;
p = (GLuint) xmesa->pixel;
- ptr = PIXELADDR4( x, y );
+ ptr = PIXELADDR4( xmesa->xm_buffer, x, y );
for (i=0;i<n;i++) {
if (mask[i]) {
ptr[i] = p;
@@ -3442,7 +3509,7 @@ static void write_span_mono_8R8G8B_ximage( MONO_SPAN_ARGS )
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
GLuint i, p, *ptr;
p = (GLuint) xmesa->pixel;
- ptr = PIXELADDR4( x, y );
+ ptr = PIXELADDR4( xmesa->xm_buffer, x, y );
for (i=0;i<n;i++) {
if (mask[i]) {
ptr[i] = p;
@@ -3462,7 +3529,7 @@ static void write_span_mono_8R8G8B24_ximage( MONO_SPAN_ARGS )
const GLubyte g = (GLubyte) ((xmesa->pixel >> 8 ) & 0xff);
const GLubyte b = (GLubyte) ((xmesa->pixel ) & 0xff);
GLuint i;
- bgr_t *ptr = PIXELADDR3( x, y );
+ bgr_t *ptr = PIXELADDR3( xmesa->xm_buffer, x, y );
for (i=0;i<n;i++) {
if (mask[i]) {
ptr[i].r = r;
@@ -3483,7 +3550,7 @@ static void write_span_mono_DITHER_ximage( MONO_SPAN_ARGS )
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
register GLubyte r, g, b;
- int yy = FLIP(y);
+ int yy = FLIP(xmesa->xm_buffer, y);
XDITHER_SETUP(yy);
r = xmesa->red;
g = xmesa->green;
@@ -3504,7 +3571,7 @@ static void write_span_mono_DITHER8_ximage( MONO_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLubyte *ptr = PIXELADDR1(x,y);
+ register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer,x,y);
register GLubyte r, g, b;
XDITHER_SETUP(y);
r = xmesa->red;
@@ -3526,7 +3593,7 @@ static void write_span_mono_LOOKUP8_ximage( MONO_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLubyte *ptr = PIXELADDR1(x,y);
+ register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer,x,y);
register GLubyte pixel = (GLubyte) xmesa->pixel;
for (i=0;i<n;i++) {
if (mask[i]) {
@@ -3550,7 +3617,7 @@ static void write_span_mono_1BIT_ximage( MONO_SPAN_ARGS )
r = xmesa->red;
g = xmesa->green;
b = xmesa->blue;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
for (i=0;i<n;i++,x++) {
if (mask[i]) {
XMesaPutPixel( img, x, y, DITHER_1BIT( x, y, r, g, b ) );
@@ -3567,7 +3634,7 @@ static void write_span_mono_HPCR_ximage( MONO_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- register GLubyte *ptr = PIXELADDR1(x,y);
+ register GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer,x,y);
register GLubyte r, g, b;
r = xmesa->red;
g = xmesa->green;
@@ -3589,7 +3656,7 @@ static void write_span_mono_GRAYSCALE8_ximage( MONO_SPAN_ARGS )
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
GLuint i;
GLubyte p = (GLubyte) xmesa->pixel;
- GLubyte *ptr = (GLubyte *) PIXELADDR1(x,y);
+ GLubyte *ptr = (GLubyte *) PIXELADDR1( xmesa->xm_buffer,x,y);
for (i=0;i<n;i++) {
if (mask[i]) {
ptr[i] = p;
@@ -3606,12 +3673,12 @@ static void write_span_mono_GRAYSCALE8_ximage( MONO_SPAN_ARGS )
static void write_span_mono_DITHER_5R6G5B_ximage( MONO_SPAN_ARGS )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- register GLushort *ptr = PIXELADDR2( x, y );
+ register GLushort *ptr = PIXELADDR2( xmesa->xm_buffer, x, y );
GLuint i;
GLint r = xmesa->red;
GLint g = xmesa->green;
GLint b = xmesa->blue;
- y = FLIP( y );
+ y = FLIP(xmesa->xm_buffer, y);
for (i=0;i<n;i++) {
if (mask[i]) {
PACK_TRUEDITHER(ptr[i], x+i, y, r, g, b);
@@ -3642,7 +3709,7 @@ static void write_pixels_mono_pixmap( MONO_PIXEL_ARGS )
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -3668,7 +3735,7 @@ static void write_pixels_mono_TRUEDITHER_pixmap( MONO_PIXEL_ARGS )
unsigned long p;
PACK_TRUEDITHER(p, x[i], y[i], r, g, b);
XMesaSetForeground( dpy, gc, p );
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -3693,7 +3760,7 @@ static void write_pixels_mono_DITHER_pixmap( MONO_PIXEL_ARGS )
for (i=0;i<n;i++) {
if (mask[i]) {
XMesaSetForeground( dpy, gc, DITHER( x[i], y[i], r, g, b ) );
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -3718,7 +3785,7 @@ static void write_pixels_mono_1BIT_pixmap( MONO_PIXEL_ARGS )
for (i=0;i<n;i++) {
if (mask[i]) {
XMesaSetForeground( dpy, gc, DITHER_1BIT( x[i], y[i], r, g, b ) );
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -3736,7 +3803,7 @@ static void write_pixels_mono_ximage( MONO_PIXEL_ARGS )
register unsigned long p = xmesa->pixel;
for (i=0;i<n;i++) {
if (mask[i]) {
- XMesaPutPixel( img, x[i], FLIP(y[i]), p );
+ XMesaPutPixel( img, x[i], FLIP(xmesa->xm_buffer, y[i]), p );
}
}
}
@@ -3757,8 +3824,8 @@ static void write_pixels_mono_TRUEDITHER_ximage( MONO_PIXEL_ARGS )
for (i=0;i<n;i++) {
if (mask[i]) {
unsigned long p;
- PACK_TRUEDITHER(p, x[i], FLIP(y[i]), r, g, b);
- XMesaPutPixel( img, x[i], FLIP(y[i]), p );
+ PACK_TRUEDITHER(p, x[i], FLIP(xmesa->xm_buffer, y[i]), r, g, b);
+ XMesaPutPixel( img, x[i], FLIP(xmesa->xm_buffer, y[i]), p );
}
}
}
@@ -3776,7 +3843,7 @@ static void write_pixels_mono_8A8B8G8R_ximage( MONO_PIXEL_ARGS )
register GLuint p = (GLuint) xmesa->pixel;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLuint *ptr = PIXELADDR4( x[i], y[i] );
+ GLuint *ptr = PIXELADDR4( xmesa->xm_buffer, x[i], y[i] );
*ptr = p;
}
}
@@ -3794,7 +3861,7 @@ static void write_pixels_mono_8R8G8B_ximage( MONO_PIXEL_ARGS )
register GLuint p = (GLuint) xmesa->pixel;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLuint *ptr = PIXELADDR4( x[i], y[i] );
+ GLuint *ptr = PIXELADDR4( xmesa->xm_buffer, x[i], y[i] );
*ptr = p;
}
}
@@ -3814,7 +3881,7 @@ static void write_pixels_mono_8R8G8B24_ximage( MONO_PIXEL_ARGS )
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
- bgr_t *ptr = PIXELADDR3( x[i], y[i] );
+ bgr_t *ptr = PIXELADDR3( xmesa->xm_buffer, x[i], y[i] );
ptr->r = r;
ptr->g = g;
ptr->b = b;
@@ -3839,7 +3906,7 @@ static void write_pixels_mono_DITHER_ximage( MONO_PIXEL_ARGS )
b = xmesa->blue;
for (i=0;i<n;i++) {
if (mask[i]) {
- XMesaPutPixel( img, x[i], FLIP(y[i]), DITHER( x[i], y[i], r, g, b ) );
+ XMesaPutPixel( img, x[i], FLIP(xmesa->xm_buffer, y[i]), DITHER( x[i], y[i], r, g, b ) );
}
}
}
@@ -3860,7 +3927,7 @@ static void write_pixels_mono_DITHER8_ximage( MONO_PIXEL_ARGS )
b = xmesa->blue;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLubyte *ptr = PIXELADDR1(x[i],y[i]);
+ GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer,x[i],y[i]);
*ptr = (GLubyte) DITHER( x[i], y[i], r, g, b );
}
}
@@ -3878,7 +3945,7 @@ static void write_pixels_mono_LOOKUP8_ximage( MONO_PIXEL_ARGS )
register GLubyte pixel = (GLubyte) xmesa->pixel;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLubyte *ptr = PIXELADDR1(x[i],y[i]);
+ GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer,x[i],y[i]);
*ptr = pixel;
}
}
@@ -3902,7 +3969,7 @@ static void write_pixels_mono_1BIT_ximage( MONO_PIXEL_ARGS )
b = xmesa->blue;
for (i=0;i<n;i++) {
if (mask[i]) {
- XMesaPutPixel( img, x[i], FLIP(y[i]), DITHER_1BIT( x[i], y[i], r, g, b ));
+ XMesaPutPixel( img, x[i], FLIP(xmesa->xm_buffer, y[i]), DITHER_1BIT( x[i], y[i], r, g, b ));
}
}
}
@@ -3922,7 +3989,7 @@ static void write_pixels_mono_HPCR_ximage( MONO_PIXEL_ARGS )
b = xmesa->blue;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLubyte *ptr = PIXELADDR1(x[i],y[i]);
+ GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer,x[i],y[i]);
*ptr = DITHER_HPCR( x[i], y[i], r, g, b );
}
}
@@ -3940,7 +4007,7 @@ static void write_pixels_mono_GRAYSCALE8_ximage( MONO_PIXEL_ARGS )
register GLubyte p = (GLubyte) xmesa->pixel;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLubyte *ptr = PIXELADDR1(x[i],y[i]);
+ GLubyte *ptr = PIXELADDR1( xmesa->xm_buffer,x[i],y[i]);
*ptr = p;
}
}
@@ -3960,7 +4027,7 @@ static void write_pixels_mono_DITHER_5R6G5B_ximage( MONO_PIXEL_ARGS )
int b = xmesa->blue;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLushort *ptr = PIXELADDR2( x[i], y[i] );
+ GLushort *ptr = PIXELADDR2( xmesa->xm_buffer, x[i], y[i] );
PACK_TRUEDITHER(*ptr, x[i], y[i], r, g, b);
}
}
@@ -3991,7 +4058,7 @@ static void write_span_index_pixmap( INDEX_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
for (i=0;i<n;i++,x++) {
if (mask[i]) {
XMesaSetForeground( dpy, gc, (unsigned long) index[i] );
@@ -4011,7 +4078,7 @@ static void write_span_index8_pixmap( INDEX8_SPAN_ARGS )
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
XMesaGC gc = xmesa->xm_buffer->gc2;
register GLuint i;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
for (i=0;i<n;i++,x++) {
if (mask[i]) {
XMesaSetForeground( dpy, gc, (unsigned long) index[i] );
@@ -4029,7 +4096,7 @@ static void write_span_index_ximage( INDEX_SPAN_ARGS )
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
XMesaImage *img = xmesa->xm_buffer->backimage;
register GLuint i;
- y = FLIP(y);
+ y = FLIP(xmesa->xm_buffer, y);
for (i=0;i<n;i++,x++) {
if (mask[i]) {
XMesaPutPixel( img, x, y, (unsigned long) index[i] );
@@ -4070,7 +4137,7 @@ static void write_span_index8_ximage8( const GLcontext *ctx, GLuint n,
const GLubyte mask[] )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- GLubyte *dst = PIXELADDR1(x,y);
+ GLubyte *dst = PIXELADDR1( xmesa->xm_buffer,x,y);
if (mask) {
GLuint i;
for (i=0;i<n;i++) {
@@ -4108,7 +4175,7 @@ static void write_pixels_index_pixmap( INDEX_PIXELS_ARGS )
for (i=0;i<n;i++) {
if (mask[i]) {
XMesaSetForeground( dpy, gc, (unsigned long) index[i] );
- XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(y[i]) );
+ XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) );
}
}
}
@@ -4124,7 +4191,7 @@ static void write_pixels_index_ximage( INDEX_PIXELS_ARGS )
register GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
- XMesaPutPixel( img, x[i], FLIP(y[i]), (unsigned long) index[i] );
+ XMesaPutPixel( img, x[i], FLIP(xmesa->xm_buffer, y[i]), (unsigned long) index[i] );
}
}
}
@@ -4145,16 +4212,22 @@ static void read_index_span( const GLcontext *ctx,
GLuint n, GLint x, GLint y, GLuint index[] )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaBuffer source;
GLuint i;
- y = FLIP(y);
+ if (xmesa->use_read_buffer)
+ source = xmesa->xm_read_buffer;
+ else
+ source = xmesa->xm_buffer;
- if (xmesa->xm_buffer->buffer) {
+ y = FLIP(source, y);
+
+ if (source->buffer) {
#ifndef XFree86Server
XMesaImage *span = NULL;
int error;
catch_xgetimage_errors( xmesa->display );
- span = XGetImage( xmesa->display, xmesa->xm_buffer->buffer,
+ span = XGetImage( xmesa->display, source->buffer,
x, y, n, 1, AllPlanes, ZPixmap );
error = check_xgetimage_errors();
if (span && !error) {
@@ -4172,13 +4245,13 @@ static void read_index_span( const GLcontext *ctx,
XMesaDestroyImage( span );
}
#else
- (*xmesa->display->GetImage)(xmesa->xm_buffer->buffer,
+ (*xmesa->display->GetImage)(source->buffer,
x, y, n, 1, ZPixmap,
~0L, (pointer)index);
#endif
}
- else if (xmesa->xm_buffer->backimage) {
- XMesaImage *img = xmesa->xm_buffer->backimage;
+ else if (source->backimage) {
+ XMesaImage *img = source->backimage;
for (i=0;i<n;i++,x++) {
index[i] = (GLuint) XMesaGetPixel( img, x, y );
}
@@ -4195,22 +4268,28 @@ static void read_color_span( const GLcontext *ctx,
GLubyte rgba[][4] )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaBuffer source;
register GLuint i;
- if (xmesa->xm_buffer->buffer) {
+ if (xmesa->use_read_buffer)
+ source = xmesa->xm_read_buffer;
+ else
+ source = xmesa->xm_buffer;
+
+ if (source->buffer) {
XMesaImage *span = NULL;
int error;
#ifdef XFree86Server
span = XMesaCreateImage(GET_VISUAL_DEPTH(xmesa->xm_visual), n, 1, NULL);
span->data = (char *)MALLOC(span->height * span->bytes_per_line);
error = (!span->data);
- (*xmesa->display->GetImage)(xmesa->xm_buffer->buffer,
- x, FLIP(y), n, 1, ZPixmap,
+ (*xmesa->display->GetImage)(source->buffer,
+ x, FLIP(source, y), n, 1, ZPixmap,
~0L, (pointer)span->data);
#else
catch_xgetimage_errors( xmesa->display );
- span = XGetImage( xmesa->display, xmesa->xm_buffer->buffer,
- x, FLIP(y), n, 1, AllPlanes, ZPixmap );
+ span = XGetImage( xmesa->display, source->buffer,
+ x, FLIP(source, y), n, 1, AllPlanes, ZPixmap );
error = check_xgetimage_errors();
#endif
if (span && !error) {
@@ -4290,9 +4369,9 @@ static void read_color_span( const GLcontext *ctx,
case PF_LOOKUP:
case PF_GRAYSCALE:
{
- GLubyte *rTable = xmesa->xm_buffer->pixel_to_r;
- GLubyte *gTable = xmesa->xm_buffer->pixel_to_g;
- GLubyte *bTable = xmesa->xm_buffer->pixel_to_b;
+ GLubyte *rTable = source->pixel_to_r;
+ GLubyte *gTable = source->pixel_to_g;
+ GLubyte *bTable = source->pixel_to_b;
if (GET_VISUAL_DEPTH(xmesa->xm_visual)==8) {
GLubyte *ptr1 = (GLubyte *) span->data;
for (i=0;i<n;i++) {
@@ -4343,7 +4422,7 @@ static void read_color_span( const GLcontext *ctx,
XMesaDestroyImage( span );
}
}
- else if (xmesa->xm_buffer->backimage) {
+ else if (source->backimage) {
switch (xmesa->pixelformat) {
case PF_TRUECOLOR:
case PF_TRUEDITHER:
@@ -4359,8 +4438,8 @@ static void read_color_span( const GLcontext *ctx,
GLint rShift = xmesa->xm_visual->rshift;
GLint gShift = xmesa->xm_visual->gshift;
GLint bShift = xmesa->xm_visual->bshift;
- XMesaImage *img = xmesa->xm_buffer->backimage;
- y = FLIP(y);
+ XMesaImage *img = source->backimage;
+ y = FLIP(source, y);
for (i=0;i<n;i++) {
unsigned long p;
p = XMesaGetPixel( img, x+i, y );
@@ -4373,7 +4452,7 @@ static void read_color_span( const GLcontext *ctx,
break;
case PF_8A8B8G8R:
{
- GLuint *ptr4 = PIXELADDR4( x, y );
+ GLuint *ptr4 = PIXELADDR4( source, x, y );
for (i=0;i<n;i++) {
GLuint p4 = *ptr4++;
rgba[i][RCOMP] = (GLubyte) ( p4 & 0xff);
@@ -4385,7 +4464,7 @@ static void read_color_span( const GLcontext *ctx,
break;
case PF_8R8G8B:
{
- GLuint *ptr4 = PIXELADDR4( x, y );
+ GLuint *ptr4 = PIXELADDR4( source, x, y );
for (i=0;i<n;i++) {
GLuint p4 = *ptr4++;
rgba[i][RCOMP] = (GLubyte) ((p4 >> 16) & 0xff);
@@ -4397,7 +4476,7 @@ static void read_color_span( const GLcontext *ctx,
break;
case PF_8R8G8B24:
{
- bgr_t *ptr3 = PIXELADDR3( x, y );
+ bgr_t *ptr3 = PIXELADDR3( source, x, y );
for (i=0;i<n;i++) {
rgba[i][RCOMP] = ptr3[i].r;
rgba[i][GCOMP] = ptr3[i].g;
@@ -4409,7 +4488,7 @@ static void read_color_span( const GLcontext *ctx,
break;
case PF_HPCR:
{
- GLubyte *ptr1 = PIXELADDR1( x, y );
+ GLubyte *ptr1 = PIXELADDR1( source, x, y );
for (i=0;i<n;i++) {
GLubyte p = *ptr1++;
rgba[i][RCOMP] = p & 0xE0;
@@ -4423,11 +4502,11 @@ static void read_color_span( const GLcontext *ctx,
case PF_LOOKUP:
case PF_GRAYSCALE:
{
- GLubyte *rTable = xmesa->xm_buffer->pixel_to_r;
- GLubyte *gTable = xmesa->xm_buffer->pixel_to_g;
- GLubyte *bTable = xmesa->xm_buffer->pixel_to_b;
+ GLubyte *rTable = source->pixel_to_r;
+ GLubyte *gTable = source->pixel_to_g;
+ GLubyte *bTable = source->pixel_to_b;
if (GET_VISUAL_DEPTH(xmesa->xm_visual)==8) {
- GLubyte *ptr1 = PIXELADDR1(x,y);
+ GLubyte *ptr1 = PIXELADDR1( source, x, y );
for (i=0;i<n;i++) {
unsigned long p = *ptr1++;
rgba[i][RCOMP] = rTable[p];
@@ -4437,8 +4516,8 @@ static void read_color_span( const GLcontext *ctx,
}
}
else {
- XMesaImage *img = xmesa->xm_buffer->backimage;
- y = FLIP(y);
+ XMesaImage *img = source->backimage;
+ y = FLIP(source, y);
for (i=0;i<n;i++,x++) {
unsigned long p;
p = XMesaGetPixel( img, x, y );
@@ -4452,9 +4531,9 @@ static void read_color_span( const GLcontext *ctx,
break;
case PF_1BIT:
{
- XMesaImage *img = xmesa->xm_buffer->backimage;
+ XMesaImage *img = source->backimage;
int bitFlip = xmesa->xm_visual->bitFlip;
- y = FLIP(y);
+ y = FLIP(source, y);
for (i=0;i<n;i++,x++) {
unsigned long p;
p = XMesaGetPixel( img, x, y ) ^ bitFlip;
@@ -4483,20 +4562,27 @@ static void read_index_pixels( const GLcontext *ctx,
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
- if (xmesa->xm_buffer->buffer) {
+ XMesaBuffer source;
+
+ if (xmesa->use_read_buffer)
+ source = xmesa->xm_read_buffer;
+ else
+ source = xmesa->xm_buffer;
+
+ if (source->buffer) {
for (i=0;i<n;i++) {
if (mask[i]) {
indx[i] = (GLuint) read_pixel( xmesa->display,
- xmesa->xm_buffer->buffer,
- x[i], FLIP(y[i]) );
+ source->buffer,
+ x[i], FLIP(source, y[i]) );
}
}
}
- else if (xmesa->xm_buffer->backimage) {
- XMesaImage *img = xmesa->xm_buffer->backimage;
+ else if (source->backimage) {
+ XMesaImage *img = source->backimage;
for (i=0;i<n;i++) {
if (mask[i]) {
- indx[i] = (GLuint) XMesaGetPixel( img, x[i], FLIP(y[i]) );
+ indx[i] = (GLuint) XMesaGetPixel( img, x[i], FLIP(source, y[i]) );
}
}
}
@@ -4510,10 +4596,18 @@ static void read_color_pixels( const GLcontext *ctx,
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
XMesaDisplay *dpy = xmesa->xm_visual->display;
- XMesaDrawable buffer = xmesa->xm_buffer->buffer;
register GLuint i;
+ XMesaBuffer source;
+ XMesaDrawable buffer;
+
+ if (xmesa->use_read_buffer)
+ source = xmesa->xm_read_buffer;
+ else
+ source = xmesa->xm_buffer;
- if (xmesa->xm_buffer->buffer) {
+ buffer = source->buffer; /* the X drawable */
+
+ if (source->buffer) {
switch (xmesa->pixelformat) {
case PF_TRUECOLOR:
case PF_TRUEDITHER:
@@ -4532,7 +4626,7 @@ static void read_color_pixels( const GLcontext *ctx,
for (i=0;i<n;i++) {
if (mask[i]) {
unsigned long p = read_pixel( dpy, buffer,
- x[i], FLIP(y[i]) );
+ x[i], FLIP(source, y[i]) );
rgba[i][RCOMP] = pixelToR[(p & rMask) >> rShift];
rgba[i][GCOMP] = pixelToG[(p & gMask) >> gShift];
rgba[i][BCOMP] = pixelToB[(p & bMask) >> bShift];
@@ -4545,7 +4639,7 @@ static void read_color_pixels( const GLcontext *ctx,
for (i=0;i<n;i++) {
if (mask[i]) {
unsigned long p = read_pixel( dpy, buffer,
- x[i], FLIP(y[i]) );
+ x[i], FLIP(source, y[i]) );
rgba[i][RCOMP] = (GLubyte) ( p & 0xff);
rgba[i][GCOMP] = (GLubyte) ((p >> 8) & 0xff);
rgba[i][BCOMP] = (GLubyte) ((p >> 16) & 0xff);
@@ -4557,7 +4651,7 @@ static void read_color_pixels( const GLcontext *ctx,
for (i=0;i<n;i++) {
if (mask[i]) {
unsigned long p = read_pixel( dpy, buffer,
- x[i], FLIP(y[i]) );
+ x[i], FLIP(source, y[i]) );
rgba[i][RCOMP] = (GLubyte) ((p >> 16) & 0xff);
rgba[i][GCOMP] = (GLubyte) ((p >> 8) & 0xff);
rgba[i][BCOMP] = (GLubyte) ( p & 0xff);
@@ -4569,7 +4663,7 @@ static void read_color_pixels( const GLcontext *ctx,
for (i=0;i<n;i++) {
if (mask[i]) {
unsigned long p = read_pixel( dpy, buffer,
- x[i], FLIP(y[i]) );
+ x[i], FLIP(source, y[i]) );
rgba[i][RCOMP] = (GLubyte) ((p >> 16) & 0xff);
rgba[i][GCOMP] = (GLubyte) ((p >> 8) & 0xff);
rgba[i][BCOMP] = (GLubyte) ( p & 0xff);
@@ -4582,7 +4676,7 @@ static void read_color_pixels( const GLcontext *ctx,
for (i=0;i<n;i++) {
if (mask[i]) {
unsigned long p = read_pixel( dpy, buffer,
- x[i], FLIP(y[i]) );
+ x[i], FLIP(source, y[i]) );
rgba[i][RCOMP] = (GLubyte) ( p & 0xE0 );
rgba[i][GCOMP] = (GLubyte) ((p & 0x1C) << 3);
rgba[i][BCOMP] = (GLubyte) ((p & 0x03) << 6);
@@ -4595,13 +4689,13 @@ static void read_color_pixels( const GLcontext *ctx,
case PF_LOOKUP:
case PF_GRAYSCALE:
{
- GLubyte *rTable = xmesa->xm_buffer->pixel_to_r;
- GLubyte *gTable = xmesa->xm_buffer->pixel_to_g;
- GLubyte *bTable = xmesa->xm_buffer->pixel_to_b;
+ GLubyte *rTable = source->pixel_to_r;
+ GLubyte *gTable = source->pixel_to_g;
+ GLubyte *bTable = source->pixel_to_b;
for (i=0;i<n;i++) {
if (mask[i]) {
unsigned long p = read_pixel( dpy, buffer,
- x[i], FLIP(y[i]) );
+ x[i], FLIP(source, y[i]) );
rgba[i][RCOMP] = rTable[p];
rgba[i][GCOMP] = gTable[p];
rgba[i][BCOMP] = bTable[p];
@@ -4616,7 +4710,7 @@ static void read_color_pixels( const GLcontext *ctx,
for (i=0;i<n;i++) {
if (mask[i]) {
unsigned long p = read_pixel( dpy, buffer,
- x[i], FLIP(y[i])) ^ bitFlip;
+ x[i], FLIP(source, y[i])) ^ bitFlip;
rgba[i][RCOMP] = (GLubyte) (p * 255);
rgba[i][GCOMP] = (GLubyte) (p * 255);
rgba[i][BCOMP] = (GLubyte) (p * 255);
@@ -4630,7 +4724,7 @@ static void read_color_pixels( const GLcontext *ctx,
return;
}
}
- else if (xmesa->xm_buffer->backimage) {
+ else if (source->backimage) {
switch (xmesa->pixelformat) {
case PF_TRUECOLOR:
case PF_TRUEDITHER:
@@ -4646,11 +4740,11 @@ static void read_color_pixels( const GLcontext *ctx,
GLint rShift = xmesa->xm_visual->rshift;
GLint gShift = xmesa->xm_visual->gshift;
GLint bShift = xmesa->xm_visual->bshift;
- XMesaImage *img = xmesa->xm_buffer->backimage;
+ XMesaImage *img = source->backimage;
for (i=0;i<n;i++) {
if (mask[i]) {
unsigned long p;
- p = XMesaGetPixel( img, x[i], FLIP(y[i]) );
+ p = XMesaGetPixel( img, x[i], FLIP(source, y[i]) );
rgba[i][RCOMP] = pixelToR[(p & rMask) >> rShift];
rgba[i][GCOMP] = pixelToG[(p & gMask) >> gShift];
rgba[i][BCOMP] = pixelToB[(p & bMask) >> bShift];
@@ -4662,7 +4756,7 @@ static void read_color_pixels( const GLcontext *ctx,
case PF_8A8B8G8R:
for (i=0;i<n;i++) {
if (mask[i]) {
- GLuint *ptr4 = PIXELADDR4( x[i], y[i] );
+ GLuint *ptr4 = PIXELADDR4( source, x[i], y[i] );
GLuint p4 = *ptr4;
rgba[i][RCOMP] = (GLubyte) ( p4 & 0xff);
rgba[i][GCOMP] = (GLubyte) ((p4 >> 8) & 0xff);
@@ -4674,7 +4768,7 @@ static void read_color_pixels( const GLcontext *ctx,
case PF_8R8G8B:
for (i=0;i<n;i++) {
if (mask[i]) {
- GLuint *ptr4 = PIXELADDR4( x[i], y[i] );
+ GLuint *ptr4 = PIXELADDR4( source, x[i], y[i] );
GLuint p4 = *ptr4;
rgba[i][RCOMP] = (GLubyte) ((p4 >> 16) & 0xff);
rgba[i][GCOMP] = (GLubyte) ((p4 >> 8) & 0xff);
@@ -4686,7 +4780,7 @@ static void read_color_pixels( const GLcontext *ctx,
case PF_8R8G8B24:
for (i=0;i<n;i++) {
if (mask[i]) {
- bgr_t *ptr3 = PIXELADDR3( x[i], y[i] );
+ bgr_t *ptr3 = PIXELADDR3( source, x[i], y[i] );
rgba[i][RCOMP] = ptr3->r;
rgba[i][GCOMP] = ptr3->g;
rgba[i][BCOMP] = ptr3->b;
@@ -4697,7 +4791,7 @@ static void read_color_pixels( const GLcontext *ctx,
case PF_HPCR:
for (i=0;i<n;i++) {
if (mask[i]) {
- GLubyte *ptr1 = PIXELADDR1( x[i], y[i] );
+ GLubyte *ptr1 = PIXELADDR1( source, x[i], y[i] );
GLubyte p = *ptr1;
rgba[i][RCOMP] = p & 0xE0;
rgba[i][GCOMP] = (p & 0x1C) << 3;
@@ -4710,14 +4804,14 @@ static void read_color_pixels( const GLcontext *ctx,
case PF_LOOKUP:
case PF_GRAYSCALE:
{
- GLubyte *rTable = xmesa->xm_buffer->pixel_to_r;
- GLubyte *gTable = xmesa->xm_buffer->pixel_to_g;
- GLubyte *bTable = xmesa->xm_buffer->pixel_to_b;
- XMesaImage *img = xmesa->xm_buffer->backimage;
+ GLubyte *rTable = source->pixel_to_r;
+ GLubyte *gTable = source->pixel_to_g;
+ GLubyte *bTable = source->pixel_to_b;
+ XMesaImage *img = source->backimage;
for (i=0;i<n;i++) {
if (mask[i]) {
unsigned long p;
- p = XMesaGetPixel( img, x[i], FLIP(y[i]) );
+ p = XMesaGetPixel( img, x[i], FLIP(source, y[i]) );
rgba[i][RCOMP] = rTable[p];
rgba[i][GCOMP] = gTable[p];
rgba[i][BCOMP] = bTable[p];
@@ -4728,12 +4822,12 @@ static void read_color_pixels( const GLcontext *ctx,
break;
case PF_1BIT:
{
- XMesaImage *img = xmesa->xm_buffer->backimage;
+ XMesaImage *img = source->backimage;
int bitFlip = xmesa->xm_visual->bitFlip;
for (i=0;i<n;i++) {
if (mask[i]) {
unsigned long p;
- p = XMesaGetPixel( img, x[i], FLIP(y[i]) ) ^ bitFlip;
+ p = XMesaGetPixel( img, x[i], FLIP(source, y[i]) ) ^ bitFlip;
rgba[i][RCOMP] = (GLubyte) (p * 255);
rgba[i][GCOMP] = (GLubyte) (p * 255);
rgba[i][BCOMP] = (GLubyte) (p * 255);
@@ -4750,12 +4844,82 @@ static void read_color_pixels( const GLcontext *ctx,
}
+
+#ifndef XFree86Server
+/*
+ * This function implements glDrawPixels() with an XPutImage call when
+ * drawing to the front buffer (X Window drawable).
+ * The image format must be GL_BGRA to match the PF_8R8G8B pixel format.
+ * XXX top/bottom edge clipping is broken!
+ */
+static GLboolean
+drawpixels_8R8G8B( GLcontext *ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid *pixels )
+{
+ const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+ XMesaDisplay *dpy = xmesa->xm_visual->display;
+ XMesaDrawable buffer = xmesa->xm_buffer->buffer;
+ XMesaGC gc = xmesa->xm_buffer->gc1;
+ assert(dpy);
+ assert(buffer);
+ assert(gc);
+
+ /* XXX also check for pixel scale/bias/lookup/zooming! */
+ if (format == GL_BGRA && type == GL_UNSIGNED_BYTE) {
+ int dstX = x;
+ int dstY = y;
+ int w = width;
+ int h = height;
+ int srcX = unpack->SkipPixels;
+ int srcY = unpack->SkipRows;
+ if (_mesa_clip_pixelrect(ctx, &dstX, &dstY, &w, &h, &srcX, &srcY)) {
+ XMesaImage ximage;
+ MEMSET(&ximage, 0, sizeof(XMesaImage));
+ ximage.width = width;
+ ximage.height = height;
+ ximage.format = ZPixmap;
+ ximage.data = (char *) pixels + (height - 1) * width * 4;
+ ximage.byte_order = LSBFirst;
+ ximage.bitmap_unit = 32;
+ ximage.bitmap_bit_order = LSBFirst;
+ ximage.bitmap_pad = 32;
+ ximage.depth = 24;
+ ximage.bytes_per_line = -width * 4;
+ ximage.bits_per_pixel = 32;
+ ximage.red_mask = 0xff0000;
+ ximage.green_mask = 0x00ff00;
+ ximage.blue_mask = 0x0000ff;
+ dstY = FLIP(xmesa->xm_buffer,dstY) - height + 1;
+ XPutImage(dpy, buffer, gc, &ximage, srcX, srcY, dstX, dstY, w, h);
+ return GL_TRUE;
+ }
+ }
+ return GL_FALSE;
+}
+#endif
+
+
+
+
static const GLubyte *get_string( GLcontext *ctx, GLenum name )
{
(void) ctx;
switch (name) {
case GL_RENDERER:
+#ifdef XFree86Server
+ return (const GLubyte *) "Mesa GLX Indirect";
+#else
return (const GLubyte *) "Mesa X11";
+#endif
+ case GL_VENDOR:
+#ifdef XFree86Server
+ return (const GLubyte *) "Precision Insight, Inc.";
+#else
+ return NULL;
+#endif
default:
return NULL;
}
@@ -4763,7 +4927,6 @@ static const GLubyte *get_string( GLcontext *ctx, GLenum name )
-
/*
* Initialize all the DD.* function pointers depending on the color
* buffer configuration. This is mainly called by XMesaMakeCurrent.
@@ -4774,6 +4937,9 @@ void xmesa_update_state( GLcontext *ctx )
int depth=GET_VISUAL_DEPTH(xmesa->xm_visual);
(void) DitherValues; /* silenced unused var warning */
+#ifndef XFree86Server
+ (void) drawpixels_8R8G8B;
+#endif
/*
* Always the same:
@@ -4787,12 +4953,14 @@ void xmesa_update_state( GLcontext *ctx )
ctx->Driver.RenderStart = 0;
ctx->Driver.RenderFinish = 0;
- ctx->Driver.SetBuffer = set_buffer;
+ ctx->Driver.SetDrawBuffer = set_draw_buffer;
+ ctx->Driver.SetReadBuffer = set_read_buffer;
ctx->Driver.Index = set_index;
ctx->Driver.Color = set_color;
ctx->Driver.ClearIndex = clear_index;
ctx->Driver.ClearColor = clear_color;
+ ctx->Driver.Clear = clear_buffers;
ctx->Driver.IndexMask = index_mask;
ctx->Driver.ColorMask = color_mask;
ctx->Driver.LogicOp = logicop;
@@ -4804,12 +4972,44 @@ void xmesa_update_state( GLcontext *ctx )
/* ctx->Driver.TriangleCaps = DD_TRI_CULL; */
+ /* setup pointers to front and back buffer clear functions */
+ /* XXX this bit of code could be moved to a one-time init */
+ xmesa->xm_buffer->front_clear_func = clear_pixmap;
+ if (sizeof(GLushort)!=2 || sizeof(GLuint)!=4) {
+ /* Do this on Crays */
+ xmesa->xm_buffer->back_clear_func = clear_nbit_ximage;
+ }
+ else {
+ /* Do this on most machines */
+ switch (xmesa->xm_visual->BitsPerPixel) {
+ case 8:
+ if (xmesa->xm_visual->hpcr_clear_flag) {
+ xmesa->xm_buffer->back_clear_func = clear_HPCR_ximage;
+ }
+ else {
+ xmesa->xm_buffer->back_clear_func = clear_8bit_ximage;
+ }
+ break;
+ case 16:
+ xmesa->xm_buffer->back_clear_func = clear_16bit_ximage;
+ break;
+ case 24:
+ xmesa->xm_buffer->back_clear_func = clear_24bit_ximage;
+ break;
+ case 32:
+ xmesa->xm_buffer->back_clear_func = clear_32bit_ximage;
+ break;
+ default:
+ xmesa->xm_buffer->back_clear_func = clear_nbit_ximage;
+ break;
+ }
+ }
+
/*
* These drawing functions depend on color buffer config:
*/
if (xmesa->xm_buffer->buffer!=XIMAGE) {
/* Writing to window or back pixmap */
- ctx->Driver.Clear = clear_pixmap;
switch (xmesa->pixelformat) {
case PF_INDEX:
ctx->Driver.WriteCI32Span = write_span_index_pixmap;
@@ -4845,6 +5045,7 @@ void xmesa_update_state( GLcontext *ctx )
ctx->Driver.WriteMonoRGBASpan = write_span_mono_pixmap;
ctx->Driver.WriteRGBAPixels = write_pixels_8R8G8B_pixmap;
ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_pixmap;
+ ctx->Driver.DrawPixels = NULL; /*drawpixels_8R8G8B;*/
break;
case PF_8R8G8B24:
ctx->Driver.WriteRGBASpan = write_span_8R8G8B24_pixmap;
@@ -4887,8 +5088,7 @@ void xmesa_update_state( GLcontext *ctx )
ctx->Driver.WriteMonoRGBASpan = write_span_mono_pixmap;
ctx->Driver.WriteRGBAPixels = write_pixels_HPCR_pixmap;
ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_pixmap;
- if (xmesa->xm_visual->hpcr_clear_flag)
- {
+ if (xmesa->xm_visual->hpcr_clear_flag) {
ctx->Driver.ClearColor = clear_color_HPCR_pixmap;
}
break;
@@ -4913,30 +5113,6 @@ void xmesa_update_state( GLcontext *ctx )
}
else if (xmesa->xm_buffer->buffer==XIMAGE) {
/* Writing to back XImage */
- if (sizeof(GLushort)!=2 || sizeof(GLuint)!=4) {
- /* Do this on Crays */
- ctx->Driver.Clear = clear_nbit_ximage;
- }
- else {
- /* Do this on most machines */
- switch (xmesa->xm_buffer->backimage->bits_per_pixel) {
- case 8:
- ctx->Driver.Clear = clear_8bit_ximage;
- break;
- case 16:
- ctx->Driver.Clear = clear_16bit_ximage;
- break;
- case 24:
- ctx->Driver.Clear = clear_24bit_ximage;
- break;
- case 32:
- ctx->Driver.Clear = clear_32bit_ximage;
- break;
- default:
- ctx->Driver.Clear = clear_nbit_ximage;
- break;
- }
- }
switch (xmesa->pixelformat) {
case PF_INDEX:
ctx->Driver.WriteCI32Span = write_span_index_ximage;
@@ -4976,6 +5152,7 @@ void xmesa_update_state( GLcontext *ctx )
ctx->Driver.WriteMonoRGBASpan = write_span_mono_8R8G8B_ximage;
ctx->Driver.WriteRGBAPixels = write_pixels_8R8G8B_ximage;
ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_8R8G8B_ximage;
+ ctx->Driver.DrawPixels = NULL;
break;
case PF_8R8G8B24:
ctx->Driver.WriteRGBASpan = write_span_8R8G8B24_ximage;
@@ -5027,10 +5204,8 @@ void xmesa_update_state( GLcontext *ctx )
ctx->Driver.WriteMonoRGBASpan = write_span_mono_HPCR_ximage;
ctx->Driver.WriteRGBAPixels = write_pixels_HPCR_ximage;
ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_HPCR_ximage;
- if (xmesa->xm_visual->hpcr_clear_flag)
- {
- ctx->Driver.Clear = clear_HPCR_ximage;
- ctx->Driver.ClearColor = clear_color_HPCR_ximage;
+ if (xmesa->xm_visual->hpcr_clear_flag) {
+ ctx->Driver.ClearColor = clear_color_HPCR_ximage;
}
break;
case PF_LOOKUP:
diff --git a/xc/extras/Mesa/src/X/xmesa3.c b/xc/extras/Mesa/src/X/xmesa3.c
index e4bc68d92..80ba3d92f 100644
--- a/xc/extras/Mesa/src/X/xmesa3.c
+++ b/xc/extras/Mesa/src/X/xmesa3.c
@@ -1,8 +1,8 @@
-/* $Id: xmesa3.c,v 1.1 1999/12/05 23:10:27 daryll Exp $ */
+/* $Id: xmesa3.c,v 1.2 2000/01/30 00:27:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,7 +25,6 @@
*/
-
/*
* Mesa/X11 interface, part 3.
*
@@ -33,31 +32,14 @@
* It should be fairly easy to write new special-purpose point, line or
* triangle functions and hook them into this module.
*/
-/* $XFree86: xc/lib/GL/mesa/src/X/xmesa3.c,v 1.2 1999/03/14 03:21:02 dawes Exp $ */
-
-struct timespec; /* this silences a compiler warning on several systems */
-struct itimerspec;
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-#ifndef XFree86Server
-#include <sys/time.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <X11/Xlib.h>
-#endif
+#include "glxheader.h"
#include "depth.h"
#include "macros.h"
#include "vb.h"
#include "types.h"
#include "xmesaP.h"
-#ifdef XFree86Server
-#include "gcstruct.h"
-#include "GL/xf86glx.h"
-#endif
@@ -87,8 +69,8 @@ static void draw_points_ANY_pixmap( GLcontext *ctx, GLuint first, GLuint last )
unsigned long pixel = xmesa_color_to_pixel( xmesa,
color[0], color[1], color[2], color[3] );
XMesaSetForeground( dpy, gc, pixel );
- x = (GLint) VB->Win.data[i][0];
- y = FLIP( (GLint) VB->Win.data[i][1] );
+ x = (GLint) VB->Win.data[i][0];
+ y = FLIP( xmesa->xm_buffer, (GLint) VB->Win.data[i][1] );
XMesaDrawPoint( dpy, buffer, gc, x, y);
}
}
@@ -99,8 +81,8 @@ static void draw_points_ANY_pixmap( GLcontext *ctx, GLuint first, GLuint last )
if (VB->ClipMask[i]==0) {
register int x, y;
XMesaSetForeground( dpy, gc, VB->IndexPtr->data[i] );
- x = (GLint) VB->Win.data[i][0];
- y = FLIP( (GLint) VB->Win.data[i][1] );
+ x = (GLint) VB->Win.data[i][0];
+ y = FLIP( xmesa->xm_buffer, (GLint) VB->Win.data[i][1] );
XMesaDrawPoint( dpy, buffer, gc, x, y);
}
}
@@ -158,10 +140,10 @@ static void flat_pixmap_line( GLcontext *ctx,
gc = xmesa->xm_buffer->gc2;
XMesaSetForeground( xmesa->display, gc, pixel );
- x0 = (GLint) VB->Win.data[vert0][0];
- y0 = FLIP( (GLint) VB->Win.data[vert0][1] );
- x1 = (GLint) VB->Win.data[vert1][0];
- y1 = FLIP( (GLint) VB->Win.data[vert1][1] );
+ x0 = (GLint) VB->Win.data[vert0][0];
+ y0 = FLIP( xmesa->xm_buffer, (GLint) VB->Win.data[vert0][1] );
+ x1 = (GLint) VB->Win.data[vert1][0];
+ y1 = FLIP( xmesa->xm_buffer, (GLint) VB->Win.data[vert1][1] );
XMesaDrawLine( xmesa->display, xmesa->xm_buffer->buffer, gc,
x0, y0, x1, y1 );
}
@@ -182,7 +164,7 @@ static void flat_TRUECOLOR_line( GLcontext *ctx,
#define INTERP_XY 1
#define CLIP_HACK 1
-#define PLOT(X,Y) XMesaPutPixel( img, X, FLIP(Y), pixel );
+#define PLOT(X,Y) XMesaPutPixel( img, X, FLIP(xmesa->xm_buffer, Y), pixel );
#include "linetemp.h"
}
@@ -201,7 +183,7 @@ static void flat_8A8B8G8R_line( GLcontext *ctx,
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) *pixelPtr = pixel;
@@ -221,7 +203,7 @@ static void flat_8R8G8B_line( GLcontext *ctx,
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) *pixelPtr = pixel;
@@ -240,7 +222,7 @@ static void flat_8R8G8B24_line( GLcontext *ctx,
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR3(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) { \
pixelPtr->r = color[RCOMP]; \
@@ -264,7 +246,7 @@ static void flat_5R6G5B_line( GLcontext *ctx,
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) *pixelPtr = pixel;
@@ -283,7 +265,7 @@ static void flat_DITHER_5R6G5B_line( GLcontext *ctx,
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) PACK_TRUEDITHER( *pixelPtr, X, Y, color[0], color[1], color[2] );
@@ -306,7 +288,7 @@ static void flat_DITHER8_line( GLcontext *ctx,
#define INTERP_XY 1
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) *pixelPtr = DITHER(X,Y,r,g,b);
@@ -328,7 +310,7 @@ static void flat_LOOKUP8_line( GLcontext *ctx,
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) *pixelPtr = pixel;
@@ -349,7 +331,7 @@ static void flat_HPCR_line( GLcontext *ctx,
#define INTERP_XY 1
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) *pixelPtr = (GLubyte) DITHER_HPCR(X,Y,r,g,b);
@@ -373,10 +355,10 @@ static void flat_TRUECOLOR_z_line( GLcontext *ctx,
#define INTERP_XY 1
#define INTERP_Z 1
#define CLIP_HACK 1
-#define PLOT(X,Y) \
- if (Z < *zPtr) { \
- *zPtr = Z; \
- XMesaPutPixel( img, X, FLIP(Y), pixel ); \
+#define PLOT(X,Y) \
+ if (Z < *zPtr) { \
+ *zPtr = Z; \
+ XMesaPutPixel( img, X, FLIP(xmesa->xm_buffer, Y), pixel ); \
}
#include "linetemp.h"
@@ -396,7 +378,7 @@ static void flat_8A8B8G8R_z_line( GLcontext *ctx,
#define INTERP_Z 1
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) \
if (Z < *zPtr) { \
@@ -421,7 +403,7 @@ static void flat_8R8G8B_z_line( GLcontext *ctx,
#define INTERP_Z 1
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) \
if (Z < *zPtr) { \
@@ -445,7 +427,7 @@ static void flat_8R8G8B24_z_line( GLcontext *ctx,
#define INTERP_Z 1
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR3(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) \
if (Z < *zPtr) { \
@@ -472,7 +454,7 @@ static void flat_5R6G5B_z_line( GLcontext *ctx,
#define INTERP_Z 1
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) \
if (Z < *zPtr) { \
@@ -495,7 +477,7 @@ static void flat_DITHER_5R6G5B_z_line( GLcontext *ctx,
#define INTERP_Z 1
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) \
if (Z < *zPtr) { \
@@ -521,7 +503,7 @@ static void flat_DITHER8_z_line( GLcontext *ctx,
#define INTERP_Z 1
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) \
if (Z < *zPtr) { \
@@ -547,7 +529,7 @@ static void flat_LOOKUP8_z_line( GLcontext *ctx,
#define INTERP_Z 1
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) \
if (Z < *zPtr) { \
@@ -573,7 +555,7 @@ static void flat_HPCR_z_line( GLcontext *ctx,
#define INTERP_Z 1
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define CLIP_HACK 1
#define PLOT(X,Y) \
if (Z < *zPtr) { \
diff --git a/xc/extras/Mesa/src/X/xmesa4.c b/xc/extras/Mesa/src/X/xmesa4.c
index c77ab8532..c239d162f 100644
--- a/xc/extras/Mesa/src/X/xmesa4.c
+++ b/xc/extras/Mesa/src/X/xmesa4.c
@@ -1,8 +1,8 @@
-/* $Id: xmesa4.c,v 1.1 1999/12/05 23:10:27 daryll Exp $ */
+/* $Id: xmesa4.c,v 1.2 2000/01/30 00:27:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,7 +25,6 @@
*/
-
/*
* Mesa/X11 interface, part 4.
*
@@ -33,33 +32,15 @@
* fairly easy to write new special-purpose triangle functions and hook
* them into this module.
*/
-/* $XFree86: xc/lib/GL/mesa/src/X/xmesa4.c,v 1.2 1999/03/14 03:21:03 dawes Exp $ */
-
-struct timespec; /* this silences a compiler warning on several systems */
-struct itimerspec;
-
-
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-#ifndef XFree86Server
-#include <sys/time.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <X11/Xlib.h>
-#endif
+#include "glxheader.h"
#include "depth.h"
#include "macros.h"
#include "vb.h"
#include "types.h"
#include "xmesaP.h"
-#ifdef XFree86Server
-#include "gcstruct.h"
-#include "GL/xf86glx.h"
-#endif
+
@@ -95,12 +76,12 @@ static void flat_pixmap_triangle( GLcontext *ctx,
gc = xmesa->xm_buffer->gc2;
XMesaSetForeground( xmesa->display, gc, pixel );
}
- p[0].x = (GLint) (VB->Win.data[v0][0] + 0.5f);
- p[0].y = FLIP( (GLint) (VB->Win.data[v0][1] - 0.5f) );
- p[1].x = (GLint) (VB->Win.data[v1][0] + 0.5f);
- p[1].y = FLIP( (GLint) (VB->Win.data[v1][1] - 0.5f) );
- p[2].x = (GLint) (VB->Win.data[v2][0] + 0.5f);
- p[2].y = FLIP( (GLint) (VB->Win.data[v2][1] - 0.5f) );
+ p[0].x = (GLint) (VB->Win.data[v0][0] + 0.5f);
+ p[0].y = FLIP( xmesa->xm_buffer, (GLint) (VB->Win.data[v0][1] - 0.5f) );
+ p[1].x = (GLint) (VB->Win.data[v1][0] + 0.5f);
+ p[1].y = FLIP( xmesa->xm_buffer, (GLint) (VB->Win.data[v1][1] - 0.5f) );
+ p[2].x = (GLint) (VB->Win.data[v2][0] + 0.5f);
+ p[2].y = FLIP( xmesa->xm_buffer, (GLint) (VB->Win.data[v2][1] - 0.5f) );
XMesaFillPolygon( xmesa->display, xmesa->xm_buffer->buffer, gc,
p, 3, Convex, CoordModeOrigin );
}
@@ -120,7 +101,8 @@ static void smooth_TRUECOLOR_z_triangle( GLcontext *ctx,
#define INTERP_RGB 1
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \
+ GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer, Y); \
+ GLint len = RIGHT-LEFT; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -149,7 +131,7 @@ static void smooth_8A8B8G8R_z_triangle( GLcontext *ctx,
(void) pv;
#define INTERP_Z 1
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -181,7 +163,7 @@ static void smooth_8R8G8B_z_triangle( GLcontext *ctx,
(void) pv;
#define INTERP_Z 1
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -213,7 +195,7 @@ static void smooth_8R8G8B24_z_triangle( GLcontext *ctx,
(void) pv;
#define INTERP_Z 1
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR3(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -250,7 +232,7 @@ static void smooth_TRUEDITHER_z_triangle( GLcontext *ctx,
#define INTERP_RGB 1
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \
+ GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -279,7 +261,7 @@ static void smooth_5R6G5B_z_triangle( GLcontext *ctx,
(void) pv;
#define INTERP_Z 1
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -311,7 +293,7 @@ static void smooth_DITHER_5R6G5B_z_triangle( GLcontext *ctx,
(void) pv;
#define INTERP_Z 1
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -343,12 +325,12 @@ static void smooth_DITHER8_z_triangle( GLcontext *ctx,
(void) pv;
#define INTERP_Z 1
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \
+ GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
XDITHER_SETUP(yy); \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
@@ -377,12 +359,12 @@ static void smooth_DITHER_z_triangle( GLcontext *ctx,
(void) pv;
#define INTERP_Z 1
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \
+ GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
XDITHER_SETUP(yy); \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
@@ -410,7 +392,7 @@ static void smooth_LOOKUP8_z_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
(void) pv;
#define INTERP_Z 1
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -443,12 +425,12 @@ static void smooth_HPCR_z_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
(void) pv;
#define INTERP_Z 1
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \
+ GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -480,7 +462,7 @@ static void flat_TRUECOLOR_z_triangle( GLcontext *ctx,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \
+ GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -502,7 +484,7 @@ static void flat_8A8B8G8R_z_triangle( GLcontext *ctx, GLuint v0,
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define INTERP_Z 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
@@ -532,7 +514,7 @@ static void flat_8R8G8B_z_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define INTERP_Z 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
@@ -563,7 +545,7 @@ static void flat_8R8G8B24_z_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
const GLubyte *color = ctx->VB->ColorPtr->data[pv];
#define INTERP_Z 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR3(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -596,7 +578,7 @@ static void flat_TRUEDITHER_z_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
#define INTERP_Z 1
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \
+ GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -621,7 +603,7 @@ static void flat_5R6G5B_z_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define INTERP_Z 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
@@ -652,7 +634,7 @@ static void flat_DITHER_5R6G5B_z_triangle( GLcontext *ctx, GLuint v0,
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
const GLubyte *color = ctx->VB->ColorPtr->data[pv];
#define INTERP_Z 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -680,7 +662,7 @@ static void flat_DITHER8_z_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define INTERP_Z 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
@@ -689,7 +671,7 @@ static void flat_DITHER8_z_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, len = RIGHT-LEFT; \
- FLAT_DITHER_ROW_SETUP(FLIP(Y)); \
+ FLAT_DITHER_ROW_SETUP(FLIP(xmesa->xm_buffer, Y)); \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -717,7 +699,7 @@ static void flat_DITHER_z_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \
+ GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
FLAT_DITHER_ROW_SETUP(yy); \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
@@ -741,7 +723,7 @@ static void flat_HPCR_z_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define INTERP_Z 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
@@ -750,7 +732,7 @@ static void flat_HPCR_z_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
GLubyte b = VB->ColorPtr->data[pv][2];
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \
+ GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -772,7 +754,7 @@ static void flat_LOOKUP8_z_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define INTERP_Z 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
@@ -810,7 +792,7 @@ static void smooth_TRUECOLOR_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
#define INTERP_RGB 1
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint xx, yy = FLIP(Y); \
+ GLint xx, yy = FLIP(xmesa->xm_buffer, Y); \
for (xx=LEFT;xx<RIGHT;xx++) { \
unsigned long p; \
PACK_TRUECOLOR(p, FixedToInt(ffr), FixedToInt(ffg), FixedToInt(ffb));\
@@ -831,7 +813,7 @@ static void smooth_8A8B8G8R_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
(void) pv;
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -857,7 +839,7 @@ static void smooth_8R8G8B_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
(void) pv;
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -883,7 +865,7 @@ static void smooth_8R8G8B24_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
(void) pv;
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR3(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -914,7 +896,7 @@ static void smooth_TRUEDITHER_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
#define INTERP_RGB 1
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint xx, yy = FLIP(Y); \
+ GLint xx, yy = FLIP(xmesa->xm_buffer, Y); \
for (xx=LEFT;xx<RIGHT;xx++) { \
unsigned long p; \
PACK_TRUEDITHER( p, xx, yy, FixedToInt(ffr), FixedToInt(ffg), \
@@ -936,7 +918,7 @@ static void smooth_5R6G5B_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
(void) pv;
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -962,7 +944,7 @@ static void smooth_DITHER_5R6G5B_triangle( GLcontext *ctx, GLuint v0,
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
(void) pv;
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -988,12 +970,12 @@ static void smooth_DITHER8_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
(void) pv;
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint xx, yy = FLIP(Y); \
+ GLint xx, yy = FLIP(xmesa->xm_buffer, Y); \
PIXEL_TYPE *pixel = pRow; \
XDITHER_SETUP(yy); \
for (xx=LEFT;xx<RIGHT;xx++,pixel++) { \
@@ -1018,7 +1000,7 @@ static void smooth_DITHER_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
#define INTERP_RGB 1
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint xx, yy = FLIP(Y); \
+ GLint xx, yy = FLIP(xmesa->xm_buffer, Y); \
XDITHER_SETUP(yy); \
for (xx=LEFT;xx<RIGHT;xx++) { \
unsigned long p = XDITHER( xx, FixedToInt(ffr), \
@@ -1040,7 +1022,7 @@ static void smooth_LOOKUP8_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
(void) pv;
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -1068,12 +1050,12 @@ static void smooth_HPCR_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
(void) pv;
#define INTERP_RGB 1
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint xx, yy = FLIP(Y); \
+ GLint xx, yy = FLIP(xmesa->xm_buffer, Y); \
PIXEL_TYPE *pixel = pRow; \
for (xx=LEFT;xx<RIGHT;xx++,pixel++) { \
*pixel = DITHER_HPCR( xx, yy, FixedToInt(ffr), \
@@ -1099,7 +1081,7 @@ static void flat_TRUECOLOR_triangle( GLcontext *ctx, GLuint v0,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint xx, yy = FLIP(Y); \
+ GLint xx, yy = FLIP(xmesa->xm_buffer, Y); \
for (xx=LEFT;xx<RIGHT;xx++) { \
XMesaPutPixel( img, xx, yy, pixel ); \
} \
@@ -1115,7 +1097,7 @@ static void flat_8A8B8G8R_triangle( GLcontext *ctx, GLuint v0,
GLuint v1, GLuint v2, GLuint pv )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
@@ -1140,7 +1122,7 @@ static void flat_8R8G8B_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
GLuint v2, GLuint pv )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
@@ -1166,7 +1148,7 @@ static void flat_8R8G8B24_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
const GLubyte *color = ctx->VB->ColorPtr->data[pv];
-#define PIXEL_ADDRESS(X,Y) PIXELADDR3(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -1193,7 +1175,7 @@ static void flat_TRUEDITHER_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
XMesaImage *img = xmesa->xm_buffer->backimage;
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint xx, yy = FLIP(Y); \
+ GLint xx, yy = FLIP(xmesa->xm_buffer, Y); \
for (xx=LEFT;xx<RIGHT;xx++) { \
unsigned long p; \
PACK_TRUEDITHER( p, xx, yy, VB->ColorPtr->data[pv][0], \
@@ -1213,7 +1195,7 @@ static void flat_5R6G5B_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
GLuint v2, GLuint pv )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
@@ -1239,7 +1221,7 @@ static void flat_DITHER_5R6G5B_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
const GLubyte *color = ctx->VB->ColorPtr->data[pv];
-#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -1262,7 +1244,7 @@ static void flat_DITHER8_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
GLuint v2, GLuint pv )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
@@ -1272,7 +1254,7 @@ static void flat_DITHER8_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
{ \
GLint xx; \
PIXEL_TYPE *pixel = pRow; \
- FLAT_DITHER_ROW_SETUP(FLIP(Y)); \
+ FLAT_DITHER_ROW_SETUP(FLIP(xmesa->xm_buffer, Y)); \
for (xx=LEFT;xx<RIGHT;xx++,pixel++) { \
*pixel = (PIXEL_TYPE) FLAT_DITHER(xx); \
} \
@@ -1294,7 +1276,7 @@ static void flat_DITHER_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint xx, yy = FLIP(Y); \
+ GLint xx, yy = FLIP(xmesa->xm_buffer, Y); \
FLAT_DITHER_ROW_SETUP(yy); \
for (xx=LEFT;xx<RIGHT;xx++) { \
unsigned long p = FLAT_DITHER(xx); \
@@ -1312,7 +1294,7 @@ static void flat_HPCR_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
GLuint v2, GLuint pv )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
@@ -1321,7 +1303,7 @@ static void flat_HPCR_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
GLubyte b = VB->ColorPtr->data[pv][2];
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
- GLint xx, yy = FLIP(Y); \
+ GLint xx, yy = FLIP(xmesa->xm_buffer, Y); \
PIXEL_TYPE *pixel = pRow; \
for (xx=LEFT;xx<RIGHT;xx++,pixel++) { \
*pixel = (PIXEL_TYPE) DITHER_HPCR( xx, yy, r, g, b ); \
@@ -1338,7 +1320,7 @@ static void flat_LOOKUP8_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
GLuint v2, GLuint pv )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y)
+#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
diff --git a/xc/extras/Mesa/src/X/xmesaP.h b/xc/extras/Mesa/src/X/xmesaP.h
index 913201d12..ee07c16ff 100644
--- a/xc/extras/Mesa/src/X/xmesaP.h
+++ b/xc/extras/Mesa/src/X/xmesaP.h
@@ -1,10 +1,10 @@
-/* $Id: xmesaP.h,v 1.1 1999/12/05 23:10:27 daryll Exp $ */
+/* $Id: xmesaP.h,v 1.2 2000/01/30 00:27:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -23,9 +23,6 @@
* 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.
*/
-/* $XFree86: xc/lib/GL/mesa/src/X/xmesaP.h,v 1.5 1999/07/06 14:51:28 dawes Exp $ */
-
-
#ifndef XMESAP_H
@@ -39,7 +36,7 @@
# ifdef GLX_DIRECT_RENDERING
# include "dri_mesa.h"
# endif
-# ifdef SHM
+# ifdef USE_XSHM
# include <X11/extensions/XShm.h>
# endif
#endif
@@ -68,6 +65,10 @@ typedef struct {
} bgr_t;
+/* Function pointer for clearing color buffers */
+typedef void (*clear_func)( GLcontext *ctx,
+ GLboolean all, GLint x, GLint y,
+ GLint width, GLint height );
/*
@@ -82,6 +83,7 @@ struct xmesa_visual {
XVisualInfo *vishandle; /* The pointer returned by glXChooseVisual */
#endif
XMesaVisualInfo visinfo; /* X's visual info */
+ GLint BitsPerPixel; /* True bits per pixel for XImages */
GLint level; /* 0=normal, 1=overlay, etc */
@@ -126,7 +128,9 @@ struct xmesa_visual {
struct xmesa_context {
GLcontext *gl_ctx; /* the core library context */
XMesaVisual xm_visual; /* Describes the buffers */
- XMesaBuffer xm_buffer; /* current framebuffer */
+ XMesaBuffer xm_buffer; /* current draw framebuffer */
+ XMesaBuffer xm_read_buffer; /* current read framebuffer */
+ GLboolean use_read_buffer; /* read from the xm_read_buffer/ */
XMesaDisplay *display; /* == xm_visual->display */
GLboolean swapbytes; /* Host byte order != display byte order? */
@@ -179,7 +183,7 @@ struct xmesa_buffer {
/* 0 = not available */
/* 1 = XImage support available */
/* 2 = Pixmap support available too */
-#ifdef SHM
+#ifdef USE_XSHM
XShmSegmentInfo shminfo;
#endif
#endif
@@ -235,6 +239,10 @@ struct xmesa_buffer {
fxMesaContext FXctx;
#endif
+ /* functions for clearing the front and back color buffers */
+ clear_func front_clear_func;
+ clear_func back_clear_func;
+
struct xmesa_buffer *Next; /* Linked list pointer: */
};
@@ -478,24 +486,24 @@ static int const kernel1[16] = {
/*
* Converts a GL window Y coord to an X window Y coord:
*/
-#define FLIP(Y) (xmesa->xm_buffer->bottom-(Y))
+#define FLIP(BUFFER, Y) ((BUFFER)->bottom-(Y))
/*
* Return the address of a 1, 2 or 4-byte pixel in the back XImage:
* X==0 is left, Y==0 is bottom.
*/
-#define PIXELADDR1( X, Y ) \
- ( xmesa->xm_buffer->ximage_origin1 - (Y) * xmesa->xm_buffer->ximage_width1 + (X) )
+#define PIXELADDR1( BUFFER, X, Y ) \
+ ( (BUFFER)->ximage_origin1 - (Y) * (BUFFER)->ximage_width1 + (X) )
-#define PIXELADDR2( X, Y ) \
- ( xmesa->xm_buffer->ximage_origin2 - (Y) * xmesa->xm_buffer->ximage_width2 + (X) )
+#define PIXELADDR2( BUFFER, X, Y ) \
+ ( (BUFFER)->ximage_origin2 - (Y) * (BUFFER)->ximage_width2 + (X) )
-#define PIXELADDR3( X, Y ) \
- ( xmesa->xm_buffer->ximage_origin3 - (Y) * xmesa->xm_buffer->ximage_width3 + (X) )
+#define PIXELADDR3( BUFFER, X, Y ) \
+ ( (BUFFER)->ximage_origin3 - (Y) * (BUFFER)->ximage_width3 + (X) )
-#define PIXELADDR4( X, Y ) \
- ( xmesa->xm_buffer->ximage_origin4 - (Y) * xmesa->xm_buffer->ximage_width4 + (X) )
+#define PIXELADDR4( BUFFER, X, Y ) \
+ ( (BUFFER)->ximage_origin4 - (Y) * (BUFFER)->ximage_width4 + (X) )
diff --git a/xc/extras/Mesa/src/X86/3dnow.c b/xc/extras/Mesa/src/X86/3dnow.c
index b4bd3dafe..f42d85201 100644
--- a/xc/extras/Mesa/src/X86/3dnow.c
+++ b/xc/extras/Mesa/src/X86/3dnow.c
@@ -1,4 +1,4 @@
-/* $Id: 3dnow.c,v 1.2 1999/12/07 03:37:16 daryll Exp $ */
+/* $Id: 3dnow.c,v 1.3 2000/01/30 00:27:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -29,7 +29,7 @@
* 3DNow! optimizations contributed by
* Holger Waechtler <holger@akaflieg.extern.tu-berlin.de>
*/
-#if defined(USE_3DNOW_ASM)
+#if defined(USE_3DNOW_ASM) && defined(USE_X86_ASM)
#include "3dnow.h"
#include <limits.h>
@@ -58,31 +58,31 @@
#define DECLARE_XFORM_GROUP(pfx, v, masked) \
- extern void gl_##pfx##_transform_points##v##_general_##masked(XFORM_ARGS); \
- extern void gl_##pfx##_transform_points##v##_identity_##masked(XFORM_ARGS); \
- extern void gl_##pfx##_transform_points##v##_3d_no_rot_##masked(XFORM_ARGS); \
- extern void gl_##pfx##_transform_points##v##_perspective_##masked(XFORM_ARGS);\
- extern void gl_##pfx##_transform_points##v##_2d_##masked(XFORM_ARGS); \
- extern void gl_##pfx##_transform_points##v##_2d_no_rot_##masked(XFORM_ARGS); \
- extern void gl_##pfx##_transform_points##v##_3d_##masked(XFORM_ARGS);
+ extern void _ASMAPI gl##pfx##_transform_points##v##_general_##masked(XFORM_ARGS); \
+ extern void _ASMAPI gl##pfx##_transform_points##v##_identity_##masked(XFORM_ARGS); \
+ extern void _ASMAPI gl##pfx##_transform_points##v##_3d_no_rot_##masked(XFORM_ARGS); \
+ extern void _ASMAPI gl##pfx##_transform_points##v##_perspective_##masked(XFORM_ARGS);\
+ extern void _ASMAPI gl##pfx##_transform_points##v##_2d_##masked(XFORM_ARGS); \
+ extern void _ASMAPI gl##pfx##_transform_points##v##_2d_no_rot_##masked(XFORM_ARGS); \
+ extern void _ASMAPI gl##pfx##_transform_points##v##_3d_##masked(XFORM_ARGS);
#define ASSIGN_XFORM_GROUP( pfx, cma, vsize, masked ) \
gl_transform_tab[cma][vsize][MATRIX_GENERAL] \
- = gl_##pfx##_transform_points##vsize##_general_##masked; \
+ = gl##pfx##_transform_points##vsize##_general_##masked; \
gl_transform_tab[cma][vsize][MATRIX_IDENTITY] \
- = gl_##pfx##_transform_points##vsize##_identity_##masked; \
+ = gl##pfx##_transform_points##vsize##_identity_##masked; \
gl_transform_tab[cma][vsize][MATRIX_3D_NO_ROT] \
- = gl_##pfx##_transform_points##vsize##_3d_no_rot_##masked; \
+ = gl##pfx##_transform_points##vsize##_3d_no_rot_##masked; \
gl_transform_tab[cma][vsize][MATRIX_PERSPECTIVE] \
- = gl_##pfx##_transform_points##vsize##_perspective_##masked; \
+ = gl##pfx##_transform_points##vsize##_perspective_##masked; \
gl_transform_tab[cma][vsize][MATRIX_2D] \
- = gl_##pfx##_transform_points##vsize##_2d_##masked; \
+ = gl##pfx##_transform_points##vsize##_2d_##masked; \
gl_transform_tab[cma][vsize][MATRIX_2D_NO_ROT] \
- = gl_##pfx##_transform_points##vsize##_2d_no_rot_##masked; \
+ = gl##pfx##_transform_points##vsize##_2d_no_rot_##masked; \
gl_transform_tab[cma][vsize][MATRIX_3D] \
- = gl_##pfx##_transform_points##vsize##_3d_##masked;
+ = gl##pfx##_transform_points##vsize##_3d_##masked;
@@ -97,48 +97,48 @@
#define DECLARE_NORM_GROUP(pfx, masked) \
- extern void gl_##pfx##_rescale_normals_##masked## (NORM_ARGS); \
- extern void gl_##pfx##_normalize_normals_##masked## (NORM_ARGS); \
- extern void gl_##pfx##_transform_normals_##masked## (NORM_ARGS); \
- extern void gl_##pfx##_transform_normals_no_rot_##masked## (NORM_ARGS); \
- extern void gl_##pfx##_transform_rescale_normals_##masked## (NORM_ARGS); \
- extern void gl_##pfx##_transform_rescale_normals_no_rot_##masked## (NORM_ARGS); \
- extern void gl_##pfx##_transform_normalize_normals_##masked## (NORM_ARGS); \
- extern void gl_##pfx##_transform_normalize_normals_no_rot_##masked## (NORM_ARGS);
+ extern void _ASMAPI gl##pfx##_rescale_normals_##masked## (NORM_ARGS); \
+ extern void _ASMAPI gl##pfx##_normalize_normals_##masked## (NORM_ARGS); \
+ extern void _ASMAPI gl##pfx##_transform_normals_##masked## (NORM_ARGS); \
+ extern void _ASMAPI gl##pfx##_transform_normals_no_rot_##masked## (NORM_ARGS); \
+ extern void _ASMAPI gl##pfx##_transform_rescale_normals_##masked## (NORM_ARGS); \
+ extern void _ASMAPI gl##pfx##_transform_rescale_normals_no_rot_##masked## (NORM_ARGS); \
+ extern void _ASMAPI gl##pfx##_transform_normalize_normals_##masked## (NORM_ARGS); \
+ extern void _ASMAPI gl##pfx##_transform_normalize_normals_no_rot_##masked## (NORM_ARGS);
#define ASSIGN_NORM_GROUP( pfx, cma, masked ) \
gl_normal_tab[NORM_RESCALE][cma] = \
- gl_##pfx##_rescale_normals_##masked##; \
+ gl##pfx##_rescale_normals_##masked##; \
gl_normal_tab[NORM_NORMALIZE][cma] = \
- gl_##pfx##_normalize_normals_##masked##; \
+ gl##pfx##_normalize_normals_##masked##; \
gl_normal_tab[NORM_TRANSFORM][cma] = \
- gl_##pfx##_transform_normals_##masked##; \
+ gl##pfx##_transform_normals_##masked##; \
gl_normal_tab[NORM_TRANSFORM_NO_ROT][cma] = \
- gl_##pfx##_transform_normals_no_rot_##masked##; \
+ gl##pfx##_transform_normals_no_rot_##masked##; \
gl_normal_tab[NORM_TRANSFORM | NORM_RESCALE][cma] = \
- gl_##pfx##_transform_rescale_normals_##masked##; \
+ gl##pfx##_transform_rescale_normals_##masked##; \
gl_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE][cma] = \
- gl_##pfx##_transform_rescale_normals_no_rot_##masked##; \
+ gl##pfx##_transform_rescale_normals_no_rot_##masked##; \
gl_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE][cma] = \
- gl_##pfx##_transform_normalize_normals_##masked##; \
+ gl##pfx##_transform_normalize_normals_##masked##; \
gl_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE][cma] = \
- gl_##pfx##_transform_normalize_normals_no_rot_##masked##;
+ gl##pfx##_transform_normalize_normals_no_rot_##masked##;
-extern void gl_3dnow_project_vertices( GLfloat *first,
+extern void _ASMAPI gl_3dnow_project_vertices( GLfloat *first,
GLfloat *last,
const GLfloat *m,
GLuint stride );
-extern void gl_3dnow_project_clipped_vertices( GLfloat *first,
+extern void _ASMAPI gl_3dnow_project_clipped_vertices( GLfloat *first,
GLfloat *last,
const GLfloat *m,
GLuint stride,
const GLubyte *clipmask );
-extern void gl_v16_3dnow_general_xform( GLfloat *first_vert,
+extern void _ASMAPI gl_v16_3dnow_general_xform( GLfloat *first_vert,
const GLfloat *m,
const GLfloat *src,
GLuint src_stride,
@@ -146,32 +146,32 @@ extern void gl_v16_3dnow_general_xform( GLfloat *first_vert,
void gl_init_3dnow_asm_transforms (void)
{
- DECLARE_XFORM_GROUP( 3dnow, 1, raw )
- DECLARE_XFORM_GROUP( 3dnow, 2, raw )
- DECLARE_XFORM_GROUP( 3dnow, 3, raw )
- DECLARE_XFORM_GROUP( 3dnow, 4, raw )
-
- DECLARE_XFORM_GROUP( 3dnow, 1, masked )
- DECLARE_XFORM_GROUP( 3dnow, 2, masked )
- DECLARE_XFORM_GROUP( 3dnow, 3, masked )
- DECLARE_XFORM_GROUP( 3dnow, 4, masked )
-
- DECLARE_NORM_GROUP( 3dnow, raw )
-/* DECLARE_NORM_GROUP( 3dnow, masked )
+ DECLARE_XFORM_GROUP( _3dnow, 1, raw )
+ DECLARE_XFORM_GROUP( _3dnow, 2, raw )
+ DECLARE_XFORM_GROUP( _3dnow, 3, raw )
+ DECLARE_XFORM_GROUP( _3dnow, 4, raw )
+
+ DECLARE_XFORM_GROUP( _3dnow, 1, masked )
+ DECLARE_XFORM_GROUP( _3dnow, 2, masked )
+ DECLARE_XFORM_GROUP( _3dnow, 3, masked )
+ DECLARE_XFORM_GROUP( _3dnow, 4, masked )
+
+ DECLARE_NORM_GROUP( _3dnow, raw )
+/* DECLARE_NORM_GROUP( _3dnow, masked )
*/
- ASSIGN_XFORM_GROUP( 3dnow, 0, 1, raw )
- ASSIGN_XFORM_GROUP( 3dnow, 0, 2, raw )
- ASSIGN_XFORM_GROUP( 3dnow, 0, 3, raw )
- ASSIGN_XFORM_GROUP( 3dnow, 0, 4, raw )
+ ASSIGN_XFORM_GROUP( _3dnow, 0, 1, raw )
+ ASSIGN_XFORM_GROUP( _3dnow, 0, 2, raw )
+ ASSIGN_XFORM_GROUP( _3dnow, 0, 3, raw )
+ ASSIGN_XFORM_GROUP( _3dnow, 0, 4, raw )
- ASSIGN_XFORM_GROUP( 3dnow, CULL_MASK_ACTIVE, 1, masked )
- ASSIGN_XFORM_GROUP( 3dnow, CULL_MASK_ACTIVE, 2, masked )
- ASSIGN_XFORM_GROUP( 3dnow, CULL_MASK_ACTIVE, 3, masked )
- ASSIGN_XFORM_GROUP( 3dnow, CULL_MASK_ACTIVE, 4, masked )
+ ASSIGN_XFORM_GROUP( _3dnow, CULL_MASK_ACTIVE, 1, masked )
+ ASSIGN_XFORM_GROUP( _3dnow, CULL_MASK_ACTIVE, 2, masked )
+ ASSIGN_XFORM_GROUP( _3dnow, CULL_MASK_ACTIVE, 3, masked )
+ ASSIGN_XFORM_GROUP( _3dnow, CULL_MASK_ACTIVE, 4, masked )
- ASSIGN_NORM_GROUP( 3dnow, 0, raw )
-/* ASSIGN_NORM_GROUP( 3dnow, CULL_MASK_ACTIVE, masked )
+ ASSIGN_NORM_GROUP( _3dnow, 0, raw )
+/* ASSIGN_NORM_GROUP( _3dnow, CULL_MASK_ACTIVE, masked )
*/
#ifdef DEBUG
@@ -187,4 +187,3 @@ void gl_init_3dnow_asm_transforms (void)
}
#endif
-
diff --git a/xc/extras/Mesa/src/X86/3dnow.h b/xc/extras/Mesa/src/X86/3dnow.h
index 742a8b313..8358e7a2d 100644
--- a/xc/extras/Mesa/src/X86/3dnow.h
+++ b/xc/extras/Mesa/src/X86/3dnow.h
@@ -1,4 +1,4 @@
-/* $Id: 3dnow.h,v 1.2 1999/12/07 03:37:16 daryll Exp $ */
+/* $Id: 3dnow.h,v 1.3 2000/01/30 00:27:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/X86/assyntax.h b/xc/extras/Mesa/src/X86/assyntax.h
index 1d476ce49..2243d206c 100644
--- a/xc/extras/Mesa/src/X86/assyntax.h
+++ b/xc/extras/Mesa/src/X86/assyntax.h
@@ -190,7 +190,15 @@
#define DR6 %db6
#define DR7 %db7
/* Floating-point Stack */
-#define ST %st
+#define _STX0 %st(0)
+#define _STX1 %st(1)
+#define _STX2 %st(2)
+#define _STX3 %st(3)
+#define _STX4 %st(4)
+#define _STX5 %st(5)
+#define _STX6 %st(6)
+#define _STX7 %st(7)
+#define ST(x) CONCAT(_STX,x)
/* MMX Registers */
#define MM0 %mm0
#define MM1 %mm1
@@ -876,9 +884,17 @@
#define D_BYTE db
/* #define SPACE */
/* #define COMM */
+#if defined(__WATCOMC__)
+SECTION _TEXT public align=16 class=CODE use32 flat
+SECTION _DATA public align=16 class=DATA use32 flat
+#define SEG_TEXT SECTION _TEXT
+#define SEG_DATA SECTION _DATA
+#define SEG_BSS SECTION .bss
+#else
#define SEG_DATA SECTION .data
#define SEG_TEXT SECTION .text
#define SEG_BSS SECTION .bss
+#endif
#define D_SPACE(n) db n REP 0
@@ -1024,10 +1040,10 @@
#define B_REGDB(d, b) BYTE_PTR [b + d]
/* Variable indirect: */
-#define VARINDIRECT(var) [var]
+#define VARINDIRECT(var) var
/* Use register contents as jump/call target: */
-#define CODEPTR(reg) [reg]
+#define CODEPTR(reg) reg
/*
* Redefine assembler commands
@@ -1464,7 +1480,7 @@
#else
#define P_ARG1(a) a
#define P_ARG2(a, b) a, b
-#define P_ARG3(a, b) a, b, c
+#define P_ARG3(a, b, c) a, b, c
#endif
/* MMX */
@@ -1570,22 +1586,22 @@
#define CMPPS(a, b, c) cmpps P_ARG3(a, b, c)
#define CMPSS(a, b, c) cmpss P_ARG3(a, b, c)
*/
-#define CMPEQPS(a, b) cmpeqps P_ARG3(a, b)
-#define CMPLTPS(a, b) cmpltps P_ARG3(a, b)
-#define CMPLEPS(a, b) cmpleps P_ARG3(a, b)
-#define CMPUNORDPS(a, b) cmpunordps P_ARG3(a, b)
-#define CMPNEQPS(a, b) cmpneqps P_ARG3(a, b)
-#define CMPNLTPS(a, b) cmpnltps P_ARG3(a, b)
-#define CMPNLEPS(a, b) cmpnleps P_ARG3(a, b)
-#define CMPORDPS(a, b) cmpordps P_ARG3(a, b)
-#define CMPEQSS(a, b) cmpeqss P_ARG3(a, b)
-#define CMPLTSS(a, b) cmpltss P_ARG3(a, b)
-#define CMPLESS(a, b) cmpless P_ARG3(a, b)
-#define CMPUNORDSS(a, b) cmpunordss P_ARG3(a, b)
-#define CMPNEQSS(a, b) cmpneqss P_ARG3(a, b)
-#define CMPNLTSS(a, b) cmpnltss P_ARG3(a, b)
-#define CMPNLESS(a, b) cmpnless P_ARG3(a, b)
-#define CMPORDSS(a, b) cmpordss P_ARG3(a, b)
+#define CMPEQPS(a, b) cmpeqps P_ARG2(a, b)
+#define CMPLTPS(a, b) cmpltps P_ARG2(a, b)
+#define CMPLEPS(a, b) cmpleps P_ARG2(a, b)
+#define CMPUNORDPS(a, b) cmpunordps P_ARG2(a, b)
+#define CMPNEQPS(a, b) cmpneqps P_ARG2(a, b)
+#define CMPNLTPS(a, b) cmpnltps P_ARG2(a, b)
+#define CMPNLEPS(a, b) cmpnleps P_ARG2(a, b)
+#define CMPORDPS(a, b) cmpordps P_ARG2(a, b)
+#define CMPEQSS(a, b) cmpeqss P_ARG2(a, b)
+#define CMPLTSS(a, b) cmpltss P_ARG2(a, b)
+#define CMPLESS(a, b) cmpless P_ARG2(a, b)
+#define CMPUNORDSS(a, b) cmpunordss P_ARG2(a, b)
+#define CMPNEQSS(a, b) cmpneqss P_ARG2(a, b)
+#define CMPNLTSS(a, b) cmpnltss P_ARG2(a, b)
+#define CMPNLESS(a, b) cmpnless P_ARG2(a, b)
+#define CMPORDSS(a, b) cmpordss P_ARG2(a, b)
#define COMISS(a, b) comiss P_ARG2(a, b)
#define CVTPI2PS(a, b) cvtpi2ps P_ARG2(a, b)
#define CVTPS2PI(a, b) cvtps2pi P_ARG2(a, b)
diff --git a/xc/extras/Mesa/src/X86/common_x86.c b/xc/extras/Mesa/src/X86/common_x86.c
index 94a9c1caf..997a8da42 100644
--- a/xc/extras/Mesa/src/X86/common_x86.c
+++ b/xc/extras/Mesa/src/X86/common_x86.c
@@ -1,9 +1,10 @@
+/* $Id: common_x86.c,v 1.2 2000/01/30 00:27:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -29,6 +30,8 @@
* processor.
*
* Written by Holger Waechtler <holger@akaflieg.extern.tu-berlin.de>
+ * Changed by Andre Werthmann <wertmann@cs.uni-potsdam.de> for using the
+ * new Katmai functions
*/
#include <stdlib.h>
@@ -37,6 +40,12 @@
int gl_x86_cpu_features = 0;
+static void message(const char *msg)
+{
+ if (getenv("MESA_DEBUG"))
+ fprintf(stderr, "%s\n", msg);
+}
+
void gl_init_all_x86_asm (void)
{
@@ -48,7 +57,7 @@ void gl_init_all_x86_asm (void)
gl_x86_cpu_features = 0;
if (gl_x86_cpu_features & GL_CPU_GenuineIntel) {
- fprintf (stderr, "GenuineIntel cpu detected.\n");
+ message("GenuineIntel cpu detected.");
}
if (gl_x86_cpu_features) {
@@ -59,7 +68,7 @@ void gl_init_all_x86_asm (void)
if (gl_x86_cpu_features & GL_CPU_MMX) {
char *s = getenv( "MESA_NO_MMX" );
if (s == NULL) {
- fprintf (stderr, "MMX cpu detected.\n");
+ message("MMX cpu detected.");
} else {
gl_x86_cpu_features &= (~GL_CPU_MMX);
}
@@ -71,7 +80,7 @@ void gl_init_all_x86_asm (void)
if (gl_x86_cpu_features & GL_CPU_3Dnow) {
char *s = getenv( "MESA_NO_3DNOW" );
if (s == NULL) {
- fprintf (stderr, "3Dnow cpu detected.\n");
+ message("3Dnow cpu detected.");
gl_init_3dnow_asm_transforms ();
} else {
gl_x86_cpu_features &= (~GL_CPU_3Dnow);
@@ -79,6 +88,19 @@ void gl_init_all_x86_asm (void)
}
#endif
+
+#ifdef USE_KATMAI_ASM
+ if (gl_x86_cpu_features & GL_CPU_Katmai) {
+ char *s = getenv( "MESA_NO_KATMAI" );
+ if (s == NULL) {
+ message("Katmai cpu detected.");
+ gl_init_katmai_asm_transforms ();
+ } else {
+ gl_x86_cpu_features &= (~GL_CPU_Katmai);
+ }
+ }
+#endif
+
#endif
}
diff --git a/xc/extras/Mesa/src/X86/common_x86asm.S b/xc/extras/Mesa/src/X86/common_x86asm.S
index 6abda02e9..bcd128244 100644
--- a/xc/extras/Mesa/src/X86/common_x86asm.S
+++ b/xc/extras/Mesa/src/X86/common_x86asm.S
@@ -46,7 +46,7 @@
#define GL_CPU_GenuineIntel CONST(1)
#define GL_CPU_MMX CONST(2)
#define GL_CPU_3Dnow CONST(4)
-
+#define GL_CPU_Katmai CONST(8)
GLOBL GLNAME(gl_identify_x86_cpu_features)
@@ -80,7 +80,7 @@ LLBL (Gidcpu_intel):
CMP_L ( CONST(0x6c65746e), ECX )
JNE ( LLBL ( Gidcpu_amd ) )
OR_L ( GL_CPU_GenuineIntel, ESI )
- JMP ( LLBL ( Gidcpu_mmx ) )
+ JMP ( LLBL ( Gidcpu_katmai ) )
LLBL ( Gidcpu_amd ):
@@ -98,6 +98,13 @@ LLBL ( Gidcpu_other ):
JMP ( LLBL ( Gidcpu_mmx ) )
+LLBL ( Gidcpu_katmai ):
+ MOV_L ( CONST(0x1), EAX )
+ CPUID /* test for Katmai */
+ TEST_L ( CONST(0x002000000), EDX ) /* is Bit 25 set ? */
+ JZ ( LLBL ( Gidcpu_mmx ) ) /* streaming SIMD-extensions not found... */
+ OR_L ( GL_CPU_Katmai, ESI ) /* Katmai detected ! :) */
+ JMP ( LLBL ( Gidcpu_mmx ) ) /* check for mmx */
LLBL ( Gidcpu_3dnow ):
MOV_L ( CONST(0x80000000), EAX ) /* extended functions supported ? */
diff --git a/xc/extras/Mesa/src/X86/common_x86asm.h b/xc/extras/Mesa/src/X86/common_x86asm.h
index 55c79ac00..a9d901f62 100644
--- a/xc/extras/Mesa/src/X86/common_x86asm.h
+++ b/xc/extras/Mesa/src/X86/common_x86asm.h
@@ -29,6 +29,8 @@
* processor.
*
* Written by Holger Waechtler <holger@akaflieg.extern.tu-berlin.de>
+ * Changed by Andre Werthmann <wertmann@cs.uni-potsdam.de> for using the
+ * new Katmai functions
*/
#ifndef _common_3dnow_h
#define _common_3dnow_h
@@ -36,7 +38,8 @@
#define GL_CPU_GenuineIntel 1
#define GL_CPU_MMX 2
#define GL_CPU_3Dnow 4
-#define GL_CPU_AnyX86 8 /* set if x86 asm allowed */
+#define GL_CPU_Katmai 8 /* set if the katmai-instructions are available */
+#define GL_CPU_AnyX86 16 /* set if x86 asm allowed */
#ifdef HAVE_CONFIG_H
#include "conf.h"
@@ -47,6 +50,9 @@
#ifdef USE_3DNOW_ASM
#include "3dnow.h"
#endif
+#ifdef USE_KATMAI_ASM
+#include "katmai.h"
+#endif
#endif
extern int gl_x86_cpu_features;
diff --git a/xc/extras/Mesa/src/X86/glapi_x86.S b/xc/extras/Mesa/src/X86/glapi_x86.S
new file mode 100644
index 000000000..a3d158d0a
--- /dev/null
+++ b/xc/extras/Mesa/src/X86/glapi_x86.S
@@ -0,0 +1,4021 @@
+/* $Id: glapi_x86.S,v 1.2 2000/01/30 00:27:03 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999-2000 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+/*
+ * X86-optimized dispatch code contibuted by Josh Vanderhoof
+ */
+
+
+#include "assyntax.h"
+#include "glapioffsets.h"
+
+#ifndef __WIN32__
+
+#if defined(USE_MGL_NAMESPACE)
+#define GL_PREFIX(n) GLNAME(mgl ## n)
+#else
+#define GL_PREFIX(n) GLNAME(gl ## n)
+#endif
+
+#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))
+
+#ifdef GNU_ASSEMBLER
+#define GLOBL_FN(x) GLOBL x ; .type x,@function
+#else
+#define GLOBL_FN(x) GLOBL x
+#endif
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Accum))
+GL_PREFIX(Accum):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Accum))
+ JMP(GL_OFFSET(_gloffset_Accum))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(AlphaFunc))
+GL_PREFIX(AlphaFunc):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_AlphaFunc))
+ JMP(GL_OFFSET(_gloffset_AlphaFunc))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Begin))
+GL_PREFIX(Begin):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Begin))
+ JMP(GL_OFFSET(_gloffset_Begin))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Bitmap))
+GL_PREFIX(Bitmap):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Bitmap))
+ JMP(GL_OFFSET(_gloffset_Bitmap))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(BlendFunc))
+GL_PREFIX(BlendFunc):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_BlendFunc))
+ JMP(GL_OFFSET(_gloffset_BlendFunc))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CallList))
+GL_PREFIX(CallList):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CallList))
+ JMP(GL_OFFSET(_gloffset_CallList))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CallLists))
+GL_PREFIX(CallLists):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CallLists))
+ JMP(GL_OFFSET(_gloffset_CallLists))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Clear))
+GL_PREFIX(Clear):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Clear))
+ JMP(GL_OFFSET(_gloffset_Clear))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ClearAccum))
+GL_PREFIX(ClearAccum):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ClearAccum))
+ JMP(GL_OFFSET(_gloffset_ClearAccum))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ClearColor))
+GL_PREFIX(ClearColor):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ClearColor))
+ JMP(GL_OFFSET(_gloffset_ClearColor))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ClearDepth))
+GL_PREFIX(ClearDepth):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ClearDepth))
+ JMP(GL_OFFSET(_gloffset_ClearDepth))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ClearIndex))
+GL_PREFIX(ClearIndex):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ClearIndex))
+ JMP(GL_OFFSET(_gloffset_ClearIndex))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ClearStencil))
+GL_PREFIX(ClearStencil):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ClearStencil))
+ JMP(GL_OFFSET(_gloffset_ClearStencil))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ClipPlane))
+GL_PREFIX(ClipPlane):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ClipPlane))
+ JMP(GL_OFFSET(_gloffset_ClipPlane))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3b))
+GL_PREFIX(Color3b):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3b))
+ JMP(GL_OFFSET(_gloffset_Color3b))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3d))
+GL_PREFIX(Color3d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3d))
+ JMP(GL_OFFSET(_gloffset_Color3d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3f))
+GL_PREFIX(Color3f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3f))
+ JMP(GL_OFFSET(_gloffset_Color3f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3i))
+GL_PREFIX(Color3i):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3i))
+ JMP(GL_OFFSET(_gloffset_Color3i))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3s))
+GL_PREFIX(Color3s):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3s))
+ JMP(GL_OFFSET(_gloffset_Color3s))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3ub))
+GL_PREFIX(Color3ub):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3ub))
+ JMP(GL_OFFSET(_gloffset_Color3ub))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3ui))
+GL_PREFIX(Color3ui):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3ui))
+ JMP(GL_OFFSET(_gloffset_Color3ui))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3us))
+GL_PREFIX(Color3us):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3us))
+ JMP(GL_OFFSET(_gloffset_Color3us))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4b))
+GL_PREFIX(Color4b):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4b))
+ JMP(GL_OFFSET(_gloffset_Color4b))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4d))
+GL_PREFIX(Color4d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4d))
+ JMP(GL_OFFSET(_gloffset_Color4d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4f))
+GL_PREFIX(Color4f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4f))
+ JMP(GL_OFFSET(_gloffset_Color4f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4i))
+GL_PREFIX(Color4i):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4i))
+ JMP(GL_OFFSET(_gloffset_Color4i))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4s))
+GL_PREFIX(Color4s):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4s))
+ JMP(GL_OFFSET(_gloffset_Color4s))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4ub))
+GL_PREFIX(Color4ub):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4ub))
+ JMP(GL_OFFSET(_gloffset_Color4ub))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4ui))
+GL_PREFIX(Color4ui):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4ui))
+ JMP(GL_OFFSET(_gloffset_Color4ui))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4us))
+GL_PREFIX(Color4us):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4us))
+ JMP(GL_OFFSET(_gloffset_Color4us))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3bv))
+GL_PREFIX(Color3bv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3bv))
+ JMP(GL_OFFSET(_gloffset_Color3bv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3dv))
+GL_PREFIX(Color3dv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3dv))
+ JMP(GL_OFFSET(_gloffset_Color3dv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3fv))
+GL_PREFIX(Color3fv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3fv))
+ JMP(GL_OFFSET(_gloffset_Color3fv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3iv))
+GL_PREFIX(Color3iv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3iv))
+ JMP(GL_OFFSET(_gloffset_Color3iv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3sv))
+GL_PREFIX(Color3sv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3sv))
+ JMP(GL_OFFSET(_gloffset_Color3sv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3ubv))
+GL_PREFIX(Color3ubv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3ubv))
+ JMP(GL_OFFSET(_gloffset_Color3ubv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3uiv))
+GL_PREFIX(Color3uiv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3uiv))
+ JMP(GL_OFFSET(_gloffset_Color3uiv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color3usv))
+GL_PREFIX(Color3usv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color3usv))
+ JMP(GL_OFFSET(_gloffset_Color3usv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4bv))
+GL_PREFIX(Color4bv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4bv))
+ JMP(GL_OFFSET(_gloffset_Color4bv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4dv))
+GL_PREFIX(Color4dv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4dv))
+ JMP(GL_OFFSET(_gloffset_Color4dv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4fv))
+GL_PREFIX(Color4fv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4fv))
+ JMP(GL_OFFSET(_gloffset_Color4fv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4iv))
+GL_PREFIX(Color4iv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4iv))
+ JMP(GL_OFFSET(_gloffset_Color4iv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4sv))
+GL_PREFIX(Color4sv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4sv))
+ JMP(GL_OFFSET(_gloffset_Color4sv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4ubv))
+GL_PREFIX(Color4ubv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4ubv))
+ JMP(GL_OFFSET(_gloffset_Color4ubv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4uiv))
+GL_PREFIX(Color4uiv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4uiv))
+ JMP(GL_OFFSET(_gloffset_Color4uiv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Color4usv))
+GL_PREFIX(Color4usv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Color4usv))
+ JMP(GL_OFFSET(_gloffset_Color4usv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ColorMask))
+GL_PREFIX(ColorMask):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ColorMask))
+ JMP(GL_OFFSET(_gloffset_ColorMask))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ColorMaterial))
+GL_PREFIX(ColorMaterial):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ColorMaterial))
+ JMP(GL_OFFSET(_gloffset_ColorMaterial))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyPixels))
+GL_PREFIX(CopyPixels):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyPixels))
+ JMP(GL_OFFSET(_gloffset_CopyPixels))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CullFace))
+GL_PREFIX(CullFace):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CullFace))
+ JMP(GL_OFFSET(_gloffset_CullFace))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(DepthFunc))
+GL_PREFIX(DepthFunc):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_DepthFunc))
+ JMP(GL_OFFSET(_gloffset_DepthFunc))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(DepthMask))
+GL_PREFIX(DepthMask):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_DepthMask))
+ JMP(GL_OFFSET(_gloffset_DepthMask))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(DepthRange))
+GL_PREFIX(DepthRange):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_DepthRange))
+ JMP(GL_OFFSET(_gloffset_DepthRange))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(DeleteLists))
+GL_PREFIX(DeleteLists):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_DeleteLists))
+ JMP(GL_OFFSET(_gloffset_DeleteLists))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Disable))
+GL_PREFIX(Disable):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Disable))
+ JMP(GL_OFFSET(_gloffset_Disable))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(DrawBuffer))
+GL_PREFIX(DrawBuffer):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_DrawBuffer))
+ JMP(GL_OFFSET(_gloffset_DrawBuffer))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(DrawElements))
+GL_PREFIX(DrawElements):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_DrawElements))
+ JMP(GL_OFFSET(_gloffset_DrawElements))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(DrawPixels))
+GL_PREFIX(DrawPixels):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_DrawPixels))
+ JMP(GL_OFFSET(_gloffset_DrawPixels))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Enable))
+GL_PREFIX(Enable):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Enable))
+ JMP(GL_OFFSET(_gloffset_Enable))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(End))
+GL_PREFIX(End):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_End))
+ JMP(GL_OFFSET(_gloffset_End))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EndList))
+GL_PREFIX(EndList):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EndList))
+ JMP(GL_OFFSET(_gloffset_EndList))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EvalCoord1d))
+GL_PREFIX(EvalCoord1d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EvalCoord1d))
+ JMP(GL_OFFSET(_gloffset_EvalCoord1d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EvalCoord1f))
+GL_PREFIX(EvalCoord1f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EvalCoord1f))
+ JMP(GL_OFFSET(_gloffset_EvalCoord1f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EvalCoord1dv))
+GL_PREFIX(EvalCoord1dv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EvalCoord1dv))
+ JMP(GL_OFFSET(_gloffset_EvalCoord1dv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EvalCoord1fv))
+GL_PREFIX(EvalCoord1fv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EvalCoord1fv))
+ JMP(GL_OFFSET(_gloffset_EvalCoord1fv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EvalCoord2d))
+GL_PREFIX(EvalCoord2d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EvalCoord2d))
+ JMP(GL_OFFSET(_gloffset_EvalCoord2d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EvalCoord2f))
+GL_PREFIX(EvalCoord2f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EvalCoord2f))
+ JMP(GL_OFFSET(_gloffset_EvalCoord2f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EvalCoord2dv))
+GL_PREFIX(EvalCoord2dv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EvalCoord2dv))
+ JMP(GL_OFFSET(_gloffset_EvalCoord2dv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EvalCoord2fv))
+GL_PREFIX(EvalCoord2fv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EvalCoord2fv))
+ JMP(GL_OFFSET(_gloffset_EvalCoord2fv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EvalPoint1))
+GL_PREFIX(EvalPoint1):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EvalPoint1))
+ JMP(GL_OFFSET(_gloffset_EvalPoint1))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EvalPoint2))
+GL_PREFIX(EvalPoint2):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EvalPoint2))
+ JMP(GL_OFFSET(_gloffset_EvalPoint2))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EvalMesh1))
+GL_PREFIX(EvalMesh1):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EvalMesh1))
+ JMP(GL_OFFSET(_gloffset_EvalMesh1))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EdgeFlag))
+GL_PREFIX(EdgeFlag):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EdgeFlag))
+ JMP(GL_OFFSET(_gloffset_EdgeFlag))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EdgeFlagv))
+GL_PREFIX(EdgeFlagv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EdgeFlagv))
+ JMP(GL_OFFSET(_gloffset_EdgeFlagv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EvalMesh2))
+GL_PREFIX(EvalMesh2):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EvalMesh2))
+ JMP(GL_OFFSET(_gloffset_EvalMesh2))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(FeedbackBuffer))
+GL_PREFIX(FeedbackBuffer):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_FeedbackBuffer))
+ JMP(GL_OFFSET(_gloffset_FeedbackBuffer))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Finish))
+GL_PREFIX(Finish):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Finish))
+ JMP(GL_OFFSET(_gloffset_Finish))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Flush))
+GL_PREFIX(Flush):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Flush))
+ JMP(GL_OFFSET(_gloffset_Flush))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Fogf))
+GL_PREFIX(Fogf):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Fogf))
+ JMP(GL_OFFSET(_gloffset_Fogf))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Fogi))
+GL_PREFIX(Fogi):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Fogi))
+ JMP(GL_OFFSET(_gloffset_Fogi))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Fogfv))
+GL_PREFIX(Fogfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Fogfv))
+ JMP(GL_OFFSET(_gloffset_Fogfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Fogiv))
+GL_PREFIX(Fogiv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Fogiv))
+ JMP(GL_OFFSET(_gloffset_Fogiv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(FrontFace))
+GL_PREFIX(FrontFace):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_FrontFace))
+ JMP(GL_OFFSET(_gloffset_FrontFace))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Frustum))
+GL_PREFIX(Frustum):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Frustum))
+ JMP(GL_OFFSET(_gloffset_Frustum))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GenLists))
+GL_PREFIX(GenLists):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GenLists))
+ JMP(GL_OFFSET(_gloffset_GenLists))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetBooleanv))
+GL_PREFIX(GetBooleanv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetBooleanv))
+ JMP(GL_OFFSET(_gloffset_GetBooleanv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetClipPlane))
+GL_PREFIX(GetClipPlane):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetClipPlane))
+ JMP(GL_OFFSET(_gloffset_GetClipPlane))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetDoublev))
+GL_PREFIX(GetDoublev):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetDoublev))
+ JMP(GL_OFFSET(_gloffset_GetDoublev))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetError))
+GL_PREFIX(GetError):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetError))
+ JMP(GL_OFFSET(_gloffset_GetError))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetFloatv))
+GL_PREFIX(GetFloatv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetFloatv))
+ JMP(GL_OFFSET(_gloffset_GetFloatv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetIntegerv))
+GL_PREFIX(GetIntegerv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetIntegerv))
+ JMP(GL_OFFSET(_gloffset_GetIntegerv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetLightfv))
+GL_PREFIX(GetLightfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetLightfv))
+ JMP(GL_OFFSET(_gloffset_GetLightfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetLightiv))
+GL_PREFIX(GetLightiv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetLightiv))
+ JMP(GL_OFFSET(_gloffset_GetLightiv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetMapdv))
+GL_PREFIX(GetMapdv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetMapdv))
+ JMP(GL_OFFSET(_gloffset_GetMapdv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetMapfv))
+GL_PREFIX(GetMapfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetMapfv))
+ JMP(GL_OFFSET(_gloffset_GetMapfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetMapiv))
+GL_PREFIX(GetMapiv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetMapiv))
+ JMP(GL_OFFSET(_gloffset_GetMapiv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetMaterialfv))
+GL_PREFIX(GetMaterialfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetMaterialfv))
+ JMP(GL_OFFSET(_gloffset_GetMaterialfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetMaterialiv))
+GL_PREFIX(GetMaterialiv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetMaterialiv))
+ JMP(GL_OFFSET(_gloffset_GetMaterialiv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetPixelMapfv))
+GL_PREFIX(GetPixelMapfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetPixelMapfv))
+ JMP(GL_OFFSET(_gloffset_GetPixelMapfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetPixelMapuiv))
+GL_PREFIX(GetPixelMapuiv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetPixelMapuiv))
+ JMP(GL_OFFSET(_gloffset_GetPixelMapuiv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetPixelMapusv))
+GL_PREFIX(GetPixelMapusv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetPixelMapusv))
+ JMP(GL_OFFSET(_gloffset_GetPixelMapusv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetPolygonStipple))
+GL_PREFIX(GetPolygonStipple):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetPolygonStipple))
+ JMP(GL_OFFSET(_gloffset_GetPolygonStipple))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetString))
+GL_PREFIX(GetString):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetString))
+ JMP(GL_OFFSET(_gloffset_GetString))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetTexEnvfv))
+GL_PREFIX(GetTexEnvfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetTexEnvfv))
+ JMP(GL_OFFSET(_gloffset_GetTexEnvfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetTexEnviv))
+GL_PREFIX(GetTexEnviv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetTexEnviv))
+ JMP(GL_OFFSET(_gloffset_GetTexEnviv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetTexGeniv))
+GL_PREFIX(GetTexGeniv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetTexGeniv))
+ JMP(GL_OFFSET(_gloffset_GetTexGeniv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetTexGendv))
+GL_PREFIX(GetTexGendv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetTexGendv))
+ JMP(GL_OFFSET(_gloffset_GetTexGendv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetTexGenfv))
+GL_PREFIX(GetTexGenfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetTexGenfv))
+ JMP(GL_OFFSET(_gloffset_GetTexGenfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetTexImage))
+GL_PREFIX(GetTexImage):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetTexImage))
+ JMP(GL_OFFSET(_gloffset_GetTexImage))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetTexLevelParameterfv))
+GL_PREFIX(GetTexLevelParameterfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetTexLevelParameterfv))
+ JMP(GL_OFFSET(_gloffset_GetTexLevelParameterfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetTexLevelParameteriv))
+GL_PREFIX(GetTexLevelParameteriv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetTexLevelParameteriv))
+ JMP(GL_OFFSET(_gloffset_GetTexLevelParameteriv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetTexParameterfv))
+GL_PREFIX(GetTexParameterfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetTexParameterfv))
+ JMP(GL_OFFSET(_gloffset_GetTexParameterfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetTexParameteriv))
+GL_PREFIX(GetTexParameteriv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetTexParameteriv))
+ JMP(GL_OFFSET(_gloffset_GetTexParameteriv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Hint))
+GL_PREFIX(Hint):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Hint))
+ JMP(GL_OFFSET(_gloffset_Hint))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Indexd))
+GL_PREFIX(Indexd):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Indexd))
+ JMP(GL_OFFSET(_gloffset_Indexd))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Indexdv))
+GL_PREFIX(Indexdv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Indexdv))
+ JMP(GL_OFFSET(_gloffset_Indexdv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Indexf))
+GL_PREFIX(Indexf):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Indexf))
+ JMP(GL_OFFSET(_gloffset_Indexf))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Indexfv))
+GL_PREFIX(Indexfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Indexfv))
+ JMP(GL_OFFSET(_gloffset_Indexfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Indexi))
+GL_PREFIX(Indexi):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Indexi))
+ JMP(GL_OFFSET(_gloffset_Indexi))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Indexiv))
+GL_PREFIX(Indexiv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Indexiv))
+ JMP(GL_OFFSET(_gloffset_Indexiv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Indexs))
+GL_PREFIX(Indexs):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Indexs))
+ JMP(GL_OFFSET(_gloffset_Indexs))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Indexsv))
+GL_PREFIX(Indexsv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Indexsv))
+ JMP(GL_OFFSET(_gloffset_Indexsv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(IndexMask))
+GL_PREFIX(IndexMask):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_IndexMask))
+ JMP(GL_OFFSET(_gloffset_IndexMask))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(InitNames))
+GL_PREFIX(InitNames):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_InitNames))
+ JMP(GL_OFFSET(_gloffset_InitNames))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(IsEnabled))
+GL_PREFIX(IsEnabled):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_IsEnabled))
+ JMP(GL_OFFSET(_gloffset_IsEnabled))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(IsList))
+GL_PREFIX(IsList):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_IsList))
+ JMP(GL_OFFSET(_gloffset_IsList))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Lightf))
+GL_PREFIX(Lightf):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Lightf))
+ JMP(GL_OFFSET(_gloffset_Lightf))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Lighti))
+GL_PREFIX(Lighti):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Lighti))
+ JMP(GL_OFFSET(_gloffset_Lighti))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Lightfv))
+GL_PREFIX(Lightfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Lightfv))
+ JMP(GL_OFFSET(_gloffset_Lightfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Lightiv))
+GL_PREFIX(Lightiv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Lightiv))
+ JMP(GL_OFFSET(_gloffset_Lightiv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LightModelf))
+GL_PREFIX(LightModelf):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_LightModelf))
+ JMP(GL_OFFSET(_gloffset_LightModelf))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LightModeli))
+GL_PREFIX(LightModeli):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_LightModeli))
+ JMP(GL_OFFSET(_gloffset_LightModeli))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LightModelfv))
+GL_PREFIX(LightModelfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_LightModelfv))
+ JMP(GL_OFFSET(_gloffset_LightModelfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LightModeliv))
+GL_PREFIX(LightModeliv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_LightModeliv))
+ JMP(GL_OFFSET(_gloffset_LightModeliv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LineWidth))
+GL_PREFIX(LineWidth):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_LineWidth))
+ JMP(GL_OFFSET(_gloffset_LineWidth))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LineStipple))
+GL_PREFIX(LineStipple):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_LineStipple))
+ JMP(GL_OFFSET(_gloffset_LineStipple))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ListBase))
+GL_PREFIX(ListBase):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ListBase))
+ JMP(GL_OFFSET(_gloffset_ListBase))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LoadIdentity))
+GL_PREFIX(LoadIdentity):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_LoadIdentity))
+ JMP(GL_OFFSET(_gloffset_LoadIdentity))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LoadMatrixd))
+GL_PREFIX(LoadMatrixd):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_LoadMatrixd))
+ JMP(GL_OFFSET(_gloffset_LoadMatrixd))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LoadMatrixf))
+GL_PREFIX(LoadMatrixf):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_LoadMatrixf))
+ JMP(GL_OFFSET(_gloffset_LoadMatrixf))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LoadName))
+GL_PREFIX(LoadName):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_LoadName))
+ JMP(GL_OFFSET(_gloffset_LoadName))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LogicOp))
+GL_PREFIX(LogicOp):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_LogicOp))
+ JMP(GL_OFFSET(_gloffset_LogicOp))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Map1d))
+GL_PREFIX(Map1d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Map1d))
+ JMP(GL_OFFSET(_gloffset_Map1d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Map1f))
+GL_PREFIX(Map1f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Map1f))
+ JMP(GL_OFFSET(_gloffset_Map1f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Map2d))
+GL_PREFIX(Map2d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Map2d))
+ JMP(GL_OFFSET(_gloffset_Map2d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Map2f))
+GL_PREFIX(Map2f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Map2f))
+ JMP(GL_OFFSET(_gloffset_Map2f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MapGrid1d))
+GL_PREFIX(MapGrid1d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MapGrid1d))
+ JMP(GL_OFFSET(_gloffset_MapGrid1d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MapGrid1f))
+GL_PREFIX(MapGrid1f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MapGrid1f))
+ JMP(GL_OFFSET(_gloffset_MapGrid1f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MapGrid2d))
+GL_PREFIX(MapGrid2d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MapGrid2d))
+ JMP(GL_OFFSET(_gloffset_MapGrid2d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MapGrid2f))
+GL_PREFIX(MapGrid2f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MapGrid2f))
+ JMP(GL_OFFSET(_gloffset_MapGrid2f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Materialf))
+GL_PREFIX(Materialf):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Materialf))
+ JMP(GL_OFFSET(_gloffset_Materialf))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Materiali))
+GL_PREFIX(Materiali):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Materiali))
+ JMP(GL_OFFSET(_gloffset_Materiali))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Materialfv))
+GL_PREFIX(Materialfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Materialfv))
+ JMP(GL_OFFSET(_gloffset_Materialfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Materialiv))
+GL_PREFIX(Materialiv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Materialiv))
+ JMP(GL_OFFSET(_gloffset_Materialiv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MatrixMode))
+GL_PREFIX(MatrixMode):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MatrixMode))
+ JMP(GL_OFFSET(_gloffset_MatrixMode))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultMatrixd))
+GL_PREFIX(MultMatrixd):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultMatrixd))
+ JMP(GL_OFFSET(_gloffset_MultMatrixd))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultMatrixf))
+GL_PREFIX(MultMatrixf):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultMatrixf))
+ JMP(GL_OFFSET(_gloffset_MultMatrixf))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(NewList))
+GL_PREFIX(NewList):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_NewList))
+ JMP(GL_OFFSET(_gloffset_NewList))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Normal3b))
+GL_PREFIX(Normal3b):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Normal3b))
+ JMP(GL_OFFSET(_gloffset_Normal3b))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Normal3bv))
+GL_PREFIX(Normal3bv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Normal3bv))
+ JMP(GL_OFFSET(_gloffset_Normal3bv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Normal3d))
+GL_PREFIX(Normal3d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Normal3d))
+ JMP(GL_OFFSET(_gloffset_Normal3d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Normal3dv))
+GL_PREFIX(Normal3dv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Normal3dv))
+ JMP(GL_OFFSET(_gloffset_Normal3dv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Normal3f))
+GL_PREFIX(Normal3f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Normal3f))
+ JMP(GL_OFFSET(_gloffset_Normal3f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Normal3fv))
+GL_PREFIX(Normal3fv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Normal3fv))
+ JMP(GL_OFFSET(_gloffset_Normal3fv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Normal3i))
+GL_PREFIX(Normal3i):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Normal3i))
+ JMP(GL_OFFSET(_gloffset_Normal3i))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Normal3iv))
+GL_PREFIX(Normal3iv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Normal3iv))
+ JMP(GL_OFFSET(_gloffset_Normal3iv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Normal3s))
+GL_PREFIX(Normal3s):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Normal3s))
+ JMP(GL_OFFSET(_gloffset_Normal3s))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Normal3sv))
+GL_PREFIX(Normal3sv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Normal3sv))
+ JMP(GL_OFFSET(_gloffset_Normal3sv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Ortho))
+GL_PREFIX(Ortho):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Ortho))
+ JMP(GL_OFFSET(_gloffset_Ortho))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PassThrough))
+GL_PREFIX(PassThrough):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PassThrough))
+ JMP(GL_OFFSET(_gloffset_PassThrough))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PixelMapfv))
+GL_PREFIX(PixelMapfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PixelMapfv))
+ JMP(GL_OFFSET(_gloffset_PixelMapfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PixelMapuiv))
+GL_PREFIX(PixelMapuiv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PixelMapuiv))
+ JMP(GL_OFFSET(_gloffset_PixelMapuiv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PixelMapusv))
+GL_PREFIX(PixelMapusv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PixelMapusv))
+ JMP(GL_OFFSET(_gloffset_PixelMapusv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PixelStoref))
+GL_PREFIX(PixelStoref):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PixelStoref))
+ JMP(GL_OFFSET(_gloffset_PixelStoref))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PixelStorei))
+GL_PREFIX(PixelStorei):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PixelStorei))
+ JMP(GL_OFFSET(_gloffset_PixelStorei))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PixelTransferf))
+GL_PREFIX(PixelTransferf):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PixelTransferf))
+ JMP(GL_OFFSET(_gloffset_PixelTransferf))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PixelTransferi))
+GL_PREFIX(PixelTransferi):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PixelTransferi))
+ JMP(GL_OFFSET(_gloffset_PixelTransferi))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PixelZoom))
+GL_PREFIX(PixelZoom):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PixelZoom))
+ JMP(GL_OFFSET(_gloffset_PixelZoom))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PointSize))
+GL_PREFIX(PointSize):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PointSize))
+ JMP(GL_OFFSET(_gloffset_PointSize))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PolygonMode))
+GL_PREFIX(PolygonMode):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PolygonMode))
+ JMP(GL_OFFSET(_gloffset_PolygonMode))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PolygonStipple))
+GL_PREFIX(PolygonStipple):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PolygonStipple))
+ JMP(GL_OFFSET(_gloffset_PolygonStipple))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PopAttrib))
+GL_PREFIX(PopAttrib):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PopAttrib))
+ JMP(GL_OFFSET(_gloffset_PopAttrib))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PopMatrix))
+GL_PREFIX(PopMatrix):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PopMatrix))
+ JMP(GL_OFFSET(_gloffset_PopMatrix))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PopName))
+GL_PREFIX(PopName):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PopName))
+ JMP(GL_OFFSET(_gloffset_PopName))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PushAttrib))
+GL_PREFIX(PushAttrib):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PushAttrib))
+ JMP(GL_OFFSET(_gloffset_PushAttrib))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PushMatrix))
+GL_PREFIX(PushMatrix):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PushMatrix))
+ JMP(GL_OFFSET(_gloffset_PushMatrix))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PushName))
+GL_PREFIX(PushName):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PushName))
+ JMP(GL_OFFSET(_gloffset_PushName))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos2d))
+GL_PREFIX(RasterPos2d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos2d))
+ JMP(GL_OFFSET(_gloffset_RasterPos2d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos2f))
+GL_PREFIX(RasterPos2f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos2f))
+ JMP(GL_OFFSET(_gloffset_RasterPos2f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos2i))
+GL_PREFIX(RasterPos2i):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos2i))
+ JMP(GL_OFFSET(_gloffset_RasterPos2i))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos2s))
+GL_PREFIX(RasterPos2s):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos2s))
+ JMP(GL_OFFSET(_gloffset_RasterPos2s))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos3d))
+GL_PREFIX(RasterPos3d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos3d))
+ JMP(GL_OFFSET(_gloffset_RasterPos3d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos3f))
+GL_PREFIX(RasterPos3f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos3f))
+ JMP(GL_OFFSET(_gloffset_RasterPos3f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos3i))
+GL_PREFIX(RasterPos3i):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos3i))
+ JMP(GL_OFFSET(_gloffset_RasterPos3i))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos3s))
+GL_PREFIX(RasterPos3s):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos3s))
+ JMP(GL_OFFSET(_gloffset_RasterPos3s))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos4d))
+GL_PREFIX(RasterPos4d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos4d))
+ JMP(GL_OFFSET(_gloffset_RasterPos4d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos4f))
+GL_PREFIX(RasterPos4f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos4f))
+ JMP(GL_OFFSET(_gloffset_RasterPos4f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos4i))
+GL_PREFIX(RasterPos4i):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos4i))
+ JMP(GL_OFFSET(_gloffset_RasterPos4i))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos4s))
+GL_PREFIX(RasterPos4s):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos4s))
+ JMP(GL_OFFSET(_gloffset_RasterPos4s))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos2dv))
+GL_PREFIX(RasterPos2dv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos2dv))
+ JMP(GL_OFFSET(_gloffset_RasterPos2dv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos2fv))
+GL_PREFIX(RasterPos2fv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos2fv))
+ JMP(GL_OFFSET(_gloffset_RasterPos2fv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos2iv))
+GL_PREFIX(RasterPos2iv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos2iv))
+ JMP(GL_OFFSET(_gloffset_RasterPos2iv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos2sv))
+GL_PREFIX(RasterPos2sv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos2sv))
+ JMP(GL_OFFSET(_gloffset_RasterPos2sv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos3dv))
+GL_PREFIX(RasterPos3dv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos3dv))
+ JMP(GL_OFFSET(_gloffset_RasterPos3dv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos3fv))
+GL_PREFIX(RasterPos3fv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos3fv))
+ JMP(GL_OFFSET(_gloffset_RasterPos3fv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos3iv))
+GL_PREFIX(RasterPos3iv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos3iv))
+ JMP(GL_OFFSET(_gloffset_RasterPos3iv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos3sv))
+GL_PREFIX(RasterPos3sv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos3sv))
+ JMP(GL_OFFSET(_gloffset_RasterPos3sv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos4dv))
+GL_PREFIX(RasterPos4dv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos4dv))
+ JMP(GL_OFFSET(_gloffset_RasterPos4dv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos4fv))
+GL_PREFIX(RasterPos4fv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos4fv))
+ JMP(GL_OFFSET(_gloffset_RasterPos4fv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos4iv))
+GL_PREFIX(RasterPos4iv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos4iv))
+ JMP(GL_OFFSET(_gloffset_RasterPos4iv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RasterPos4sv))
+GL_PREFIX(RasterPos4sv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RasterPos4sv))
+ JMP(GL_OFFSET(_gloffset_RasterPos4sv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ReadBuffer))
+GL_PREFIX(ReadBuffer):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ReadBuffer))
+ JMP(GL_OFFSET(_gloffset_ReadBuffer))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ReadPixels))
+GL_PREFIX(ReadPixels):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ReadPixels))
+ JMP(GL_OFFSET(_gloffset_ReadPixels))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Rectd))
+GL_PREFIX(Rectd):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Rectd))
+ JMP(GL_OFFSET(_gloffset_Rectd))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Rectdv))
+GL_PREFIX(Rectdv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Rectdv))
+ JMP(GL_OFFSET(_gloffset_Rectdv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Rectf))
+GL_PREFIX(Rectf):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Rectf))
+ JMP(GL_OFFSET(_gloffset_Rectf))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Rectfv))
+GL_PREFIX(Rectfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Rectfv))
+ JMP(GL_OFFSET(_gloffset_Rectfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Recti))
+GL_PREFIX(Recti):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Recti))
+ JMP(GL_OFFSET(_gloffset_Recti))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Rectiv))
+GL_PREFIX(Rectiv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Rectiv))
+ JMP(GL_OFFSET(_gloffset_Rectiv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Rects))
+GL_PREFIX(Rects):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Rects))
+ JMP(GL_OFFSET(_gloffset_Rects))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Rectsv))
+GL_PREFIX(Rectsv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Rectsv))
+ JMP(GL_OFFSET(_gloffset_Rectsv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(RenderMode))
+GL_PREFIX(RenderMode):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_RenderMode))
+ JMP(GL_OFFSET(_gloffset_RenderMode))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Rotated))
+GL_PREFIX(Rotated):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Rotated))
+ JMP(GL_OFFSET(_gloffset_Rotated))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Rotatef))
+GL_PREFIX(Rotatef):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Rotatef))
+ JMP(GL_OFFSET(_gloffset_Rotatef))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SelectBuffer))
+GL_PREFIX(SelectBuffer):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_SelectBuffer))
+ JMP(GL_OFFSET(_gloffset_SelectBuffer))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Scaled))
+GL_PREFIX(Scaled):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Scaled))
+ JMP(GL_OFFSET(_gloffset_Scaled))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Scalef))
+GL_PREFIX(Scalef):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Scalef))
+ JMP(GL_OFFSET(_gloffset_Scalef))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Scissor))
+GL_PREFIX(Scissor):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Scissor))
+ JMP(GL_OFFSET(_gloffset_Scissor))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ShadeModel))
+GL_PREFIX(ShadeModel):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ShadeModel))
+ JMP(GL_OFFSET(_gloffset_ShadeModel))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(StencilFunc))
+GL_PREFIX(StencilFunc):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_StencilFunc))
+ JMP(GL_OFFSET(_gloffset_StencilFunc))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(StencilMask))
+GL_PREFIX(StencilMask):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_StencilMask))
+ JMP(GL_OFFSET(_gloffset_StencilMask))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(StencilOp))
+GL_PREFIX(StencilOp):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_StencilOp))
+ JMP(GL_OFFSET(_gloffset_StencilOp))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord1d))
+GL_PREFIX(TexCoord1d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord1d))
+ JMP(GL_OFFSET(_gloffset_TexCoord1d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord1f))
+GL_PREFIX(TexCoord1f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord1f))
+ JMP(GL_OFFSET(_gloffset_TexCoord1f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord1i))
+GL_PREFIX(TexCoord1i):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord1i))
+ JMP(GL_OFFSET(_gloffset_TexCoord1i))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord1s))
+GL_PREFIX(TexCoord1s):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord1s))
+ JMP(GL_OFFSET(_gloffset_TexCoord1s))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord2d))
+GL_PREFIX(TexCoord2d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord2d))
+ JMP(GL_OFFSET(_gloffset_TexCoord2d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord2f))
+GL_PREFIX(TexCoord2f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord2f))
+ JMP(GL_OFFSET(_gloffset_TexCoord2f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord2s))
+GL_PREFIX(TexCoord2s):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord2s))
+ JMP(GL_OFFSET(_gloffset_TexCoord2s))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord2i))
+GL_PREFIX(TexCoord2i):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord2i))
+ JMP(GL_OFFSET(_gloffset_TexCoord2i))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord3d))
+GL_PREFIX(TexCoord3d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord3d))
+ JMP(GL_OFFSET(_gloffset_TexCoord3d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord3f))
+GL_PREFIX(TexCoord3f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord3f))
+ JMP(GL_OFFSET(_gloffset_TexCoord3f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord3i))
+GL_PREFIX(TexCoord3i):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord3i))
+ JMP(GL_OFFSET(_gloffset_TexCoord3i))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord3s))
+GL_PREFIX(TexCoord3s):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord3s))
+ JMP(GL_OFFSET(_gloffset_TexCoord3s))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord4d))
+GL_PREFIX(TexCoord4d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord4d))
+ JMP(GL_OFFSET(_gloffset_TexCoord4d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord4f))
+GL_PREFIX(TexCoord4f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord4f))
+ JMP(GL_OFFSET(_gloffset_TexCoord4f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord4i))
+GL_PREFIX(TexCoord4i):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord4i))
+ JMP(GL_OFFSET(_gloffset_TexCoord4i))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord4s))
+GL_PREFIX(TexCoord4s):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord4s))
+ JMP(GL_OFFSET(_gloffset_TexCoord4s))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord1dv))
+GL_PREFIX(TexCoord1dv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord1dv))
+ JMP(GL_OFFSET(_gloffset_TexCoord1dv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord1fv))
+GL_PREFIX(TexCoord1fv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord1fv))
+ JMP(GL_OFFSET(_gloffset_TexCoord1fv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord1iv))
+GL_PREFIX(TexCoord1iv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord1iv))
+ JMP(GL_OFFSET(_gloffset_TexCoord1iv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord1sv))
+GL_PREFIX(TexCoord1sv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord1sv))
+ JMP(GL_OFFSET(_gloffset_TexCoord1sv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord2dv))
+GL_PREFIX(TexCoord2dv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord2dv))
+ JMP(GL_OFFSET(_gloffset_TexCoord2dv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord2fv))
+GL_PREFIX(TexCoord2fv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord2fv))
+ JMP(GL_OFFSET(_gloffset_TexCoord2fv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord2iv))
+GL_PREFIX(TexCoord2iv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord2iv))
+ JMP(GL_OFFSET(_gloffset_TexCoord2iv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord2sv))
+GL_PREFIX(TexCoord2sv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord2sv))
+ JMP(GL_OFFSET(_gloffset_TexCoord2sv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord3dv))
+GL_PREFIX(TexCoord3dv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord3dv))
+ JMP(GL_OFFSET(_gloffset_TexCoord3dv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord3fv))
+GL_PREFIX(TexCoord3fv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord3fv))
+ JMP(GL_OFFSET(_gloffset_TexCoord3fv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord3iv))
+GL_PREFIX(TexCoord3iv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord3iv))
+ JMP(GL_OFFSET(_gloffset_TexCoord3iv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord3sv))
+GL_PREFIX(TexCoord3sv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord3sv))
+ JMP(GL_OFFSET(_gloffset_TexCoord3sv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord4dv))
+GL_PREFIX(TexCoord4dv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord4dv))
+ JMP(GL_OFFSET(_gloffset_TexCoord4dv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord4fv))
+GL_PREFIX(TexCoord4fv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord4fv))
+ JMP(GL_OFFSET(_gloffset_TexCoord4fv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord4iv))
+GL_PREFIX(TexCoord4iv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord4iv))
+ JMP(GL_OFFSET(_gloffset_TexCoord4iv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoord4sv))
+GL_PREFIX(TexCoord4sv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoord4sv))
+ JMP(GL_OFFSET(_gloffset_TexCoord4sv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexGend))
+GL_PREFIX(TexGend):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexGend))
+ JMP(GL_OFFSET(_gloffset_TexGend))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexGendv))
+GL_PREFIX(TexGendv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexGendv))
+ JMP(GL_OFFSET(_gloffset_TexGendv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexGenf))
+GL_PREFIX(TexGenf):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexGenf))
+ JMP(GL_OFFSET(_gloffset_TexGenf))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexGenfv))
+GL_PREFIX(TexGenfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexGenfv))
+ JMP(GL_OFFSET(_gloffset_TexGenfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexGeni))
+GL_PREFIX(TexGeni):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexGeni))
+ JMP(GL_OFFSET(_gloffset_TexGeni))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexGeniv))
+GL_PREFIX(TexGeniv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexGeniv))
+ JMP(GL_OFFSET(_gloffset_TexGeniv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexEnvf))
+GL_PREFIX(TexEnvf):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexEnvf))
+ JMP(GL_OFFSET(_gloffset_TexEnvf))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexEnvfv))
+GL_PREFIX(TexEnvfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexEnvfv))
+ JMP(GL_OFFSET(_gloffset_TexEnvfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexEnvi))
+GL_PREFIX(TexEnvi):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexEnvi))
+ JMP(GL_OFFSET(_gloffset_TexEnvi))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexEnviv))
+GL_PREFIX(TexEnviv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexEnviv))
+ JMP(GL_OFFSET(_gloffset_TexEnviv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexImage1D))
+GL_PREFIX(TexImage1D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexImage1D))
+ JMP(GL_OFFSET(_gloffset_TexImage1D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexImage2D))
+GL_PREFIX(TexImage2D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexImage2D))
+ JMP(GL_OFFSET(_gloffset_TexImage2D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexParameterf))
+GL_PREFIX(TexParameterf):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexParameterf))
+ JMP(GL_OFFSET(_gloffset_TexParameterf))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexParameterfv))
+GL_PREFIX(TexParameterfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexParameterfv))
+ JMP(GL_OFFSET(_gloffset_TexParameterfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexParameteri))
+GL_PREFIX(TexParameteri):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexParameteri))
+ JMP(GL_OFFSET(_gloffset_TexParameteri))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexParameteriv))
+GL_PREFIX(TexParameteriv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexParameteriv))
+ JMP(GL_OFFSET(_gloffset_TexParameteriv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Translated))
+GL_PREFIX(Translated):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Translated))
+ JMP(GL_OFFSET(_gloffset_Translated))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Translatef))
+GL_PREFIX(Translatef):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Translatef))
+ JMP(GL_OFFSET(_gloffset_Translatef))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex2d))
+GL_PREFIX(Vertex2d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex2d))
+ JMP(GL_OFFSET(_gloffset_Vertex2d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex2dv))
+GL_PREFIX(Vertex2dv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex2dv))
+ JMP(GL_OFFSET(_gloffset_Vertex2dv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex2f))
+GL_PREFIX(Vertex2f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex2f))
+ JMP(GL_OFFSET(_gloffset_Vertex2f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex2fv))
+GL_PREFIX(Vertex2fv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex2fv))
+ JMP(GL_OFFSET(_gloffset_Vertex2fv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex2i))
+GL_PREFIX(Vertex2i):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex2i))
+ JMP(GL_OFFSET(_gloffset_Vertex2i))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex2iv))
+GL_PREFIX(Vertex2iv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex2iv))
+ JMP(GL_OFFSET(_gloffset_Vertex2iv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex2s))
+GL_PREFIX(Vertex2s):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex2s))
+ JMP(GL_OFFSET(_gloffset_Vertex2s))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex2sv))
+GL_PREFIX(Vertex2sv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex2sv))
+ JMP(GL_OFFSET(_gloffset_Vertex2sv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex3d))
+GL_PREFIX(Vertex3d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex3d))
+ JMP(GL_OFFSET(_gloffset_Vertex3d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex3dv))
+GL_PREFIX(Vertex3dv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex3dv))
+ JMP(GL_OFFSET(_gloffset_Vertex3dv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex3f))
+GL_PREFIX(Vertex3f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex3f))
+ JMP(GL_OFFSET(_gloffset_Vertex3f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex3fv))
+GL_PREFIX(Vertex3fv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex3fv))
+ JMP(GL_OFFSET(_gloffset_Vertex3fv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex3i))
+GL_PREFIX(Vertex3i):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex3i))
+ JMP(GL_OFFSET(_gloffset_Vertex3i))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex3iv))
+GL_PREFIX(Vertex3iv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex3iv))
+ JMP(GL_OFFSET(_gloffset_Vertex3iv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex3s))
+GL_PREFIX(Vertex3s):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex3s))
+ JMP(GL_OFFSET(_gloffset_Vertex3s))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex3sv))
+GL_PREFIX(Vertex3sv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex3sv))
+ JMP(GL_OFFSET(_gloffset_Vertex3sv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex4d))
+GL_PREFIX(Vertex4d):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex4d))
+ JMP(GL_OFFSET(_gloffset_Vertex4d))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex4dv))
+GL_PREFIX(Vertex4dv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex4dv))
+ JMP(GL_OFFSET(_gloffset_Vertex4dv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex4f))
+GL_PREFIX(Vertex4f):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex4f))
+ JMP(GL_OFFSET(_gloffset_Vertex4f))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex4fv))
+GL_PREFIX(Vertex4fv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex4fv))
+ JMP(GL_OFFSET(_gloffset_Vertex4fv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex4i))
+GL_PREFIX(Vertex4i):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex4i))
+ JMP(GL_OFFSET(_gloffset_Vertex4i))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex4iv))
+GL_PREFIX(Vertex4iv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex4iv))
+ JMP(GL_OFFSET(_gloffset_Vertex4iv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex4s))
+GL_PREFIX(Vertex4s):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex4s))
+ JMP(GL_OFFSET(_gloffset_Vertex4s))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Vertex4sv))
+GL_PREFIX(Vertex4sv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Vertex4sv))
+ JMP(GL_OFFSET(_gloffset_Vertex4sv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Viewport))
+GL_PREFIX(Viewport):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Viewport))
+ JMP(GL_OFFSET(_gloffset_Viewport))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(AreTexturesResident))
+GL_PREFIX(AreTexturesResident):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_AreTexturesResident))
+ JMP(GL_OFFSET(_gloffset_AreTexturesResident))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ArrayElement))
+GL_PREFIX(ArrayElement):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ArrayElement))
+ JMP(GL_OFFSET(_gloffset_ArrayElement))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(BindTexture))
+GL_PREFIX(BindTexture):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_BindTexture))
+ JMP(GL_OFFSET(_gloffset_BindTexture))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ColorPointer))
+GL_PREFIX(ColorPointer):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ColorPointer))
+ JMP(GL_OFFSET(_gloffset_ColorPointer))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyTexImage1D))
+GL_PREFIX(CopyTexImage1D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyTexImage1D))
+ JMP(GL_OFFSET(_gloffset_CopyTexImage1D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyTexImage2D))
+GL_PREFIX(CopyTexImage2D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyTexImage2D))
+ JMP(GL_OFFSET(_gloffset_CopyTexImage2D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyTexSubImage1D))
+GL_PREFIX(CopyTexSubImage1D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyTexSubImage1D))
+ JMP(GL_OFFSET(_gloffset_CopyTexSubImage1D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyTexSubImage2D))
+GL_PREFIX(CopyTexSubImage2D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyTexSubImage2D))
+ JMP(GL_OFFSET(_gloffset_CopyTexSubImage2D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(DeleteTextures))
+GL_PREFIX(DeleteTextures):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_DeleteTextures))
+ JMP(GL_OFFSET(_gloffset_DeleteTextures))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(DisableClientState))
+GL_PREFIX(DisableClientState):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_DisableClientState))
+ JMP(GL_OFFSET(_gloffset_DisableClientState))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(DrawArrays))
+GL_PREFIX(DrawArrays):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_DrawArrays))
+ JMP(GL_OFFSET(_gloffset_DrawArrays))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EdgeFlagPointer))
+GL_PREFIX(EdgeFlagPointer):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EdgeFlagPointer))
+ JMP(GL_OFFSET(_gloffset_EdgeFlagPointer))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EnableClientState))
+GL_PREFIX(EnableClientState):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_EnableClientState))
+ JMP(GL_OFFSET(_gloffset_EnableClientState))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GenTextures))
+GL_PREFIX(GenTextures):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GenTextures))
+ JMP(GL_OFFSET(_gloffset_GenTextures))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetPointerv))
+GL_PREFIX(GetPointerv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetPointerv))
+ JMP(GL_OFFSET(_gloffset_GetPointerv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(IndexPointer))
+GL_PREFIX(IndexPointer):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_IndexPointer))
+ JMP(GL_OFFSET(_gloffset_IndexPointer))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Indexub))
+GL_PREFIX(Indexub):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Indexub))
+ JMP(GL_OFFSET(_gloffset_Indexub))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Indexubv))
+GL_PREFIX(Indexubv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Indexubv))
+ JMP(GL_OFFSET(_gloffset_Indexubv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(InterleavedArrays))
+GL_PREFIX(InterleavedArrays):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_InterleavedArrays))
+ JMP(GL_OFFSET(_gloffset_InterleavedArrays))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(IsTexture))
+GL_PREFIX(IsTexture):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_IsTexture))
+ JMP(GL_OFFSET(_gloffset_IsTexture))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(NormalPointer))
+GL_PREFIX(NormalPointer):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_NormalPointer))
+ JMP(GL_OFFSET(_gloffset_NormalPointer))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PolygonOffset))
+GL_PREFIX(PolygonOffset):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PolygonOffset))
+ JMP(GL_OFFSET(_gloffset_PolygonOffset))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PopClientAttrib))
+GL_PREFIX(PopClientAttrib):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PopClientAttrib))
+ JMP(GL_OFFSET(_gloffset_PopClientAttrib))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PrioritizeTextures))
+GL_PREFIX(PrioritizeTextures):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PrioritizeTextures))
+ JMP(GL_OFFSET(_gloffset_PrioritizeTextures))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PushClientAttrib))
+GL_PREFIX(PushClientAttrib):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PushClientAttrib))
+ JMP(GL_OFFSET(_gloffset_PushClientAttrib))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoordPointer))
+GL_PREFIX(TexCoordPointer):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexCoordPointer))
+ JMP(GL_OFFSET(_gloffset_TexCoordPointer))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexSubImage1D))
+GL_PREFIX(TexSubImage1D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexSubImage1D))
+ JMP(GL_OFFSET(_gloffset_TexSubImage1D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexSubImage2D))
+GL_PREFIX(TexSubImage2D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexSubImage2D))
+ JMP(GL_OFFSET(_gloffset_TexSubImage2D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexPointer))
+GL_PREFIX(VertexPointer):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_VertexPointer))
+ JMP(GL_OFFSET(_gloffset_VertexPointer))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyTexSubImage3D))
+GL_PREFIX(CopyTexSubImage3D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyTexSubImage3D))
+ JMP(GL_OFFSET(_gloffset_CopyTexSubImage3D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(DrawRangeElements))
+GL_PREFIX(DrawRangeElements):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_DrawRangeElements))
+ JMP(GL_OFFSET(_gloffset_DrawRangeElements))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexImage3D))
+GL_PREFIX(TexImage3D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexImage3D))
+ JMP(GL_OFFSET(_gloffset_TexImage3D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexSubImage3D))
+GL_PREFIX(TexSubImage3D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexSubImage3D))
+ JMP(GL_OFFSET(_gloffset_TexSubImage3D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(BlendColor))
+GL_PREFIX(BlendColor):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_BlendColor))
+ JMP(GL_OFFSET(_gloffset_BlendColor))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(BlendEquation))
+GL_PREFIX(BlendEquation):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_BlendEquation))
+ JMP(GL_OFFSET(_gloffset_BlendEquation))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ColorSubTable))
+GL_PREFIX(ColorSubTable):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ColorSubTable))
+ JMP(GL_OFFSET(_gloffset_ColorSubTable))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ColorTable))
+GL_PREFIX(ColorTable):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ColorTable))
+ JMP(GL_OFFSET(_gloffset_ColorTable))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ColorTableParameterfv))
+GL_PREFIX(ColorTableParameterfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ColorTableParameterfv))
+ JMP(GL_OFFSET(_gloffset_ColorTableParameterfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ColorTableParameteriv))
+GL_PREFIX(ColorTableParameteriv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ColorTableParameteriv))
+ JMP(GL_OFFSET(_gloffset_ColorTableParameteriv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ConvolutionFilter1D))
+GL_PREFIX(ConvolutionFilter1D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ConvolutionFilter1D))
+ JMP(GL_OFFSET(_gloffset_ConvolutionFilter1D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ConvolutionFilter2D))
+GL_PREFIX(ConvolutionFilter2D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ConvolutionFilter2D))
+ JMP(GL_OFFSET(_gloffset_ConvolutionFilter2D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ConvolutionParameterf))
+GL_PREFIX(ConvolutionParameterf):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ConvolutionParameterf))
+ JMP(GL_OFFSET(_gloffset_ConvolutionParameterf))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ConvolutionParameterfv))
+GL_PREFIX(ConvolutionParameterfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ConvolutionParameterfv))
+ JMP(GL_OFFSET(_gloffset_ConvolutionParameterfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ConvolutionParameteri))
+GL_PREFIX(ConvolutionParameteri):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ConvolutionParameteri))
+ JMP(GL_OFFSET(_gloffset_ConvolutionParameteri))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ConvolutionParameteriv))
+GL_PREFIX(ConvolutionParameteriv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ConvolutionParameteriv))
+ JMP(GL_OFFSET(_gloffset_ConvolutionParameteriv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyColorSubTable))
+GL_PREFIX(CopyColorSubTable):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyColorSubTable))
+ JMP(GL_OFFSET(_gloffset_CopyColorSubTable))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyColorTable))
+GL_PREFIX(CopyColorTable):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyColorTable))
+ JMP(GL_OFFSET(_gloffset_CopyColorTable))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyConvolutionFilter1D))
+GL_PREFIX(CopyConvolutionFilter1D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyConvolutionFilter1D))
+ JMP(GL_OFFSET(_gloffset_CopyConvolutionFilter1D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyConvolutionFilter2D))
+GL_PREFIX(CopyConvolutionFilter2D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyConvolutionFilter2D))
+ JMP(GL_OFFSET(_gloffset_CopyConvolutionFilter2D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetColorTable))
+GL_PREFIX(GetColorTable):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetColorTable))
+ JMP(GL_OFFSET(_gloffset_GetColorTable))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetColorTableParameterfv))
+GL_PREFIX(GetColorTableParameterfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetColorTableParameterfv))
+ JMP(GL_OFFSET(_gloffset_GetColorTableParameterfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetColorTableParameteriv))
+GL_PREFIX(GetColorTableParameteriv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetColorTableParameteriv))
+ JMP(GL_OFFSET(_gloffset_GetColorTableParameteriv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetConvolutionFilter))
+GL_PREFIX(GetConvolutionFilter):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetConvolutionFilter))
+ JMP(GL_OFFSET(_gloffset_GetConvolutionFilter))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetConvolutionParameterfv))
+GL_PREFIX(GetConvolutionParameterfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetConvolutionParameterfv))
+ JMP(GL_OFFSET(_gloffset_GetConvolutionParameterfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetConvolutionParameteriv))
+GL_PREFIX(GetConvolutionParameteriv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetConvolutionParameteriv))
+ JMP(GL_OFFSET(_gloffset_GetConvolutionParameteriv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetHistogram))
+GL_PREFIX(GetHistogram):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetHistogram))
+ JMP(GL_OFFSET(_gloffset_GetHistogram))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetHistogramParameterfv))
+GL_PREFIX(GetHistogramParameterfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetHistogramParameterfv))
+ JMP(GL_OFFSET(_gloffset_GetHistogramParameterfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetHistogramParameteriv))
+GL_PREFIX(GetHistogramParameteriv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetHistogramParameteriv))
+ JMP(GL_OFFSET(_gloffset_GetHistogramParameteriv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetMinmax))
+GL_PREFIX(GetMinmax):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetMinmax))
+ JMP(GL_OFFSET(_gloffset_GetMinmax))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetMinmaxParameterfv))
+GL_PREFIX(GetMinmaxParameterfv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetMinmaxParameterfv))
+ JMP(GL_OFFSET(_gloffset_GetMinmaxParameterfv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetMinmaxParameteriv))
+GL_PREFIX(GetMinmaxParameteriv):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetMinmaxParameteriv))
+ JMP(GL_OFFSET(_gloffset_GetMinmaxParameteriv))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetSeparableFilter))
+GL_PREFIX(GetSeparableFilter):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetSeparableFilter))
+ JMP(GL_OFFSET(_gloffset_GetSeparableFilter))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Histogram))
+GL_PREFIX(Histogram):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Histogram))
+ JMP(GL_OFFSET(_gloffset_Histogram))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(Minmax))
+GL_PREFIX(Minmax):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_Minmax))
+ JMP(GL_OFFSET(_gloffset_Minmax))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ResetMinmax))
+GL_PREFIX(ResetMinmax):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ResetMinmax))
+ JMP(GL_OFFSET(_gloffset_ResetMinmax))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ResetHistogram))
+GL_PREFIX(ResetHistogram):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ResetHistogram))
+ JMP(GL_OFFSET(_gloffset_ResetHistogram))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SeparableFilter2D))
+GL_PREFIX(SeparableFilter2D):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_SeparableFilter2D))
+ JMP(GL_OFFSET(_gloffset_SeparableFilter2D))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ActiveTextureARB))
+GL_PREFIX(ActiveTextureARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ActiveTextureARB))
+ JMP(GL_OFFSET(_gloffset_ActiveTextureARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ClientActiveTextureARB))
+GL_PREFIX(ClientActiveTextureARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ClientActiveTextureARB))
+ JMP(GL_OFFSET(_gloffset_ClientActiveTextureARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1dARB))
+GL_PREFIX(MultiTexCoord1dARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord1dARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1dARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1dvARB))
+GL_PREFIX(MultiTexCoord1dvARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord1dvARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1dvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1fARB))
+GL_PREFIX(MultiTexCoord1fARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord1fARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1fARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1fvARB))
+GL_PREFIX(MultiTexCoord1fvARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord1fvARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1fvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1iARB))
+GL_PREFIX(MultiTexCoord1iARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord1iARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1iARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1ivARB))
+GL_PREFIX(MultiTexCoord1ivARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord1ivARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1ivARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1sARB))
+GL_PREFIX(MultiTexCoord1sARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord1sARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1sARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord1svARB))
+GL_PREFIX(MultiTexCoord1svARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord1svARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord1svARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2dARB))
+GL_PREFIX(MultiTexCoord2dARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord2dARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2dARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2dvARB))
+GL_PREFIX(MultiTexCoord2dvARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord2dvARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2dvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2fARB))
+GL_PREFIX(MultiTexCoord2fARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord2fARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2fARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2fvARB))
+GL_PREFIX(MultiTexCoord2fvARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord2fvARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2fvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2iARB))
+GL_PREFIX(MultiTexCoord2iARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord2iARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2iARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2ivARB))
+GL_PREFIX(MultiTexCoord2ivARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord2ivARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2ivARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2sARB))
+GL_PREFIX(MultiTexCoord2sARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord2sARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2sARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord2svARB))
+GL_PREFIX(MultiTexCoord2svARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord2svARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord2svARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3dARB))
+GL_PREFIX(MultiTexCoord3dARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord3dARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3dARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3dvARB))
+GL_PREFIX(MultiTexCoord3dvARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord3dvARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3dvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3fARB))
+GL_PREFIX(MultiTexCoord3fARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord3fARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3fARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3fvARB))
+GL_PREFIX(MultiTexCoord3fvARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord3fvARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3fvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3iARB))
+GL_PREFIX(MultiTexCoord3iARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord3iARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3iARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3ivARB))
+GL_PREFIX(MultiTexCoord3ivARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord3ivARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3ivARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3sARB))
+GL_PREFIX(MultiTexCoord3sARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord3sARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3sARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord3svARB))
+GL_PREFIX(MultiTexCoord3svARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord3svARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord3svARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4dARB))
+GL_PREFIX(MultiTexCoord4dARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord4dARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4dARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4dvARB))
+GL_PREFIX(MultiTexCoord4dvARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord4dvARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4dvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4fARB))
+GL_PREFIX(MultiTexCoord4fARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord4fARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4fARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4fvARB))
+GL_PREFIX(MultiTexCoord4fvARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord4fvARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4fvARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4iARB))
+GL_PREFIX(MultiTexCoord4iARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord4iARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4iARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4ivARB))
+GL_PREFIX(MultiTexCoord4ivARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord4ivARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4ivARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4sARB))
+GL_PREFIX(MultiTexCoord4sARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord4sARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4sARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultiTexCoord4svARB))
+GL_PREFIX(MultiTexCoord4svARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultiTexCoord4svARB))
+ JMP(GL_OFFSET(_gloffset_MultiTexCoord4svARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(BlendColorEXT))
+GL_PREFIX(BlendColorEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_BlendColorEXT))
+ JMP(GL_OFFSET(_gloffset_BlendColorEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PolygonOffsetEXT))
+GL_PREFIX(PolygonOffsetEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PolygonOffsetEXT))
+ JMP(GL_OFFSET(_gloffset_PolygonOffsetEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexImage3DEXT))
+GL_PREFIX(TexImage3DEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexImage3DEXT))
+ JMP(GL_OFFSET(_gloffset_TexImage3DEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexSubImage3DEXT))
+GL_PREFIX(TexSubImage3DEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexSubImage3DEXT))
+ JMP(GL_OFFSET(_gloffset_TexSubImage3DEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyTexSubImage3DEXT))
+GL_PREFIX(CopyTexSubImage3DEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyTexSubImage3DEXT))
+ JMP(GL_OFFSET(_gloffset_CopyTexSubImage3DEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetTexFilterFuncSGIS))
+GL_PREFIX(GetTexFilterFuncSGIS):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetTexFilterFuncSGIS))
+ JMP(GL_OFFSET(_gloffset_GetTexFilterFuncSGIS))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexFilterFuncSGIS))
+GL_PREFIX(TexFilterFuncSGIS):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexFilterFuncSGIS))
+ JMP(GL_OFFSET(_gloffset_TexFilterFuncSGIS))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyTexSubImage1DEXT))
+GL_PREFIX(CopyTexSubImage1DEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyTexSubImage1DEXT))
+ JMP(GL_OFFSET(_gloffset_CopyTexSubImage1DEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexSubImage1DEXT))
+GL_PREFIX(TexSubImage1DEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexSubImage1DEXT))
+ JMP(GL_OFFSET(_gloffset_TexSubImage1DEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexSubImage2DEXT))
+GL_PREFIX(TexSubImage2DEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_TexSubImage2DEXT))
+ JMP(GL_OFFSET(_gloffset_TexSubImage2DEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyTexImage1DEXT))
+GL_PREFIX(CopyTexImage1DEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyTexImage1DEXT))
+ JMP(GL_OFFSET(_gloffset_CopyTexImage1DEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyTexImage2DEXT))
+GL_PREFIX(CopyTexImage2DEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyTexImage2DEXT))
+ JMP(GL_OFFSET(_gloffset_CopyTexImage2DEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyTexSubImage2DEXT))
+GL_PREFIX(CopyTexSubImage2DEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyTexSubImage2DEXT))
+ JMP(GL_OFFSET(_gloffset_CopyTexSubImage2DEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetHistogramEXT))
+GL_PREFIX(GetHistogramEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetHistogramEXT))
+ JMP(GL_OFFSET(_gloffset_GetHistogramEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetHistogramParameterfvEXT))
+GL_PREFIX(GetHistogramParameterfvEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetHistogramParameterfvEXT))
+ JMP(GL_OFFSET(_gloffset_GetHistogramParameterfvEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetHistogramParameterivEXT))
+GL_PREFIX(GetHistogramParameterivEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetHistogramParameterivEXT))
+ JMP(GL_OFFSET(_gloffset_GetHistogramParameterivEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetMinmaxEXT))
+GL_PREFIX(GetMinmaxEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetMinmaxEXT))
+ JMP(GL_OFFSET(_gloffset_GetMinmaxEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetMinmaxParameterfvEXT))
+GL_PREFIX(GetMinmaxParameterfvEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetMinmaxParameterfvEXT))
+ JMP(GL_OFFSET(_gloffset_GetMinmaxParameterfvEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetMinmaxParameterivEXT))
+GL_PREFIX(GetMinmaxParameterivEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetMinmaxParameterivEXT))
+ JMP(GL_OFFSET(_gloffset_GetMinmaxParameterivEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(HistogramEXT))
+GL_PREFIX(HistogramEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_HistogramEXT))
+ JMP(GL_OFFSET(_gloffset_HistogramEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MinmaxEXT))
+GL_PREFIX(MinmaxEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MinmaxEXT))
+ JMP(GL_OFFSET(_gloffset_MinmaxEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ResetHistogramEXT))
+GL_PREFIX(ResetHistogramEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ResetHistogramEXT))
+ JMP(GL_OFFSET(_gloffset_ResetHistogramEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ResetMinmaxEXT))
+GL_PREFIX(ResetMinmaxEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ResetMinmaxEXT))
+ JMP(GL_OFFSET(_gloffset_ResetMinmaxEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ConvolutionFilter1DEXT))
+GL_PREFIX(ConvolutionFilter1DEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ConvolutionFilter1DEXT))
+ JMP(GL_OFFSET(_gloffset_ConvolutionFilter1DEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ConvolutionFilter2DEXT))
+GL_PREFIX(ConvolutionFilter2DEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ConvolutionFilter2DEXT))
+ JMP(GL_OFFSET(_gloffset_ConvolutionFilter2DEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ConvolutionParameterfEXT))
+GL_PREFIX(ConvolutionParameterfEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ConvolutionParameterfEXT))
+ JMP(GL_OFFSET(_gloffset_ConvolutionParameterfEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ConvolutionParameterfvEXT))
+GL_PREFIX(ConvolutionParameterfvEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ConvolutionParameterfvEXT))
+ JMP(GL_OFFSET(_gloffset_ConvolutionParameterfvEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ConvolutionParameteriEXT))
+GL_PREFIX(ConvolutionParameteriEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ConvolutionParameteriEXT))
+ JMP(GL_OFFSET(_gloffset_ConvolutionParameteriEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ConvolutionParameterivEXT))
+GL_PREFIX(ConvolutionParameterivEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ConvolutionParameterivEXT))
+ JMP(GL_OFFSET(_gloffset_ConvolutionParameterivEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyConvolutionFilter1DEXT))
+GL_PREFIX(CopyConvolutionFilter1DEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyConvolutionFilter1DEXT))
+ JMP(GL_OFFSET(_gloffset_CopyConvolutionFilter1DEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyConvolutionFilter2DEXT))
+GL_PREFIX(CopyConvolutionFilter2DEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyConvolutionFilter2DEXT))
+ JMP(GL_OFFSET(_gloffset_CopyConvolutionFilter2DEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetConvolutionFilterEXT))
+GL_PREFIX(GetConvolutionFilterEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetConvolutionFilterEXT))
+ JMP(GL_OFFSET(_gloffset_GetConvolutionFilterEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetConvolutionParameterfvEXT))
+GL_PREFIX(GetConvolutionParameterfvEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetConvolutionParameterfvEXT))
+ JMP(GL_OFFSET(_gloffset_GetConvolutionParameterfvEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetConvolutionParameterivEXT))
+GL_PREFIX(GetConvolutionParameterivEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetConvolutionParameterivEXT))
+ JMP(GL_OFFSET(_gloffset_GetConvolutionParameterivEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetSeparableFilterEXT))
+GL_PREFIX(GetSeparableFilterEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetSeparableFilterEXT))
+ JMP(GL_OFFSET(_gloffset_GetSeparableFilterEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(SeparableFilter2DEXT))
+GL_PREFIX(SeparableFilter2DEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_SeparableFilter2DEXT))
+ JMP(GL_OFFSET(_gloffset_SeparableFilter2DEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ColorTableParameterfvSGI))
+GL_PREFIX(ColorTableParameterfvSGI):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ColorTableParameterfvSGI))
+ JMP(GL_OFFSET(_gloffset_ColorTableParameterfvSGI))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ColorTableParameterivSGI))
+GL_PREFIX(ColorTableParameterivSGI):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ColorTableParameterivSGI))
+ JMP(GL_OFFSET(_gloffset_ColorTableParameterivSGI))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ColorTableSGI))
+GL_PREFIX(ColorTableSGI):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ColorTableSGI))
+ JMP(GL_OFFSET(_gloffset_ColorTableSGI))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(CopyColorTableSGI))
+GL_PREFIX(CopyColorTableSGI):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_CopyColorTableSGI))
+ JMP(GL_OFFSET(_gloffset_CopyColorTableSGI))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetColorTableSGI))
+GL_PREFIX(GetColorTableSGI):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetColorTableSGI))
+ JMP(GL_OFFSET(_gloffset_GetColorTableSGI))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetColorTableParameterfvSGI))
+GL_PREFIX(GetColorTableParameterfvSGI):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetColorTableParameterfvSGI))
+ JMP(GL_OFFSET(_gloffset_GetColorTableParameterfvSGI))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetColorTableParameterivSGI))
+GL_PREFIX(GetColorTableParameterivSGI):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetColorTableParameterivSGI))
+ JMP(GL_OFFSET(_gloffset_GetColorTableParameterivSGI))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GenTexturesEXT))
+GL_PREFIX(GenTexturesEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GenTexturesEXT))
+ JMP(GL_OFFSET(_gloffset_GenTexturesEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(DeleteTexturesEXT))
+GL_PREFIX(DeleteTexturesEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_DeleteTexturesEXT))
+ JMP(GL_OFFSET(_gloffset_DeleteTexturesEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(BindTextureEXT))
+GL_PREFIX(BindTextureEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_BindTextureEXT))
+ JMP(GL_OFFSET(_gloffset_BindTextureEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PrioritizeTexturesEXT))
+GL_PREFIX(PrioritizeTexturesEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PrioritizeTexturesEXT))
+ JMP(GL_OFFSET(_gloffset_PrioritizeTexturesEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(AreTexturesResidentEXT))
+GL_PREFIX(AreTexturesResidentEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_AreTexturesResidentEXT))
+ JMP(GL_OFFSET(_gloffset_AreTexturesResidentEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(IsTextureEXT))
+GL_PREFIX(IsTextureEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_IsTextureEXT))
+ JMP(GL_OFFSET(_gloffset_IsTextureEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(BlendEquationEXT))
+GL_PREFIX(BlendEquationEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_BlendEquationEXT))
+ JMP(GL_OFFSET(_gloffset_BlendEquationEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(VertexPointerEXT))
+GL_PREFIX(VertexPointerEXT):
+ JMP(GLNAME(_glapi_fallback_VertexPointerEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(NormalPointerEXT))
+GL_PREFIX(NormalPointerEXT):
+ JMP(GLNAME(_glapi_fallback_NormalPointerEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ColorPointerEXT))
+GL_PREFIX(ColorPointerEXT):
+ JMP(GLNAME(_glapi_fallback_ColorPointerEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(IndexPointerEXT))
+GL_PREFIX(IndexPointerEXT):
+ JMP(GLNAME(_glapi_fallback_IndexPointerEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(TexCoordPointerEXT))
+GL_PREFIX(TexCoordPointerEXT):
+ JMP(GLNAME(_glapi_fallback_TexCoordPointerEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(EdgeFlagPointerEXT))
+GL_PREFIX(EdgeFlagPointerEXT):
+ JMP(GLNAME(_glapi_fallback_EdgeFlagPointerEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetPointervEXT))
+GL_PREFIX(GetPointervEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetPointervEXT))
+ JMP(GL_OFFSET(_gloffset_GetPointervEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ArrayElementEXT))
+GL_PREFIX(ArrayElementEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ArrayElementEXT))
+ JMP(GL_OFFSET(_gloffset_ArrayElementEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(DrawArraysEXT))
+GL_PREFIX(DrawArraysEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_DrawArraysEXT))
+ JMP(GL_OFFSET(_gloffset_DrawArraysEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PointParameterfEXT))
+GL_PREFIX(PointParameterfEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PointParameterfEXT))
+ JMP(GL_OFFSET(_gloffset_PointParameterfEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(PointParameterfvEXT))
+GL_PREFIX(PointParameterfvEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_PointParameterfvEXT))
+ JMP(GL_OFFSET(_gloffset_PointParameterfvEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(HintPGI))
+GL_PREFIX(HintPGI):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_HintPGI))
+ JMP(GL_OFFSET(_gloffset_HintPGI))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ColorTableEXT))
+GL_PREFIX(ColorTableEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ColorTableEXT))
+ JMP(GL_OFFSET(_gloffset_ColorTableEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ColorSubTableEXT))
+GL_PREFIX(ColorSubTableEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ColorSubTableEXT))
+ JMP(GL_OFFSET(_gloffset_ColorSubTableEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetColorTableEXT))
+GL_PREFIX(GetColorTableEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetColorTableEXT))
+ JMP(GL_OFFSET(_gloffset_GetColorTableEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetColorTableParameterfvEXT))
+GL_PREFIX(GetColorTableParameterfvEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetColorTableParameterfvEXT))
+ JMP(GL_OFFSET(_gloffset_GetColorTableParameterfvEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(GetColorTableParameterivEXT))
+GL_PREFIX(GetColorTableParameterivEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_GetColorTableParameterivEXT))
+ JMP(GL_OFFSET(_gloffset_GetColorTableParameterivEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LockArraysEXT))
+GL_PREFIX(LockArraysEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_LockArraysEXT))
+ JMP(GL_OFFSET(_gloffset_LockArraysEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(UnlockArraysEXT))
+GL_PREFIX(UnlockArraysEXT):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_UnlockArraysEXT))
+ JMP(GL_OFFSET(_gloffset_UnlockArraysEXT))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(BlendFuncSeparateINGR))
+GL_PREFIX(BlendFuncSeparateINGR):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_BlendFuncSeparateINGR))
+ JMP(GL_OFFSET(_gloffset_BlendFuncSeparateINGR))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2iMESA))
+GL_PREFIX(WindowPos2iMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos2iMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2sMESA))
+GL_PREFIX(WindowPos2sMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos2sMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2fMESA))
+GL_PREFIX(WindowPos2fMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos2fMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2dMESA))
+GL_PREFIX(WindowPos2dMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos2dMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2ivMESA))
+GL_PREFIX(WindowPos2ivMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos2ivMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2svMESA))
+GL_PREFIX(WindowPos2svMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos2svMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2fvMESA))
+GL_PREFIX(WindowPos2fvMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos2fvMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos2dvMESA))
+GL_PREFIX(WindowPos2dvMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos2dvMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3iMESA))
+GL_PREFIX(WindowPos3iMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos3iMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3sMESA))
+GL_PREFIX(WindowPos3sMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos3sMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3fMESA))
+GL_PREFIX(WindowPos3fMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos3fMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3dMESA))
+GL_PREFIX(WindowPos3dMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos3dMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3ivMESA))
+GL_PREFIX(WindowPos3ivMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos3ivMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3svMESA))
+GL_PREFIX(WindowPos3svMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos3svMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3fvMESA))
+GL_PREFIX(WindowPos3fvMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos3fvMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos3dvMESA))
+GL_PREFIX(WindowPos3dvMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos3dvMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos4iMESA))
+GL_PREFIX(WindowPos4iMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos4iMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos4sMESA))
+GL_PREFIX(WindowPos4sMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos4sMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos4fMESA))
+GL_PREFIX(WindowPos4fMESA):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_WindowPos4fMESA))
+ JMP(GL_OFFSET(_gloffset_WindowPos4fMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos4dMESA))
+GL_PREFIX(WindowPos4dMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos4dMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos4ivMESA))
+GL_PREFIX(WindowPos4ivMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos4ivMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos4svMESA))
+GL_PREFIX(WindowPos4svMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos4svMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos4fvMESA))
+GL_PREFIX(WindowPos4fvMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos4fvMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(WindowPos4dvMESA))
+GL_PREFIX(WindowPos4dvMESA):
+ JMP(GLNAME(_glapi_fallback_WindowPos4dvMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(ResizeBuffersMESA))
+GL_PREFIX(ResizeBuffersMESA):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_ResizeBuffersMESA))
+ JMP(GL_OFFSET(_gloffset_ResizeBuffersMESA))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LoadTransposeMatrixdARB))
+GL_PREFIX(LoadTransposeMatrixdARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_LoadTransposeMatrixdARB))
+ JMP(GL_OFFSET(_gloffset_LoadTransposeMatrixdARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(LoadTransposeMatrixfARB))
+GL_PREFIX(LoadTransposeMatrixfARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_LoadTransposeMatrixfARB))
+ JMP(GL_OFFSET(_gloffset_LoadTransposeMatrixfARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultTransposeMatrixdARB))
+GL_PREFIX(MultTransposeMatrixdARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultTransposeMatrixdARB))
+ JMP(GL_OFFSET(_gloffset_MultTransposeMatrixdARB))
+
+ALIGNTEXT16
+GLOBL_FN(GL_PREFIX(MultTransposeMatrixfARB))
+GL_PREFIX(MultTransposeMatrixfARB):
+ MOV_L(GLNAME(_glapi_Dispatch), EAX)
+ TEST_L(EAX, EAX)
+ JZ(GLNAME(_glapi_fallback_MultTransposeMatrixfARB))
+ JMP(GL_OFFSET(_gloffset_MultTransposeMatrixfARB))
+
+#endif /* __WIN32__ */
diff --git a/xc/extras/Mesa/src/X86/katmai.c b/xc/extras/Mesa/src/X86/katmai.c
new file mode 100644
index 000000000..c14fc27b5
--- /dev/null
+++ b/xc/extras/Mesa/src/X86/katmai.c
@@ -0,0 +1,225 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.1
+ *
+ * Copyright (C) 1999 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+/*
+ * PentiumIII-SIMD (SSE) optimizations contributed by
+ * Andre Werthmann <wertmann@cs.uni-potsdam.de>
+ */
+
+#if defined(USE_KATMAI_ASM)
+#include "katmai.h"
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include "context.h"
+#include "types.h"
+#include "xform.h"
+#include "vertices.h"
+
+#ifdef DEBUG
+#include "debug_xform.h"
+#endif
+
+
+
+
+#define XFORM_ARGS GLvector4f *to_vec, \
+ const GLmatrix *mat, \
+ const GLvector4f *from_vec, \
+ const GLubyte *mask, \
+ const GLubyte flag
+
+
+
+#define DECLARE_XFORM_GROUP(pfx, v, masked) \
+ extern void gl_##pfx##_transform_points##v##_general_##masked(XFORM_ARGS); \
+ extern void gl_##pfx##_transform_points##v##_identity_##masked(XFORM_ARGS); \
+ extern void gl_##pfx##_transform_points##v##_3d_no_rot_##masked(XFORM_ARGS); \
+ extern void gl_##pfx##_transform_points##v##_perspective_##masked(XFORM_ARGS);\
+ extern void gl_##pfx##_transform_points##v##_2d_##masked(XFORM_ARGS); \
+ extern void gl_##pfx##_transform_points##v##_2d_no_rot_##masked(XFORM_ARGS); \
+ extern void gl_##pfx##_transform_points##v##_3d_##masked(XFORM_ARGS);
+
+
+
+#define ASSIGN_XFORM_GROUP( pfx, cma, vsize, masked ) \
+ gl_transform_tab[cma][vsize][MATRIX_GENERAL] \
+ = gl_##pfx##_transform_points##vsize##_general_##masked; \
+ gl_transform_tab[cma][vsize][MATRIX_IDENTITY] \
+ = gl_##pfx##_transform_points##vsize##_identity_##masked; \
+ gl_transform_tab[cma][vsize][MATRIX_3D_NO_ROT] \
+ = gl_##pfx##_transform_points##vsize##_3d_no_rot_##masked; \
+ gl_transform_tab[cma][vsize][MATRIX_PERSPECTIVE] \
+ = gl_##pfx##_transform_points##vsize##_perspective_##masked; \
+ gl_transform_tab[cma][vsize][MATRIX_2D] \
+ = gl_##pfx##_transform_points##vsize##_2d_##masked; \
+ gl_transform_tab[cma][vsize][MATRIX_2D_NO_ROT] \
+ = gl_##pfx##_transform_points##vsize##_2d_no_rot_##masked; \
+ gl_transform_tab[cma][vsize][MATRIX_3D] \
+ = gl_##pfx##_transform_points##vsize##_3d_##masked;
+
+
+
+
+#define NORM_ARGS const GLmatrix *mat, \
+ GLfloat scale, \
+ const GLvector3f *in, \
+ const GLfloat *lengths, \
+ const GLubyte mask[], \
+ GLvector3f *dest
+
+
+
+#define DECLARE_NORM_GROUP(pfx, masked) \
+ extern void gl_##pfx##_rescale_normals_##masked## (NORM_ARGS); \
+ extern void gl_##pfx##_normalize_normals_##masked## (NORM_ARGS); \
+ extern void gl_##pfx##_transform_normals_##masked## (NORM_ARGS); \
+ extern void gl_##pfx##_transform_normals_no_rot_##masked## (NORM_ARGS); \
+ extern void gl_##pfx##_transform_rescale_normals_##masked## (NORM_ARGS); \
+ extern void gl_##pfx##_transform_rescale_normals_no_rot_##masked## (NORM_ARGS); \
+ extern void gl_##pfx##_transform_normalize_normals_##masked## (NORM_ARGS); \
+ extern void gl_##pfx##_transform_normalize_normals_no_rot_##masked## (NORM_ARGS);
+
+
+
+#define ASSIGN_NORM_GROUP( pfx, cma, masked ) \
+ gl_normal_tab[NORM_RESCALE][cma] = \
+ gl_##pfx##_rescale_normals_##masked##; \
+ gl_normal_tab[NORM_NORMALIZE][cma] = \
+ gl_##pfx##_normalize_normals_##masked##; \
+ gl_normal_tab[NORM_TRANSFORM][cma] = \
+ gl_##pfx##_transform_normals_##masked##; \
+ gl_normal_tab[NORM_TRANSFORM_NO_ROT][cma] = \
+ gl_##pfx##_transform_normals_no_rot_##masked##; \
+ gl_normal_tab[NORM_TRANSFORM | NORM_RESCALE][cma] = \
+ gl_##pfx##_transform_rescale_normals_##masked##; \
+ gl_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE][cma] = \
+ gl_##pfx##_transform_rescale_normals_no_rot_##masked##; \
+ gl_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE][cma] = \
+ gl_##pfx##_transform_normalize_normals_##masked##; \
+ gl_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE][cma] = \
+ gl_##pfx##_transform_normalize_normals_no_rot_##masked##;
+
+
+extern void gl_katmai_project_vertices( GLfloat *first,
+ GLfloat *last,
+ const GLfloat *m,
+ GLuint stride );
+
+extern void gl_katmai_project_clipped_vertices( GLfloat *first,
+ GLfloat *last,
+ const GLfloat *m,
+ GLuint stride,
+ const GLubyte *clipmask );
+
+extern void gl_v16_katmai_general_xform( GLfloat *first_vert,
+ const GLfloat *m,
+ const GLfloat *src,
+ GLuint src_stride,
+ GLuint count );
+
+
+
+void gl_init_katmai_asm_transforms (void)
+{
+ extern void gl_katmai_transform_rescale_normals_raw(NORM_ARGS);
+ extern void gl_katmai_transform_rescale_normals_no_rot_raw(NORM_ARGS);
+ extern void gl_katmai_transform_normals_no_rot_raw(NORM_ARGS);
+
+ /* Some functions are not written in SSE-assembly, because the fpu ones are faster */
+ extern void gl_katmai_transform_points4_general_raw(XFORM_ARGS);
+ extern void gl_katmai_transform_points4_general_masked(XFORM_ARGS);
+ extern void gl_katmai_transform_points4_identity_masked(XFORM_ARGS);
+ extern void gl_katmai_transform_points4_3d_no_rot_masked(XFORM_ARGS);
+ extern void gl_katmai_transform_points4_3d_raw(XFORM_ARGS);
+ extern void gl_katmai_transform_points4_3d_masked(XFORM_ARGS);
+
+
+ DECLARE_XFORM_GROUP( katmai, 1, raw )
+ DECLARE_XFORM_GROUP( katmai, 1, masked )
+
+ DECLARE_XFORM_GROUP( katmai, 2, raw )
+ DECLARE_XFORM_GROUP( katmai, 2, masked )
+
+ DECLARE_XFORM_GROUP( katmai, 3, raw )
+ DECLARE_XFORM_GROUP( katmai, 3, masked )
+
+
+ gl_normal_tab[NORM_TRANSFORM | NORM_RESCALE][0]=gl_katmai_transform_rescale_normals_raw;
+ gl_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE][0]=gl_katmai_transform_rescale_normals_no_rot_raw;
+ gl_normal_tab[NORM_TRANSFORM_NO_ROT][0]=gl_katmai_transform_normals_no_rot_raw;
+
+
+ gl_transform_tab[0][4][MATRIX_GENERAL]=gl_katmai_transform_points4_general_raw;
+ gl_transform_tab[CULL_MASK_ACTIVE][4][MATRIX_GENERAL]=gl_katmai_transform_points4_general_masked;
+
+ gl_transform_tab[CULL_MASK_ACTIVE][4][MATRIX_IDENTITY]=gl_katmai_transform_points4_identity_masked;
+
+ gl_transform_tab[CULL_MASK_ACTIVE][4][MATRIX_3D_NO_ROT]=gl_katmai_transform_points4_3d_no_rot_masked;
+
+ gl_transform_tab[0][4][MATRIX_3D]=gl_katmai_transform_points4_3d_raw;
+ gl_transform_tab[CULL_MASK_ACTIVE][4][MATRIX_3D]=gl_katmai_transform_points4_3d_masked;
+
+
+ ASSIGN_XFORM_GROUP( katmai, 0, 1, raw )
+ ASSIGN_XFORM_GROUP( katmai, CULL_MASK_ACTIVE, 1, masked )
+
+ ASSIGN_XFORM_GROUP( katmai, 0, 2, raw )
+ ASSIGN_XFORM_GROUP( katmai, CULL_MASK_ACTIVE, 2, masked )
+
+ ASSIGN_XFORM_GROUP( katmai, 0, 3, raw )
+ ASSIGN_XFORM_GROUP( katmai, CULL_MASK_ACTIVE, 3, masked )
+
+
+ /* TODO ! (some parts of it) */
+
+ /*
+ DECLARE_NORM_GROUP( katmai, raw )
+
+ ASSIGN_NORM_GROUP( katmai, 0, raw )
+ */
+
+#ifdef DEBUG
+ gl_test_all_transform_functions("Katmai!");
+ gl_test_all_normal_transform_functions("Katmai!");
+#endif
+
+ /* done */
+
+ /* Hook in some stuff for vertices.c.
+ */
+ gl_xform_points3_v16_general = gl_v16_katmai_general_xform;
+
+ /* test, if it works correctly ! */
+ gl_project_v16 = gl_katmai_project_vertices;
+
+ /* test, if it works correctly ! */
+ gl_project_clipped_v16 = gl_katmai_project_clipped_vertices;
+}
+
+#endif
diff --git a/xc/extras/Mesa/src/pointers.h b/xc/extras/Mesa/src/X86/katmai.h
index c34da6aa4..40d769f4d 100644
--- a/xc/extras/Mesa/src/pointers.h
+++ b/xc/extras/Mesa/src/X86/katmai.h
@@ -1,5 +1,3 @@
-/* $Id: pointers.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
-
/*
* Mesa 3-D graphics library
* Version: 3.1
@@ -25,17 +23,21 @@
*/
+/*
+ * PentiumIII-SIMD (SSE) optimizations contributed by
+ * Andre Werthmann <wertmann@cs.uni-potsdam.de>
+ */
+#ifndef __KATMAI_H__
+#define __KATMAI_H__
-#include "types.h"
-#ifndef POINTERS_H
-#define POINTERS_H
+#include "xform.h"
-extern void gl_init_api_function_pointers( GLcontext *ctx );
+void gl_init_katmai_asm_transforms (void);
-#endif
+#endif /* __KATMAI_H__ */
diff --git a/xc/extras/Mesa/src/X86/katmai_norm_raw.S b/xc/extras/Mesa/src/X86/katmai_norm_raw.S
new file mode 100644
index 000000000..6ac046d5f
--- /dev/null
+++ b/xc/extras/Mesa/src/X86/katmai_norm_raw.S
@@ -0,0 +1,265 @@
+#include "assyntax.h"
+/** TODO:
+ * - insert PREFETCH instructions to avoid cache-misses !
+ * - some more optimizations are possible...
+ * - for 40-50% more performance in the SSE-functions, the
+ * data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
+ */
+
+ SEG_TEXT
+
+
+#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER)
+#define LLBL(a) .L ## a
+#else
+#define LLBL(a) a
+#endif
+
+#define OFFSET_MAT 4
+#define OFFSET_SCALE 8
+#define OFFSET_IN 12
+#define OFFSET_LENGTHS 16
+#define OFFSET_MASK 20
+#define OFFSET_DEST 24
+
+#define ARG_MAT REGOFF(FRAME_OFFSET+OFFSET_MAT, ESP)
+#define ARG_SCALE REGOFF(FRAME_OFFSET+OFFSET_SCALE, ESP)
+#define ARG_IN REGOFF(FRAME_OFFSET+OFFSET_IN, ESP)
+#define ARG_LENGTHS REGOFF(FRAME_OFFSET+OFFSET_LENGTHS, ESP)
+#define ARG_MASK REGOFF(FRAME_OFFSET+OFFSET_MASK, ESP)
+#define ARG_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP)
+
+
+#define V3F_START 4
+#define V3F_COUNT 8
+#define V3F_STRIDE 12
+
+#define MAT_INV 64
+
+#define M(i) REGOFF(i * 4, EDX)
+#define S(i) REGOFF(i * 4, ESI)
+#define D(i) REGOFF(i * 4, EDI)
+#define STRIDE REGOFF(12, ESI)
+
+#undef FRAME_OFFSET
+
+/*
+ * Offsets for norm_func arguments
+ *
+ * static void TAG(transform_rescale_normals_no_rot)( const GLmatrix *mat,
+ * GLfloat scale,
+ * const GLvector3f *in,
+ * const GLfloat *lengths,
+ * const GLubyte mask[],
+ * GLvector3f *dest )
+ */
+
+ALIGNTEXT16
+GLOBL GLNAME(gl_katmai_transform_rescale_normals_no_rot_raw)
+GLNAME(gl_katmai_transform_rescale_normals_no_rot_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+
+ MOV_L ( ARG_IN, ESI ) /* ptr to source GLvector3f */
+ MOV_L ( ARG_DEST, EDI ) /* ptr to dest GLvector3f */
+
+ MOV_L ( ARG_MAT, EDX ) /* ptr to matrix */
+ MOV_L ( REGOFF(MAT_INV, EDX), EDX) /* matrix->inv */
+
+ MOV_L ( REGOFF(V3F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L ( ECX, ECX )
+ JZ( LLBL(K_G3TRNNRR_finish) ) /* count was zero; go to finish */
+
+ MOV_L ( STRIDE, EAX ) /* stride */
+ MOV_L ( ECX, REGOFF(V3F_COUNT, EDI) ) /* set dest-count */
+
+ IMUL_L( CONST(12), ECX ) /* count *= 12 */
+ MOV_L( REGOFF(V3F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V3F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVSS ( M(0), XMM1 ) /* m0 */
+ MOVSS ( M(5), XMM2 ) /* m5 */
+ UNPCKLPS( XMM2, XMM1 ) /* m5 | m0 */
+ MOVSS ( ARG_SCALE, XMM0 ) /* scale */
+ SHUFPS ( CONST(0x0), XMM0, XMM0 ) /* scale | scale */
+ MULPS ( XMM0, XMM1 ) /* m5*scale | m0*scale */
+ MULSS ( M(10), XMM0 ) /* m10*scale */
+
+ALIGNTEXT32
+LLBL(K_G3TRNNRR_top):
+ MOVLPS ( S(0), XMM2 ) /* uy | ux */
+ MULPS ( XMM1, XMM2 ) /* uy*m5*scale | ux*m0*scale */
+ MOVLPS ( XMM2, D(0) ) /* ->D(1) | D(0) */
+
+ MOVSS ( S(2), XMM2 ) /* uz */
+ MULSS ( XMM0, XMM2 ) /* uz*m10*scale */
+ MOVSS ( XMM2, D(2) ) /* ->D(2) */
+
+LLBL(K_G3TRNNRR_skip):
+ ADD_L ( CONST(12), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_G3TRNNRR_top) )
+
+LLBL(K_G3TRNNRR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+ALIGNTEXT16
+GLOBL GLNAME(gl_katmai_transform_rescale_normals_raw)
+GLNAME(gl_katmai_transform_rescale_normals_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+
+ MOV_L ( ARG_IN, ESI ) /* ptr to source GLvector3f */
+ MOV_L ( ARG_DEST, EDI ) /* ptr to dest GLvector3f */
+
+ MOV_L ( ARG_MAT, EDX ) /* ptr to matrix */
+ MOV_L ( REGOFF(MAT_INV, EDX), EDX) /* matrix->inv */
+
+ MOV_L ( REGOFF(V3F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L ( ECX, ECX )
+ JZ( LLBL(K_G3TRNR_finish) ) /* count was zero; go to finish */
+
+ MOV_L ( STRIDE, EAX ) /* stride */
+ MOV_L ( ECX, REGOFF(V3F_COUNT, EDI) ) /* set dest-count */
+
+ IMUL_L( CONST(12), ECX ) /* count *= 12 */
+ MOV_L( REGOFF(V3F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V3F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVSS ( M(0), XMM0 ) /* m0 */
+ MOVSS ( M(4), XMM1 ) /* m4 */
+ UNPCKLPS( XMM1, XMM0 ) /* m4 | m0 */
+
+ MOVSS ( ARG_SCALE, XMM4 ) /* scale */
+ SHUFPS ( CONST(0x0), XMM4, XMM4 ) /* scale | scale */
+
+ MULPS ( XMM4, XMM0 ) /* m4*scale | m0*scale */
+ MOVSS ( M(1), XMM1 ) /* m1 */
+ MOVSS ( M(5), XMM2 ) /* m5 */
+ UNPCKLPS( XMM2, XMM1 ) /* m5 | m1 */
+ MULPS ( XMM4, XMM1 ) /* m5*scale | m1*scale */
+ MOVSS ( M(2), XMM2 ) /* m2 */
+ MOVSS ( M(6), XMM3 ) /* m6 */
+ UNPCKLPS( XMM3, XMM2 ) /* m6 | m2 */
+ MULPS ( XMM4, XMM2 ) /* m6*scale | m2*scale */
+
+ MOVSS ( M(8), XMM6 ) /* m8 */
+ MULSS ( ARG_SCALE, XMM6 ) /* m8*scale */
+ MOVSS ( M(9), XMM7 ) /* m9 */
+ MULSS ( ARG_SCALE, XMM7 ) /* m9*scale */
+
+ALIGNTEXT32
+LLBL(K_G3TRNR_top):
+ MOVSS ( S(0), XMM3 ) /* ux */
+ SHUFPS ( CONST(0x0), XMM3, XMM3 ) /* ux | ux */
+ MULPS ( XMM0, XMM3 ) /* ux*m4 | ux*m0 */
+ MOVSS ( S(1), XMM4 ) /* uy */
+ SHUFPS ( CONST(0x0), XMM4, XMM4 ) /* uy | uy */
+ MULPS ( XMM1, XMM4 ) /* uy*m5 | uy*m1 */
+ MOVSS ( S(2), XMM5 ) /* uz */
+ SHUFPS ( CONST(0x0), XMM5, XMM5 ) /* uz | uz */
+ MULPS ( XMM2, XMM5 ) /* uz*m6 | uz*m2 */
+
+ ADDPS ( XMM4, XMM3 )
+ ADDPS ( XMM5, XMM3 )
+ MOVLPS ( XMM3, D(0) )
+
+ MOVSS ( M(10), XMM3 ) /* m10 */
+ MULSS ( ARG_SCALE, XMM3 ) /* m10*scale */
+ MULSS ( S(2), XMM3 ) /* m10*scale*uz */
+ MOVSS ( S(1), XMM4 ) /* uy */
+ MULSS ( XMM7, XMM4 ) /* uy*m9*scale */
+ MOVSS ( S(0), XMM5 ) /* ux */
+ MULSS ( XMM6, XMM5 ) /* ux*m8*scale */
+
+ ADDSS ( XMM4, XMM3 )
+ ADDSS ( XMM5, XMM3 )
+ MOVSS ( XMM3, D(2) )
+
+LLBL(K_G3TRNR_skip):
+ ADD_L ( CONST(12), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_G3TRNR_top) )
+
+LLBL(K_G3TRNR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT16
+GLOBL GLNAME(gl_katmai_transform_normals_no_rot_raw)
+GLNAME(gl_katmai_transform_normals_no_rot_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+
+ MOV_L ( ARG_IN, ESI ) /* ptr to source GLvector3f */
+ MOV_L ( ARG_DEST, EDI ) /* ptr to dest GLvector3f */
+
+ MOV_L ( ARG_MAT, EDX ) /* ptr to matrix */
+ MOV_L ( REGOFF(MAT_INV, EDX), EDX) /* matrix->inv */
+
+ MOV_L ( REGOFF(V3F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L ( ECX, ECX )
+ JZ( LLBL(K_G3TNNRR_finish) ) /* count was zero; go to finish */
+
+ MOV_L ( STRIDE, EAX ) /* stride */
+ MOV_L ( ECX, REGOFF(V3F_COUNT, EDI) ) /* set dest-count */
+
+ IMUL_L( CONST(12), ECX ) /* count *= 12 */
+ MOV_L( REGOFF(V3F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V3F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVSS( M(0), XMM0 ) /* m0 */
+ MOVSS( M(5), XMM1 ) /* m5 */
+ UNPCKLPS( XMM1, XMM0 ) /* m5 | m0 */
+ MOVSS( M(10), XMM1 ) /* m10 */
+
+ALIGNTEXT32
+LLBL(K_G3TNNRR_top):
+ MOVLPS( S(0), XMM2 ) /* uy | ux */
+ MULPS( XMM0, XMM2 ) /* uy*m5 | ux*m0 */
+ MOVLPS( XMM2, D(0) )
+
+ MOVSS( S(2), XMM2 ) /* uz */
+ MULSS( XMM1, XMM2 ) /* uz*m10 */
+ MOVSS( XMM2, D(2) )
+
+LLBL(K_G3TNNRR_skip):
+ ADD_L ( CONST(12), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_G3TNNRR_top) )
+
+LLBL(K_G3TNNRR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
diff --git a/xc/extras/Mesa/src/X86/katmai_xform_masked1.S b/xc/extras/Mesa/src/X86/katmai_xform_masked1.S
new file mode 100644
index 000000000..5e45f09c4
--- /dev/null
+++ b/xc/extras/Mesa/src/X86/katmai_xform_masked1.S
@@ -0,0 +1,518 @@
+#include "assyntax.h"
+/** TODO:
+ * - insert PREFETCH instructions to avoid cache-misses !
+ * - some more optimizations are possible...
+ * - for 40-50% more performance in the SSE-functions, the
+ * data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
+ */
+
+ SEG_TEXT
+
+
+#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER)
+#define LLBL(a) .L ## a
+#else
+#define LLBL(a) a
+#endif
+
+#define S(i) REGOFF(i * 4, ESI)
+#define D(i) REGOFF(i * 4, EDI)
+#define M(i) REGOFF(i * 4, EDX)
+
+/*
+ * Offsets into GLvector4f
+ */
+#define V4F_DATA 0
+#define V4F_START 4
+#define V4F_COUNT 8
+#define V4F_STRIDE 12
+#define V4F_SIZE 16
+#define V4F_FLAGS 20
+
+#define VEC_SIZE_1 1
+#define VEC_SIZE_2 3
+#define VEC_SIZE_3 7
+#define VEC_SIZE_4 15
+
+/*
+ * Offsets for transform_func arguments
+ *
+ * typedef void (*transform_func)( GLvector4f *to_vec,
+ * const GLmatrix *mat,
+ * const GLvector4f *from_vec,
+ * const GLubyte *clipmask,
+ * const GLubyte flag );
+ */
+#define OFFSET_DEST 4
+#define OFFSET_MATRIX 8
+#define OFFSET_SOURCE 12
+#define OFFSET_CLIP 16
+#define OFFSET_FLAG 20
+
+#define ARG_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP)
+#define ARG_MATRIX REGOFF(FRAME_OFFSET+OFFSET_MATRIX, ESP)
+#define ARG_SOURCE REGOFF(FRAME_OFFSET+OFFSET_SOURCE, ESP)
+#define ARG_CLIP REGOFF(FRAME_OFFSET+OFFSET_CLIP, ESP)
+#define ARG_FLAG REGOFF(FRAME_OFFSET+OFFSET_FLAG, ESP)
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points1_general_masked)
+GLNAME( gl_katmai_transform_points1_general_masked ):
+
+#define FRAME_OFFSET 16
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+ PUSH_L ( EBX )
+ PUSH_L ( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX ) /* count was zero ? */
+ JZ( LLBL( K_GTP1GM_finish ) ) /* yes -> nothing to do. */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVUPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */
+ MOVUPS( M(12), XMM1 ) /* m15 | m14 | m13 | m12 */
+
+ALIGNTEXT32
+LLBL( K_GTP1GM_top ):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP1GM_skip) )
+
+ MOVSS( S(0), XMM2 ) /* ox */
+ SHUFPS( CONST(0x0), XMM2, XMM2 ) /* ox | ox | ox | ox */
+ MULPS( XMM0, XMM2 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
+ ADDPS( XMM1, XMM2 ) /* + | + | + | + */
+ MOVUPS( XMM2, D(0) )
+
+LLBL(K_GTP1GM_skip):
+ INC_L ( EBP )
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP1GM_top) )
+
+LLBL(K_GTP1GM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points1_identity_masked)
+GLNAME( gl_katmai_transform_points1_identity_masked ):
+
+#define FRAME_OFFSET 16
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+ PUSH_L ( EBX )
+ PUSH_L ( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX )
+ JZ( LLBL(K_GTP1IM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_1), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(1), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ CMP_L( ESI, EDI )
+ JE( LLBL(K_GTP1IM_finish) )
+
+ALIGNTEXT32
+LLBL( K_GTP1IM_top ):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP1IM_skip) )
+
+ MOV_L( S(0), EDX )
+ MOV_L( EDX, D(0) )
+
+LLBL(K_GTP1IM_skip):
+ INC_L ( EBP )
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP1IM_top) )
+
+LLBL(K_GTP1IM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points1_3d_no_rot_masked)
+GLNAME(gl_katmai_transform_points1_3d_no_rot_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+ PUSH_L( EBX )
+ PUSH_L( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX )
+ JZ( LLBL(K_GTP13DNRM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVSS( M(0), XMM0 ) /* m0 */
+ MOVSS( M(12), XMM1 ) /* m12 */
+ MOVSS( M(13), XMM2 ) /* m13 */
+ MOVSS( M(14), XMM3 ) /* m14 */
+
+ALIGNTEXT32
+LLBL(K_GTP13DNRM_top):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP13DNRM_skip) )
+
+ MOVSS( S(0), XMM4 ) /* ox */
+ MULSS( XMM0, XMM4 ) /* ox*m0 */
+ ADDSS( XMM1, XMM4 ) /* ox*m0+m12 */
+ MOVSS( XMM4, D(0) )
+
+ MOVSS( XMM2, D(1) )
+ MOVSS( XMM3, D(2) )
+
+LLBL(K_GTP13DNRM_skip):
+ INC_L ( EBP )
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP13DNRM_top) )
+
+LLBL(K_GTP13DNRM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points1_perspective_masked)
+GLNAME(gl_katmai_transform_points1_perspective_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+ PUSH_L ( EBX )
+ PUSH_L ( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP13PM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ XORPS( XMM0, XMM0 ) /* 0 | 0 | 0 | 0 */
+ MOVSS( M(0), XMM1 ) /* m0 */
+ MOVSS( M(14), XMM2 ) /* m14 */
+
+ALIGNTEXT32
+LLBL(K_GTP13PM_top):
+ TEST_B ( BL, REGIND(EBP) )
+ JNZ ( LLBL(K_GTP13PM_skip) )
+
+ MOVSS( S(0), XMM3 ) /* ox */
+ MULSS( XMM1, XMM3 ) /* ox*m0 */
+ MOVSS( XMM3, D(0) ) /* ox*m0->D(0) */
+ MOVSS( XMM2, D(2) ) /* m14->D(2) */
+
+ MOVSS( XMM0, D(1) )
+ MOVSS( XMM0, D(3) )
+
+LLBL(K_GTP13PM_skip):
+ INC_L( EBP )
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP13PM_top) )
+
+LLBL(K_GTP13PM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points1_2d_masked)
+GLNAME(gl_katmai_transform_points1_2d_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+ PUSH_L( EBX )
+ PUSH_L( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP13P2DM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVLPS( M(0), XMM0 ) /* m1 | m0 */
+ MOVLPS( M(12), XMM1 ) /* m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP13P2DM_top):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP13P2DM_skip) )
+
+ MOVSS( S(0), XMM2 ) /* ox */
+ SHUFPS( CONST(0x0), XMM2, XMM2 ) /* ox | ox | ox | ox */
+ MULPS( XMM0, XMM2 ) /* - | - | ox*m1 | ox*m0 */
+ ADDPS( XMM1, XMM2 ) /* - | - | ox*m1+m13 | ox*m0+m12 */
+ MOVLPS( XMM2, D(0) )
+
+LLBL(K_GTP13P2DM_skip):
+ INC_L ( EBP )
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP13P2DM_top) )
+
+LLBL(K_GTP13P2DM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points1_2d_no_rot_masked)
+GLNAME(gl_katmai_transform_points1_2d_no_rot_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+ PUSH_L( EBX )
+ PUSH_L( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP13P2DNRM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVSS( M(0), XMM0 ) /* m0 */
+ MOVSS( M(12), XMM1 ) /* m12 */
+ MOVSS( M(13), XMM2 ) /* m13 */
+
+ALIGNTEXT32
+LLBL(K_GTP13P2DNRM_top):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP13P2DNRM_skip) )
+
+ MOVSS( S(0), XMM3 ) /* ox */
+ MULSS( XMM0, XMM3 ) /* ox*m0 */
+ ADDSS( XMM1, XMM3 ) /* ox*m0+m12 */
+ MOVSS( XMM3, D(0) )
+ MOVSS( XMM2, D(1) )
+
+LLBL(K_GTP13P2DNRM_skip):
+ INC_L( EBP )
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP13P2DNRM_top) )
+
+LLBL(K_GTP13P2DNRM_finish):
+ POP_L( EBP )
+ POP_L( EBX )
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points1_3d_masked)
+GLNAME(gl_katmai_transform_points1_3d_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+ PUSH_L( EBX )
+ PUSH_L( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP13P3DM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVUPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */
+ MOVUPS( M(12), XMM1 ) /* m15 | m14 | m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP13P3DM_top):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP13P3DM_skip) )
+
+ MOVSS( S(0), XMM2 ) /* ox */
+ SHUFPS( CONST(0x0), XMM2, XMM2 ) /* ox | ox | ox | ox */
+ MULPS( XMM0, XMM2 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
+ ADDPS( XMM1, XMM2 ) /* +m15 | +m14 | +m13 | +m12 */
+ MOVLPS( XMM2, D(0) ) /* - | - | ->D(1)| ->D(0)*/
+ UNPCKHPS( XMM2, XMM2 ) /* ox*m3+m15 | ox*m3+m15 | ox*m2+m14 | ox*m2+m14 */
+ MOVSS( XMM2, D(2) ) /* ->D(2) */
+
+LLBL(K_GTP13P3DM_skip):
+ INC_L( EBP )
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP13P3DM_top) )
+
+LLBL(K_GTP13P3DM_finish):
+ POP_L( EBP )
+ POP_L( EBX )
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
diff --git a/xc/extras/Mesa/src/X86/katmai_xform_masked2.S b/xc/extras/Mesa/src/X86/katmai_xform_masked2.S
new file mode 100644
index 000000000..f6d30fba1
--- /dev/null
+++ b/xc/extras/Mesa/src/X86/katmai_xform_masked2.S
@@ -0,0 +1,544 @@
+#include "assyntax.h"
+/** TODO:
+ * - insert PREFETCH instructions to avoid cache-misses !
+ * - some more optimizations are possible...
+ * - for 40-50% more performance in the SSE-functions, the
+ * data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
+ */
+
+ SEG_TEXT
+
+
+#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER)
+#define LLBL(a) .L ## a
+#else
+#define LLBL(a) a
+#endif
+
+#define S(i) REGOFF(i * 4, ESI)
+#define D(i) REGOFF(i * 4, EDI)
+#define M(i) REGOFF(i * 4, EDX)
+
+/*
+ * Offsets into GLvector4f
+ */
+#define V4F_DATA 0
+#define V4F_START 4
+#define V4F_COUNT 8
+#define V4F_STRIDE 12
+#define V4F_SIZE 16
+#define V4F_FLAGS 20
+
+#define VEC_SIZE_1 1
+#define VEC_SIZE_2 3
+#define VEC_SIZE_3 7
+#define VEC_SIZE_4 15
+
+/*
+ * Offsets for transform_func arguments
+ *
+ * typedef void (*transform_func)( GLvector4f *to_vec,
+ * const GLmatrix *mat,
+ * const GLvector4f *from_vec,
+ * const GLubyte *clipmask,
+ * const GLubyte flag );
+ */
+#define OFFSET_DEST 4
+#define OFFSET_MATRIX 8
+#define OFFSET_SOURCE 12
+#define OFFSET_CLIP 16
+#define OFFSET_FLAG 20
+
+#define ARG_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP)
+#define ARG_MATRIX REGOFF(FRAME_OFFSET+OFFSET_MATRIX, ESP)
+#define ARG_SOURCE REGOFF(FRAME_OFFSET+OFFSET_SOURCE, ESP)
+#define ARG_CLIP REGOFF(FRAME_OFFSET+OFFSET_CLIP, ESP)
+#define ARG_FLAG REGOFF(FRAME_OFFSET+OFFSET_FLAG, ESP)
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points2_general_masked)
+GLNAME( gl_katmai_transform_points2_general_masked ):
+
+#define FRAME_OFFSET 16
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+ PUSH_L ( EBX )
+ PUSH_L ( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX )
+ JZ( LLBL(K_GTP2GM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVUPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */
+ MOVUPS( M(4), XMM1 ) /* m7 | m6 | m5 | m4 */
+ MOVUPS( M(12), XMM2 ) /* m15 | m14 | m13 | m12 */
+
+ALIGNTEXT32
+LLBL( K_GTP2GM_top ):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP2GM_skip) )
+
+ MOVSS( S(0), XMM3 ) /* ox */
+ SHUFPS( CONST(0x0), XMM3, XMM3 ) /* ox | ox | ox | ox */
+ MULPS( XMM0, XMM3 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
+ MOVSS( S(1), XMM4 ) /* oy */
+ SHUFPS( CONST(0x0), XMM4, XMM4 ) /* oy | oy | oy | oy */
+ MULPS( XMM1, XMM4 ) /* oy*m7 | oy*m6 | oy*m5 | oy*m4 */
+
+ ADDPS( XMM4, XMM3 )
+ ADDPS( XMM2, XMM3 )
+ MOVUPS( XMM3, D(0) )
+
+LLBL(K_GTP2GM_skip):
+ INC_L ( EBP )
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP2GM_top) )
+
+LLBL(K_GTP2GM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points2_identity_masked)
+GLNAME( gl_katmai_transform_points2_identity_masked ):
+
+#define FRAME_OFFSET 16
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+ PUSH_L ( EBX )
+ PUSH_L ( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP2IM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ CMP_L( ESI, EDI )
+ JE( LLBL(K_GTP2IM_finish) )
+
+ALIGNTEXT32
+LLBL( K_GTP2IM_top ):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP2IM_skip) )
+
+ MOV_L( S(0), EDX )
+ MOV_L( EDX, D(0) )
+ MOV_L( S(1), EDX )
+ MOV_L( EDX, D(1) )
+
+LLBL(K_GTP2IM_skip):
+ INC_L ( EBP )
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP2IM_top) )
+
+LLBL(K_GTP2IM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points2_3d_no_rot_masked)
+GLNAME(gl_katmai_transform_points2_3d_no_rot_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+ PUSH_L( EBX )
+ PUSH_L( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP23DNRM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVSS ( M(0), XMM1 ) /* - | - | - | m0 */
+ MOVSS ( M(5), XMM2 ) /* - | - | - | m5 */
+ UNPCKLPS ( XMM2, XMM1 ) /* - | - | m5 | m0 */
+ MOVLPS ( M(12), XMM2 ) /* - | - | m13 | m12 */
+ MOVSS ( M(14), XMM3 ) /* - | - | - | m14 */
+
+ALIGNTEXT32
+LLBL(K_GTP23DNRM_top):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP23DNRM_skip) )
+
+ MOVLPS ( S(0), XMM0 ) /* - | - | oy | ox */
+ MULPS ( XMM1, XMM0 ) /* - | - | oy*m5 | ox*m0 */
+ ADDPS ( XMM2, XMM0 ) /* - | - | +m13 | +m12 */
+ MOVLPS ( XMM0, D(0) ) /* -> D(1) | -> D(0) */
+
+ MOVSS ( XMM3, D(2) ) /* -> D(2) */
+
+LLBL(K_GTP23DNRM_skip):
+ INC_L ( EBP )
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP23DNRM_top) )
+
+LLBL(K_GTP23DNRM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points2_perspective_masked)
+GLNAME(gl_katmai_transform_points2_perspective_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+ PUSH_L ( EBX )
+ PUSH_L ( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP23PM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVSS ( M(0), XMM1 ) /* - | - | - | m0 */
+ MOVSS ( M(5), XMM2 ) /* - | - | - | m5 */
+ UNPCKLPS ( XMM2, XMM1 ) /* - | - | m5 | m0 */
+ MOVSS ( M(14), XMM3 ) /* m14 */
+ XORPS ( XMM0, XMM0 ) /* 0 | 0 | 0 | 0 */
+
+ALIGNTEXT32
+LLBL(K_GTP23PM_top):
+ TEST_B ( BL, REGIND(EBP) )
+ JNZ ( LLBL(K_GTP23PM_skip) )
+
+ MOVLPS( S(0), XMM4 ) /* oy | ox */
+ MULPS( XMM1, XMM4 ) /* oy*m5 | ox*m0 */
+ MOVLPS( XMM4, D(0) ) /* ->D(1) | ->D(0) */
+ MOVSS( XMM3, D(2) ) /* ->D(2) */
+ MOVSS( XMM0, D(3) ) /* ->D(3) */
+
+LLBL(K_GTP23PM_skip):
+ INC_L( EBP )
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP23PM_top) )
+
+LLBL(K_GTP23PM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points2_2d_masked)
+GLNAME(gl_katmai_transform_points2_2d_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+ PUSH_L( EBX )
+ PUSH_L( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP23P2DM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVLPS( M(0), XMM0 ) /* m1 | m0 */
+ MOVLPS( M(4), XMM1 ) /* m5 | m4 */
+ MOVLPS( M(12), XMM2 ) /* m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP23P2DM_top):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP23P2DM_skip) )
+
+ MOVSS( S(0), XMM3 ) /* ox */
+ SHUFPS( CONST(0x0), XMM3, XMM3 ) /* ox | ox */
+ MULPS( XMM0, XMM3 ) /* ox*m1 | ox*m0 */
+
+ MOVSS( S(1), XMM4 ) /* oy */
+ SHUFPS( CONST(0x0), XMM4, XMM4 ) /* oy | oy */
+ MULPS( XMM1, XMM4 ) /* oy*m5 | oy*m4 */
+
+ ADDPS( XMM4, XMM3 )
+ ADDPS( XMM2, XMM3 )
+ MOVLPS( XMM3, D(0) ) /* ->D(1) | ->D(0) */
+
+LLBL(K_GTP23P2DM_skip):
+ INC_L ( EBP )
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP23P2DM_top) )
+
+LLBL(K_GTP23P2DM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points2_2d_no_rot_masked)
+GLNAME(gl_katmai_transform_points2_2d_no_rot_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+ PUSH_L( EBX )
+ PUSH_L( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP23P2DNRM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVSS ( M(0), XMM1 ) /* m0 */
+ MOVSS ( M(5), XMM2 ) /* m5 */
+ UNPCKLPS ( XMM2, XMM1 ) /* m5 | m0 */
+ MOVLPS ( M(12), XMM2 ) /* m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP23P2DNRM_top):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP23P2DNRM_skip) )
+
+ MOVLPS( S(0), XMM0 ) /* oy | ox */
+ MULPS( XMM1, XMM0 ) /* oy*m5 | ox*m0 */
+ ADDPS( XMM2, XMM0 ) /* +m13 | +m12 */
+ MOVLPS( XMM0, D(0) ) /* ->D(1) | ->D(0) */
+
+LLBL(K_GTP23P2DNRM_skip):
+ INC_L( EBP )
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP23P2DNRM_top) )
+
+LLBL(K_GTP23P2DNRM_finish):
+ POP_L( EBP )
+ POP_L( EBX )
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points2_3d_masked)
+GLNAME(gl_katmai_transform_points2_3d_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+ PUSH_L( EBX )
+ PUSH_L( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP23P3DM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVUPS( M(0), XMM0 ) /* m2 | m1 | m0 */
+ MOVUPS( M(4), XMM1 ) /* m6 | m5 | m4 */
+ MOVUPS( M(12), XMM2 ) /* m14 | m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP23P3DM_top):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP23P3DM_skip) )
+
+ MOVSS( S(0), XMM3 ) /* ox */
+ SHUFPS( CONST(0x0), XMM3, XMM3 ) /* ox | ox | ox */
+ MULPS( XMM0, XMM3 ) /* ox*m2 | ox*m1 | ox*m0 */
+
+ MOVSS( S(1), XMM4 ) /* oy */
+ SHUFPS( CONST(0x0), XMM4, XMM4 ) /* oy | oy | oy */
+ MULPS( XMM1, XMM4 ) /* oy*m6 | oy*m5 | oy*m4 */
+
+ ADDPS( XMM4, XMM3 )
+ ADDPS( XMM2, XMM3 )
+
+ MOVLPS( XMM3, D(0) ) /* ->D(1) | ->D(0) */
+ UNPCKHPS( XMM3, XMM3 )
+ MOVSS( XMM3, D(2) ) /* ->D(2) */
+
+LLBL(K_GTP23P3DM_skip):
+ INC_L( EBP )
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP23P3DM_top) )
+
+LLBL(K_GTP23P3DM_finish):
+ POP_L( EBP )
+ POP_L( EBX )
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
diff --git a/xc/extras/Mesa/src/X86/katmai_xform_masked3.S b/xc/extras/Mesa/src/X86/katmai_xform_masked3.S
new file mode 100644
index 000000000..b88109a57
--- /dev/null
+++ b/xc/extras/Mesa/src/X86/katmai_xform_masked3.S
@@ -0,0 +1,584 @@
+#include "assyntax.h"
+/** TODO:
+ * - insert PREFETCH instructions to avoid cache-misses !
+ * - some more optimizations are possible...
+ * - for 40-50% more performance in the SSE-functions, the
+ * data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
+ */
+
+ SEG_TEXT
+
+
+#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER)
+#define LLBL(a) .L ## a
+#else
+#define LLBL(a) a
+#endif
+
+#define S(i) REGOFF(i * 4, ESI)
+#define D(i) REGOFF(i * 4, EDI)
+#define M(i) REGOFF(i * 4, EDX)
+
+/*
+ * Offsets into GLvector4f
+ */
+#define V4F_DATA 0
+#define V4F_START 4
+#define V4F_COUNT 8
+#define V4F_STRIDE 12
+#define V4F_SIZE 16
+#define V4F_FLAGS 20
+
+#define VEC_SIZE_1 1
+#define VEC_SIZE_2 3
+#define VEC_SIZE_3 7
+#define VEC_SIZE_4 15
+
+/*
+ * Offsets for transform_func arguments
+ *
+ * typedef void (*transform_func)( GLvector4f *to_vec,
+ * const GLmatrix *mat,
+ * const GLvector4f *from_vec,
+ * const GLubyte *clipmask,
+ * const GLubyte flag );
+ */
+#define OFFSET_DEST 4
+#define OFFSET_MATRIX 8
+#define OFFSET_SOURCE 12
+#define OFFSET_CLIP 16
+#define OFFSET_FLAG 20
+
+#define ARG_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP)
+#define ARG_MATRIX REGOFF(FRAME_OFFSET+OFFSET_MATRIX, ESP)
+#define ARG_SOURCE REGOFF(FRAME_OFFSET+OFFSET_SOURCE, ESP)
+#define ARG_CLIP REGOFF(FRAME_OFFSET+OFFSET_CLIP, ESP)
+#define ARG_FLAG REGOFF(FRAME_OFFSET+OFFSET_FLAG, ESP)
+
+ALIGNTEXT16
+GLOBL GLNAME(gl_katmai_transform_points3_general_masked)
+GLNAME( gl_katmai_transform_points3_general_masked ):
+
+#define FRAME_OFFSET 16
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+ PUSH_L ( EBX )
+ PUSH_L ( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX )
+ JZ( LLBL(K_GTPGM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVUPS ( REGOFF(0, EDX), XMM0 ) /* m0 | m1 | m2 | m3 */
+ MOVUPS ( REGOFF(16, EDX), XMM1 ) /* m4 | m5 | m6 | m7 */
+ MOVUPS ( REGOFF(32, EDX), XMM2 ) /* m8 | m9 | m10 | m11 */
+ MOVUPS ( REGOFF(48, EDX), XMM3 ) /* m12 | m13 | m14 | m15 */
+
+
+ALIGNTEXT32
+LLBL( K_GTPGM_top ):
+ TEST_B ( BL, REGIND(EBP) )
+ JNZ ( LLBL(K_GTPGM_skip) )
+
+ MOVSS ( REGOFF(0, ESI), XMM4 ) /* | | | ox */
+ SHUFPS ( CONST(0x0), XMM4, XMM4 ) /* ox | ox | ox | ox */
+ MOVSS ( REGOFF(4, ESI), XMM5 ) /* | | | oy */
+ SHUFPS ( CONST(0x0), XMM5, XMM5 ) /* oy | oy | oy | oy */
+ MOVSS ( REGOFF(8, ESI), XMM6 ) /* | | | oz */
+ SHUFPS ( CONST(0x0), XMM6, XMM6 ) /* oz | oz | oz | oz */
+
+ MULPS ( XMM0, XMM4 ) /* m3*ox | m2*ox | m1*ox | m0*ox */
+ MULPS ( XMM1, XMM5 ) /* m7*oy | m6*oy | m5*oy | m4*oy */
+ MULPS ( XMM2, XMM6 ) /* m11*oz | m10*oz | m9*oz | m8*oz */
+
+ ADDPS ( XMM5, XMM4 )
+ ADDPS ( XMM6, XMM4 )
+ ADDPS ( XMM3, XMM4 )
+
+ MOVUPS ( XMM4, REGOFF(0, EDI) )
+
+LLBL(K_GTPGM_skip):
+ INC_L ( EBP )
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTPGM_top) )
+
+LLBL(K_GTPGM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT16
+GLOBL GLNAME(gl_katmai_transform_points3_identity_masked)
+GLNAME( gl_katmai_transform_points3_identity_masked ):
+
+#define FRAME_OFFSET 16
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+ PUSH_L ( EBX )
+ PUSH_L ( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX )
+ JZ( LLBL(K_GTPIM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ CMP_L( ESI, EDI )
+ JE( LLBL(K_GTPIM_finish) )
+
+
+ALIGNTEXT32
+LLBL( K_GTPIM_top ):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTPIM_skip) )
+
+ MOVLPS ( S(0), XMM0 )
+ MOVLPS ( XMM0, D(0) )
+ MOVSS ( S(2), XMM0 )
+ MOVSS ( XMM0, D(2) )
+
+LLBL(K_GTPIM_skip):
+ INC_L ( EBP )
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTPIM_top) )
+
+LLBL(K_GTPIM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points3_3d_no_rot_masked)
+GLNAME(gl_katmai_transform_points3_3d_no_rot_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ PUSH_L( EBX )
+ PUSH_L( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX )
+ JZ( LLBL(K_GTP3DNRM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVSS ( M(0), XMM1 ) /* - | - | - | m0 */
+ MOVSS ( M(5), XMM2 ) /* - | - | - | m5 */
+ UNPCKLPS ( XMM2, XMM1 ) /* - | - | m5 | m0 */
+ MOVLPS ( M(12), XMM2 ) /* - | - | m13 | m12 */
+ MOVSS ( M(10), XMM3 ) /* - | - | - | m10 */
+ MOVSS ( M(14), XMM4 ) /* - | - | - | m14 */
+
+ALIGNTEXT32
+LLBL(K_GTP3DNRM_top):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP3DNRM_skip) )
+
+ MOVLPS ( S(0), XMM0 ) /* - | - | s1 | s0 */
+ MULPS ( XMM1, XMM0 ) /* - | - | s1*m5 | s0*m0 */
+ ADDPS ( XMM2, XMM0 ) /* - | - | +m13 | +m12 */
+ MOVLPS ( XMM0, D(0) ) /* -> D(1) | -> D(0) */
+
+ MOVSS ( S(2), XMM0 ) /* sz */
+ MULSS ( XMM3, XMM0 ) /* sz*m10 */
+ ADDSS ( XMM4, XMM0 ) /* +m14 */
+ MOVSS ( XMM0, D(2) ) /* -> D(2) */
+
+LLBL(K_GTP3DNRM_skip):
+ INC_L( EBP )
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP3DNRM_top) )
+
+LLBL(K_GTP3DNRM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points3_perspective_masked)
+GLNAME(gl_katmai_transform_points3_perspective_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ PUSH_L( EBX )
+ PUSH_L( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX )
+ JZ( LLBL(K_GTP3PM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVSS ( M(0), XMM1 ) /* - | - | - | m0 */
+ MOVSS ( M(5), XMM2 ) /* - | - | - | m5 */
+ UNPCKLPS ( XMM2, XMM1 ) /* - | - | m5 | m0 */
+ MOVLPS ( M(8), XMM2 ) /* - | - | m9 | m8 */
+ MOVSS ( M(10), XMM3 ) /* m10 */
+ MOVSS ( M(14), XMM4 ) /* m14 */
+ XORPS ( XMM6, XMM6 ) /* 0 */
+
+ALIGNTEXT32
+LLBL(K_GTP3PM_top):
+ TEST_B ( BL, REGIND(EBP) )
+ JNZ ( LLBL(K_GTP3PM_skip) )
+
+ MOVLPS ( S(0), XMM0 ) /* oy | ox */
+ MULPS ( XMM1, XMM0 ) /* oy*m5 | ox*m0 */
+ MOVSS ( S(2), XMM5 ) /* oz */
+ SHUFPS ( CONST(0x0), XMM5, XMM5 ) /* oz | oz */
+ MULPS ( XMM2, XMM5 ) /* oz*m9 | oz*m8 */
+ ADDPS ( XMM5, XMM0 ) /* +oy*m5 | +ox*m0 */
+ MOVLPS ( XMM0, D(0) ) /* ->D(1) | ->D(0) */
+
+ MOVSS ( S(2), XMM0 ) /* oz */
+ MULSS ( XMM3, XMM0 ) /* oz*m10 */
+ ADDSS ( XMM4, XMM0 ) /* +m14 */
+ MOVSS ( XMM0, D(2) ) /* ->D(2) */
+
+ MOVSS ( S(2), XMM0 ) /* oz */
+ MOVSS ( XMM6, XMM5 ) /* 0 */
+ SUBPS ( XMM0, XMM5 ) /* -oz */
+ MOVSS ( XMM5, D(3) )
+
+LLBL(K_GTP3PM_skip):
+ INC_L ( EBP )
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP3PM_top) )
+
+LLBL(K_GTP3PM_finish):
+ POP_L( EBP )
+ POP_L( EBX )
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points3_2d_masked)
+GLNAME(gl_katmai_transform_points3_2d_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ PUSH_L( EBX )
+ PUSH_L( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX )
+ JZ( LLBL(K_GTP3P2DM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVLPS( M(0), XMM0 ) /* m1 | m0 */
+ MOVLPS( M(4), XMM1 ) /* m5 | m4 */
+ MOVLPS( M(12), XMM2 ) /* m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP3P2DM_top):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP3P2DM_skip) )
+
+ MOVSS ( S(0), XMM3 ) /* ox */
+ SHUFPS ( CONST(0x0), XMM3, XMM3 ) /* ox | ox */
+ MULPS ( XMM0, XMM3 ) /* ox*m1 | ox*m0 */
+ MOVSS ( S(1), XMM4 ) /* oy */
+ SHUFPS ( CONST(0x0), XMM4, XMM4 ) /* oy | oy */
+ MULPS ( XMM1, XMM4 ) /* oy*m5 | oy*m4 */
+
+ ADDPS ( XMM4, XMM3 )
+ ADDPS ( XMM2, XMM3 )
+ MOVLPS ( XMM3, D(0) )
+
+ MOVSS ( S(2), XMM3 )
+ MOVSS ( XMM3, D(2) )
+
+LLBL(K_GTP3P2DM_skip):
+ INC_L( EBP )
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP3P2DM_top) )
+
+LLBL(K_GTP3P2DM_finish):
+ POP_L( EBP )
+ POP_L( EBX )
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points3_2d_no_rot_masked)
+GLNAME(gl_katmai_transform_points3_2d_no_rot_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ PUSH_L( EBX )
+ PUSH_L( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX )
+ JZ( LLBL(K_GTP3P2DNRM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVSS ( M(0), XMM1 ) /* m0 */
+ MOVSS ( M(5), XMM2 ) /* m5 */
+ UNPCKLPS ( XMM2, XMM1 ) /* m5 | m0 */
+ MOVLPS ( M(12), XMM2 ) /* m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP3P2DNRM_top):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP3P2DNRM_skip) )
+
+ MOVLPS( S(0), XMM0 ) /* oy | ox */
+ MULPS( XMM1, XMM0 ) /* oy*m5 | ox*m0 */
+ ADDPS( XMM2, XMM0 ) /* +m13 | +m12 */
+ MOVLPS( XMM0, D(0) ) /* ->D(1) | ->D(0) */
+
+ MOVSS( S(2), XMM0 )
+ MOVSS( XMM0, D(2) )
+
+LLBL(K_GTP3P2DNRM_skip):
+ INC_L( EBP )
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP3P2DNRM_top) )
+
+LLBL(K_GTP3P2DNRM_finish):
+ POP_L( EBP )
+ POP_L( EBX )
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points3_3d_masked)
+GLNAME(gl_katmai_transform_points3_3d_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ PUSH_L( EBX )
+ PUSH_L( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX )
+ JZ( LLBL(K_GTP3P3DM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVUPS( M(0), XMM0 ) /* m2 | m1 | m0 */
+ MOVUPS( M(4), XMM1 ) /* m6 | m5 | m4 */
+ MOVUPS( M(8), XMM2 ) /* m10 | m9 | m8 */
+ MOVUPS( M(12), XMM3 ) /* m14 | m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP3P3DM_top):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP3P3DM_skip) )
+
+ MOVSS( S(0), XMM4 )
+ SHUFPS( CONST(0x0), XMM4, XMM4 ) /* ox | ox | ox */
+ MULPS( XMM0, XMM4 ) /* ox*m2 | ox*m1 | ox*m0 */
+
+ MOVSS( S(1), XMM5 )
+ SHUFPS( CONST(0x0), XMM5, XMM5 ) /* oy | oy | oy */
+ MULPS( XMM1, XMM5 ) /* oy*m6 | oy*m5 | oy*m4 */
+
+ MOVSS( S(2), XMM6 )
+ SHUFPS( CONST(0x0), XMM6, XMM6 ) /* oz | oz | oz */
+ MULPS( XMM2, XMM6 ) /* oz*m10 | oz*m9 | oz*m8 */
+
+ ADDPS( XMM5, XMM4 ) /* + | + | + */
+ ADDPS( XMM6, XMM4 ) /* + | + | + */
+ ADDPS( XMM3, XMM4 ) /* + | + | + */
+
+ MOVLPS( XMM4, D(0) ) /* => D(1) | => D(0) */
+ UNPCKHPS( XMM4, XMM4 )
+ MOVSS( XMM4, D(2) )
+
+LLBL(K_GTP3P3DM_skip):
+ INC_L( EBP )
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP3P3DM_top) )
+
+LLBL(K_GTP3P3DM_finish):
+ POP_L( EBP )
+ POP_L( EBX )
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
diff --git a/xc/extras/Mesa/src/X86/katmai_xform_masked4.S b/xc/extras/Mesa/src/X86/katmai_xform_masked4.S
new file mode 100644
index 000000000..b10736226
--- /dev/null
+++ b/xc/extras/Mesa/src/X86/katmai_xform_masked4.S
@@ -0,0 +1,373 @@
+#include "assyntax.h"
+/** TODO:
+ * - insert PREFETCH instructions to avoid cache-misses !
+ * - some more optimizations are possible...
+ * - for 40-50% more performance in the SSE-functions, the
+ * data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
+ */
+
+ SEG_TEXT
+
+
+#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER)
+#define LLBL(a) .L ## a
+#else
+#define LLBL(a) a
+#endif
+
+#define S(i) REGOFF(i * 4, ESI)
+#define D(i) REGOFF(i * 4, EDI)
+#define M(i) REGOFF(i * 4, EDX)
+
+/*
+ * Offsets into GLvector4f
+ */
+#define V4F_DATA 0
+#define V4F_START 4
+#define V4F_COUNT 8
+#define V4F_STRIDE 12
+#define V4F_SIZE 16
+#define V4F_FLAGS 20
+
+#define VEC_SIZE_1 1
+#define VEC_SIZE_2 3
+#define VEC_SIZE_3 7
+#define VEC_SIZE_4 15
+
+/*
+ * Offsets for transform_func arguments
+ *
+ * typedef void (*transform_func)( GLvector4f *to_vec,
+ * const GLmatrix *mat,
+ * const GLvector4f *from_vec,
+ * const GLubyte *clipmask,
+ * const GLubyte flag );
+ */
+#define OFFSET_DEST 4
+#define OFFSET_MATRIX 8
+#define OFFSET_SOURCE 12
+#define OFFSET_CLIP 16
+#define OFFSET_FLAG 20
+
+#define ARG_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP)
+#define ARG_MATRIX REGOFF(FRAME_OFFSET+OFFSET_MATRIX, ESP)
+#define ARG_SOURCE REGOFF(FRAME_OFFSET+OFFSET_SOURCE, ESP)
+#define ARG_CLIP REGOFF(FRAME_OFFSET+OFFSET_CLIP, ESP)
+#define ARG_FLAG REGOFF(FRAME_OFFSET+OFFSET_FLAG, ESP)
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points4_general_masked)
+GLNAME( gl_katmai_transform_points4_general_masked ):
+
+#define FRAME_OFFSET 16
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+ PUSH_L ( EBX )
+ PUSH_L ( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX ) /* count was zero ? */
+ JZ( LLBL( K_GTP4GM_finish ) ) /* yes -> nothing to do. */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVUPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */
+ MOVUPS( M(4), XMM1 ) /* m7 | m6 | m5 | m4 */
+ MOVUPS( M(8), XMM2 ) /* m11 | m10 | m9 | m8 */
+ MOVUPS( M(12), XMM3 ) /* m15 | m14 | m13 | m12 */
+
+ALIGNTEXT32
+LLBL( K_GTP4GM_top ):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP4GM_skip) )
+
+ MOVSS( S(0), XMM4 ) /* ox */
+ SHUFPS( CONST(0x0), XMM4, XMM4 ) /* ox | ox | ox | ox */
+ MULPS( XMM0, XMM4 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
+
+ MOVSS( S(1), XMM5 ) /* oy */
+ SHUFPS( CONST(0x0), XMM5, XMM5 ) /* oy | oy | oy | oy */
+ MULPS( XMM1, XMM5 ) /* oy*m7 | oy*m6 | oy*m5 | oy*m4 */
+
+ MOVSS( S(2), XMM6 ) /* oz */
+ SHUFPS( CONST(0x0), XMM6, XMM6 ) /* oz | oz | oz | oz */
+ MULPS( XMM2, XMM6 ) /* oz*m11 | oz*m10 | oz*m9 | oz*m8 */
+
+ MOVSS( S(3), XMM7 ) /* ow */
+ SHUFPS( CONST(0x0), XMM7, XMM7 ) /* ow | ow | ow | ow */
+ MULPS( XMM3, XMM7 ) /* ow*m15 | ow*m14 | ow*m13 | ow*m12 */
+
+ ADDPS( XMM5, XMM4 ) /* ox*m3+oy*m7 | ... */
+ ADDPS( XMM6, XMM4 ) /* ox*m3+oy*m7+oz*m11 | ... */
+ ADDPS( XMM7, XMM4 ) /* ox*m3+oy*m7+oz*m11+ow*m15 | ... */
+ MOVUPS( XMM4, D(0) ) /* ->D(3) | ->D(2) | ->D(1) | ->D(0) */
+
+LLBL(K_GTP4GM_skip):
+ INC_L ( EBP )
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP4GM_top) )
+
+LLBL(K_GTP4GM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points4_identity_masked)
+GLNAME( gl_katmai_transform_points4_identity_masked ):
+
+#define FRAME_OFFSET 16
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+ PUSH_L ( EBX )
+ PUSH_L ( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX )
+ JZ( LLBL(K_GTP4IM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ MOV_L( EAX, ARG_SOURCE )
+
+ CMP_L( ESI, EDI )
+ JE( LLBL(K_GTP4IM_finish) )
+
+ALIGNTEXT16
+LLBL( K_GTP4IM_top ):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP4IM_skip) )
+
+ MOV_L( S(0), EAX )
+ MOV_L( S(1), EDX )
+ MOV_L( EAX, D(0) )
+ MOV_L( EDX, D(1) )
+
+ MOV_L( S(2), EAX )
+ MOV_L( S(3), EDX )
+ MOV_L( EAX, D(2) )
+ MOV_L( EDX, D(3) )
+
+LLBL(K_GTP4IM_skip):
+ INC_L ( EBP )
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( ARG_SOURCE, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP4IM_top) )
+
+LLBL(K_GTP4IM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points4_3d_no_rot_masked)
+GLNAME(gl_katmai_transform_points4_3d_no_rot_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+ PUSH_L( EBX )
+ PUSH_L( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX )
+ JZ( LLBL(K_GTP43DNRM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVSS( M(0), XMM0 ) /* m0 */
+ MOVSS( M(5), XMM1 ) /* m5 */
+ UNPCKLPS( XMM1, XMM0 ) /* m5 | m0 */
+ MOVSS( M(10), XMM1 ) /* m10 */
+ MOVLPS( M(12), XMM2 ) /* m13 | m12 */
+ MOVSS( M(14), XMM3 ) /* m14 */
+
+ALIGNTEXT32
+LLBL(K_GTP43DNRM_top):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP43DNRM_skip) )
+
+ MOVLPS( S(0), XMM4 ) /* oy | ox */
+ MULPS( XMM0, XMM4 ) /* oy*m5 | ox*m0 */
+ MOVSS( S(3), XMM5 ) /* ow */
+ SHUFPS( CONST(0x0), XMM5, XMM5 ) /* ow | ow | ow | ow */
+ MULPS( XMM2, XMM5 ) /* ow*m13 | ow*m12 */
+ ADDPS( XMM5, XMM4 ) /* oy*m5+ow*m13 | ox*m0+ow*m12 */
+ MOVLPS( XMM4, D(0) ) /* ->D(1) | ->D(0) */
+
+ MOVSS( S(2), XMM4 ) /* oz */
+ MULSS( XMM1, XMM4 ) /* oz*m10 */
+ MOVSS( S(3), XMM5 ) /* ow */
+ MOVSS( XMM5, D(3) ) /* ->D(3) */
+ MULSS( XMM3, XMM5 ) /* ow*m14 */
+ ADDSS( XMM5, XMM4 ) /* ow*m14+oz*m10 */
+ MOVSS( XMM4, D(2) ) /* ->D(2) */
+
+LLBL(K_GTP43DNRM_skip):
+ INC_L ( EBP )
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP43DNRM_top) )
+
+LLBL(K_GTP43DNRM_finish):
+ POP_L ( EBP )
+ POP_L ( EBX )
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points4_3d_masked)
+GLNAME(gl_katmai_transform_points4_3d_masked):
+
+#define FRAME_OFFSET 16
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+ PUSH_L( EBX )
+ PUSH_L( EBP )
+
+ MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
+ MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( ARG_CLIP, EBP ) /* ptr to clip mask array */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+ MOV_B( ARG_FLAG, BL ) /* clip mask flags */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP43P3DM_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVUPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */
+ MOVUPS( M(4), XMM1 ) /* m7 | m6 | m5 | m4 */
+ MOVUPS( M(8), XMM2 ) /* m11 | m10 | m9 | m8 */
+ MOVUPS( M(12), XMM3 ) /* m15 | m14 | m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP43P3DM_top):
+ TEST_B( BL, REGIND(EBP) )
+ JNZ( LLBL(K_GTP43P3DM_skip) )
+
+ MOVSS( S(0), XMM4 ) /* ox */
+ SHUFPS( CONST(0x0), XMM4, XMM4 ) /* ox | ox | ox | ox */
+ MULPS( XMM0, XMM4 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
+
+ MOVSS( S(1), XMM5 ) /* oy */
+ SHUFPS( CONST(0x0), XMM5, XMM5 ) /* oy | oy | oy | oy */
+ MULPS( XMM1, XMM5 ) /* oy*m7 | oy*m6 | oy*m5 | oy*m4 */
+
+ MOVSS( S(2), XMM6 ) /* oz */
+ SHUFPS( CONST(0x0), XMM6, XMM6 ) /* oz | oz | oz | oz */
+ MULPS( XMM2, XMM6 ) /* oz*m11 | oz*m10 | oz*m9 | oz*m8 */
+
+ MOVSS( S(3), XMM7 ) /* ow */
+ SHUFPS( CONST(0x0), XMM7, XMM7 ) /* ow | ow | ow | ow */
+ MULPS( XMM3, XMM7 ) /* ow*m15 | ow*m14 | ow*m13 | ow*m12 */
+
+ ADDPS( XMM5, XMM4 ) /* ox*m3+oy*m7 | ... */
+ ADDPS( XMM6, XMM4 ) /* ox*m3+oy*m7+oz*m11 | ... */
+ ADDPS( XMM7, XMM4 ) /* ox*m3+oy*m7+oz*m11+ow*m15 | ... */
+ MOVUPS( XMM4, D(0) ) /* ->D(3) | ->D(2) | ->D(1) | ->D(0) */
+
+ MOVSS( S(3), XMM4 ) /* ow */
+ MOVSS( XMM4, D(3) ) /* ->D(3) */
+
+LLBL(K_GTP43P3DM_skip):
+ INC_L( EBP )
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP43P3DM_top) )
+
+LLBL(K_GTP43P3DM_finish):
+ POP_L( EBP )
+ POP_L( EBX )
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
diff --git a/xc/extras/Mesa/src/X86/katmai_xform_raw1.S b/xc/extras/Mesa/src/X86/katmai_xform_raw1.S
new file mode 100644
index 000000000..a36ea3783
--- /dev/null
+++ b/xc/extras/Mesa/src/X86/katmai_xform_raw1.S
@@ -0,0 +1,448 @@
+#include "assyntax.h"
+/** TODO:
+ * - insert PREFETCH instructions to avoid cache-misses !
+ * - some more optimizations are possible...
+ * - for 40-50% more performance in the SSE-functions, the
+ * data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
+ */
+
+ SEG_TEXT
+
+
+#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER)
+#define LLBL(a) .L ## a
+#else
+#define LLBL(a) a
+#endif
+
+#define S(i) REGOFF(i * 4, ESI)
+#define D(i) REGOFF(i * 4, EDI)
+#define M(i) REGOFF(i * 4, EDX)
+
+/*
+ * Offsets into GLvector4f
+ */
+#define V4F_DATA 0
+#define V4F_START 4
+#define V4F_COUNT 8
+#define V4F_STRIDE 12
+#define V4F_SIZE 16
+#define V4F_FLAGS 20
+
+#define VEC_SIZE_1 1
+#define VEC_SIZE_2 3
+#define VEC_SIZE_3 7
+#define VEC_SIZE_4 15
+
+/*
+ * Offsets for transform_func arguments
+ *
+ * typedef void (*transform_func)( GLvector4f *to_vec,
+ * const GLmatrix *mat,
+ * const GLvector4f *from_vec,
+ * const GLubyte *clipmask,
+ * const GLubyte flag );
+ */
+#define OFFSET_DEST 4
+#define OFFSET_MATRIX 8
+#define OFFSET_SOURCE 12
+#define OFFSET_CLIP 16
+#define OFFSET_FLAG 20
+
+#define ARG_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP)
+#define ARG_MATRIX REGOFF(FRAME_OFFSET+OFFSET_MATRIX, ESP)
+#define ARG_SOURCE REGOFF(FRAME_OFFSET+OFFSET_SOURCE, ESP)
+#define ARG_CLIP REGOFF(FRAME_OFFSET+OFFSET_CLIP, ESP)
+#define ARG_FLAG REGOFF(FRAME_OFFSET+OFFSET_FLAG, ESP)
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points1_general_raw)
+GLNAME( gl_katmai_transform_points1_general_raw ):
+
+#define FRAME_OFFSET 8
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ CMP_L( CONST(0), ECX ) /* count == 0 ? */
+ JE( LLBL( K_GTP1GR_finish ) ) /* yes -> nothing to do. */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVUPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */
+ MOVUPS( M(12), XMM1 ) /* m15 | m14 | m13 | m12 */
+
+ALIGNTEXT32
+LLBL( K_GTP1GR_top ):
+ MOVSS( S(0), XMM2 ) /* ox */
+ SHUFPS( CONST(0x0), XMM2, XMM2 ) /* ox | ox | ox | ox */
+ MULPS( XMM0, XMM2 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
+ ADDPS( XMM1, XMM2 ) /* + | + | + | + */
+ MOVUPS( XMM2, D(0) )
+
+LLBL(K_GTP1GR_skip):
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP1GR_top) )
+
+LLBL(K_GTP1GR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points1_identity_raw)
+GLNAME( gl_katmai_transform_points1_identity_raw ):
+
+#define FRAME_OFFSET 8
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP1IR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_1), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(1), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ CMP_L( ESI, EDI )
+ JE( LLBL(K_GTP1IR_finish) )
+
+
+ALIGNTEXT32
+LLBL( K_GTP1IR_top ):
+ MOV_L( S(0), EDX )
+ MOV_L( EDX, D(0) )
+
+LLBL(K_GTP1IR_skip):
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP1IR_top) )
+
+LLBL(K_GTP1IR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points1_3d_no_rot_raw)
+GLNAME(gl_katmai_transform_points1_3d_no_rot_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP13DNRR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVSS( M(0), XMM0 ) /* m0 */
+ MOVSS( M(12), XMM1 ) /* m12 */
+ MOVSS( M(13), XMM2 ) /* m13 */
+ MOVSS( M(14), XMM3 ) /* m14 */
+
+ALIGNTEXT32
+LLBL(K_GTP13DNRR_top):
+ MOVSS( S(0), XMM4 ) /* ox */
+ MULSS( XMM0, XMM4 ) /* ox*m0 */
+ ADDSS( XMM1, XMM4 ) /* ox*m0+m12 */
+ MOVSS( XMM4, D(0) )
+
+ MOVSS( XMM2, D(1) )
+ MOVSS( XMM3, D(2) )
+
+LLBL(K_GTP13DNRR_skip):
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP13DNRR_top) )
+
+LLBL(K_GTP13DNRR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points1_perspective_raw)
+GLNAME(gl_katmai_transform_points1_perspective_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP13PR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ XORPS( XMM0, XMM0 ) /* 0 | 0 | 0 | 0 */
+ MOVSS( M(0), XMM1 ) /* m0 */
+ MOVSS( M(14), XMM2 ) /* m14 */
+
+ALIGNTEXT32
+LLBL(K_GTP13PR_top):
+ MOVSS( S(0), XMM3 ) /* ox */
+ MULSS( XMM1, XMM3 ) /* ox*m0 */
+ MOVSS( XMM3, D(0) ) /* ox*m0->D(0) */
+ MOVSS( XMM2, D(2) ) /* m14->D(2) */
+
+ MOVSS( XMM0, D(1) )
+ MOVSS( XMM0, D(3) )
+
+LLBL(K_GTP13PR_skip):
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP13PR_top) )
+
+LLBL(K_GTP13PR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points1_2d_raw)
+GLNAME(gl_katmai_transform_points1_2d_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP13P2DR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVLPS( M(0), XMM0 ) /* m1 | m0 */
+ MOVLPS( M(12), XMM1 ) /* m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP13P2DR_top):
+ MOVSS( S(0), XMM2 ) /* ox */
+ SHUFPS( CONST(0x0), XMM2, XMM2 ) /* ox | ox | ox | ox */
+ MULPS( XMM0, XMM2 ) /* - | - | ox*m1 | ox*m0 */
+ ADDPS( XMM1, XMM2 ) /* - | - | ox*m1+m13 | ox*m0+m12 */
+ MOVLPS( XMM2, D(0) )
+
+LLBL(K_GTP13P2DR_skip):
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP13P2DR_top) )
+
+LLBL(K_GTP13P2DR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points1_2d_no_rot_raw)
+GLNAME(gl_katmai_transform_points1_2d_no_rot_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP13P2DNRR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVSS( M(0), XMM0 ) /* m0 */
+ MOVSS( M(12), XMM1 ) /* m12 */
+ MOVSS( M(13), XMM2 ) /* m13 */
+
+ALIGNTEXT32
+LLBL(K_GTP13P2DNRR_top):
+ MOVSS( S(0), XMM3 ) /* ox */
+ MULSS( XMM0, XMM3 ) /* ox*m0 */
+ ADDSS( XMM1, XMM3 ) /* ox*m0+m12 */
+ MOVSS( XMM3, D(0) )
+ MOVSS( XMM2, D(1) )
+
+LLBL(K_GTP13P2DNRR_skip):
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP13P2DNRR_top) )
+
+LLBL(K_GTP13P2DNRR_finish):
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points1_3d_raw)
+GLNAME(gl_katmai_transform_points1_3d_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP13P3DR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVUPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */
+ MOVUPS( M(12), XMM1 ) /* m15 | m14 | m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP13P3DR_top):
+ MOVSS( S(0), XMM2 ) /* ox */
+ SHUFPS( CONST(0x0), XMM2, XMM2 ) /* ox | ox | ox | ox */
+ MULPS( XMM0, XMM2 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
+ ADDPS( XMM1, XMM2 ) /* +m15 | +m14 | +m13 | +m12 */
+ MOVLPS( XMM2, D(0) ) /* - | - | ->D(1)| ->D(0)*/
+ UNPCKHPS( XMM2, XMM2 ) /* ox*m3+m15 | ox*m3+m15 | ox*m2+m14 | ox*m2+m14 */
+ MOVSS( XMM2, D(2) )
+
+LLBL(K_GTP13P3DR_skip):
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP13P3DR_top) )
+
+LLBL(K_GTP13P3DR_finish):
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
diff --git a/xc/extras/Mesa/src/X86/katmai_xform_raw2.S b/xc/extras/Mesa/src/X86/katmai_xform_raw2.S
new file mode 100644
index 000000000..ffe658c9b
--- /dev/null
+++ b/xc/extras/Mesa/src/X86/katmai_xform_raw2.S
@@ -0,0 +1,469 @@
+#include "assyntax.h"
+/** TODO:
+ * - insert PREFETCH instructions to avoid cache-misses !
+ * - some more optimizations are possible...
+ * - for 40-50% more performance in the SSE-functions, the
+ * data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
+ */
+
+ SEG_TEXT
+
+
+#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER)
+#define LLBL(a) .L ## a
+#else
+#define LLBL(a) a
+#endif
+
+#define S(i) REGOFF(i * 4, ESI)
+#define D(i) REGOFF(i * 4, EDI)
+#define M(i) REGOFF(i * 4, EDX)
+
+/*
+ * Offsets into GLvector4f
+ */
+#define V4F_DATA 0
+#define V4F_START 4
+#define V4F_COUNT 8
+#define V4F_STRIDE 12
+#define V4F_SIZE 16
+#define V4F_FLAGS 20
+
+#define VEC_SIZE_1 1
+#define VEC_SIZE_2 3
+#define VEC_SIZE_3 7
+#define VEC_SIZE_4 15
+
+/*
+ * Offsets for transform_func arguments
+ *
+ * typedef void (*transform_func)( GLvector4f *to_vec,
+ * const GLmatrix *mat,
+ * const GLvector4f *from_vec,
+ * const GLubyte *clipmask,
+ * const GLubyte flag );
+ */
+#define OFFSET_DEST 4
+#define OFFSET_MATRIX 8
+#define OFFSET_SOURCE 12
+#define OFFSET_CLIP 16
+#define OFFSET_FLAG 20
+
+#define ARG_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP)
+#define ARG_MATRIX REGOFF(FRAME_OFFSET+OFFSET_MATRIX, ESP)
+#define ARG_SOURCE REGOFF(FRAME_OFFSET+OFFSET_SOURCE, ESP)
+#define ARG_CLIP REGOFF(FRAME_OFFSET+OFFSET_CLIP, ESP)
+#define ARG_FLAG REGOFF(FRAME_OFFSET+OFFSET_FLAG, ESP)
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points2_general_raw)
+GLNAME( gl_katmai_transform_points2_general_raw ):
+
+#define FRAME_OFFSET 8
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX )
+ JZ( LLBL(K_GTP2GR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVUPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */
+ MOVUPS( M(4), XMM1 ) /* m7 | m6 | m5 | m4 */
+ MOVUPS( M(12), XMM2 ) /* m15 | m14 | m13 | m12 */
+
+ALIGNTEXT32
+LLBL( K_GTP2GR_top ):
+ MOVSS( S(0), XMM3 ) /* ox */
+ SHUFPS( CONST(0x0), XMM3, XMM3 ) /* ox | ox | ox | ox */
+ MULPS( XMM0, XMM3 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
+ MOVSS( S(1), XMM4 ) /* oy */
+ SHUFPS( CONST(0x0), XMM4, XMM4 ) /* oy | oy | oy | oy */
+ MULPS( XMM1, XMM4 ) /* oy*m7 | oy*m6 | oy*m5 | oy*m4 */
+
+ ADDPS( XMM4, XMM3 )
+ ADDPS( XMM2, XMM3 )
+ MOVUPS( XMM3, D(0) )
+
+LLBL(K_GTP2GR_skip):
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP2GR_top) )
+
+LLBL(K_GTP2GR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points2_identity_raw)
+GLNAME( gl_katmai_transform_points2_identity_raw ):
+
+#define FRAME_OFFSET 8
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP2IR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ CMP_L( ESI, EDI )
+ JE( LLBL(K_GTP2IR_finish) )
+
+
+ALIGNTEXT32
+LLBL( K_GTP2IR_top ):
+ MOV_L ( S(0), EDX )
+ MOV_L ( EDX, D(0) )
+ MOV_L ( S(1), EDX )
+ MOV_L ( EDX, D(1) )
+
+LLBL(K_GTP2IR_skip):
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP2IR_top) )
+
+LLBL(K_GTP2IR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points2_3d_no_rot_raw)
+GLNAME(gl_katmai_transform_points2_3d_no_rot_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP23DNRR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVSS ( M(0), XMM1 ) /* - | - | - | m0 */
+ MOVSS ( M(5), XMM2 ) /* - | - | - | m5 */
+ UNPCKLPS ( XMM2, XMM1 ) /* - | - | m5 | m0 */
+ MOVLPS ( M(12), XMM2 ) /* - | - | m13 | m12 */
+ MOVSS ( M(14), XMM3 ) /* - | - | - | m14 */
+
+ALIGNTEXT32
+LLBL(K_GTP23DNRR_top):
+ MOVLPS ( S(0), XMM0 ) /* - | - | oy | ox */
+ MULPS ( XMM1, XMM0 ) /* - | - | oy*m5 | ox*m0 */
+ ADDPS ( XMM2, XMM0 ) /* - | - | +m13 | +m12 */
+ MOVLPS ( XMM0, D(0) ) /* -> D(1) | -> D(0) */
+
+ MOVSS ( XMM3, D(2) ) /* -> D(2) */
+
+LLBL(K_GTP23DNRR_skip):
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP23DNRR_top) )
+
+LLBL(K_GTP23DNRR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points2_perspective_raw)
+GLNAME(gl_katmai_transform_points2_perspective_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP23PR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVSS ( M(0), XMM1 ) /* - | - | - | m0 */
+ MOVSS ( M(5), XMM2 ) /* - | - | - | m5 */
+ UNPCKLPS ( XMM2, XMM1 ) /* - | - | m5 | m0 */
+ MOVSS ( M(14), XMM3 ) /* m14 */
+ XORPS ( XMM0, XMM0 ) /* 0 | 0 | 0 | 0 */
+
+ALIGNTEXT32
+LLBL(K_GTP23PR_top):
+ MOVLPS( S(0), XMM4 ) /* oy | ox */
+ MULPS( XMM1, XMM4 ) /* oy*m5 | ox*m0 */
+ MOVLPS( XMM4, D(0) ) /* ->D(1) | ->D(0) */
+ MOVSS( XMM3, D(2) ) /* ->D(2) */
+ MOVSS( XMM0, D(3) ) /* ->D(3) */
+
+LLBL(K_GTP23PR_skip):
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP23PR_top) )
+
+LLBL(K_GTP23PR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points2_2d_raw)
+GLNAME(gl_katmai_transform_points2_2d_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP23P2DR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVLPS( M(0), XMM0 ) /* m1 | m0 */
+ MOVLPS( M(4), XMM1 ) /* m5 | m4 */
+ MOVLPS( M(12), XMM2 ) /* m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP23P2DR_top):
+ MOVSS( S(0), XMM3 ) /* ox */
+ SHUFPS( CONST(0x0), XMM3, XMM3 ) /* ox | ox */
+ MULPS( XMM0, XMM3 ) /* ox*m1 | ox*m0 */
+
+ MOVSS( S(1), XMM4 ) /* oy */
+ SHUFPS( CONST(0x0), XMM4, XMM4 ) /* oy | oy */
+ MULPS( XMM1, XMM4 ) /* oy*m5 | oy*m4 */
+
+ ADDPS( XMM4, XMM3 )
+ ADDPS( XMM2, XMM3 )
+ MOVLPS( XMM3, D(0) ) /* ->D(1) | ->D(0) */
+
+LLBL(K_GTP23P2DR_skip):
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP23P2DR_top) )
+
+LLBL(K_GTP23P2DR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points2_2d_no_rot_raw)
+GLNAME(gl_katmai_transform_points2_2d_no_rot_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP23P2DNRR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVSS ( M(0), XMM1 ) /* m0 */
+ MOVSS ( M(5), XMM2 ) /* m5 */
+ UNPCKLPS ( XMM2, XMM1 ) /* m5 | m0 */
+ MOVLPS ( M(12), XMM2 ) /* m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP23P2DNRR_top):
+ MOVLPS( S(0), XMM0 ) /* oy | ox */
+ MULPS( XMM1, XMM0 ) /* oy*m5 | ox*m0 */
+ ADDPS( XMM2, XMM0 ) /* +m13 | +m12 */
+ MOVLPS( XMM0, D(0) ) /* ->D(1) | ->D(0) */
+
+LLBL(K_GTP23P2DNRR_skip):
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP23P2DNRR_top) )
+
+LLBL(K_GTP23P2DNRR_finish):
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points2_3d_raw)
+GLNAME(gl_katmai_transform_points2_3d_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP23P3DR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVUPS( M(0), XMM0 ) /* m2 | m1 | m0 */
+ MOVUPS( M(4), XMM1 ) /* m6 | m5 | m4 */
+ MOVUPS( M(12), XMM2 ) /* m14 | m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP23P3DR_top):
+ MOVSS( S(0), XMM3 ) /* ox */
+ SHUFPS( CONST(0x0), XMM3, XMM3 ) /* ox | ox | ox */
+ MULPS( XMM0, XMM3 ) /* ox*m2 | ox*m1 | ox*m0 */
+
+ MOVSS( S(1), XMM4 ) /* oy */
+ SHUFPS( CONST(0x0), XMM4, XMM4 ) /* oy | oy | oy */
+ MULPS( XMM1, XMM4 ) /* oy*m6 | oy*m5 | oy*m4 */
+
+ ADDPS( XMM4, XMM3 )
+ ADDPS( XMM2, XMM3 )
+
+ MOVLPS( XMM3, D(0) ) /* ->D(1) | ->D(0) */
+ UNPCKHPS( XMM3, XMM3 )
+ MOVSS( XMM3, D(2) ) /* ->D(2) */
+
+LLBL(K_GTP23P3DR_skip):
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP23P3DR_top) )
+
+LLBL(K_GTP23P3DR_finish):
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
diff --git a/xc/extras/Mesa/src/X86/katmai_xform_raw3.S b/xc/extras/Mesa/src/X86/katmai_xform_raw3.S
new file mode 100644
index 000000000..44f7bb517
--- /dev/null
+++ b/xc/extras/Mesa/src/X86/katmai_xform_raw3.S
@@ -0,0 +1,515 @@
+#include "assyntax.h"
+/** TODO:
+ * - insert PREFETCH instructions to avoid cache-misses !
+ * - some more optimizations are possible...
+ * - for 40-50% more performance in the SSE-functions, the
+ * data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
+ */
+
+ SEG_TEXT
+
+
+#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER)
+#define LLBL(a) .L ## a
+#else
+#define LLBL(a) a
+#endif
+
+#define S(i) REGOFF(i * 4, ESI)
+#define D(i) REGOFF(i * 4, EDI)
+#define M(i) REGOFF(i * 4, EDX)
+
+/*
+ * Offsets into GLvector4f
+ */
+#define V4F_DATA 0
+#define V4F_START 4
+#define V4F_COUNT 8
+#define V4F_STRIDE 12
+#define V4F_SIZE 16
+#define V4F_FLAGS 20
+
+#define VEC_SIZE_1 1
+#define VEC_SIZE_2 3
+#define VEC_SIZE_3 7
+#define VEC_SIZE_4 15
+
+/*
+ * Offsets for transform_func arguments
+ *
+ * typedef void (*transform_func)( GLvector4f *to_vec,
+ * const GLmatrix *mat,
+ * const GLvector4f *from_vec,
+ * const GLubyte *clipmask,
+ * const GLubyte flag );
+ */
+#define OFFSET_DEST 4
+#define OFFSET_MATRIX 8
+#define OFFSET_SOURCE 12
+#define OFFSET_CLIP 16
+#define OFFSET_FLAG 20
+
+#define ARG_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP)
+#define ARG_MATRIX REGOFF(FRAME_OFFSET+OFFSET_MATRIX, ESP)
+#define ARG_SOURCE REGOFF(FRAME_OFFSET+OFFSET_SOURCE, ESP)
+#define ARG_CLIP REGOFF(FRAME_OFFSET+OFFSET_CLIP, ESP)
+#define ARG_FLAG REGOFF(FRAME_OFFSET+OFFSET_FLAG, ESP)
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points3_general_raw)
+GLNAME( gl_katmai_transform_points3_general_raw ):
+
+#define FRAME_OFFSET 8
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ CMP_L ( CONST(0), ECX ) /* count == 0 ? */
+ JE ( LLBL( K_GTPGR_finish ) ) /* yes -> nothing to do. */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVUPS ( REGOFF(0, EDX), XMM0 ) /* m0 | m1 | m2 | m3 */
+ MOVUPS ( REGOFF(16, EDX), XMM1 ) /* m4 | m5 | m6 | m7 */
+ MOVUPS ( REGOFF(32, EDX), XMM2 ) /* m8 | m9 | m10 | m11 */
+ MOVUPS ( REGOFF(48, EDX), XMM3 ) /* m12 | m13 | m14 | m15 */
+
+
+ALIGNTEXT32
+LLBL( K_GTPGR_top ):
+ MOVSS ( REGOFF(0, ESI), XMM4 ) /* | | | ox */
+ SHUFPS ( CONST(0x0), XMM4, XMM4 ) /* ox | ox | ox | ox */
+ MOVSS ( REGOFF(4, ESI), XMM5 ) /* | | | oy */
+ SHUFPS ( CONST(0x0), XMM5, XMM5 ) /* oy | oy | oy | oy */
+ MOVSS ( REGOFF(8, ESI), XMM6 ) /* | | | oz */
+ SHUFPS ( CONST(0x0), XMM6, XMM6 ) /* oz | oz | oz | oz */
+
+ MULPS ( XMM0, XMM4 ) /* m3*ox | m2*ox | m1*ox | m0*ox */
+ MULPS ( XMM1, XMM5 ) /* m7*oy | m6*oy | m5*oy | m4*oy */
+ MULPS ( XMM2, XMM6 ) /* m11*oz | m10*oz | m9*oz | m8*oz */
+
+ ADDPS ( XMM5, XMM4 )
+ ADDPS ( XMM6, XMM4 )
+ ADDPS ( XMM3, XMM4 )
+
+ MOVUPS ( XMM4, REGOFF(0, EDI) )
+
+LLBL(K_GTPGR_skip):
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTPGR_top) )
+
+LLBL(K_GTPGR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points3_identity_raw)
+GLNAME( gl_katmai_transform_points3_identity_raw ):
+
+#define FRAME_OFFSET 8
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTPIR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ CMP_L( ESI, EDI )
+ JE( LLBL(K_GTPIR_finish) )
+
+
+ALIGNTEXT32
+LLBL( K_GTPIR_top ):
+ MOVLPS ( S(0), XMM0 )
+ MOVLPS ( XMM0, D(0) )
+ MOVSS ( S(2), XMM0 )
+ MOVSS ( XMM0, D(2) )
+
+LLBL(K_GTPIR_skip):
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTPIR_top) )
+
+LLBL(K_GTPIR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points3_3d_no_rot_raw)
+GLNAME(gl_katmai_transform_points3_3d_no_rot_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP3DNRR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVSS ( M(0), XMM1 ) /* - | - | - | m0 */
+ MOVSS ( M(5), XMM2 ) /* - | - | - | m5 */
+ UNPCKLPS ( XMM2, XMM1 ) /* - | - | m5 | m0 */
+ MOVLPS ( M(12), XMM2 ) /* - | - | m13 | m12 */
+ MOVSS ( M(10), XMM3 ) /* - | - | - | m10 */
+ MOVSS ( M(14), XMM4 ) /* - | - | - | m14 */
+
+ALIGNTEXT32
+LLBL(K_GTP3DNRR_top):
+
+ MOVLPS ( S(0), XMM0 ) /* - | - | s1 | s0 */
+ MULPS ( XMM1, XMM0 ) /* - | - | s1*m5 | s0*m0 */
+ ADDPS ( XMM2, XMM0 ) /* - | - | +m13 | +m12 */
+ MOVLPS ( XMM0, D(0) ) /* -> D(1) | -> D(0) */
+
+ MOVSS ( S(2), XMM0 ) /* sz */
+ MULSS ( XMM3, XMM0 ) /* sz*m10 */
+ ADDSS ( XMM4, XMM0 ) /* +m14 */
+ MOVSS ( XMM0, D(2) ) /* -> D(2) */
+
+LLBL(K_GTP3DNRR_skip):
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP3DNRR_top) )
+
+LLBL(K_GTP3DNRR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points3_perspective_raw)
+GLNAME(gl_katmai_transform_points3_perspective_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP3PR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVSS ( M(0), XMM1 ) /* - | - | - | m0 */
+ MOVSS ( M(5), XMM2 ) /* - | - | - | m5 */
+ UNPCKLPS ( XMM2, XMM1 ) /* - | - | m5 | m0 */
+ MOVLPS ( M(8), XMM2 ) /* - | - | m9 | m8 */
+ MOVSS ( M(10), XMM3 ) /* m10 */
+ MOVSS ( M(14), XMM4 ) /* m14 */
+ XORPS ( XMM6, XMM6 ) /* 0 */
+
+ALIGNTEXT32
+LLBL(K_GTP3PR_top):
+ MOVLPS ( S(0), XMM0 ) /* oy | ox */
+ MULPS ( XMM1, XMM0 ) /* oy*m5 | ox*m0 */
+ MOVSS ( S(2), XMM5 ) /* oz */
+ SHUFPS ( CONST(0x0), XMM5, XMM5 ) /* oz | oz */
+ MULPS ( XMM2, XMM5 ) /* oz*m9 | oz*m8 */
+ ADDPS ( XMM5, XMM0 ) /* +oy*m5 | +ox*m0 */
+ MOVLPS ( XMM0, D(0) ) /* ->D(1) | ->D(0) */
+
+ MOVSS ( S(2), XMM0 ) /* oz */
+ MULSS ( XMM3, XMM0 ) /* oz*m10 */
+ ADDSS ( XMM4, XMM0 ) /* +m14 */
+ MOVSS ( XMM0, D(2) ) /* ->D(2) */
+
+ MOVSS ( S(2), XMM0 ) /* oz */
+ MOVSS ( XMM6, XMM5 ) /* 0 */
+ SUBPS ( XMM0, XMM5 ) /* -oz */
+ MOVSS ( XMM5, D(3) ) /* ->D(3) */
+
+LLBL(K_GTP3PR_skip):
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP3PR_top) )
+
+LLBL(K_GTP3PR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points3_2d_raw)
+GLNAME(gl_katmai_transform_points3_2d_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP3P2DR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVLPS( M(0), XMM0 ) /* m1 | m0 */
+ MOVLPS( M(4), XMM1 ) /* m5 | m4 */
+ MOVLPS( M(12), XMM2 ) /* m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP3P2DR_top):
+ MOVSS ( S(0), XMM3 ) /* ox */
+ SHUFPS ( CONST(0x0), XMM3, XMM3 ) /* ox | ox */
+ MULPS ( XMM0, XMM3 ) /* ox*m1 | ox*m0 */
+ MOVSS ( S(1), XMM4 ) /* oy */
+ SHUFPS ( CONST(0x0), XMM4, XMM4 ) /* oy | oy */
+ MULPS ( XMM1, XMM4 ) /* oy*m5 | oy*m4 */
+
+ ADDPS ( XMM4, XMM3 )
+ ADDPS ( XMM2, XMM3 )
+ MOVLPS ( XMM3, D(0) )
+
+ MOVSS ( S(2), XMM3 )
+ MOVSS ( XMM3, D(2) )
+
+LLBL(K_GTP3P2DR_skip):
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP3P2DR_top) )
+
+LLBL(K_GTP3P2DR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points3_2d_no_rot_raw)
+GLNAME(gl_katmai_transform_points3_2d_no_rot_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP3P2DNRR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVSS ( M(0), XMM1 ) /* m0 */
+ MOVSS ( M(5), XMM2 ) /* m5 */
+ UNPCKLPS ( XMM2, XMM1 ) /* m5 | m0 */
+ MOVLPS ( M(12), XMM2 ) /* m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP3P2DNRR_top):
+ MOVLPS( S(0), XMM0 ) /* oy | ox */
+ MULPS( XMM1, XMM0 ) /* oy*m5 | ox*m0 */
+ ADDPS( XMM2, XMM0 ) /* +m13 | +m12 */
+ MOVLPS( XMM0, D(0) ) /* ->D(1) | ->D(0) */
+
+ MOVSS( S(2), XMM0 )
+ MOVSS( XMM0, D(2) )
+
+LLBL(K_GTP3P2DNRR_skip):
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP3P2DNRR_top) )
+
+LLBL(K_GTP3P2DNRR_finish):
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points3_3d_raw)
+GLNAME(gl_katmai_transform_points3_3d_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP3P3DR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVUPS( M(0), XMM0 ) /* m2 | m1 | m0 */
+ MOVUPS( M(4), XMM1 ) /* m6 | m5 | m4 */
+ MOVUPS( M(8), XMM2 ) /* m10 | m9 | m8 */
+ MOVUPS( M(12), XMM3 ) /* m14 | m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP3P3DR_top):
+ MOVSS( S(0), XMM4 )
+ SHUFPS( CONST(0x0), XMM4, XMM4 ) /* ox | ox | ox */
+ MULPS( XMM0, XMM4 ) /* ox*m2 | ox*m1 | ox*m0 */
+
+ MOVSS( S(1), XMM5 )
+ SHUFPS( CONST(0x0), XMM5, XMM5 ) /* oy | oy | oy */
+ MULPS( XMM1, XMM5 ) /* oy*m6 | oy*m5 | oy*m4 */
+
+ MOVSS( S(2), XMM6 )
+ SHUFPS( CONST(0x0), XMM6, XMM6 ) /* oz | oz | oz */
+ MULPS( XMM2, XMM6 ) /* oz*m10 | oz*m9 | oz*m8 */
+
+ ADDPS( XMM5, XMM4 ) /* + | + | + */
+ ADDPS( XMM6, XMM4 ) /* + | + | + */
+ ADDPS( XMM3, XMM4 ) /* + | + | + */
+
+ MOVLPS( XMM4, D(0) ) /* => D(1) | => D(0) */
+ UNPCKHPS( XMM4, XMM4 )
+ MOVSS( XMM4, D(2) )
+
+LLBL(K_GTP3P3DR_skip):
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP3P3DR_top) )
+
+LLBL(K_GTP3P3DR_finish):
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
diff --git a/xc/extras/Mesa/src/X86/katmai_xform_raw4.S b/xc/extras/Mesa/src/X86/katmai_xform_raw4.S
new file mode 100644
index 000000000..0d776ee1e
--- /dev/null
+++ b/xc/extras/Mesa/src/X86/katmai_xform_raw4.S
@@ -0,0 +1,203 @@
+#include "assyntax.h"
+/** TODO:
+ * - insert PREFETCH instructions to avoid cache-misses !
+ * - some more optimizations are possible...
+ * - for 40-50% more performance in the SSE-functions, the
+ * data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
+ */
+
+ SEG_TEXT
+
+
+#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER)
+#define LLBL(a) .L ## a
+#else
+#define LLBL(a) a
+#endif
+
+#define S(i) REGOFF(i * 4, ESI)
+#define D(i) REGOFF(i * 4, EDI)
+#define M(i) REGOFF(i * 4, EDX)
+
+/*
+ * Offsets into GLvector4f
+ */
+#define V4F_DATA 0
+#define V4F_START 4
+#define V4F_COUNT 8
+#define V4F_STRIDE 12
+#define V4F_SIZE 16
+#define V4F_FLAGS 20
+
+#define VEC_SIZE_1 1
+#define VEC_SIZE_2 3
+#define VEC_SIZE_3 7
+#define VEC_SIZE_4 15
+
+/*
+ * Offsets for transform_func arguments
+ *
+ * typedef void (*transform_func)( GLvector4f *to_vec,
+ * const GLmatrix *mat,
+ * const GLvector4f *from_vec,
+ * const GLubyte *clipmask,
+ * const GLubyte flag );
+ */
+#define OFFSET_DEST 4
+#define OFFSET_MATRIX 8
+#define OFFSET_SOURCE 12
+#define OFFSET_CLIP 16
+#define OFFSET_FLAG 20
+
+#define ARG_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP)
+#define ARG_MATRIX REGOFF(FRAME_OFFSET+OFFSET_MATRIX, ESP)
+#define ARG_SOURCE REGOFF(FRAME_OFFSET+OFFSET_SOURCE, ESP)
+#define ARG_CLIP REGOFF(FRAME_OFFSET+OFFSET_CLIP, ESP)
+#define ARG_FLAG REGOFF(FRAME_OFFSET+OFFSET_FLAG, ESP)
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points4_general_raw)
+GLNAME( gl_katmai_transform_points4_general_raw ):
+
+#define FRAME_OFFSET 8
+ PUSH_L ( ESI )
+ PUSH_L ( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ CMP_L( CONST(0), ECX ) /* count == 0 ? */
+ JE( LLBL( K_GTP4GR_finish ) ) /* yes -> nothing to do. */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+ALIGNTEXT32
+ MOVUPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */
+ MOVUPS( M(4), XMM1 ) /* m7 | m6 | m5 | m4 */
+ MOVUPS( M(8), XMM2 ) /* m11 | m10 | m9 | m8 */
+ MOVUPS( M(12), XMM3 ) /* m15 | m14 | m13 | m12 */
+
+ALIGNTEXT32
+LLBL( K_GTP4GR_top ):
+ MOVSS( S(0), XMM4 ) /* ox */
+ SHUFPS( CONST(0x0), XMM4, XMM4 ) /* ox | ox | ox | ox */
+ MULPS( XMM0, XMM4 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
+
+ MOVSS( S(1), XMM5 ) /* oy */
+ SHUFPS( CONST(0x0), XMM5, XMM5 ) /* oy | oy | oy | oy */
+ MULPS( XMM1, XMM5 ) /* oy*m7 | oy*m6 | oy*m5 | oy*m4 */
+
+ MOVSS( S(2), XMM6 ) /* oz */
+ SHUFPS( CONST(0x0), XMM6, XMM6 ) /* oz | oz | oz | oz */
+ MULPS( XMM2, XMM6 ) /* oz*m11 | oz*m10 | oz*m9 | oz*m8 */
+
+ MOVSS( S(3), XMM7 ) /* ow */
+ SHUFPS( CONST(0x0), XMM7, XMM7 ) /* ow | ow | ow | ow */
+ MULPS( XMM3, XMM7 ) /* ow*m15 | ow*m14 | ow*m13 | ow*m12 */
+
+ ADDPS( XMM5, XMM4 ) /* ox*m3+oy*m7 | ... */
+ ADDPS( XMM6, XMM4 ) /* ox*m3+oy*m7+oz*m11 | ... */
+ ADDPS( XMM7, XMM4 ) /* ox*m3+oy*m7+oz*m11+ow*m15 | ... */
+ MOVUPS( XMM4, D(0) ) /* ->D(3) | ->D(2) | ->D(1) | ->D(0) */
+
+LLBL(K_GTP4GR_skip):
+ ADD_L ( CONST(16), EDI )
+ ADD_L ( EAX, ESI )
+ CMP_L ( ECX, EDI )
+ JNE ( LLBL(K_GTP4GR_top) )
+
+LLBL(K_GTP4GR_finish):
+ POP_L ( EDI )
+ POP_L ( ESI )
+ RET
+#undef FRAME_OFFSET
+
+
+ALIGNTEXT4
+GLOBL GLNAME(gl_katmai_transform_points4_3d_raw)
+GLNAME(gl_katmai_transform_points4_3d_raw):
+
+#define FRAME_OFFSET 8
+ PUSH_L( ESI )
+ PUSH_L( EDI )
+
+ MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
+ MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
+
+ MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
+ MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
+
+ TEST_L( ECX, ECX)
+ JZ( LLBL(K_GTP43P3DR_finish) ) /* count was zero; go to finish */
+
+ MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
+ OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
+
+ MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
+ MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
+
+ SHL_L( CONST(4), ECX ) /* count *= 16 */
+ MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
+
+ MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
+ ADD_L( EDI, ECX ) /* count += dest ptr */
+
+
+ALIGNTEXT32
+ MOVUPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */
+ MOVUPS( M(4), XMM1 ) /* m7 | m6 | m5 | m4 */
+ MOVUPS( M(8), XMM2 ) /* m11 | m10 | m9 | m8 */
+ MOVUPS( M(12), XMM3 ) /* m15 | m14 | m13 | m12 */
+
+ALIGNTEXT32
+LLBL(K_GTP43P3DR_top):
+ MOVSS( S(0), XMM4 ) /* ox */
+ SHUFPS( CONST(0x0), XMM4, XMM4 ) /* ox | ox | ox | ox */
+ MULPS( XMM0, XMM4 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
+
+ MOVSS( S(1), XMM5 ) /* oy */
+ SHUFPS( CONST(0x0), XMM5, XMM5 ) /* oy | oy | oy | oy */
+ MULPS( XMM1, XMM5 ) /* oy*m7 | oy*m6 | oy*m5 | oy*m4 */
+
+ MOVSS( S(2), XMM6 ) /* oz */
+ SHUFPS( CONST(0x0), XMM6, XMM6 ) /* oz | oz | oz | oz */
+ MULPS( XMM2, XMM6 ) /* oz*m11 | oz*m10 | oz*m9 | oz*m8 */
+
+ MOVSS( S(3), XMM7 ) /* ow */
+ SHUFPS( CONST(0x0), XMM7, XMM7 ) /* ow | ow | ow | ow */
+ MULPS( XMM3, XMM7 ) /* ow*m15 | ow*m14 | ow*m13 | ow*m12 */
+
+ ADDPS( XMM5, XMM4 ) /* ox*m3+oy*m7 | ... */
+ ADDPS( XMM6, XMM4 ) /* ox*m3+oy*m7+oz*m11 | ... */
+ ADDPS( XMM7, XMM4 ) /* ox*m3+oy*m7+oz*m11+ow*m15 | ... */
+ MOVUPS( XMM4, D(0) ) /* ->D(3) | ->D(2) | ->D(1) | ->D(0) */
+
+ MOVSS( S(3), XMM4 ) /* ow */
+ MOVSS( XMM4, D(3) ) /* ->D(3) */
+
+LLBL(K_GTP43P3DR_skip):
+ ADD_L( CONST(16), EDI )
+ ADD_L( EAX, ESI )
+ CMP_L( ECX, EDI )
+ JNE( LLBL(K_GTP43P3DR_top) )
+
+LLBL(K_GTP43P3DR_finish):
+ POP_L( EDI )
+ POP_L( ESI )
+ RET
+#undef FRAME_OFFSET
+
diff --git a/xc/extras/Mesa/src/X86/mmx.h b/xc/extras/Mesa/src/X86/mmx.h
index c8c5eff30..f0e05cf06 100644
--- a/xc/extras/Mesa/src/X86/mmx.h
+++ b/xc/extras/Mesa/src/X86/mmx.h
@@ -31,9 +31,9 @@
#define ASM_MMX_H
-extern void
+extern void _ASMAPI
gl_mmx_blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLubyte rgba[][4], const GLubyte dest[][4] );
+ GLubyte rgba[][4], const GLubyte dest[][4] );
void gl_mmx_set_blend_function( GLcontext *ctx )
diff --git a/xc/extras/Mesa/src/X86/vertex_katmai.S b/xc/extras/Mesa/src/X86/vertex_katmai.S
new file mode 100644
index 000000000..eb51413d7
--- /dev/null
+++ b/xc/extras/Mesa/src/X86/vertex_katmai.S
@@ -0,0 +1,192 @@
+#include "assyntax.h"
+
+#define MAT_SY 20
+#define MAT_SZ 40
+#define MAT_TX 48
+#define MAT_TY 52
+#define MAT_TZ 56
+
+
+ SEG_TEXT
+
+#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER)
+#define LLBL(a) .L##a
+#else
+#define LLBL(a) a
+#endif
+
+
+/*
+ * void gl_v16_katmai_general_xform (GLfloat *dest,
+ * const GLfloat *m,
+ * const GLfloat *src,
+ * GLuint src_stride,
+ * GLuint count )
+ *
+ */
+
+ALIGNTEXT16
+GLOBL GLNAME( gl_v16_katmai_general_xform )
+GLNAME( gl_v16_katmai_general_xform ):
+
+ PUSH_L( EDI )
+ PUSH_L( ESI )
+
+ MOV_L( REGOFF(12, ESP), EAX ) /* f - destination */
+ MOV_L( REGOFF(16, ESP), ESI ) /* m - matrix */
+ MOV_L( REGOFF(20, ESP), EDX ) /* obj - source */
+ MOV_L( REGOFF(24, ESP), EDI ) /* obj_stride */
+ MOV_L( REGOFF(28, ESP), ECX ) /* count */
+
+ MOVUPS( REGOFF(0, ESI), XMM4 ) /* x14, x13, x12, x11 => xmm4 */
+ MOVUPS( REGOFF(16, ESI), XMM5 ) /* x24, x23, x22, x21 => xmm5 */
+ MOVUPS( REGOFF(32, ESI), XMM6 ) /* x34, x33, x32, x31 => xmm6 */
+ MOVUPS( REGOFF(48, ESI), XMM7 ) /* x44, x43, x42, x41 => xmm7 */
+
+ALIGNTEXT32
+LLBL( loop1 ):
+
+ MOVSS( REGOFF(0, EDX), XMM0 ) /* s1 => xmm0 */
+ SHUFPS( CONST(0x0), XMM0, XMM0 ) /* xmm0 shuffle to other 96 bits */
+ MULPS( XMM4, XMM0 ) /* x14*s1, x13*s1, x12*s1, x11*s1 */
+
+ MOVSS( REGOFF(4, EDX), XMM1 ) /* s2 => xmm1 */
+ SHUFPS( CONST(0x0), XMM1, XMM1 ) /* xmm1 shuffle to other 96 bits */
+ MULPS( XMM5, XMM1 ) /* x24*s2, x23*s2, x22*s2, x21*s2 */
+
+ MOVSS( REGOFF(8, EDX), XMM2 ) /* s3 => xmm2 */
+ SHUFPS( CONST(0x0), XMM2, XMM2 ) /* xmm2 shuffle to other 96 bits */
+ MULPS( XMM6, XMM2 ) /* x34*s3, x33*s3, x32*s3, x31*s3 */
+
+ ADDPS( XMM1, XMM0 ) /* xmm0 + xmm1 => xmm0 */
+ ADDPS( XMM2, XMM0 ) /* xmm0 + xmm2 => xmm0 */
+ ADDPS( XMM7, XMM0 ) /* xmm0 + xmm7 => xmm0 */
+
+ MOVUPS( XMM0, REGOFF(0, EAX) ) /* xmm0 => dest( f11, f12, f13, f14 ) */
+
+ ADD_L ( CONST(64), EAX ) /* f + 64 bytes => f */
+ ADD_L ( EDI, EDX ) /* obj + obj_stride => obj */
+
+ DEC_L ( ECX ) /* count - 1 => count */
+ JNE ( LLBL(loop1) ) /* if not zero, go back to LABL(loop1) */
+
+ POP_L( ESI )
+ POP_L( EDI )
+
+ RET
+
+
+/* void gl_katmai_project_vertices(GLfloat *first,
+ * GLfloat *last,
+ * const GLfloat *m,
+ * GLuint stride )
+ */
+
+
+ALIGNTEXT16
+GLOBL GLNAME( gl_katmai_project_vertices )
+GLNAME( gl_katmai_project_vertices ):
+
+ PUSH_L( EBP )
+
+ MOV_L( REGOFF(8, ESP), ECX ) /* first_vert */
+ MOV_L( REGOFF(12, ESP), EDX ) /* last_vert */
+ MOV_L( REGOFF(16, ESP), EBP ) /* matrix */
+ MOV_L( REGOFF(20, ESP), EAX ) /* stride */
+
+
+ALIGNTEXT32
+ MOVUPS( REGOFF(MAT_TX, EBP), XMM0 ) /* (x44), x43, x42, x41 => xmm0 */
+ MOVSS( REGOFF(0, EBP), XMM1 ) /* -, -, -, x11 => xmm1 */
+ UNPCKLPS( REGOFF(MAT_SY, EBP), XMM1 ) /* -, -, x22, x11 => xmm1 */
+ SHUFPS( CONST(0x44), REGOFF(MAT_SZ, EBP), XMM1 )
+ /* -, x33, x22, x11 => xmm1 */
+
+ SUB_L( ECX, EDX ) /* last -= first */
+
+LLBL( v16_katmai_pv_loop_start ):
+ MOVUPS( REGOFF(0, ECX), XMM3 ) /* f[3], f[2], f[1], f[0] */
+
+ MOVSS( REGOFF(12, ECX), XMM2 ) /* -, -, -, f[3] */
+ SHUFPS( CONST(0x0), XMM2, XMM2 ) /* f[3], f[3], f[3], f[3] */
+ RCPPS( XMM2, XMM2 ) /* 1/f[3], 1/f[3], 1/f[3], 1/f[3] */
+
+ MULPS( XMM2, XMM1 ) /* -, x33*1/f[3]... */
+ MULPS( XMM3, XMM1 ) /* -, x33*1/f[3]*f[2]... */
+ ADDPS( XMM0, XMM1 ) /* -, x33*1/f[3]*f[2]+x43... */
+
+ MOVUPS( XMM1, REGOFF(0, ECX) ) /* back to f */
+ MOVSS( XMM2, REGOFF(12, ECX) ) /* 1/f[3] into f[3] ! */
+
+
+ ADD_L( EAX, ECX ) /* f += stride */
+ SUB_L( EAX, EDX ) /* (last-first)-stride */
+ JA ( LLBL( v16_katmai_pv_loop_start ) )
+
+ POP_L( EBP )
+ RET
+
+
+
+/* void gl_katmai_project_clipped_vertices(GLfloat *first,
+ * GLfloat *last,
+ * const GLfloat *m,
+ * GLuint stride,
+ * const GLubyte *clipmask );
+ */
+
+
+ALIGNTEXT16
+GLOBL GLNAME( gl_katmai_project_clipped_vertices )
+GLNAME( gl_katmai_project_clipped_vertices ):
+
+ PUSH_L( EBP )
+ PUSH_L( ESI )
+
+ MOV_L( REGOFF(12, ESP), ECX ) /* first_vert */
+ MOV_L( REGOFF(16, ESP), EDX ) /* last_vert */
+ MOV_L( REGOFF(20, ESP), EBP ) /* matrix */
+ MOV_L( REGOFF(24, ESP), EAX ) /* stride */
+ MOV_L( REGOFF(28, ESP), ESI ) /* clip_mask */
+
+
+
+ALIGNTEXT32
+
+ MOVUPS( REGOFF(MAT_TX, EBP), XMM0 ) /* (x44), x43, x42, x41 => xmm0 */
+ MOVSS( REGOFF(0, EBP), XMM1 ) /* -, -, -, x11 => xmm1 */
+ UNPCKLPS( REGOFF(MAT_SY, EBP), XMM1 ) /* -, -, x22, x11 => xmm1 */
+ SHUFPS( CONST(0x44), REGOFF(MAT_SZ, EBP), XMM1 )
+ /* -, x33, x22, x11 => xmm1 */
+
+LLBL( v16_katmai_pcv_loop_start ):
+ CMP_B ( CONST(0), REGIND(ESI) ) /* clip_mask == 0 ? */
+ JNE( LLBL( v16_katmai_pcv_skip ) ) /* no -> skip ! */
+
+ MOVUPS( REGOFF(0, ECX), XMM3 ) /* f[3], f[2], f[1], f[0] */
+
+ MOVSS( REGOFF(12, ECX), XMM2 ) /* -, -, -, f[3] */
+ SHUFPS( CONST(0x0), XMM2, XMM2 ) /* f[3], f[3], f[3], f[3] */
+ RCPPS( XMM2, XMM2 ) /* 1/f[3], 1/f[3], 1/f[3], 1/f[3] */
+
+ MULPS( XMM2, XMM1 ) /* -, x33*1/f[3]... */
+ MULPS( XMM3, XMM1 ) /* -, x33*1/f[3]*f[2]... */
+ ADDPS( XMM0, XMM1 ) /* -, x33*1/f[3]*f[2]+x43... */
+
+ MOVUPS( XMM1, REGOFF(0, ECX) ) /* back to f */
+ MOVSS( XMM2, REGOFF(12, ECX) ) /* 1/f[3] into f[3] ! */
+
+LLBL( v16_katmai_pcv_skip ):
+ ADD_L( EAX, ECX ) /* f += stride */
+ INC_L( ESI ) /* nect ClipMask */
+
+ CMP_L( ECX, EDX ) /* p_first_vertex == p_last_vertex */
+ JNE( LLBL( v16_katmai_pcv_loop_start ) )
+ /* no -> go on with next vertex */
+
+ POP_L( ESI )
+ POP_L( EBP )
+ RET
+
+
+
diff --git a/xc/extras/Mesa/src/X86/x86.c b/xc/extras/Mesa/src/X86/x86.c
index 99bebe373..8413f6923 100644
--- a/xc/extras/Mesa/src/X86/x86.c
+++ b/xc/extras/Mesa/src/X86/x86.c
@@ -1,4 +1,4 @@
-/* $Id: x86.c,v 1.2 1999/12/07 03:37:16 daryll Exp $ */
+/* $Id: x86.c,v 1.3 2000/01/30 00:27:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -40,14 +40,14 @@
#include "xform.h"
#include "x86.h"
-extern void gl_v16_x86_cliptest_points4(GLfloat *first_vert,
+extern void _ASMAPI gl_v16_x86_cliptest_points4(GLfloat *first_vert,
GLfloat *last_vert,
GLubyte *or_mask,
GLubyte *and_mask,
GLubyte *clip_mask );
-extern void gl_v16_x86_general_xform(GLfloat *dest,
+extern void _ASMAPI gl_v16_x86_general_xform(GLfloat *dest,
const GLfloat *m,
const GLfloat *src,
GLuint src_stride,
@@ -62,13 +62,13 @@ extern void gl_v16_x86_general_xform(GLfloat *dest,
const GLubyte flag
#define DECLARE_XFORM_GROUP(pfx, vsize, masked) \
- extern void gl_##pfx##_transform_points##vsize##_general_##masked(XFORM_ARGS); \
- extern void gl_##pfx##_transform_points##vsize##_identity_##masked(XFORM_ARGS); \
- extern void gl_##pfx##_transform_points##vsize##_3d_no_rot_##masked(XFORM_ARGS); \
- extern void gl_##pfx##_transform_points##vsize##_perspective_##masked(XFORM_ARGS); \
- extern void gl_##pfx##_transform_points##vsize##_2d_##masked(XFORM_ARGS); \
- extern void gl_##pfx##_transform_points##vsize##_2d_no_rot_##masked(XFORM_ARGS); \
- extern void gl_##pfx##_transform_points##vsize##_3d_##masked(XFORM_ARGS);
+ extern void _ASMAPI gl_##pfx##_transform_points##vsize##_general_##masked(XFORM_ARGS); \
+ extern void _ASMAPI gl_##pfx##_transform_points##vsize##_identity_##masked(XFORM_ARGS); \
+ extern void _ASMAPI gl_##pfx##_transform_points##vsize##_3d_no_rot_##masked(XFORM_ARGS); \
+ extern void _ASMAPI gl_##pfx##_transform_points##vsize##_perspective_##masked(XFORM_ARGS); \
+ extern void _ASMAPI gl_##pfx##_transform_points##vsize##_2d_##masked(XFORM_ARGS); \
+ extern void _ASMAPI gl_##pfx##_transform_points##vsize##_2d_no_rot_##masked(XFORM_ARGS); \
+ extern void _ASMAPI gl_##pfx##_transform_points##vsize##_3d_##masked(XFORM_ARGS);
#define ASSIGN_XFORM_GROUP( pfx, cma, vsize, masked ) \
gl_transform_tab[cma][vsize][MATRIX_GENERAL] \
@@ -96,7 +96,7 @@ void gl_init_x86_asm_transforms( void )
DECLARE_XFORM_GROUP( x86, 3, masked )
DECLARE_XFORM_GROUP( x86, 4, masked )
- extern GLvector4f *gl_x86_cliptest_points4( GLvector4f *clip_vec,
+ extern GLvector4f * _ASMAPI gl_x86_cliptest_points4( GLvector4f *clip_vec,
GLvector4f *proj_vec,
GLubyte clipMask[],
GLubyte *orMask,
diff --git a/xc/extras/Mesa/src/X86/x86.h b/xc/extras/Mesa/src/X86/x86.h
index 1d835a543..4d477ffac 100644
--- a/xc/extras/Mesa/src/X86/x86.h
+++ b/xc/extras/Mesa/src/X86/x86.h
@@ -1,4 +1,4 @@
-/* $Id: x86.h,v 1.2 1999/12/07 03:37:16 daryll Exp $ */
+/* $Id: x86.h,v 1.3 2000/01/30 00:27:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/accum.c b/xc/extras/Mesa/src/accum.c
index ccd89423f..b10b456ec 100644
--- a/xc/extras/Mesa/src/accum.c
+++ b/xc/extras/Mesa/src/accum.c
@@ -1,8 +1,8 @@
-/* $Id: accum.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: accum.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,22 +25,13 @@
*/
-/* $XFree86: xc/lib/GL/mesa/src/accum.c,v 1.3 1999/04/04 00:20:17 dawes Exp $ */
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "accum.h"
#include "context.h"
-#include "macros.h"
+#include "mem.h"
#include "masking.h"
#include "span.h"
#include "types.h"
@@ -79,15 +70,15 @@ void gl_alloc_accum_buffer( GLcontext *ctx )
{
GLint n;
- if (ctx->Buffer->Accum) {
- FREE( ctx->Buffer->Accum );
- ctx->Buffer->Accum = NULL;
+ if (ctx->DrawBuffer->Accum) {
+ FREE( ctx->DrawBuffer->Accum );
+ ctx->DrawBuffer->Accum = NULL;
}
/* allocate accumulation buffer if not already present */
- n = ctx->Buffer->Width * ctx->Buffer->Height * 4 * sizeof(GLaccum);
- ctx->Buffer->Accum = (GLaccum *) MALLOC( n );
- if (!ctx->Buffer->Accum) {
+ n = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height * 4 * sizeof(GLaccum);
+ ctx->DrawBuffer->Accum = (GLaccum *) MALLOC( n );
+ if (!ctx->DrawBuffer->Accum) {
/* unable to setup accumulation buffer */
gl_error( ctx, GL_OUT_OF_MEMORY, "glAccum" );
}
@@ -101,9 +92,10 @@ void gl_alloc_accum_buffer( GLcontext *ctx )
-void gl_ClearAccum( GLcontext *ctx,
- GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
+void
+_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glAccum");
ctx->Accum.ClearColor[0] = CLAMP( red, -1.0, 1.0 );
@@ -121,10 +113,10 @@ void gl_ClearAccum( GLcontext *ctx,
*/
static void rescale_accum( GLcontext *ctx )
{
- const GLuint n = ctx->Buffer->Width * ctx->Buffer->Height * 4;
+ const GLuint n = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height * 4;
const GLfloat fChanMax = (1 << (sizeof(GLchan) * 8)) - 1;
const GLfloat s = ctx->IntegerAccumScaler * (32767.0 / fChanMax);
- GLaccum *accum = ctx->Buffer->Accum;
+ GLaccum *accum = ctx->DrawBuffer->Accum;
GLuint i;
assert(ctx->IntegerAccumMode);
@@ -139,8 +131,10 @@ static void rescale_accum( GLcontext *ctx )
-void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
+void
+_mesa_Accum( GLenum op, GLfloat value )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint xpos, ypos, width, height, width4;
GLfloat acc_scale;
GLubyte rgba[MAX_WIDTH][4];
@@ -149,9 +143,13 @@ void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glAccum");
- if (ctx->Visual->AccumBits==0 || !ctx->Buffer->Accum) {
- /* No accumulation buffer! */
- gl_warning(ctx, "Calling glAccum() without an accumulation buffer");
+ if (ctx->Visual->AccumBits == 0 || ctx->DrawBuffer != ctx->ReadBuffer) {
+ gl_error(ctx, GL_INVALID_OPERATION, "glAccum");
+ return;
+ }
+
+ if (!ctx->DrawBuffer->Accum) {
+ gl_warning(ctx, "Calling glAccum() without an accumulation buffer (low memory?)");
return;
}
@@ -180,8 +178,8 @@ void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
/* whole window */
xpos = 0;
ypos = 0;
- width = ctx->Buffer->Width;
- height = ctx->Buffer->Height;
+ width = ctx->DrawBuffer->Width;
+ height = ctx->DrawBuffer->Height;
}
width4 = 4 * width;
@@ -195,7 +193,7 @@ void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
if (ctx->IntegerAccumMode)
rescale_accum(ctx);
for (j = 0; j < height; j++) {
- GLaccum * acc = ctx->Buffer->Accum + ypos * width4 + 4 * xpos;
+ GLaccum * acc = ctx->DrawBuffer->Accum + ypos * width4 + 4 * xpos;
GLuint i;
for (i = 0; i < width4; i++) {
acc[i] += intVal;
@@ -212,7 +210,7 @@ void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
if (ctx->IntegerAccumMode)
rescale_accum(ctx);
for (j = 0; j < height; j++) {
- GLaccum *acc = ctx->Buffer->Accum + ypos * width4 + 4 * xpos;
+ GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + 4 * xpos;
GLuint i;
for (i = 0; i < width4; i++) {
acc[i] = (GLaccum) ( (GLfloat) acc[i] * value );
@@ -223,7 +221,8 @@ void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
break;
case GL_ACCUM:
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.DriverReadBuffer );
+ (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
+ ctx->Pixel.DriverReadBuffer );
/* May have to leave optimized accum buffer mode */
if (ctx->IntegerAccumScaler == 0.0 && value > 0.0 && value <= 1.0)
@@ -234,13 +233,13 @@ void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
if (ctx->IntegerAccumMode) {
/* simply add integer color values into accum buffer */
GLuint j;
- GLaccum *acc = ctx->Buffer->Accum + ypos * width4 + xpos * 4;
+ GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos * 4;
assert(ctx->IntegerAccumScaler > 0.0);
assert(ctx->IntegerAccumScaler <= 1.0);
for (j = 0; j < height; j++) {
GLuint i, i4;
- gl_read_rgba_span(ctx, width, xpos, ypos, rgba);
+ gl_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
for (i = i4 = 0; i < width; i++, i4+=4) {
acc[i4+0] += rgba[i][RCOMP];
acc[i4+1] += rgba[i][GCOMP];
@@ -259,9 +258,9 @@ void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
const GLfloat ascale = value * acc_scale / fChanMax;
GLuint j;
for (j=0;j<height;j++) {
- GLaccum *acc = ctx->Buffer->Accum + ypos * width4 + xpos * 4;
+ GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos * 4;
GLuint i;
- gl_read_rgba_span(ctx, width, xpos, ypos, rgba);
+ gl_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
for (i=0;i<width;i++) {
*acc += (GLaccum) ( (GLfloat) rgba[i][RCOMP] * rscale ); acc++;
*acc += (GLaccum) ( (GLfloat) rgba[i][GCOMP] * gscale ); acc++;
@@ -271,11 +270,14 @@ void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
ypos++;
}
}
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer );
+ /* restore read buffer = draw buffer (the default) */
+ (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
+ ctx->Color.DriverDrawBuffer );
break;
case GL_LOAD:
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.DriverReadBuffer );
+ (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
+ ctx->Pixel.DriverReadBuffer );
/* This is a change to go into optimized accum buffer mode */
if (value > 0.0 && value <= 1.0) {
@@ -294,12 +296,12 @@ void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
if (ctx->IntegerAccumMode) {
/* just copy values into accum buffer */
GLuint j;
- GLaccum *acc = ctx->Buffer->Accum + ypos * width4 + xpos * 4;
+ GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos * 4;
assert(ctx->IntegerAccumScaler > 0.0);
assert(ctx->IntegerAccumScaler <= 1.0);
for (j = 0; j < height; j++) {
GLuint i, i4;
- gl_read_rgba_span(ctx, width, xpos, ypos, rgba);
+ gl_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
for (i = i4 = 0; i < width; i++, i4 += 4) {
acc[i4+0] = rgba[i][RCOMP];
acc[i4+1] = rgba[i][GCOMP];
@@ -319,8 +321,8 @@ void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
const GLfloat d = 3.0 / acc_scale;
GLuint i, j;
for (j = 0; j < height; j++) {
- GLaccum *acc = ctx->Buffer->Accum + ypos * width4 + xpos * 4;
- gl_read_rgba_span(ctx, width, xpos, ypos, rgba);
+ GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos * 4;
+ gl_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
for (i=0;i<width;i++) {
*acc++ = (GLaccum) ((GLfloat) rgba[i][RCOMP] * rscale + d);
*acc++ = (GLaccum) ((GLfloat) rgba[i][GCOMP] * gscale + d);
@@ -330,7 +332,10 @@ void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
ypos++;
}
}
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer );
+
+ /* restore read buffer = draw buffer (the default) */
+ (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
+ ctx->Color.DriverDrawBuffer );
break;
case GL_RETURN:
@@ -344,7 +349,7 @@ void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
static GLchan multTable[32768];
static GLfloat prevMult = 0.0;
GLuint j;
- const GLint max = (GLint) (256 / mult);
+ const GLint max = 256 / mult;
if (mult != prevMult) {
assert(max <= 32768);
for (j = 0; j < max; j++)
@@ -355,7 +360,7 @@ void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
assert(ctx->IntegerAccumScaler > 0.0);
assert(ctx->IntegerAccumScaler <= 1.0);
for (j = 0; j < height; j++) {
- const GLaccum *acc = ctx->Buffer->Accum + ypos * width4 + xpos*4;
+ const GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos*4;
GLuint i, i4;
for (i = i4 = 0; i < width; i++, i4 += 4) {
ASSERT(acc[i4+0] < max);
@@ -382,7 +387,7 @@ void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
const GLfloat ascale = value / acc_scale * fChanMax;
GLuint i, j;
for (j=0;j<height;j++) {
- const GLaccum *acc = ctx->Buffer->Accum + ypos * width4 + xpos*4;
+ const GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos*4;
for (i=0;i<width;i++) {
GLint r, g, b, a;
r = (GLint) ( (GLfloat) (*acc++) * rscale + 0.5F );
@@ -436,15 +441,15 @@ void gl_clear_accum_buffer( GLcontext *ctx )
}
/* number of pixels */
- buffersize = ctx->Buffer->Width * ctx->Buffer->Height;
+ buffersize = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height;
- if (!ctx->Buffer->Accum) {
+ if (!ctx->DrawBuffer->Accum) {
/* try to alloc accumulation buffer */
- ctx->Buffer->Accum = (GLaccum *)
+ ctx->DrawBuffer->Accum = (GLaccum *)
MALLOC( buffersize * 4 * sizeof(GLaccum) );
}
- if (ctx->Buffer->Accum) {
+ if (ctx->DrawBuffer->Accum) {
if (ctx->Scissor.Enabled) {
/* Limit clear to scissor box */
GLaccum r, g, b, a;
@@ -456,12 +461,12 @@ void gl_clear_accum_buffer( GLcontext *ctx )
b = (GLaccum) (ctx->Accum.ClearColor[2] * acc_scale);
a = (GLaccum) (ctx->Accum.ClearColor[3] * acc_scale);
/* size of region to clear */
- width = 4 * (ctx->Buffer->Xmax - ctx->Buffer->Xmin + 1);
- height = ctx->Buffer->Ymax - ctx->Buffer->Ymin + 1;
+ width = 4 * (ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1);
+ height = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin + 1;
/* ptr to first element to clear */
- row = ctx->Buffer->Accum
- + 4 * (ctx->Buffer->Ymin * ctx->Buffer->Width
- + ctx->Buffer->Xmin);
+ row = ctx->DrawBuffer->Accum
+ + 4 * (ctx->DrawBuffer->Ymin * ctx->DrawBuffer->Width
+ + ctx->DrawBuffer->Xmin);
for (j=0;j<height;j++) {
for (i=0;i<width;i+=4) {
row[i+0] = r;
@@ -469,7 +474,7 @@ void gl_clear_accum_buffer( GLcontext *ctx )
row[i+2] = b;
row[i+3] = a;
}
- row += 4 * ctx->Buffer->Width;
+ row += 4 * ctx->DrawBuffer->Width;
}
}
else {
@@ -479,14 +484,14 @@ void gl_clear_accum_buffer( GLcontext *ctx )
ctx->Accum.ClearColor[2]==0.0 &&
ctx->Accum.ClearColor[3]==0.0) {
/* Black */
- MEMSET( ctx->Buffer->Accum, 0, buffersize * 4 * sizeof(GLaccum) );
+ MEMSET( ctx->DrawBuffer->Accum, 0, buffersize * 4 * sizeof(GLaccum) );
}
else {
/* Not black */
GLaccum *acc, r, g, b, a;
GLuint i;
- acc = ctx->Buffer->Accum;
+ acc = ctx->DrawBuffer->Accum;
r = (GLaccum) (ctx->Accum.ClearColor[0] * acc_scale);
g = (GLaccum) (ctx->Accum.ClearColor[1] * acc_scale);
b = (GLaccum) (ctx->Accum.ClearColor[2] * acc_scale);
diff --git a/xc/extras/Mesa/src/accum.h b/xc/extras/Mesa/src/accum.h
index 5f5755326..1e26fb0b7 100644
--- a/xc/extras/Mesa/src/accum.h
+++ b/xc/extras/Mesa/src/accum.h
@@ -1,4 +1,4 @@
-/* $Id: accum.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: accum.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -38,14 +38,15 @@
extern void gl_alloc_accum_buffer( GLcontext *ctx );
-extern void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value );
+extern void gl_clear_accum_buffer( GLcontext *ctx );
-extern void gl_ClearAccum( GLcontext *ctx, GLfloat red, GLfloat green,
- GLfloat blue, GLfloat alpha );
+extern void
+_mesa_Accum( GLenum op, GLfloat value );
-extern void gl_clear_accum_buffer( GLcontext *ctx );
+extern void
+_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
#endif
diff --git a/xc/extras/Mesa/src/all.h b/xc/extras/Mesa/src/all.h
index f0d5dc95b..7e8e99d78 100644
--- a/xc/extras/Mesa/src/all.h
+++ b/xc/extras/Mesa/src/all.h
@@ -1,8 +1,8 @@
-/* $Id: all.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: all.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,10 +25,8 @@
*/
-
-
-
-/* The purpose of this file is to collect all the header files that Mesa
+/*
+ * The purpose of this file is to collect all the header files that Mesa
* uses into a single header so that we can get new compilers that support
* pre-compiled headers to compile much faster.
* All we do is list all the internal headers used by Mesa in this one
@@ -47,59 +45,50 @@
This is an error. all.h should be included only if PC_HEADER is defined.
#endif
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-#ifndef XFree86LOADER
-#include <assert.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <float.h>
-#include <math.h>
-#endif
-#include "GL/gl.h"
-#ifdef XFree86Server
-#include "GL/osmesa.h"
-#endif
+#include "glheader.h"
#include "accum.h"
#include "alpha.h"
#include "alphabuf.h"
-#include "api.h"
#include "asm-386.h"
#include "attrib.h"
+#include "bbox.h"
#include "bitmap.h"
#include "blend.h"
#include "clip.h"
#include "colortab.h"
-#include "context.h"
#include "config.h"
+#include "context.h"
#include "copypix.h"
+#include "cva.h"
#include "dd.h"
+#include "debug_xform.h"
#include "depth.h"
#include "dlist.h"
#include "drawpix.h"
#include "enable.h"
+#include "enums.h"
#include "eval.h"
+#include "extensions.h"
#include "feedback.h"
#include "fixed.h"
#include "fog.h"
#include "get.h"
+#include "glapi.h"
+#include "glapinoop.h"
+#include "glmisc.h"
#include "hash.h"
#include "image.h"
+#include "imaging.h"
#include "light.h"
#include "lines.h"
#include "logic.h"
#include "macros.h"
#include "masking.h"
#include "matrix.h"
-#include "glmisc.h"
+#include "mem.h"
#include "mmath.h"
#include "pb.h"
#include "pixel.h"
-#include "pointers.h"
#include "points.h"
#include "polygon.h"
#include "quads.h"
@@ -109,6 +98,7 @@
#include "scissor.h"
#include "shade.h"
#include "span.h"
+#include "stages.h"
#include "stencil.h"
#include "teximage.h"
#include "texobj.h"
@@ -118,14 +108,16 @@
#include "types.h"
#include "varray.h"
#include "vb.h"
+#include "vbcull.h"
#include "vbfill.h"
+#include "vbindirect.h"
#include "vbrender.h"
#include "vbxform.h"
+#include "vector.h"
+#include "vertices.h"
#include "winpos.h"
#include "xform.h"
#include "zoom.h"
-#ifdef XFree86Server
-#include "GL/xf86glx.h"
-#endif
+
#endif /*SRC_ALL_H*/
diff --git a/xc/extras/Mesa/src/alpha.c b/xc/extras/Mesa/src/alpha.c
index e96900ca4..01c92f560 100644
--- a/xc/extras/Mesa/src/alpha.c
+++ b/xc/extras/Mesa/src/alpha.c
@@ -1,8 +1,8 @@
-/* $Id: alpha.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: alpha.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -23,17 +23,12 @@
* 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.
*/
-/* $XFree86: xc/lib/GL/mesa/src/alpha.c,v 1.2 1999/04/04 00:20:18 dawes Exp $ */
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "alpha.h"
#include "context.h"
#include "types.h"
@@ -43,8 +38,10 @@
-void gl_AlphaFunc( GLcontext* ctx, GLenum func, GLclampf ref )
+void
+_mesa_AlphaFunc( GLenum func, GLclampf ref )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glAlphaFunc");
switch (func) {
@@ -75,7 +72,6 @@ void gl_AlphaFunc( GLcontext* ctx, GLenum func, GLclampf ref )
-
/*
* Apply the alpha test to a span of pixels.
* In: rgba - array of pixels
diff --git a/xc/extras/Mesa/src/alpha.h b/xc/extras/Mesa/src/alpha.h
index 100411ef9..72355a7cd 100644
--- a/xc/extras/Mesa/src/alpha.h
+++ b/xc/extras/Mesa/src/alpha.h
@@ -1,8 +1,8 @@
-/* $Id: alpha.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: alpha.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef ALPHA_H
#define ALPHA_H
@@ -39,7 +36,8 @@ extern GLint gl_alpha_test( const GLcontext *ctx, GLuint n,
CONST GLubyte rgba[][4], GLubyte mask[] );
-extern void gl_AlphaFunc( GLcontext *ctx, GLenum func, GLclampf ref );
+extern void
+_mesa_AlphaFunc( GLenum func, GLclampf ref );
#endif
diff --git a/xc/extras/Mesa/src/alphabuf.c b/xc/extras/Mesa/src/alphabuf.c
index 969df6fe7..cdf01af04 100644
--- a/xc/extras/Mesa/src/alphabuf.c
+++ b/xc/extras/Mesa/src/alphabuf.c
@@ -1,8 +1,8 @@
-/* $Id: alphabuf.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: alphabuf.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,56 +25,60 @@
*/
-
-
-
/*
* Software alpha planes. Many frame buffers don't have alpha bits so
* we simulate them in software.
*/
-#include <stdlib.h>
#ifdef PC_HEADER
#include "all.h"
#else
+#include "glheader.h"
#include "alphabuf.h"
#include "context.h"
-#include "macros.h"
+#include "mem.h"
#include "types.h"
#endif
-#define ALPHA_ADDR(X,Y) (ctx->Buffer->Alpha + (Y) * ctx->Buffer->Width + (X))
+#define ALPHA_DRAW_ADDR(X,Y) \
+ (ctx->DrawBuffer->Alpha + (Y) * ctx->DrawBuffer->Width + (X))
+
+#define ALPHA_READ_ADDR(X,Y) \
+ (ctx->ReadBuffer->Alpha + (Y) * ctx->ReadBuffer->Width + (X))
/*
- * Allocate a new front and back alpha buffer.
+ * Allocate new front/back/left/right alpha buffers.
+ * Input: ctx - the context
+ *
*/
-void gl_alloc_alpha_buffers( GLcontext *ctx )
+static void
+alloc_alpha_buffers( GLcontext *ctx, GLframebuffer *buf )
{
- GLint bytes = ctx->Buffer->Width * ctx->Buffer->Height * sizeof(GLubyte);
+ GLint bytes = buf->Width * buf->Height * sizeof(GLubyte);
ASSERT(ctx->Visual->SoftwareAlpha);
- if (ctx->Buffer->FrontLeftAlpha) {
- FREE( ctx->Buffer->FrontLeftAlpha );
+ if (buf->FrontLeftAlpha) {
+ FREE( buf->FrontLeftAlpha );
}
- ctx->Buffer->FrontLeftAlpha = (GLubyte *) MALLOC( bytes );
- if (!ctx->Buffer->FrontLeftAlpha) {
+ buf->FrontLeftAlpha = (GLubyte *) MALLOC( bytes );
+ if (!buf->FrontLeftAlpha) {
/* out of memory */
gl_error( ctx, GL_OUT_OF_MEMORY,
"Couldn't allocate front-left alpha buffer" );
}
if (ctx->Visual->DBflag) {
- if (ctx->Buffer->BackLeftAlpha) {
- FREE( ctx->Buffer->BackLeftAlpha );
+ if (buf->BackLeftAlpha) {
+ FREE( buf->BackLeftAlpha );
}
- ctx->Buffer->BackLeftAlpha = (GLubyte *) MALLOC( bytes );
- if (!ctx->Buffer->BackLeftAlpha) {
+ buf->BackLeftAlpha = (GLubyte *) MALLOC( bytes );
+ if (!buf->BackLeftAlpha) {
/* out of memory */
gl_error( ctx, GL_OUT_OF_MEMORY,
"Couldn't allocate back-left alpha buffer" );
@@ -82,22 +86,22 @@ void gl_alloc_alpha_buffers( GLcontext *ctx )
}
if (ctx->Visual->StereoFlag) {
- if (ctx->Buffer->FrontRightAlpha) {
- FREE( ctx->Buffer->FrontRightAlpha );
+ if (buf->FrontRightAlpha) {
+ FREE( buf->FrontRightAlpha );
}
- ctx->Buffer->FrontRightAlpha = (GLubyte *) MALLOC( bytes );
- if (!ctx->Buffer->FrontRightAlpha) {
+ buf->FrontRightAlpha = (GLubyte *) MALLOC( bytes );
+ if (!buf->FrontRightAlpha) {
/* out of memory */
gl_error( ctx, GL_OUT_OF_MEMORY,
"Couldn't allocate front-right alpha buffer" );
}
if (ctx->Visual->DBflag) {
- if (ctx->Buffer->BackRightAlpha) {
- FREE( ctx->Buffer->BackRightAlpha );
+ if (buf->BackRightAlpha) {
+ FREE( buf->BackRightAlpha );
}
- ctx->Buffer->BackRightAlpha = (GLubyte *) MALLOC( bytes );
- if (!ctx->Buffer->BackRightAlpha) {
+ buf->BackRightAlpha = (GLubyte *) MALLOC( bytes );
+ if (!buf->BackRightAlpha) {
/* out of memory */
gl_error( ctx, GL_OUT_OF_MEMORY,
"Couldn't allocate back-right alpha buffer" );
@@ -106,13 +110,25 @@ void gl_alloc_alpha_buffers( GLcontext *ctx )
}
if (ctx->Color.DriverDrawBuffer == GL_FRONT_LEFT)
- ctx->Buffer->Alpha = ctx->Buffer->FrontLeftAlpha;
+ buf->Alpha = buf->FrontLeftAlpha;
else if (ctx->Color.DriverDrawBuffer == GL_BACK_LEFT)
- ctx->Buffer->Alpha = ctx->Buffer->BackLeftAlpha;
+ buf->Alpha = buf->BackLeftAlpha;
else if (ctx->Color.DriverDrawBuffer == GL_FRONT_RIGHT)
- ctx->Buffer->Alpha = ctx->Buffer->FrontRightAlpha;
+ buf->Alpha = buf->FrontRightAlpha;
else if (ctx->Color.DriverDrawBuffer == GL_BACK_RIGHT)
- ctx->Buffer->Alpha = ctx->Buffer->BackRightAlpha;
+ buf->Alpha = buf->BackRightAlpha;
+}
+
+
+/*
+ * Allocate a new front and back alpha buffer.
+ */
+void gl_alloc_alpha_buffers( GLcontext *ctx )
+{
+ alloc_alpha_buffers( ctx, ctx->DrawBuffer );
+ if (ctx->ReadBuffer != ctx->DrawBuffer) {
+ alloc_alpha_buffers( ctx, ctx->ReadBuffer );
+ }
}
@@ -132,25 +148,26 @@ void gl_clear_alpha_buffers( GLcontext *ctx )
if (bufferBit & ctx->Color.DrawDestMask) {
GLubyte *buffer;
if (bufferBit == FRONT_LEFT_BIT) {
- buffer = ctx->Buffer->FrontLeftAlpha;
+ buffer = ctx->DrawBuffer->FrontLeftAlpha;
}
else if (bufferBit == FRONT_RIGHT_BIT) {
- buffer = ctx->Buffer->FrontRightAlpha;
+ buffer = ctx->DrawBuffer->FrontRightAlpha;
}
else if (bufferBit == BACK_LEFT_BIT) {
- buffer = ctx->Buffer->BackLeftAlpha;
+ buffer = ctx->DrawBuffer->BackLeftAlpha;
}
else {
- buffer = ctx->Buffer->BackRightAlpha;
+ buffer = ctx->DrawBuffer->BackRightAlpha;
}
if (ctx->Scissor.Enabled) {
/* clear scissor region */
GLint j;
- GLint rowLen = ctx->Buffer->Xmax - ctx->Buffer->Xmin + 1;
- GLint rows = ctx->Buffer->Ymax - ctx->Buffer->Ymin + 1;
- GLubyte *aptr = buffer + ctx->Buffer->Ymin * ctx->Buffer->Width
- + ctx->Buffer->Xmin;
+ GLint rowLen = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1;
+ GLint rows = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin + 1;
+ GLubyte *aptr = buffer
+ + ctx->DrawBuffer->Ymin * ctx->DrawBuffer->Width
+ + ctx->DrawBuffer->Xmin;
for (j = 0; j < rows; j++) {
MEMSET( aptr, aclear, rowLen );
aptr += rowLen;
@@ -158,7 +175,8 @@ void gl_clear_alpha_buffers( GLcontext *ctx )
}
else {
/* clear whole buffer */
- MEMSET( buffer, aclear, ctx->Buffer->Width * ctx->Buffer->Height );
+ GLuint bytes = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height;
+ MEMSET( buffer, aclear, bytes );
}
}
}
@@ -169,7 +187,7 @@ void gl_clear_alpha_buffers( GLcontext *ctx )
void gl_write_alpha_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
CONST GLubyte rgba[][4], const GLubyte mask[] )
{
- GLubyte *aptr = ALPHA_ADDR( x, y );
+ GLubyte *aptr = ALPHA_DRAW_ADDR( x, y );
GLuint i;
if (mask) {
@@ -191,7 +209,7 @@ void gl_write_alpha_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
void gl_write_mono_alpha_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
GLubyte alpha, const GLubyte mask[] )
{
- GLubyte *aptr = ALPHA_ADDR( x, y );
+ GLubyte *aptr = ALPHA_DRAW_ADDR( x, y );
GLuint i;
if (mask) {
@@ -219,14 +237,14 @@ void gl_write_alpha_pixels( GLcontext *ctx,
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
- GLubyte *aptr = ALPHA_ADDR( x[i], y[i] );
+ GLubyte *aptr = ALPHA_DRAW_ADDR( x[i], y[i] );
*aptr = rgba[i][ACOMP];
}
}
}
else {
for (i=0;i<n;i++) {
- GLubyte *aptr = ALPHA_ADDR( x[i], y[i] );
+ GLubyte *aptr = ALPHA_DRAW_ADDR( x[i], y[i] );
*aptr = rgba[i][ACOMP];
}
}
@@ -242,14 +260,14 @@ void gl_write_mono_alpha_pixels( GLcontext *ctx,
if (mask) {
for (i=0;i<n;i++) {
if (mask[i]) {
- GLubyte *aptr = ALPHA_ADDR( x[i], y[i] );
+ GLubyte *aptr = ALPHA_DRAW_ADDR( x[i], y[i] );
*aptr = alpha;
}
}
}
else {
for (i=0;i<n;i++) {
- GLubyte *aptr = ALPHA_ADDR( x[i], y[i] );
+ GLubyte *aptr = ALPHA_DRAW_ADDR( x[i], y[i] );
*aptr = alpha;
}
}
@@ -260,7 +278,7 @@ void gl_write_mono_alpha_pixels( GLcontext *ctx,
void gl_read_alpha_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, GLubyte rgba[][4] )
{
- GLubyte *aptr = ALPHA_ADDR( x, y );
+ GLubyte *aptr = ALPHA_READ_ADDR( x, y );
GLuint i;
for (i=0;i<n;i++) {
rgba[i][ACOMP] = *aptr++;
@@ -275,7 +293,7 @@ void gl_read_alpha_pixels( GLcontext *ctx,
GLuint i;
for (i=0;i<n;i++) {
if (mask[i]) {
- GLubyte *aptr = ALPHA_ADDR( x[i], y[i] );
+ GLubyte *aptr = ALPHA_READ_ADDR( x[i], y[i] );
rgba[i][ACOMP] = *aptr;
}
}
diff --git a/xc/extras/Mesa/src/alphabuf.h b/xc/extras/Mesa/src/alphabuf.h
index a6d646078..d8d01ffbb 100644
--- a/xc/extras/Mesa/src/alphabuf.h
+++ b/xc/extras/Mesa/src/alphabuf.h
@@ -1,4 +1,4 @@
-/* $Id: alphabuf.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: alphabuf.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/api.h b/xc/extras/Mesa/src/api.h
deleted file mode 100644
index e68602a6f..000000000
--- a/xc/extras/Mesa/src/api.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* $Id: api.h,v 1.4 1999/12/18 16:51:05 daryll Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.1
- *
- * Copyright (C) 1999 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"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-/* $XFree86: xc/lib/GL/mesa/src/api.h,v 1.4 1999/06/27 14:07:26 dawes Exp $ */
-
-
-
-
-/*
- * This header contains stuff only included by api1.c, api2.c and apiext.c
- * and cva.c and varray.c
- */
-
-
-#ifndef API_H
-#define API_H
-
-
-#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) && !defined(GLX_USE_DLOPEN)
-#define NEED_MESA_FUNCS_WRAPPED
-#include "mesa_api.h"
-#endif
-
-/*
- * Single/multiple thread context selection.
- */
-#ifdef THREADS
-
-/* Get the context associated with the calling thread */
-#define GET_CONTEXT GLcontext *CC = gl_get_thread_context()
-#define GET_IMMEDIATE struct immediate *IM = (gl_get_thread_context())->input;
-
-#define SET_IMMEDIATE(ctx, im) \
-do { \
- ctx->input = im; \
-} while (0)
-
-#else
-
-/* CC is a global pointer for all threads in the address space */
-#define GET_CONTEXT
-
-/* And so is VB */
-#define GET_IMMEDIATE struct immediate *IM = CURRENT_INPUT
-
-#define SET_IMMEDIATE(ctx, im) \
-do { \
- ctx->input = im; \
- CURRENT_INPUT = im; \
-} while (0)
-
-#endif /* THREADS */
-
-
-/* Make sure there's a rendering context. KW: Only do this if compiled
- * debug.
- */
-#ifdef DEBUG
-#define CHECK_CONTEXT \
- if (!CC) { \
- if (getenv("MESA_DEBUG")) { \
- fprintf(stderr,"Mesa user error: no rendering context.\n"); \
- } \
- return; \
- }
-
-#define CHECK_CONTEXT_RETURN(R) \
- if (!CC) { \
- if (getenv("MESA_DEBUG")) { \
- fprintf(stderr,"Mesa user error: no rendering context.\n"); \
- } \
- return (R); \
- }
-#else
-#define CHECK_CONTEXT
-#define CHECK_CONTEXT_RETURN(R)
-#endif
-
-
-#if !defined(CTX_ARG)
-#define CTX_ARG
-#define CTX_VOID
-#define CTX_PRM
-#define CTX_VPRM
-#endif
-
-/*
- * An optimization in a few performance-critical functions.
- */
-#ifndef XFree86Server /* don't think we want this in DRI??? */
-#define SHORTCUT
-#endif
-
-
-
-#endif
diff --git a/xc/extras/Mesa/src/api1.c b/xc/extras/Mesa/src/api1.c
deleted file mode 100644
index 0f418de4d..000000000
--- a/xc/extras/Mesa/src/api1.c
+++ /dev/null
@@ -1,2058 +0,0 @@
-/* $Id: api1.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.1
- *
- * Copyright (C) 1999 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"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#ifndef XFree86Server
-#include <stdio.h>
-#include <stdlib.h>
-#else
-#include "GL/xf86glx.h"
-#endif
-#include "api.h"
-#include "bitmap.h"
-#include "context.h"
-#include "drawpix.h"
-#include "eval.h"
-#include "image.h"
-#include "light.h"
-#include "macros.h"
-#include "matrix.h"
-#include "mmath.h"
-#include "teximage.h"
-#include "types.h"
-#include "varray.h"
-#include "vb.h"
-#include "vbfill.h"
-#endif
-
-/*
- * Part 1 of API functions
- */
-
-void GLAPIENTRY glAccum(CTX_ARG GLenum op, GLfloat value )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Accum)(CC, op, value);
-}
-
-
-void GLAPIENTRY glAlphaFunc(CTX_ARG GLenum func, GLclampf ref )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.AlphaFunc)(CC, func, ref);
-}
-
-
-GLboolean GLAPIENTRY glAreTexturesResident(CTX_ARG GLsizei n, const GLuint *textures,
- GLboolean *residences )
-{
- GET_CONTEXT;
- CHECK_CONTEXT_RETURN(GL_FALSE);
- return (*CC->API.AreTexturesResident)(CC, n, textures, residences);
-}
-
-/* Enough funny business going on in here it might be quicker to use a
- * function pointer.
- */
-#define ARRAY_ELT( IM, i ) \
-{ \
- GLuint count = IM->Count; \
- IM->Elt[count] = i; \
- IM->Flag[count] = ((IM->Flag[count] & IM->ArrayAndFlags) | \
- VERT_ELT); \
- IM->FlushElt |= IM->ArrayEltFlush; \
- IM->Count = count += IM->ArrayIncr; \
- if (count == VB_MAX) \
- IM->maybe_transform_vb( IM ); \
-}
-
-
-void GLAPIENTRY glArrayElement(CTX_ARG GLint i )
-{
- GET_IMMEDIATE;
- ARRAY_ELT( IM, i );
-}
-
-
-void GLAPIENTRY glArrayElementEXT(CTX_ARG GLint i )
-{
- GET_IMMEDIATE;
- ARRAY_ELT( IM, i );
-}
-
-
-void gl_ArrayElement( GLcontext *CC, GLint i )
-{
- struct immediate *im = CC->input;
- ARRAY_ELT( im, i );
-}
-
-
-void GLAPIENTRY glBegin(CTX_ARG GLenum mode )
-{
- GET_CONTEXT;
-
- if (mode < GL_POINTS || mode > GL_POLYGON) {
- gl_compile_error( CC, GL_INVALID_ENUM, "glBegin" );
- return;
- }
-
- gl_Begin(CC,mode);
-}
-
-
-void GLAPIENTRY glBindTexture(CTX_ARG GLenum target, GLuint texture )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.BindTexture)(CC, target, texture);
-}
-
-
-void GLAPIENTRY glBitmap(CTX_ARG GLsizei width, GLsizei height,
- GLfloat xorig, GLfloat yorig,
- GLfloat xmove, GLfloat ymove,
- const GLubyte *bitmap )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Bitmap)( CC, width, height, xorig, yorig, xmove, ymove, bitmap,
- &CC->Unpack );
-}
-
-
-void GLAPIENTRY glBlendFunc(CTX_ARG GLenum sfactor, GLenum dfactor )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.BlendFunc)(CC, sfactor, dfactor);
-}
-
-
-void GLAPIENTRY glCallList(CTX_ARG GLuint list )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.CallList)(CC, list);
-}
-
-
-void GLAPIENTRY glCallLists(CTX_ARG GLsizei n, GLenum type, const GLvoid *lists )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.CallLists)(CC, n, type, lists);
-}
-
-
-void GLAPIENTRY glClear(CTX_ARG GLbitfield mask )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Clear)(CC, mask);
-}
-
-
-void GLAPIENTRY glClearAccum(CTX_ARG GLfloat red, GLfloat green,
- GLfloat blue, GLfloat alpha )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.ClearAccum)(CC, red, green, blue, alpha);
-}
-
-
-
-void GLAPIENTRY glClearIndex(CTX_ARG GLfloat c )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.ClearIndex)(CC, c);
-}
-
-
-void GLAPIENTRY glClearColor(CTX_ARG GLclampf red, GLclampf green,
- GLclampf blue, GLclampf alpha )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.ClearColor)(CC, red, green, blue, alpha);
-}
-
-
-void GLAPIENTRY glClearDepth(CTX_ARG GLclampd depth )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.ClearDepth)( CC, depth );
-}
-
-
-void GLAPIENTRY glClearStencil(CTX_ARG GLint s )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.ClearStencil)(CC, s);
-}
-
-
-void GLAPIENTRY glClipPlane(CTX_ARG GLenum plane, const GLdouble *equation )
-{
- GLfloat eq[4];
- GET_CONTEXT;
- CHECK_CONTEXT;
- eq[0] = (GLfloat) equation[0];
- eq[1] = (GLfloat) equation[1];
- eq[2] = (GLfloat) equation[2];
- eq[3] = (GLfloat) equation[3];
- (*CC->API.ClipPlane)(CC, plane, eq );
-}
-
-
-/* KW: Again, a stateless implementation of these functions. The big
- * news here is the impact on color material. This was previously
- * handled by swaping the function pointers that these API's used to
- * call. This is no longer possible, and we have to pick up the
- * pieces later on and make them work with either color-color, or
- * color-material.
- *
- * But in truth, this is not a bad thing, because it was necessary
- * to implement that mechanism to get good performance from
- * color-material and vertex arrays.
- */
-#define COLOR( IM, r,g,b,a ) \
-{ \
- GLuint count = IM->Count; \
- IM->Flag[count] |= VERT_RGBA; \
- IM->Color[count][0] = r; \
- IM->Color[count][1] = g; \
- IM->Color[count][2] = b; \
- IM->Color[count][3] = a; \
-}
-
-#if 0
-#define COLOR4F( IM, r,g,b,a ) \
-{ \
- GLuint count = IM->Count; \
- IM->Flag[count] |= VERT_RGBA | VERT_FLOAT_RGBA; \
- IM->FloatColor[count][0] = r; \
- IM->FloatColor[count][1] = g; \
- IM->FloatColor[count][2] = b; \
- IM->FloatColor[count][3] = a; \
-}
-#else
-#define COLOR4F(IM, r, g, b, a) \
-{ \
- GLubyte col[4]; \
- FLOAT_COLOR_TO_UBYTE_COLOR(col[0], r); \
- FLOAT_COLOR_TO_UBYTE_COLOR(col[1], g); \
- FLOAT_COLOR_TO_UBYTE_COLOR(col[2], b); \
- FLOAT_COLOR_TO_UBYTE_COLOR(col[3], a); \
- COLORV( IM, col ); \
-}
-#endif
-
-
-
-#define COLORV( IM, v ) \
-{ \
- GLuint count = IM->Count; \
- IM->Flag[count] |= VERT_RGBA; \
- COPY_4UBV(IM->Color[count], v); \
-}
-
-
-void GLAPIENTRY glColor3b(CTX_ARG GLbyte red, GLbyte green, GLbyte blue )
-{
- GET_IMMEDIATE;
- COLOR( IM,
- BYTE_TO_UBYTE(red),
- BYTE_TO_UBYTE(green),
- BYTE_TO_UBYTE(blue),
- 255 );
-}
-
-
-void GLAPIENTRY glColor3d(CTX_ARG GLdouble red, GLdouble green, GLdouble blue )
-{
- GLubyte col[4];
- GLfloat r = red;
- GLfloat g = green;
- GLfloat b = blue;
- GET_IMMEDIATE;
- FLOAT_COLOR_TO_UBYTE_COLOR(col[0], r);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[1], g);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[2], b);
- col[3] = 255;
- COLORV( IM, col );
-
-/* COLOR4F( IM, red, green, blue, 1.0 ); */
-}
-
-
-void GLAPIENTRY glColor3f(CTX_ARG GLfloat red, GLfloat green, GLfloat blue )
-{
- GLubyte col[4];
- GET_IMMEDIATE;
- FLOAT_COLOR_TO_UBYTE_COLOR(col[0], red);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[1], green);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[2], blue);
- col[3] = 255;
- COLORV( IM, col );
-
-/* COLOR4F( IM, red, green, blue, 1.0 ); */
-}
-
-
-void GLAPIENTRY glColor3i(CTX_ARG GLint red, GLint green, GLint blue )
-{
- GET_IMMEDIATE;
- COLOR( IM, INT_TO_UBYTE(red),
- INT_TO_UBYTE(green),
- INT_TO_UBYTE(blue),
- 255);
-}
-
-
-void GLAPIENTRY glColor3s(CTX_ARG GLshort red, GLshort green, GLshort blue )
-{
- GET_IMMEDIATE;
- COLOR( IM, SHORT_TO_UBYTE(red),
- SHORT_TO_UBYTE(green),
- SHORT_TO_UBYTE(blue),
- 255);
-}
-
-
-void GLAPIENTRY glColor3ub(CTX_ARG GLubyte red, GLubyte green, GLubyte blue )
-{
- GET_IMMEDIATE;
- COLOR( IM, red, green, blue, 255 );
-}
-
-
-void GLAPIENTRY glColor3ui(CTX_ARG GLuint red, GLuint green, GLuint blue )
-{
- GET_IMMEDIATE;
- COLOR( IM, UINT_TO_UBYTE(red),
- UINT_TO_UBYTE(green),
- UINT_TO_UBYTE(blue),
- 255 );
-}
-
-
-void GLAPIENTRY glColor3us(CTX_ARG GLushort red, GLushort green, GLushort blue )
-{
- GET_IMMEDIATE;
- COLOR( IM, USHORT_TO_UBYTE(red), USHORT_TO_UBYTE(green),
- USHORT_TO_UBYTE(blue),
- 255 );
-}
-
-
-void GLAPIENTRY glColor4b(CTX_ARG GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha )
-{
- GET_IMMEDIATE;
- COLOR( IM, BYTE_TO_UBYTE(red), BYTE_TO_UBYTE(green),
- BYTE_TO_UBYTE(blue), BYTE_TO_UBYTE(alpha) );
-}
-
-
-void GLAPIENTRY glColor4d(CTX_ARG GLdouble red, GLdouble green, GLdouble blue,
- GLdouble alpha )
-{
- GLubyte col[4];
- GLfloat r = red;
- GLfloat g = green;
- GLfloat b = blue;
- GLfloat a = alpha;
- GET_IMMEDIATE;
- FLOAT_COLOR_TO_UBYTE_COLOR(col[0], r);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[1], g);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[2], b);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[3], a);
- COLORV( IM, col );
-
-/* COLOR4F( IM, red, green, blue, alpha ); */
-}
-
-
-void GLAPIENTRY glColor4f(CTX_ARG GLfloat red, GLfloat green,
- GLfloat blue, GLfloat alpha )
-{
- GLubyte col[4];
- GET_IMMEDIATE;
- FLOAT_COLOR_TO_UBYTE_COLOR(col[0], red);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[1], green);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[2], blue);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[3], alpha);
- COLORV( IM, col );
-
-/* COLOR4F( IM, red, green, blue, alpha ); */
-}
-
-void GLAPIENTRY glColor4i(CTX_ARG GLint red, GLint green, GLint blue, GLint alpha )
-{
- GET_IMMEDIATE;
- COLOR( IM, INT_TO_UBYTE(red), INT_TO_UBYTE(green),
- INT_TO_UBYTE(blue), INT_TO_UBYTE(alpha) );
-}
-
-
-void GLAPIENTRY glColor4s(CTX_ARG GLshort red, GLshort green,
- GLshort blue, GLshort alpha )
-{
- GET_IMMEDIATE;
- COLOR( IM, SHORT_TO_UBYTE(red), SHORT_TO_UBYTE(green),
- SHORT_TO_UBYTE(blue), SHORT_TO_UBYTE(alpha) );
-}
-
-void GLAPIENTRY glColor4ub(CTX_ARG GLubyte red, GLubyte green,
- GLubyte blue, GLubyte alpha )
-{
- GET_IMMEDIATE;
- COLOR( IM, red, green, blue, alpha );
-}
-
-void GLAPIENTRY glColor4ui(CTX_ARG GLuint red, GLuint green,
- GLuint blue, GLuint alpha )
-{
- GET_IMMEDIATE;
- COLOR( IM, UINT_TO_UBYTE(red), UINT_TO_UBYTE(green),
- UINT_TO_UBYTE(blue), UINT_TO_UBYTE(alpha) );
-}
-
-void GLAPIENTRY glColor4us(CTX_ARG GLushort red, GLushort green,
- GLushort blue, GLushort alpha )
-{
- GET_IMMEDIATE;
- COLOR( IM, USHORT_TO_UBYTE(red), USHORT_TO_UBYTE(green),
- USHORT_TO_UBYTE(blue), USHORT_TO_UBYTE(alpha) );
-}
-
-
-void GLAPIENTRY glColor3bv(CTX_ARG const GLbyte *v )
-{
- GET_IMMEDIATE;
- COLOR( IM, BYTE_TO_UBYTE(v[0]), BYTE_TO_UBYTE(v[1]),
- BYTE_TO_UBYTE(v[2]), 255 );
-}
-
-
-void GLAPIENTRY glColor3dv(CTX_ARG const GLdouble *v )
-{
- GLubyte col[4];
- GLfloat r = v[0];
- GLfloat g = v[1];
- GLfloat b = v[2];
- GET_IMMEDIATE;
- FLOAT_COLOR_TO_UBYTE_COLOR(col[0], r);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[1], g);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[2], b);
- col[3]= 255;
- COLORV( IM, col );
-
-/* COLOR4F( IM, v[0], v[1], v[2], v[3] ); */
-}
-
-
-void GLAPIENTRY glColor3fv(CTX_ARG const GLfloat *v )
-{
- GLubyte col[4];
- GET_IMMEDIATE;
- FLOAT_COLOR_TO_UBYTE_COLOR(col[0], v[0]);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[1], v[1]);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[2], v[2]);
- col[3] = 255;
- COLORV( IM, col );
-
-/* COLOR4F( IM, v[0], v[1], v[2], v[3] ); */
-}
-
-
-void GLAPIENTRY glColor3iv(CTX_ARG const GLint *v )
-{
- GET_IMMEDIATE;
- COLOR( IM, INT_TO_UBYTE(v[0]), INT_TO_UBYTE(v[1]),
- INT_TO_UBYTE(v[2]), 255 );
-}
-
-
-void GLAPIENTRY glColor3sv(CTX_ARG const GLshort *v )
-{
- GET_IMMEDIATE;
- COLOR( IM, SHORT_TO_UBYTE(v[0]), SHORT_TO_UBYTE(v[1]),
- SHORT_TO_UBYTE(v[2]), 255 );
-}
-
-
-void GLAPIENTRY glColor3ubv(CTX_ARG const GLubyte *v )
-{
- GET_IMMEDIATE;
- COLOR( IM, v[0], v[1], v[2], 255 );
-}
-
-
-void GLAPIENTRY glColor3uiv(CTX_ARG const GLuint *v )
-{
- GET_IMMEDIATE;
- COLOR( IM, UINT_TO_UBYTE(v[0]), UINT_TO_UBYTE(v[1]),
- UINT_TO_UBYTE(v[2]), 255 );
-}
-
-
-void GLAPIENTRY glColor3usv(CTX_ARG const GLushort *v )
-{
- GET_IMMEDIATE;
- COLOR( IM, USHORT_TO_UBYTE(v[0]), USHORT_TO_UBYTE(v[1]),
- USHORT_TO_UBYTE(v[2]), 255 );
-
-}
-
-
-void GLAPIENTRY glColor4bv(CTX_ARG const GLbyte *v )
-{
- GET_IMMEDIATE;
- COLOR( IM, BYTE_TO_UBYTE(v[0]), BYTE_TO_UBYTE(v[1]),
- BYTE_TO_UBYTE(v[2]), BYTE_TO_UBYTE(v[3]) );
-}
-
-
-void GLAPIENTRY glColor4dv(CTX_ARG const GLdouble *v )
-{
- GLubyte col[4];
- GLfloat r = v[0];
- GLfloat g = v[1];
- GLfloat b = v[2];
- GLfloat a = v[3];
- GET_IMMEDIATE;
- FLOAT_COLOR_TO_UBYTE_COLOR(col[0], r);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[1], g);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[2], b);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[3], a);
- COLORV( IM, col );
-
-/* COLOR4F( IM, v[0], v[1], v[2], v[3] ); */
-}
-
-
-void GLAPIENTRY glColor4fv(CTX_ARG const GLfloat *v )
-{
- GLubyte col[4];
- GET_IMMEDIATE;
- FLOAT_COLOR_TO_UBYTE_COLOR(col[0], v[0]);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[1], v[1]);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[2], v[2]);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[3], v[3]);
- COLORV( IM, col );
-
-/* COLOR4F( IM, v[0], v[1], v[2], v[3] ); */
-}
-
-
-void GLAPIENTRY glColor4iv(CTX_ARG const GLint *v )
-{
- GET_IMMEDIATE;
- COLOR( IM, INT_TO_UBYTE(v[0]), INT_TO_UBYTE(v[1]),
- INT_TO_UBYTE(v[2]), INT_TO_UBYTE(v[3]) );
-}
-
-
-void GLAPIENTRY glColor4sv(CTX_ARG const GLshort *v )
-{
- GET_IMMEDIATE;
- COLOR( IM, SHORT_TO_UBYTE(v[0]), SHORT_TO_UBYTE(v[1]),
- SHORT_TO_UBYTE(v[2]), SHORT_TO_UBYTE(v[3]) );
-}
-
-
-void GLAPIENTRY glColor4ubv(CTX_ARG const GLubyte *v )
-{
- GET_IMMEDIATE;
- COLORV( IM, v );
-}
-
-
-void GLAPIENTRY glColor4uiv(CTX_ARG const GLuint *v )
-{
- GET_IMMEDIATE;
- COLOR( IM, UINT_TO_UBYTE(v[0]), UINT_TO_UBYTE(v[1]),
- UINT_TO_UBYTE(v[2]), UINT_TO_UBYTE(v[3]) );
-}
-
-
-void GLAPIENTRY glColor4usv(CTX_ARG const GLushort *v )
-{
- GET_IMMEDIATE;
- COLOR( IM, USHORT_TO_UBYTE(v[0]), USHORT_TO_UBYTE(v[1]),
- USHORT_TO_UBYTE(v[2]), USHORT_TO_UBYTE(v[3]) );
-}
-
-
-void GLAPIENTRY glColorMask(CTX_ARG GLboolean red, GLboolean green,
- GLboolean blue, GLboolean alpha )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.ColorMask)(CC, red, green, blue, alpha);
-}
-
-
-void GLAPIENTRY glColorMaterial(CTX_ARG GLenum face, GLenum mode )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.ColorMaterial)(CC, face, mode);
-}
-
-
-void GLAPIENTRY glCopyPixels(CTX_ARG GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum type )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.CopyPixels)(CC, x, y, width, height, type);
-}
-
-
-void GLAPIENTRY glCopyTexImage1D(CTX_ARG GLenum target, GLint level,
- GLenum internalformat,
- GLint x, GLint y,
- GLsizei width, GLint border )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.CopyTexImage1D)( CC, target, level, internalformat,
- x, y, width, border );
-}
-
-
-void GLAPIENTRY glCopyTexImage2D(CTX_ARG GLenum target, GLint level,
- GLenum internalformat,
- GLint x, GLint y,
- GLsizei width, GLsizei height, GLint border )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.CopyTexImage2D)( CC, target, level, internalformat,
- x, y, width, height, border );
-}
-
-
-void GLAPIENTRY glCopyTexSubImage1D(CTX_ARG GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y,
- GLsizei width )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.CopyTexSubImage1D)( CC, target, level, xoffset, x, y, width );
-}
-
-
-void GLAPIENTRY glCopyTexSubImage2D(CTX_ARG GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.CopyTexSubImage2D)( CC, target, level, xoffset, yoffset,
- x, y, width, height );
-}
-
-
-/* 1.2 */
-void GLAPIENTRY glCopyTexSubImage3D(CTX_ARG GLenum target, GLint level, GLint xoffset,
- GLint yoffset, GLint zoffset,
- GLint x, GLint y, GLsizei width,
- GLsizei height )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.CopyTexSubImage3D)( CC, target, level, xoffset, yoffset,
- zoffset, x, y, width, height );
-}
-
-
-
-void GLAPIENTRY glCullFace(CTX_ARG GLenum mode )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.CullFace)(CC, mode);
-}
-
-
-void GLAPIENTRY glDepthFunc(CTX_ARG GLenum func )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.DepthFunc)( CC, func );
-}
-
-
-void GLAPIENTRY glDepthMask(CTX_ARG GLboolean flag )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.DepthMask)( CC, flag );
-}
-
-
-void GLAPIENTRY glDepthRange(CTX_ARG GLclampd near_val, GLclampd far_val )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.DepthRange)( CC, near_val, far_val );
-}
-
-
-void GLAPIENTRY glDeleteLists(CTX_ARG GLuint list, GLsizei range )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.DeleteLists)(CC, list, range);
-}
-
-
-void GLAPIENTRY glDeleteTextures(CTX_ARG GLsizei n, const GLuint *textures )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.DeleteTextures)(CC, n, textures);
-}
-
-
-void GLAPIENTRY glDisable(CTX_ARG GLenum cap )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Disable)( CC, cap );
-}
-
-
-void GLAPIENTRY glDisableClientState(CTX_ARG GLenum cap )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.DisableClientState)( CC, cap );
-}
-
-
-void GLAPIENTRY glDrawArrays(CTX_ARG GLenum mode, GLint first, GLsizei count )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- gl_DrawArrays(CC, mode, first, count);
-}
-
-
-void GLAPIENTRY glDrawBuffer(CTX_ARG GLenum mode )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.DrawBuffer)(CC, mode);
-}
-
-
-
-void GLAPIENTRY glDrawPixels(CTX_ARG GLsizei width, GLsizei height, GLenum format,
- GLenum type, const GLvoid *pixels )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- if (CC->CompileFlag || !gl_direct_DrawPixels(CC, &CC->Unpack, width, height,
- format, type, pixels)) {
- struct gl_image *image;
- image = gl_unpack_image( CC, width, height, format, type, pixels, &CC->Unpack );
- (*CC->API.DrawPixels)( CC, image );
- if (image->RefCount==0) {
- /* image not in display list */
- gl_free_image( image );
- }
- }
-}
-
-
-void GLAPIENTRY glEnable(CTX_ARG GLenum cap )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Enable)( CC, cap );
-}
-
-
-void GLAPIENTRY glEnableClientState(CTX_ARG GLenum cap )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.EnableClientState)( CC, cap );
-}
-
-
-/* KW: Both streams now go to the outside-begin-end state. Raise
- * errors for either stream if it was not in the inside state.
- */
-void GLAPIENTRY glEnd(CTX_VOID )
-{
- GLuint state;
- GLuint inflags;
- GET_IMMEDIATE;
-
-
- state = IM->BeginState;
- inflags = (~state) & (VERT_BEGIN_0|VERT_BEGIN_1);
- state |= inflags << 2; /* errors */
-
- if (MESA_VERBOSE&VERBOSE_API) {
- if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
- fprintf(stderr, "glEnd(IM %d), BeginState is %x, errors %x\n",
- IM->id, state,
- inflags<<2);
- else
- fprintf(stderr, ">");
- }
-
-
- if (inflags != (VERT_BEGIN_0|VERT_BEGIN_1))
- {
- GLuint count = IM->Count;
- GLuint last = IM->LastPrimitive;
-
- state &= ~(VERT_BEGIN_0|VERT_BEGIN_1); /* update state */
- IM->Flag[count] |= VERT_END;
- IM->NextPrimitive[IM->LastPrimitive] = count;
- IM->LastPrimitive = count;
- IM->Primitive[count] = GL_POLYGON+1;
-
- if (IM->FlushElt) {
- gl_exec_array_elements( IM->backref, IM, last, count );
- IM->FlushElt = 0;
- }
- }
-
- if (MESA_VERBOSE&VERBOSE_API)
- fprintf(stderr, "in glEnd final state %x\n", state);
-
- IM->BeginState = state;
-
- if ((MESA_DEBUG_FLAGS&DEBUG_ALWAYS_FLUSH))
- IM->maybe_transform_vb( IM );
-}
-
-
-void gl_End( GLcontext *ctx )
-{
- struct immediate *IM = ctx->input;
- GLuint state = IM->BeginState;
- GLuint inflags = (~state) & (VERT_BEGIN_0|VERT_BEGIN_1);
-
-
- if (MESA_VERBOSE&VERBOSE_API) {
- if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
- fprintf(stderr, "gl_End(IM %d), BeginState is %x, errors %x\n",
- IM->id, state,
- inflags<<2);
- else
- fprintf(stderr, ">");
- }
-
- state |= inflags << 2; /* errors */
-
- if (inflags != (VERT_BEGIN_0|VERT_BEGIN_1))
- {
- GLuint count = IM->Count;
- GLuint last = IM->LastPrimitive;
-
- state &= ~(VERT_BEGIN_0|VERT_BEGIN_1); /* update state */
- IM->Flag[count] |= VERT_END;
- IM->NextPrimitive[IM->LastPrimitive] = count;
- IM->LastPrimitive = count;
- IM->Primitive[count] = GL_POLYGON+1;
-
- if (IM->FlushElt) {
- gl_exec_array_elements( ctx, IM, last, count );
- IM->FlushElt = 0;
- }
- }
-
- IM->BeginState = state;
-
- /* You can set this flag to get the old 'flush vb on glEnd()'
- * behaviour.
- */
- if ((MESA_DEBUG_FLAGS&DEBUG_ALWAYS_FLUSH))
- IM->maybe_transform_vb( IM );
-}
-
-void GLAPIENTRY glEndList(CTX_VOID )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.EndList)(CC);
-}
-
-/* KW: If are compiling, we don't know whether eval will produce a
- * vertex when it is run in the future. If this is pure immediate
- * mode, eval is a noop if neither vertex map is enabled.
- *
- * Thus we need to have a check in the display list code or
- * elsewhere for eval(1,2) vertices in the case where
- * map(1,2)_vertex is disabled, and to purge those vertices from
- * the vb. This is currently done
- * via modifications to the cull_vb and render_vb operations, and
- * by using the existing cullmask mechanism for all other operations.
- */
-
-
-/* KW: Because the eval values don't become 'current', fixup will flow
- * through these vertices, and then evaluation will write on top
- * of the fixup results.
- *
- * This is a little inefficient, but at least it is correct. This
- * could be short-circuited in the case where all vertices are
- * eval-vertices, or more generally by a cullmask in fixup.
- *
- * Note: using Obj to hold eval coord data. This data is actually
- * transformed if eval is disabled. But disabling eval & sending
- * eval coords is stupid, right?
- */
-
-
-#define EVALCOORD1(IM, x) \
-{ \
- GLuint count = IM->Count++; \
- IM->Flag[count] |= VERT_EVAL_C1; \
- ASSIGN_4V(IM->Obj[count], x, 0, 0, 1); \
- if (count == VB_MAX-1) \
- IM->maybe_transform_vb( IM ); \
-}
-
-#define EVALCOORD2(IM, x, y) \
-{ \
- GLuint count = IM->Count++; \
- IM->Flag[count] |= VERT_EVAL_C2; \
- ASSIGN_4V(IM->Obj[count], x, y, 0, 1); \
- if (count == VB_MAX-1) \
- IM->maybe_transform_vb( IM ); \
-}
-
-#define EVALPOINT1(IM, x) \
-{ \
- GLuint count = IM->Count++; \
- IM->Flag[count] |= VERT_EVAL_P1; \
- ASSIGN_4V(IM->Obj[count], x, 0, 0, 1); \
- if (count == VB_MAX-1) \
- IM->maybe_transform_vb( IM ); \
-}
-
-#define EVALPOINT2(IM, x, y) \
-{ \
- GLuint count = IM->Count++; \
- IM->Flag[count] |= VERT_EVAL_P2; \
- ASSIGN_4V(IM->Obj[count], x, y, 0, 1); \
- if (count == VB_MAX-1) \
- IM->maybe_transform_vb( IM ); \
-}
-
-
-void GLAPIENTRY glEvalCoord1d(CTX_ARG GLdouble u )
-{
- GET_IMMEDIATE;
- EVALCOORD1( IM, (GLfloat) u );
-}
-
-
-void GLAPIENTRY glEvalCoord1f(CTX_ARG GLfloat u )
-{
- GET_IMMEDIATE;
- EVALCOORD1( IM, u );
-}
-
-
-/* Lame internal function:
- */
-void gl_EvalCoord1f( GLcontext *CC, GLfloat u )
-{
- struct immediate *i = CC->input;
- EVALCOORD1( i, u );
-}
-
-
-void GLAPIENTRY glEvalCoord1dv(CTX_ARG const GLdouble *u )
-{
- GET_IMMEDIATE;
- EVALCOORD1( IM, (GLfloat) *u );
-}
-
-
-void GLAPIENTRY glEvalCoord1fv(CTX_ARG const GLfloat *u )
-{
- GET_IMMEDIATE;
- EVALCOORD1( IM, (GLfloat) *u );
-}
-
-
-void GLAPIENTRY glEvalCoord2d(CTX_ARG GLdouble u, GLdouble v )
-{
- GET_IMMEDIATE;
- EVALCOORD2( IM, (GLfloat) u, (GLfloat) v );
-}
-
-
-void GLAPIENTRY glEvalCoord2f(CTX_ARG GLfloat u, GLfloat v )
-{
- GET_IMMEDIATE;
- EVALCOORD2( IM, u, v );
-}
-
-
-/* Lame internal function:
- */
-void gl_EvalCoord2f( GLcontext *CC, GLfloat u, GLfloat v )
-{
- struct immediate *i = CC->input;
- EVALCOORD2( i, u, v );
-}
-
-
-void GLAPIENTRY glEvalCoord2dv(CTX_ARG const GLdouble *u )
-{
- GET_IMMEDIATE;
- EVALCOORD2( IM, (GLfloat) u[0], (GLfloat) u[1] );
-}
-
-
-void GLAPIENTRY glEvalCoord2fv(CTX_ARG const GLfloat *u )
-{
- GET_IMMEDIATE;
- EVALCOORD2( IM, u[0], u[1] );
-}
-
-
-void GLAPIENTRY glEvalPoint1(CTX_ARG GLint i )
-{
- GET_IMMEDIATE;
- EVALPOINT1( IM, i );
-}
-
-
-void GLAPIENTRY glEvalPoint2(CTX_ARG GLint i, GLint j )
-{
- GET_IMMEDIATE;
- EVALPOINT2( IM, i, j );
-}
-
-
-void GLAPIENTRY glEvalMesh1(CTX_ARG GLenum mode, GLint i1, GLint i2 )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.EvalMesh1)( CC, mode, i1, i2 );
-}
-
-
-void GLAPIENTRY glEdgeFlag(CTX_ARG GLboolean flag )
-{
- GLuint count;
- GET_IMMEDIATE;
- count = IM->Count;
- IM->EdgeFlag[count] = flag;
- IM->Flag[count] |= VERT_EDGE;
-}
-
-
-void GLAPIENTRY glEdgeFlagv(CTX_ARG const GLboolean *flag )
-{
- GLuint count;
- GET_IMMEDIATE;
- count = IM->Count;
- IM->EdgeFlag[count] = *flag;
- IM->Flag[count] |= VERT_EDGE;
-}
-
-
-
-void GLAPIENTRY glEvalMesh2(CTX_ARG GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.EvalMesh2)( CC, mode, i1, i2, j1, j2 );
-}
-
-
-void GLAPIENTRY glFeedbackBuffer(CTX_ARG GLsizei size, GLenum type, GLfloat *buffer )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.FeedbackBuffer)(CC, size, type, buffer);
-}
-
-
-void GLAPIENTRY glFinish(CTX_VOID )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Finish)(CC);
-}
-
-
-void GLAPIENTRY glFlush(CTX_VOID )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Flush)(CC);
-}
-
-
-void GLAPIENTRY glFogf(CTX_ARG GLenum pname, GLfloat param )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Fogfv)(CC, pname, &param);
-}
-
-
-void GLAPIENTRY glFogi(CTX_ARG GLenum pname, GLint param )
-{
- GLfloat fparam = (GLfloat) param;
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Fogfv)(CC, pname, &fparam);
-}
-
-
-void GLAPIENTRY glFogfv(CTX_ARG GLenum pname, const GLfloat *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Fogfv)(CC, pname, params);
-}
-
-
-void GLAPIENTRY glFogiv(CTX_ARG GLenum pname, const GLint *params )
-{
- GLfloat p[4];
- GET_CONTEXT;
- CHECK_CONTEXT;
-
- switch (pname) {
- case GL_FOG_MODE:
- case GL_FOG_DENSITY:
- case GL_FOG_START:
- case GL_FOG_END:
- case GL_FOG_INDEX:
- p[0] = (GLfloat) *params;
- break;
- case GL_FOG_COLOR:
- p[0] = INT_TO_FLOAT( params[0] );
- p[1] = INT_TO_FLOAT( params[1] );
- p[2] = INT_TO_FLOAT( params[2] );
- p[3] = INT_TO_FLOAT( params[3] );
- break;
- default:
- /* Error will be caught later in gl_Fogfv */
- ;
- }
- (*CC->API.Fogfv)( CC, pname, p );
-}
-
-
-void GLAPIENTRY glFrontFace(CTX_ARG GLenum mode )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.FrontFace)(CC, mode);
-}
-
-
-void GLAPIENTRY glFrustum(CTX_ARG GLdouble left, GLdouble right,
- GLdouble bottom, GLdouble top,
- GLdouble nearval, GLdouble farval )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Frustum)(CC, left, right, bottom, top, nearval, farval);
-}
-
-
-GLuint GLAPIENTRY glGenLists(CTX_ARG GLsizei range )
-{
- GET_CONTEXT;
- CHECK_CONTEXT_RETURN(0);
- return (*CC->API.GenLists)(CC, range);
-}
-
-
-void GLAPIENTRY glGenTextures(CTX_ARG GLsizei n, GLuint *textures )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GenTextures)(CC, n, textures);
-}
-
-
-void GLAPIENTRY glGetBooleanv(CTX_ARG GLenum pname, GLboolean *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetBooleanv)(CC, pname, params);
-}
-
-
-void GLAPIENTRY glGetClipPlane(CTX_ARG GLenum plane, GLdouble *equation )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetClipPlane)(CC, plane, equation);
-}
-
-
-void GLAPIENTRY glGetDoublev(CTX_ARG GLenum pname, GLdouble *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetDoublev)(CC, pname, params);
-}
-
-
-GLenum GLAPIENTRY glGetError(CTX_VOID )
-{
- GET_CONTEXT;
- if (!CC) {
- /* No current context */
- return (GLenum) GL_NO_ERROR;
- }
- return (*CC->API.GetError)(CC);
-}
-
-
-void GLAPIENTRY glGetFloatv(CTX_ARG GLenum pname, GLfloat *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetFloatv)(CC, pname, params);
-}
-
-
-void GLAPIENTRY glGetIntegerv(CTX_ARG GLenum pname, GLint *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetIntegerv)(CC, pname, params);
-}
-
-
-void GLAPIENTRY glGetLightfv(CTX_ARG GLenum light, GLenum pname, GLfloat *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetLightfv)(CC, light, pname, params);
-}
-
-
-void GLAPIENTRY glGetLightiv(CTX_ARG GLenum light, GLenum pname, GLint *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetLightiv)(CC, light, pname, params);
-}
-
-
-void GLAPIENTRY glGetMapdv(CTX_ARG GLenum target, GLenum query, GLdouble *v )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetMapdv)( CC, target, query, v );
-}
-
-
-void GLAPIENTRY glGetMapfv(CTX_ARG GLenum target, GLenum query, GLfloat *v )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetMapfv)( CC, target, query, v );
-}
-
-
-void GLAPIENTRY glGetMapiv(CTX_ARG GLenum target, GLenum query, GLint *v )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetMapiv)( CC, target, query, v );
-}
-
-
-void GLAPIENTRY glGetMaterialfv(CTX_ARG GLenum face, GLenum pname, GLfloat *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetMaterialfv)(CC, face, pname, params);
-}
-
-
-void GLAPIENTRY glGetMaterialiv(CTX_ARG GLenum face, GLenum pname, GLint *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetMaterialiv)(CC, face, pname, params);
-}
-
-
-void GLAPIENTRY glGetPixelMapfv(CTX_ARG GLenum map, GLfloat *values )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetPixelMapfv)(CC, map, values);
-}
-
-
-void GLAPIENTRY glGetPixelMapuiv(CTX_ARG GLenum map, GLuint *values )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetPixelMapuiv)(CC, map, values);
-}
-
-
-void GLAPIENTRY glGetPixelMapusv(CTX_ARG GLenum map, GLushort *values )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetPixelMapusv)(CC, map, values);
-}
-
-
-void GLAPIENTRY glGetPointerv(CTX_ARG GLenum pname, GLvoid **params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetPointerv)(CC, pname, params);
-}
-
-
-void GLAPIENTRY glGetPolygonStipple(CTX_ARG GLubyte *mask )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetPolygonStipple)(CC, mask);
-}
-
-
-const GLubyte * GLAPIENTRY glGetString(CTX_ARG GLenum name )
-{
- GET_CONTEXT;
- CHECK_CONTEXT_RETURN(NULL);
- /* even check for NULL context when not compiled with -DDEBUG */
- if (!CC)
- return NULL;
- return (*CC->API.GetString)(CC, name);
-}
-
-
-void GLAPIENTRY glGetTexEnvfv(CTX_ARG GLenum target, GLenum pname, GLfloat *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetTexEnvfv)(CC, target, pname, params);
-}
-
-
-void GLAPIENTRY glGetTexEnviv(CTX_ARG GLenum target, GLenum pname, GLint *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetTexEnviv)(CC, target, pname, params);
-}
-
-
-void GLAPIENTRY glGetTexGeniv(CTX_ARG GLenum coord, GLenum pname, GLint *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetTexGeniv)(CC, coord, pname, params);
-}
-
-
-void GLAPIENTRY glGetTexGendv(CTX_ARG GLenum coord, GLenum pname, GLdouble *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetTexGendv)(CC, coord, pname, params);
-}
-
-
-void GLAPIENTRY glGetTexGenfv(CTX_ARG GLenum coord, GLenum pname, GLfloat *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetTexGenfv)(CC, coord, pname, params);
-}
-
-
-void GLAPIENTRY glGetTexImage(CTX_ARG GLenum target, GLint level, GLenum format,
- GLenum type, GLvoid *pixels )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetTexImage)(CC, target, level, format, type, pixels);
-}
-
-
-void GLAPIENTRY glGetTexLevelParameterfv(CTX_ARG GLenum target, GLint level,
- GLenum pname, GLfloat *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetTexLevelParameterfv)(CC, target, level, pname, params);
-}
-
-
-void GLAPIENTRY glGetTexLevelParameteriv(CTX_ARG GLenum target, GLint level,
- GLenum pname, GLint *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetTexLevelParameteriv)(CC, target, level, pname, params);
-}
-
-
-void GLAPIENTRY glGetTexParameterfv(CTX_ARG GLenum target, GLenum pname,
- GLfloat *params)
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetTexParameterfv)(CC, target, pname, params);
-}
-
-
-void GLAPIENTRY glGetTexParameteriv(CTX_ARG GLenum target, GLenum pname,
- GLint *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetTexParameteriv)(CC, target, pname, params);
-}
-
-
-void GLAPIENTRY glHint(CTX_ARG GLenum target, GLenum mode )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- if (mode!=GL_DONT_CARE && mode!=GL_FASTEST && mode!=GL_NICEST)
- (*CC->API.Error)( CC, GL_INVALID_ENUM, "glHint(mode)" );
- else
- (*CC->API.Hint)(CC, target, mode);
-}
-
-
-#define INDEX( c ) \
-{ \
- GLuint count; \
- GET_IMMEDIATE; \
- count = IM->Count; \
- IM->Index[count] = c; \
- IM->Flag[count] |= VERT_INDEX; \
-}
-
-
-void GLAPIENTRY glIndexd(CTX_ARG GLdouble c )
-{
- INDEX( (GLuint) (GLint) c );
-}
-
-
-void GLAPIENTRY glIndexf(CTX_ARG GLfloat c )
-{
- INDEX( (GLuint) (GLint) c );
-}
-
-
-void GLAPIENTRY glIndexi(CTX_ARG GLint c )
-{
- INDEX( (GLuint) c );
-}
-
-
-void GLAPIENTRY glIndexs(CTX_ARG GLshort c )
-{
- INDEX( (GLuint) c );
-}
-
-
-/* GL_VERSION_1_1 */
-void GLAPIENTRY glIndexub(CTX_ARG GLubyte c )
-{
- INDEX( (GLuint) c );
-}
-
-
-void GLAPIENTRY glIndexdv(CTX_ARG const GLdouble *c )
-{
- INDEX( (GLuint) (GLint) *c );
-}
-
-
-void GLAPIENTRY glIndexfv(CTX_ARG const GLfloat *c )
-{
- INDEX( (GLuint) (GLint) *c );
-}
-
-
-void GLAPIENTRY glIndexiv(CTX_ARG const GLint *c )
-{
- INDEX( *c );
-}
-
-
-void GLAPIENTRY glIndexsv(CTX_ARG const GLshort *c )
-{
- INDEX( (GLuint) (GLint) *c );
-}
-
-
-/* GL_VERSION_1_1 */
-void GLAPIENTRY glIndexubv(CTX_ARG const GLubyte *c )
-{
- INDEX( (GLuint) *c );
-}
-
-
-void GLAPIENTRY glIndexMask(CTX_ARG GLuint mask )
-{
- GET_CONTEXT;
- (*CC->API.IndexMask)(CC, mask);
-}
-
-
-
-
-void GLAPIENTRY glInitNames(CTX_VOID )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.InitNames)(CC);
-}
-
-
-GLboolean GLAPIENTRY glIsList(CTX_ARG GLuint list )
-{
- GET_CONTEXT;
- CHECK_CONTEXT_RETURN(GL_FALSE);
- return (*CC->API.IsList)(CC, list);
-}
-
-
-GLboolean GLAPIENTRY glIsTexture(CTX_ARG GLuint texture )
-{
- GET_CONTEXT;
- CHECK_CONTEXT_RETURN(GL_FALSE);
- return (*CC->API.IsTexture)(CC, texture);
-}
-
-
-void GLAPIENTRY glLightf(CTX_ARG GLenum light, GLenum pname, GLfloat param )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Lightfv)( CC, light, pname, &param, 1 );
-}
-
-
-void GLAPIENTRY glLighti(CTX_ARG GLenum light, GLenum pname, GLint param )
-{
- GLfloat fparam = (GLfloat) param;
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Lightfv)( CC, light, pname, &fparam, 1 );
-}
-
-
-void GLAPIENTRY glLightfv(CTX_ARG GLenum light, GLenum pname, const GLfloat *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Lightfv)( CC, light, pname, params, 4 );
-}
-
-
-void GLAPIENTRY glLightiv(CTX_ARG GLenum light, GLenum pname, const GLint *params )
-{
- GLfloat fparam[4];
- GET_CONTEXT;
- CHECK_CONTEXT;
-
- switch (pname) {
- case GL_AMBIENT:
- case GL_DIFFUSE:
- case GL_SPECULAR:
- fparam[0] = INT_TO_FLOAT( params[0] );
- fparam[1] = INT_TO_FLOAT( params[1] );
- fparam[2] = INT_TO_FLOAT( params[2] );
- fparam[3] = INT_TO_FLOAT( params[3] );
- break;
- case GL_POSITION:
- fparam[0] = (GLfloat) params[0];
- fparam[1] = (GLfloat) params[1];
- fparam[2] = (GLfloat) params[2];
- fparam[3] = (GLfloat) params[3];
- break;
- case GL_SPOT_DIRECTION:
- fparam[0] = (GLfloat) params[0];
- fparam[1] = (GLfloat) params[1];
- fparam[2] = (GLfloat) params[2];
- break;
- case GL_SPOT_EXPONENT:
- case GL_SPOT_CUTOFF:
- case GL_CONSTANT_ATTENUATION:
- case GL_LINEAR_ATTENUATION:
- case GL_QUADRATIC_ATTENUATION:
- fparam[0] = (GLfloat) params[0];
- break;
- default:
- /* error will be caught later in gl_Lightfv */
- ;
- }
- (*CC->API.Lightfv)( CC, light, pname, fparam, 4 );
-}
-
-
-void GLAPIENTRY glLightModelf(CTX_ARG GLenum pname, GLfloat param )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.LightModelfv)( CC, pname, &param );
-}
-
-
-void GLAPIENTRY glLightModeli(CTX_ARG GLenum pname, GLint param )
-{
- GLfloat fparam[4];
- GET_CONTEXT;
- CHECK_CONTEXT;
- fparam[0] = (GLfloat) param;
- (*CC->API.LightModelfv)( CC, pname, fparam );
-}
-
-
-void GLAPIENTRY glLightModelfv(CTX_ARG GLenum pname, const GLfloat *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.LightModelfv)( CC, pname, params );
-}
-
-
-void GLAPIENTRY glLightModeliv(CTX_ARG GLenum pname, const GLint *params )
-{
- GLfloat fparam[4];
- GET_CONTEXT;
- CHECK_CONTEXT;
-
- switch (pname) {
- case GL_LIGHT_MODEL_AMBIENT:
- fparam[0] = INT_TO_FLOAT( params[0] );
- fparam[1] = INT_TO_FLOAT( params[1] );
- fparam[2] = INT_TO_FLOAT( params[2] );
- fparam[3] = INT_TO_FLOAT( params[3] );
- break;
- case GL_LIGHT_MODEL_LOCAL_VIEWER:
- case GL_LIGHT_MODEL_TWO_SIDE:
- case GL_LIGHT_MODEL_COLOR_CONTROL:
- fparam[0] = (GLfloat) params[0];
- break;
- default:
- /* Error will be caught later in gl_LightModelfv */
- ;
- }
- (*CC->API.LightModelfv)( CC, pname, fparam );
-}
-
-
-void GLAPIENTRY glLineWidth(CTX_ARG GLfloat width )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.LineWidth)(CC, width);
-}
-
-
-void GLAPIENTRY glLineStipple(CTX_ARG GLint factor, GLushort pattern )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.LineStipple)(CC, factor, pattern);
-}
-
-
-void GLAPIENTRY glListBase(CTX_ARG GLuint base )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.ListBase)(CC, base);
-}
-
-
-void GLAPIENTRY glLoadIdentity(CTX_VOID )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.LoadIdentity)( CC );
-}
-
-
-void GLAPIENTRY glLoadMatrixd(CTX_ARG const GLdouble *m )
-{
- GLfloat fm[16];
- GLuint i;
- GET_CONTEXT;
- CHECK_CONTEXT;
-
- for (i=0;i<16;i++) {
- fm[i] = (GLfloat) m[i];
- }
-
- (*CC->API.LoadMatrixf)( CC, fm );
-}
-
-
-void GLAPIENTRY glLoadMatrixf(CTX_ARG const GLfloat *m )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.LoadMatrixf)( CC, m );
-}
-
-
-void GLAPIENTRY glLoadName(CTX_ARG GLuint name )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.LoadName)(CC, name);
-}
-
-
-void GLAPIENTRY glLogicOp(CTX_ARG GLenum opcode )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.LogicOp)(CC, opcode);
-}
-
-
-
-void GLAPIENTRY glMap1d(CTX_ARG GLenum target, GLdouble u1, GLdouble u2, GLint stride,
- GLint order, const GLdouble *points )
-{
- GLfloat *pnts;
- GLboolean retain;
- GET_CONTEXT;
- CHECK_CONTEXT;
-
- pnts = gl_copy_map_points1d( target, stride, order, points );
- retain = CC->CompileFlag;
- (*CC->API.Map1f)( CC, target, u1, u2, stride, order, pnts, retain );
-}
-
-
-void GLAPIENTRY glMap1f(CTX_ARG GLenum target, GLfloat u1, GLfloat u2, GLint stride,
- GLint order, const GLfloat *points )
-{
- GLfloat *pnts;
- GLboolean retain;
- GET_CONTEXT;
- CHECK_CONTEXT;
-
- pnts = gl_copy_map_points1f( target, stride, order, points );
- retain = CC->CompileFlag;
- (*CC->API.Map1f)( CC, target, u1, u2, stride, order, pnts, retain );
-}
-
-
-void GLAPIENTRY glMap2d(CTX_ARG GLenum target,
- GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
- GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
- const GLdouble *points )
-{
- GLfloat *pnts;
- GLboolean retain;
- GET_CONTEXT;
- CHECK_CONTEXT;
-
- pnts = gl_copy_map_points2d( target, ustride, uorder,
- vstride, vorder, points );
- retain = CC->CompileFlag;
- (*CC->API.Map2f)( CC, target, u1, u2, ustride, uorder,
- v1, v2, vstride, vorder, pnts, retain );
-}
-
-
-void GLAPIENTRY glMap2f(CTX_ARG GLenum target,
- GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
- GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
- const GLfloat *points )
-{
- GLfloat *pnts;
- GLboolean retain;
- GET_CONTEXT;
- CHECK_CONTEXT;
-
- pnts = gl_copy_map_points2f( target, ustride, uorder,
- vstride, vorder, points );
- retain = CC->CompileFlag;
- (*CC->API.Map2f)( CC, target, u1, u2, ustride, uorder,
- v1, v2, vstride, vorder, pnts, retain );
-}
-
-
-void GLAPIENTRY glMapGrid1d(CTX_ARG GLint un, GLdouble u1, GLdouble u2 )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.MapGrid1f)( CC, un, (GLfloat) u1, (GLfloat) u2 );
-}
-
-
-void GLAPIENTRY glMapGrid1f(CTX_ARG GLint un, GLfloat u1, GLfloat u2 )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.MapGrid1f)( CC, un, u1, u2 );
-}
-
-
-void GLAPIENTRY glMapGrid2d(CTX_ARG GLint un, GLdouble u1, GLdouble u2,
- GLint vn, GLdouble v1, GLdouble v2 )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.MapGrid2f)( CC, un, (GLfloat) u1, (GLfloat) u2,
- vn, (GLfloat) v1, (GLfloat) v2 );
-}
-
-
-void GLAPIENTRY glMapGrid2f(CTX_ARG GLint un, GLfloat u1, GLfloat u2,
- GLint vn, GLfloat v1, GLfloat v2 )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.MapGrid2f)( CC, un, u1, u2, vn, v1, v2 );
-}
-
-
-void GLAPIENTRY glMaterialf(CTX_ARG GLenum face, GLenum pname, GLfloat param )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- gl_Materialfv( CC, face, pname, &param );
-}
-
-
-
-void GLAPIENTRY glMateriali(CTX_ARG GLenum face, GLenum pname, GLint param )
-{
- GLfloat fparam[4];
- GET_CONTEXT;
- CHECK_CONTEXT;
- fparam[0] = (GLfloat) param;
- gl_Materialfv( CC, face, pname, fparam );
-}
-
-
-void GLAPIENTRY glMaterialfv(CTX_ARG GLenum face, GLenum pname, const GLfloat *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- gl_Materialfv( CC, face, pname, params );
-}
-
-
-void GLAPIENTRY glMaterialiv(CTX_ARG GLenum face, GLenum pname, const GLint *params )
-{
- GLfloat fparam[4];
- GET_CONTEXT;
- CHECK_CONTEXT;
- switch (pname) {
- case GL_AMBIENT:
- case GL_DIFFUSE:
- case GL_SPECULAR:
- case GL_EMISSION:
- case GL_AMBIENT_AND_DIFFUSE:
- fparam[0] = INT_TO_FLOAT( params[0] );
- fparam[1] = INT_TO_FLOAT( params[1] );
- fparam[2] = INT_TO_FLOAT( params[2] );
- fparam[3] = INT_TO_FLOAT( params[3] );
- break;
- case GL_SHININESS:
- fparam[0] = (GLfloat) params[0];
- break;
- case GL_COLOR_INDEXES:
- fparam[0] = (GLfloat) params[0];
- fparam[1] = (GLfloat) params[1];
- fparam[2] = (GLfloat) params[2];
- break;
- default:
- /* Error will be caught later in gl_Materialfv */
- ;
- }
- gl_Materialfv( CC, face, pname, fparam );
-}
-
-
-void GLAPIENTRY glMatrixMode(CTX_ARG GLenum mode )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.MatrixMode)( CC, mode );
-}
-
-
-void GLAPIENTRY glMultMatrixd(CTX_ARG const GLdouble *m )
-{
- GLfloat fm[16];
- GLuint i;
- GET_CONTEXT;
- CHECK_CONTEXT;
-
- for (i=0;i<16;i++) {
- fm[i] = (GLfloat) m[i];
- }
-
- (*CC->API.MultMatrixf)( CC, fm );
-}
-
-
-void GLAPIENTRY glMultMatrixf(CTX_ARG const GLfloat *m )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.MultMatrixf)( CC, m );
-}
-
-
-void GLAPIENTRY glNewList(CTX_ARG GLuint list, GLenum mode )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.NewList)(CC, list, mode);
-}
-
-
-/* KW: Now that we build buffers for display lists the same way we
- * fill the vb, we can do the work here without a second function
- * call. The Flag member allows the identification of missing
- * (ie shared) normals.
- */
-#define NORMAL( x,y,z ) \
-{ \
- GLuint count; \
- GLfloat *normal; \
- GET_IMMEDIATE; \
- count = IM->Count; \
- IM->Flag[count] |= VERT_NORM; \
- normal = IM->Normal[count]; \
- ASSIGN_3V(normal, x,y,z); \
-}
-
-
-void GLAPIENTRY glNormal3b(CTX_ARG GLbyte nx, GLbyte ny, GLbyte nz )
-{
- NORMAL( BYTE_TO_FLOAT(nx),
- BYTE_TO_FLOAT(ny),
- BYTE_TO_FLOAT(nz) );
-}
-
-
-void GLAPIENTRY glNormal3d(CTX_ARG GLdouble nx, GLdouble ny, GLdouble nz )
-{
- NORMAL(nx,ny,nz);
-}
-
-
-void GLAPIENTRY glNormal3f(CTX_ARG GLfloat nx, GLfloat ny, GLfloat nz )
-{
- NORMAL(nx,ny,nz);
-}
-
-
-void GLAPIENTRY glNormal3i(CTX_ARG GLint nx, GLint ny, GLint nz )
-{
- NORMAL( INT_TO_FLOAT(nx),
- INT_TO_FLOAT(ny),
- INT_TO_FLOAT(nz) );
-}
-
-
-void GLAPIENTRY glNormal3s(CTX_ARG GLshort nx, GLshort ny, GLshort nz )
-{
- NORMAL( SHORT_TO_FLOAT(nx),
- SHORT_TO_FLOAT(ny),
- SHORT_TO_FLOAT(nz) );
-}
-
-
-void GLAPIENTRY glNormal3bv(CTX_ARG const GLbyte *v )
-{
- NORMAL( BYTE_TO_FLOAT(v[0]),
- BYTE_TO_FLOAT(v[1]),
- BYTE_TO_FLOAT(v[2]) );
-}
-
-
-void GLAPIENTRY glNormal3dv(CTX_ARG const GLdouble *v )
-{
- NORMAL( v[0], v[1], v[2] );
-}
-
-
-void GLAPIENTRY glNormal3fv(CTX_ARG const GLfloat *v )
-{
- NORMAL( v[0], v[1], v[2] );
-}
-
-
-void GLAPIENTRY glNormal3iv(CTX_ARG const GLint *v )
-{
- NORMAL( INT_TO_FLOAT(v[0]),
- INT_TO_FLOAT(v[1]),
- INT_TO_FLOAT(v[2]) );
-}
-
-
-void GLAPIENTRY glNormal3sv(CTX_ARG const GLshort *v )
-{
- NORMAL( SHORT_TO_FLOAT(v[0]),
- SHORT_TO_FLOAT(v[1]),
- SHORT_TO_FLOAT(v[2]) );
-}
-
diff --git a/xc/extras/Mesa/src/api2.c b/xc/extras/Mesa/src/api2.c
deleted file mode 100644
index 5df01ed74..000000000
--- a/xc/extras/Mesa/src/api2.c
+++ /dev/null
@@ -1,1362 +0,0 @@
-/* $Id: api2.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.1
- *
- * Copyright (C) 1999 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"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#ifndef XFree86Server
-#include <stdio.h>
-#include <stdlib.h>
-#else
-#include "GL/xf86glx.h"
-#endif
-#include "api.h"
-#include "context.h"
-#include "varray.h"
-#include "image.h"
-#include "macros.h"
-#include "matrix.h"
-#include "teximage.h"
-#include "types.h"
-#include "vb.h"
-#endif
-
-
-/*
- * Part 2 of API functions
- */
-
-void GLAPIENTRY glOrtho(CTX_ARG GLdouble left, GLdouble right,
- GLdouble bottom, GLdouble top,
- GLdouble nearval, GLdouble farval )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Ortho)(CC, left, right, bottom, top, nearval, farval);
-}
-
-
-void GLAPIENTRY glPassThrough(CTX_ARG GLfloat token )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PassThrough)(CC, token);
-}
-
-
-void GLAPIENTRY glPixelMapfv(CTX_ARG GLenum map, GLint mapsize, const GLfloat *values )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PixelMapfv)( CC, map, mapsize, values );
-}
-
-
-void GLAPIENTRY glPixelMapuiv(CTX_ARG GLenum map, GLint mapsize, const GLuint *values )
-{
- GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
- GLint i;
- GET_CONTEXT;
- CHECK_CONTEXT;
-
- if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
- for (i=0;i<mapsize;i++) {
- fvalues[i] = (GLfloat) values[i];
- }
- }
- else {
- for (i=0;i<mapsize;i++) {
- fvalues[i] = UINT_TO_FLOAT( values[i] );
- }
- }
- (*CC->API.PixelMapfv)( CC, map, mapsize, fvalues );
-}
-
-
-
-void GLAPIENTRY glPixelMapusv(CTX_ARG GLenum map, GLint mapsize, const GLushort *values )
-{
- GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
- GLint i;
- GET_CONTEXT;
- CHECK_CONTEXT;
-
- if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
- for (i=0;i<mapsize;i++) {
- fvalues[i] = (GLfloat) values[i];
- }
- }
- else {
- for (i=0;i<mapsize;i++) {
- fvalues[i] = USHORT_TO_FLOAT( values[i] );
- }
- }
- (*CC->API.PixelMapfv)( CC, map, mapsize, fvalues );
-}
-
-
-void GLAPIENTRY glPixelStoref(CTX_ARG GLenum pname, GLfloat param )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PixelStorei)( CC, pname, (GLint) param );
-}
-
-
-void GLAPIENTRY glPixelStorei(CTX_ARG GLenum pname, GLint param )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PixelStorei)( CC, pname, param );
-}
-
-
-void GLAPIENTRY glPixelTransferf(CTX_ARG GLenum pname, GLfloat param )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PixelTransferf)(CC, pname, param);
-}
-
-
-void GLAPIENTRY glPixelTransferi(CTX_ARG GLenum pname, GLint param )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PixelTransferf)(CC, pname, (GLfloat) param);
-}
-
-
-void GLAPIENTRY glPixelZoom(CTX_ARG GLfloat xfactor, GLfloat yfactor )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PixelZoom)(CC, xfactor, yfactor);
-}
-
-
-void GLAPIENTRY glPointSize(CTX_ARG GLfloat size )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PointSize)(CC, size);
-}
-
-
-void GLAPIENTRY glPolygonMode(CTX_ARG GLenum face, GLenum mode )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PolygonMode)(CC, face, mode);
-}
-
-
-void GLAPIENTRY glPolygonOffset(CTX_ARG GLfloat factor, GLfloat units )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PolygonOffset)( CC, factor, units );
-}
-
-
-/* GL_EXT_polygon_offset */
-void GLAPIENTRY glPolygonOffsetEXT(CTX_ARG GLfloat factor, GLfloat bias )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PolygonOffset)( CC, factor, bias * DEPTH_SCALE );
-}
-
-
-void GLAPIENTRY glPolygonStipple(CTX_ARG const GLubyte *pattern )
-{
- GLuint unpackedPattern[32];
- GET_CONTEXT;
- CHECK_CONTEXT;
- gl_unpack_polygon_stipple( CC, pattern, unpackedPattern );
- (*CC->API.PolygonStipple)(CC, unpackedPattern);
-}
-
-
-void GLAPIENTRY glPopAttrib(CTX_VOID )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PopAttrib)(CC);
-}
-
-
-void GLAPIENTRY glPopClientAttrib(CTX_VOID )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PopClientAttrib)(CC);
-}
-
-
-void GLAPIENTRY glPopMatrix(CTX_VOID )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PopMatrix)( CC );
-}
-
-
-void GLAPIENTRY glPopName(CTX_VOID )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PopName)(CC);
-}
-
-
-void GLAPIENTRY glPrioritizeTextures(CTX_ARG GLsizei n, const GLuint *textures,
- const GLclampf *priorities )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PrioritizeTextures)(CC, n, textures, priorities);
-}
-
-
-void GLAPIENTRY glPushMatrix(CTX_VOID )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PushMatrix)( CC );
-}
-
-
-void GLAPIENTRY glRasterPos2d(CTX_ARG GLdouble x, GLdouble y )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos2f(CTX_ARG GLfloat x, GLfloat y )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos2i(CTX_ARG GLint x, GLint y )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos2s(CTX_ARG GLshort x, GLshort y )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos3d(CTX_ARG GLdouble x, GLdouble y, GLdouble z )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos3f(CTX_ARG GLfloat x, GLfloat y, GLfloat z )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos3i(CTX_ARG GLint x, GLint y, GLint z )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos3s(CTX_ARG GLshort x, GLshort y, GLshort z )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos4d(CTX_ARG GLdouble x, GLdouble y, GLdouble z, GLdouble w )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y,
- (GLfloat) z, (GLfloat) w );
-}
-
-
-void GLAPIENTRY glRasterPos4f(CTX_ARG GLfloat x, GLfloat y, GLfloat z, GLfloat w )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, x, y, z, w );
-}
-
-
-void GLAPIENTRY glRasterPos4i(CTX_ARG GLint x, GLint y, GLint z, GLint w )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y,
- (GLfloat) z, (GLfloat) w );
-}
-
-
-void GLAPIENTRY glRasterPos4s(CTX_ARG GLshort x, GLshort y, GLshort z, GLshort w )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y,
- (GLfloat) z, (GLfloat) w );
-}
-
-
-void GLAPIENTRY glRasterPos2dv(CTX_ARG const GLdouble *v )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos2fv(CTX_ARG const GLfloat *v )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos2iv(CTX_ARG const GLint *v )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos2sv(CTX_ARG const GLshort *v )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos3dv(CTX_ARG const GLdouble *v )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos3fv(CTX_ARG const GLfloat *v )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos3iv(CTX_ARG const GLint *v )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos3sv(CTX_ARG const GLshort *v )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], 1.0F );
-}
-
-
-void GLAPIENTRY glRasterPos4dv(CTX_ARG const GLdouble *v )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], (GLfloat) v[3] );
-}
-
-
-void GLAPIENTRY glRasterPos4fv(CTX_ARG const GLfloat *v )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, v[0], v[1], v[2], v[3] );
-}
-
-
-void GLAPIENTRY glRasterPos4iv(CTX_ARG const GLint *v )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], (GLfloat) v[3] );
-}
-
-
-void GLAPIENTRY glRasterPos4sv(CTX_ARG const GLshort *v )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], (GLfloat) v[3] );
-}
-
-
-void GLAPIENTRY glReadBuffer(CTX_ARG GLenum mode )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.ReadBuffer)( CC, mode );
-}
-
-
-void GLAPIENTRY glReadPixels(CTX_ARG GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type, GLvoid *pixels )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.ReadPixels)( CC, x, y, width, height, format, type, pixels );
-}
-
-
-void GLAPIENTRY glRectd(CTX_ARG GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Rectf)( CC, (GLfloat) x1, (GLfloat) y1,
- (GLfloat) x2, (GLfloat) y2 );
-}
-
-
-void GLAPIENTRY glRectf(CTX_ARG GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Rectf)( CC, x1, y1, x2, y2 );
-}
-
-
-void GLAPIENTRY glRecti(CTX_ARG GLint x1, GLint y1, GLint x2, GLint y2 )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Rectf)( CC, (GLfloat) x1, (GLfloat) y1,
- (GLfloat) x2, (GLfloat) y2 );
-}
-
-
-void GLAPIENTRY glRects(CTX_ARG GLshort x1, GLshort y1, GLshort x2, GLshort y2 )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Rectf)( CC, (GLfloat) x1, (GLfloat) y1,
- (GLfloat) x2, (GLfloat) y2 );
-}
-
-
-void GLAPIENTRY glRectdv(CTX_ARG const GLdouble *v1, const GLdouble *v2 )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Rectf)(CC, (GLfloat) v1[0], (GLfloat) v1[1],
- (GLfloat) v2[0], (GLfloat) v2[1]);
-}
-
-
-void GLAPIENTRY glRectfv(CTX_ARG const GLfloat *v1, const GLfloat *v2 )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Rectf)(CC, v1[0], v1[1], v2[0], v2[1]);
-}
-
-
-void GLAPIENTRY glRectiv(CTX_ARG const GLint *v1, const GLint *v2 )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Rectf)( CC, (GLfloat) v1[0], (GLfloat) v1[1],
- (GLfloat) v2[0], (GLfloat) v2[1] );
-}
-
-
-void GLAPIENTRY glRectsv(CTX_ARG const GLshort *v1, const GLshort *v2 )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Rectf)(CC, (GLfloat) v1[0], (GLfloat) v1[1],
- (GLfloat) v2[0], (GLfloat) v2[1]);
-}
-
-
-void GLAPIENTRY glScissor(CTX_ARG GLint x, GLint y, GLsizei width, GLsizei height)
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Scissor)(CC, x, y, width, height);
-}
-
-
-GLboolean GLAPIENTRY glIsEnabled(CTX_ARG GLenum cap )
-{
- GET_CONTEXT;
- CHECK_CONTEXT_RETURN(GL_FALSE);
- return (*CC->API.IsEnabled)( CC, cap );
-}
-
-
-
-void GLAPIENTRY glPushAttrib(CTX_ARG GLbitfield mask )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PushAttrib)(CC, mask);
-}
-
-
-void GLAPIENTRY glPushClientAttrib(CTX_ARG GLbitfield mask )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PushClientAttrib)(CC, mask);
-}
-
-
-void GLAPIENTRY glPushName(CTX_ARG GLuint name )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PushName)(CC, name);
-}
-
-
-GLint GLAPIENTRY glRenderMode(CTX_ARG GLenum mode )
-{
- GET_CONTEXT;
- CHECK_CONTEXT_RETURN(0);
- return (*CC->API.RenderMode)(CC, mode);
-}
-
-
-void GLAPIENTRY glRotated(CTX_ARG GLdouble angle, GLdouble x, GLdouble y, GLdouble z )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Rotatef)( CC, (GLfloat) angle,
- (GLfloat) x, (GLfloat) y, (GLfloat) z );
-}
-
-
-void GLAPIENTRY glRotatef(CTX_ARG GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Rotatef)( CC, angle, x, y, z );
-}
-
-
-void GLAPIENTRY glSelectBuffer(CTX_ARG GLsizei size, GLuint *buffer )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.SelectBuffer)(CC, size, buffer);
-}
-
-
-void GLAPIENTRY glScaled(CTX_ARG GLdouble x, GLdouble y, GLdouble z )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Scalef)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z );
-}
-
-
-void GLAPIENTRY glScalef(CTX_ARG GLfloat x, GLfloat y, GLfloat z )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Scalef)( CC, x, y, z );
-}
-
-
-void GLAPIENTRY glShadeModel(CTX_ARG GLenum mode )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.ShadeModel)(CC, mode);
-}
-
-
-void GLAPIENTRY glStencilFunc(CTX_ARG GLenum func, GLint ref, GLuint mask )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.StencilFunc)(CC, func, ref, mask);
-}
-
-
-void GLAPIENTRY glStencilMask(CTX_ARG GLuint mask )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.StencilMask)(CC, mask);
-}
-
-
-void GLAPIENTRY glStencilOp(CTX_ARG GLenum fail, GLenum zfail, GLenum zpass )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.StencilOp)(CC, fail, zfail, zpass);
-}
-
-#define TEXCOORD1(s) \
-{ \
- GLuint count; \
- GLfloat *tc; \
- GET_IMMEDIATE; \
- count = IM->Count; \
- IM->Flag[count] |= VERT_TEX0_1; \
- tc = IM->TexCoord[0][count]; \
- ASSIGN_4V(tc,s,0,0,1); \
-}
-
-#define TEXCOORD2(s,t) \
-{ \
- GLuint count; \
- GLfloat *tc; \
- GET_IMMEDIATE; \
- count = IM->Count; \
- IM->Flag[count] |= VERT_TEX0_12; \
- tc = IM->TexCoord[0][count]; \
- ASSIGN_4V(tc, s,t,0,1); \
-}
-
-#define TEXCOORD3(s,t,u) \
-{ \
- GLuint count; \
- GLfloat *tc; \
- GET_IMMEDIATE; \
- count = IM->Count; \
- IM->Flag[count] |= VERT_TEX0_123; \
- tc = IM->TexCoord[0][count]; \
- ASSIGN_4V(tc, s,t,u,1); \
-}
-
-#define TEXCOORD4(s,t,u,v) \
-{ \
- GLuint count; \
- GLfloat *tc; \
- GET_IMMEDIATE; \
- count = IM->Count; \
- IM->Flag[count] |= VERT_TEX0_1234; \
- tc = IM->TexCoord[0][count]; \
- ASSIGN_4V(tc, s,t,u,v); \
-}
-
-
-void GLAPIENTRY glTexCoord1d(CTX_ARG GLdouble s )
-{
- TEXCOORD1(s);
-}
-
-
-void GLAPIENTRY glTexCoord1f(CTX_ARG GLfloat s )
-{
- TEXCOORD1(s);
-}
-
-
-void GLAPIENTRY glTexCoord1i(CTX_ARG GLint s )
-{
- TEXCOORD1(s);
-}
-
-
-void GLAPIENTRY glTexCoord1s(CTX_ARG GLshort s )
-{
- TEXCOORD1(s);
-}
-
-
-void GLAPIENTRY glTexCoord2d(CTX_ARG GLdouble s, GLdouble t )
-{
- TEXCOORD2(s,t);
-}
-
-void GLAPIENTRY glTexCoord2f(CTX_ARG GLfloat s, GLfloat t )
-{
- TEXCOORD2(*(&s),*&t);
-}
-
-
-void GLAPIENTRY glTexCoord2s(CTX_ARG GLshort s, GLshort t )
-{
- TEXCOORD2(s,t);
-}
-
-void GLAPIENTRY glTexCoord2i(CTX_ARG GLint s, GLint t )
-{
- TEXCOORD2(s,t);
-}
-
-
-void GLAPIENTRY glTexCoord3d(CTX_ARG GLdouble s, GLdouble t, GLdouble r )
-{
- TEXCOORD3(s,t,r);
-}
-
-
-void GLAPIENTRY glTexCoord3f(CTX_ARG GLfloat s, GLfloat t, GLfloat r )
-{
- TEXCOORD3(s,t,r);
-}
-
-
-void GLAPIENTRY glTexCoord3i(CTX_ARG GLint s, GLint t, GLint r )
-{
- TEXCOORD3(s,t,r);
-}
-
-
-void GLAPIENTRY glTexCoord3s(CTX_ARG GLshort s, GLshort t, GLshort r )
-{
- TEXCOORD3(s,t,r);
-}
-
-
-void GLAPIENTRY glTexCoord4d(CTX_ARG GLdouble s, GLdouble t, GLdouble r, GLdouble q )
-{
- TEXCOORD4(s,t,r,q)
-}
-
-
-void GLAPIENTRY glTexCoord4f(CTX_ARG GLfloat s, GLfloat t, GLfloat r, GLfloat q )
-{
- TEXCOORD4(s,t,r,q)
-}
-
-
-void GLAPIENTRY glTexCoord4i(CTX_ARG GLint s, GLint t, GLint r, GLint q )
-{
- TEXCOORD4(s,t,r,q)
-}
-
-
-void GLAPIENTRY glTexCoord4s(CTX_ARG GLshort s, GLshort t, GLshort r, GLshort q )
-{
- TEXCOORD4(s,t,r,q)
-}
-
-
-void GLAPIENTRY glTexCoord1dv(CTX_ARG const GLdouble *v )
-{
- TEXCOORD1(v[0]);
-}
-
-
-void GLAPIENTRY glTexCoord1fv(CTX_ARG const GLfloat *v )
-{
- TEXCOORD1(v[0]);
-}
-
-
-void GLAPIENTRY glTexCoord1iv(CTX_ARG const GLint *v )
-{
- TEXCOORD1(v[0]);
-}
-
-
-void GLAPIENTRY glTexCoord1sv(CTX_ARG const GLshort *v )
-{
- TEXCOORD1(v[0]);
-}
-
-
-void GLAPIENTRY glTexCoord2dv(CTX_ARG const GLdouble *v )
-{
- TEXCOORD2(v[0],v[1]);
-}
-
-
-void GLAPIENTRY glTexCoord2fv(CTX_ARG const GLfloat *v )
-{
- TEXCOORD2(v[0],v[1]);
-}
-
-
-void GLAPIENTRY glTexCoord2iv(CTX_ARG const GLint *v )
-{
- TEXCOORD2(v[0],v[1]);
-}
-
-
-void GLAPIENTRY glTexCoord2sv(CTX_ARG const GLshort *v )
-{
- TEXCOORD2(v[0],v[1]);
-}
-
-
-void GLAPIENTRY glTexCoord3dv(CTX_ARG const GLdouble *v )
-{
- TEXCOORD2(v[0],v[1]);
-}
-
-
-void GLAPIENTRY glTexCoord3fv(CTX_ARG const GLfloat *v )
-{
- TEXCOORD3(v[0],v[1],v[2]);
-}
-
-
-void GLAPIENTRY glTexCoord3iv(CTX_ARG const GLint *v )
-{
- TEXCOORD3(v[0],v[1],v[2]);
-}
-
-
-void GLAPIENTRY glTexCoord3sv(CTX_ARG const GLshort *v )
-{
- TEXCOORD3(v[0],v[1],v[2]);
-}
-
-
-void GLAPIENTRY glTexCoord4dv(CTX_ARG const GLdouble *v )
-{
- TEXCOORD4(v[0],v[1],v[2],v[3]);
-}
-
-
-void GLAPIENTRY glTexCoord4fv(CTX_ARG const GLfloat *v )
-{
-
- TEXCOORD4(v[0],v[1],v[2],v[3]);
-}
-
-
-void GLAPIENTRY glTexCoord4iv(CTX_ARG const GLint *v )
-{
- TEXCOORD4(v[0],v[1],v[2],v[3]);
-}
-
-
-void GLAPIENTRY glTexCoord4sv(CTX_ARG const GLshort *v )
-{
- TEXCOORD4(v[0],v[1],v[2],v[3]);
-}
-
-
-
-void GLAPIENTRY glTexGend(CTX_ARG GLenum coord, GLenum pname, GLdouble param )
-{
- GLfloat p = (GLfloat) param;
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.TexGenfv)( CC, coord, pname, &p );
-}
-
-
-void GLAPIENTRY glTexGenf(CTX_ARG GLenum coord, GLenum pname, GLfloat param )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.TexGenfv)( CC, coord, pname, &param );
-}
-
-
-void GLAPIENTRY glTexGeni(CTX_ARG GLenum coord, GLenum pname, GLint param )
-{
- GLfloat p = (GLfloat) param;
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.TexGenfv)( CC, coord, pname, &p );
-}
-
-
-void GLAPIENTRY glTexGendv(CTX_ARG GLenum coord, GLenum pname, const GLdouble *params )
-{
- GLfloat p[4];
- GET_CONTEXT;
- CHECK_CONTEXT;
- p[0] = params[0];
- p[1] = params[1];
- p[2] = params[2];
- p[3] = params[3];
- (*CC->API.TexGenfv)( CC, coord, pname, p );
-}
-
-
-void GLAPIENTRY glTexGeniv(CTX_ARG GLenum coord, GLenum pname, const GLint *params )
-{
- GLfloat p[4];
- GET_CONTEXT;
- CHECK_CONTEXT;
- p[0] = params[0];
- p[1] = params[1];
- p[2] = params[2];
- p[3] = params[3];
- (*CC->API.TexGenfv)( CC, coord, pname, p );
-}
-
-
-void GLAPIENTRY glTexGenfv(CTX_ARG GLenum coord, GLenum pname, const GLfloat *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.TexGenfv)( CC, coord, pname, params );
-}
-
-
-
-
-void GLAPIENTRY glTexEnvf(CTX_ARG GLenum target, GLenum pname, GLfloat param )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.TexEnvfv)( CC, target, pname, &param );
-}
-
-
-
-void GLAPIENTRY glTexEnvi(CTX_ARG GLenum target, GLenum pname, GLint param )
-{
- GLfloat p[4];
- GET_CONTEXT;
- p[0] = (GLfloat) param;
- p[1] = p[2] = p[3] = 0.0;
- CHECK_CONTEXT;
- (*CC->API.TexEnvfv)( CC, target, pname, p );
-}
-
-
-
-void GLAPIENTRY glTexEnvfv(CTX_ARG GLenum target, GLenum pname, const GLfloat *param )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.TexEnvfv)( CC, target, pname, param );
-}
-
-
-
-void GLAPIENTRY glTexEnviv(CTX_ARG GLenum target, GLenum pname, const GLint *param )
-{
- GLfloat p[4];
- GET_CONTEXT;
- p[0] = INT_TO_FLOAT( param[0] );
- p[1] = INT_TO_FLOAT( param[1] );
- p[2] = INT_TO_FLOAT( param[2] );
- p[3] = INT_TO_FLOAT( param[3] );
- CHECK_CONTEXT;
- (*CC->API.TexEnvfv)( CC, target, pname, p );
-}
-
-
-void GLAPIENTRY glTexImage1D(CTX_ARG GLenum target, GLint level,
- GLint internalformat,
- GLsizei width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.TexImage1D)( CC, target, level, internalformat,
- width, border, format, type, pixels );
-}
-
-
-void GLAPIENTRY glTexImage2D(CTX_ARG GLenum target, GLint level,
- GLint internalformat,
- GLsizei width, GLsizei height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.TexImage2D)( CC, target, level, internalformat,
- width, height, border, format, type, pixels );
-}
-
-
-void GLAPIENTRY glTexImage3D(CTX_ARG GLenum target, GLint level,
- GLint internalformat,
- GLsizei width, GLsizei height, GLsizei depth,
- GLint border, GLenum format, GLenum type,
- const GLvoid *pixels )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.TexImage3D)( CC, target, level, internalformat,
- width, height, depth, border, format, type,
- pixels );
-}
-
-
-void GLAPIENTRY glTexParameterf(CTX_ARG GLenum target, GLenum pname, GLfloat param )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.TexParameterfv)( CC, target, pname, &param );
-}
-
-
-void GLAPIENTRY glTexParameteri(CTX_ARG GLenum target, GLenum pname, GLint param )
-{
- GLfloat fparam[4];
- GET_CONTEXT;
- fparam[0] = (GLfloat) param;
- fparam[1] = fparam[2] = fparam[3] = 0.0;
- CHECK_CONTEXT;
- (*CC->API.TexParameterfv)( CC, target, pname, fparam );
-}
-
-
-void GLAPIENTRY glTexParameterfv(CTX_ARG GLenum target, GLenum pname, const GLfloat *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.TexParameterfv)( CC, target, pname, params );
-}
-
-
-void GLAPIENTRY glTexParameteriv(CTX_ARG GLenum target, GLenum pname, const GLint *params )
-{
- GLfloat p[4];
- GET_CONTEXT;
- CHECK_CONTEXT;
- if (pname==GL_TEXTURE_BORDER_COLOR) {
- p[0] = INT_TO_FLOAT( params[0] );
- p[1] = INT_TO_FLOAT( params[1] );
- p[2] = INT_TO_FLOAT( params[2] );
- p[3] = INT_TO_FLOAT( params[3] );
- }
- else {
- p[0] = (GLfloat) params[0];
- p[1] = (GLfloat) params[1];
- p[2] = (GLfloat) params[2];
- p[3] = (GLfloat) params[3];
- }
- (*CC->API.TexParameterfv)( CC, target, pname, p );
-}
-
-
-void GLAPIENTRY glTexSubImage1D(CTX_ARG GLenum target, GLint level,
- GLint xoffset, GLsizei width, GLenum format,
- GLenum type, const GLvoid *pixels )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.TexSubImage1D)( CC, target, level, xoffset, width,
- format, type, pixels );
-}
-
-
-void GLAPIENTRY glTexSubImage2D(CTX_ARG GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.TexSubImage2D)( CC, target, level, xoffset, yoffset,
- width, height, format, type, pixels );
-}
-
-
-void GLAPIENTRY glTexSubImage3D(CTX_ARG GLenum target, GLint level,
- GLint xoffset,
- GLint yoffset, GLint zoffset, GLsizei width,
- GLsizei height, GLsizei depth, GLenum format,
- GLenum type, const GLvoid *pixels )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.TexSubImage3D)( CC, target, level, xoffset, yoffset, zoffset,
- width, height, depth, format, type, pixels );
-}
-
-
-void GLAPIENTRY glTranslated(CTX_ARG GLdouble x, GLdouble y, GLdouble z )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Translatef)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z );
-}
-
-
-void GLAPIENTRY glTranslatef(CTX_ARG GLfloat x, GLfloat y, GLfloat z )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Translatef)( CC, x, y, z );
-}
-
-/* KW: Run into bad problems in reset_vb/fixup_input if we don't fully pad
- * the incoming vertices.
- */
-#define VERTEX2(IM, x,y) \
-{ \
- GLuint count = IM->Count++; \
- GLfloat *dest = IM->Obj[count]; \
- IM->Flag[count] |= VERT_OBJ_2; \
- ASSIGN_4V(dest, x, y, 0, 1); \
- if (dest == IM->Obj[VB_MAX-1]) \
- IM->maybe_transform_vb( IM ); \
-}
-
-#define VERTEX3(IM,x,y,z) \
-{ \
- GLuint count = IM->Count++; \
- GLfloat *dest = IM->Obj[count]; \
- IM->Flag[count] |= VERT_OBJ_23; \
- ASSIGN_4V(dest, x, y, z, 1); \
- if (dest == IM->Obj[VB_MAX-1]) \
- IM->maybe_transform_vb( IM ); \
-}
-
-#define VERTEX4(IM, x,y,z,w) \
-{ \
- GLuint count = IM->Count++; \
- GLfloat *dest = IM->Obj[count]; \
- IM->Flag[count] |= VERT_OBJ_234; \
- ASSIGN_4V(dest, x, y, z, w); \
- if (dest == IM->Obj[VB_MAX-1]) \
- IM->maybe_transform_vb( IM ); \
-}
-
-
-void GLAPIENTRY glVertex2d(CTX_ARG GLdouble x, GLdouble y )
-{
- GET_IMMEDIATE;
- VERTEX2( IM, (GLfloat) x, (GLfloat) y );
-}
-
-
-void GLAPIENTRY glVertex2f(CTX_ARG GLfloat x, GLfloat y )
-{
- GET_IMMEDIATE;
- VERTEX2( IM, *(&x), *(&y) );
-}
-
-/* Internal use:
- */
-void gl_Vertex2f( GLcontext *ctx, GLfloat x, GLfloat y )
-{
- struct immediate *im = ctx->input;
- VERTEX2( im, x, y );
-}
-
-void GLAPIENTRY glVertex2i(CTX_ARG GLint x, GLint y )
-{
- GET_IMMEDIATE;
- VERTEX2( IM, (GLfloat) x, (GLfloat) y );
-}
-
-void GLAPIENTRY glVertex2s(CTX_ARG GLshort x, GLshort y )
-{
- GET_IMMEDIATE;
- VERTEX2( IM, (GLfloat) x, (GLfloat) y );
-}
-
-void GLAPIENTRY glVertex3d(CTX_ARG GLdouble x, GLdouble y, GLdouble z )
-{
- GET_IMMEDIATE;
- VERTEX3( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z );
-}
-
-
-void GLAPIENTRY glVertex3f(CTX_ARG GLfloat x, GLfloat y, GLfloat z )
-{
- GET_IMMEDIATE;
- VERTEX3( IM, *(&x), *(&y), *(&z) );
-}
-
-void GLAPIENTRY glVertex3i(CTX_ARG GLint x, GLint y, GLint z )
-{
- GET_IMMEDIATE;
- VERTEX3( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z );
-}
-
-
-void GLAPIENTRY glVertex3s(CTX_ARG GLshort x, GLshort y, GLshort z )
-{
- GET_IMMEDIATE;
- VERTEX3( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z );
-}
-
-
-void GLAPIENTRY glVertex4d(CTX_ARG GLdouble x, GLdouble y, GLdouble z, GLdouble w )
-{
- GET_IMMEDIATE;
- VERTEX4( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
-}
-
-
-void GLAPIENTRY glVertex4f(CTX_ARG GLfloat x, GLfloat y, GLfloat z, GLfloat w )
-{
- GET_IMMEDIATE;
- VERTEX4( IM, *(&x), *(&y), *(&z), *(&w) );
-}
-
-
-void GLAPIENTRY glVertex4i(CTX_ARG GLint x, GLint y, GLint z, GLint w )
-{
- GET_IMMEDIATE;
- VERTEX4( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
-}
-
-
-void GLAPIENTRY glVertex4s(CTX_ARG GLshort x, GLshort y, GLshort z, GLshort w )
-{
- GET_IMMEDIATE;
- VERTEX4( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
-}
-
-
-void GLAPIENTRY glVertex2dv(CTX_ARG const GLdouble *v )
-{
- GET_IMMEDIATE;
- VERTEX2( IM, (GLfloat) v[0], (GLfloat) v[1] );
-}
-
-
-void GLAPIENTRY glVertex2fv(CTX_ARG const GLfloat *v )
-{
- GET_IMMEDIATE;
- VERTEX2( IM, v[0], v[1] );
-}
-
-
-void GLAPIENTRY glVertex2iv(CTX_ARG const GLint *v )
-{
- GET_IMMEDIATE;
- VERTEX2( IM, (GLfloat) v[0], (GLfloat) v[1] );
-}
-
-
-void GLAPIENTRY glVertex2sv(CTX_ARG const GLshort *v )
-{
- GET_IMMEDIATE;
- VERTEX2( IM, (GLfloat) v[0], (GLfloat) v[1] );
-}
-
-
-void GLAPIENTRY glVertex3dv(CTX_ARG const GLdouble *v )
-{
- GET_IMMEDIATE;
- VERTEX3( IM, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
-}
-
-
-void GLAPIENTRY glVertex3fv(CTX_ARG const GLfloat *v )
-{
- GET_IMMEDIATE;
- VERTEX3( IM, v[0], v[1], v[2] );
-}
-
-void GLAPIENTRY glVertex3iv(CTX_ARG const GLint *v )
-{
- GET_IMMEDIATE;
- VERTEX3( IM, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
-}
-
-
-void GLAPIENTRY glVertex3sv(CTX_ARG const GLshort *v )
-{
- GET_IMMEDIATE;
- VERTEX3( IM, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
-}
-
-
-void GLAPIENTRY glVertex4dv(CTX_ARG const GLdouble *v )
-{
- GET_IMMEDIATE;
- VERTEX4( IM,
- (GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], (GLfloat) v[3] );
-}
-
-
-void GLAPIENTRY glVertex4fv(CTX_ARG const GLfloat *v )
-{
- GET_IMMEDIATE;
- VERTEX4( IM, v[0], v[1], v[2], v[3] );
-}
-
-
-void GLAPIENTRY glVertex4iv(CTX_ARG const GLint *v )
-{
- GET_IMMEDIATE;
- VERTEX4( IM,
- (GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], (GLfloat) v[3] );
-}
-
-
-void GLAPIENTRY glVertex4sv(CTX_ARG const GLshort *v )
-{
- GET_IMMEDIATE;
- VERTEX4( IM,
- (GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], (GLfloat) v[3] );
-}
-
-
-
-void GLAPIENTRY glViewport(CTX_ARG GLint x, GLint y, GLsizei width, GLsizei height )
-{
- GET_CONTEXT;
- (*CC->API.Viewport)( CC, x, y, width, height );
-}
-
diff --git a/xc/extras/Mesa/src/apiext.c b/xc/extras/Mesa/src/apiext.c
deleted file mode 100644
index 286261146..000000000
--- a/xc/extras/Mesa/src/apiext.c
+++ /dev/null
@@ -1,1297 +0,0 @@
-/* $Id: apiext.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.1
- *
- * Copyright (C) 1999 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"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#ifndef XFree86Server
-#include <stdio.h>
-#include <stdlib.h>
-#else
-#include "GL/xf86glx.h"
-#endif
-#include "api.h"
-#include "context.h"
-#include "cva.h"
-#include "image.h"
-#include "types.h"
-#include "varray.h"
-#endif
-
-#if !defined(CTX_ARG)
- #define CTX_ARG
- #define CTX_VOID
- #define CTX_PRM
-#endif
-
-/*
- * Extension API functions
- */
-
-
-
-/*
- * GL_EXT_blend_minmax
- */
-
-void GLAPIENTRY glBlendEquationEXT(CTX_ARG GLenum mode )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.BlendEquation)(CC, mode);
-}
-
-
-
-
-/*
- * GL_EXT_blend_color
- */
-
-void GLAPIENTRY glBlendColorEXT(CTX_ARG GLclampf red, GLclampf green,
- GLclampf blue, GLclampf alpha )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.BlendColor)(CC, red, green, blue, alpha);
-}
-
-
-
-
-/*
- * GL_EXT_vertex_array
- */
-
-void GLAPIENTRY glVertexPointerEXT(CTX_ARG GLint size, GLenum type, GLsizei stride,
- GLsizei count, const GLvoid *ptr )
-{
- glVertexPointer(CTX_PRM size, type, stride, ptr );
- (void) count;
-}
-
-
-void GLAPIENTRY glNormalPointerEXT(CTX_ARG GLenum type, GLsizei stride, GLsizei count,
- const GLvoid *ptr )
-{
- glNormalPointer(CTX_PRM type, stride, ptr);
- (void) count;
-}
-
-
-void GLAPIENTRY glColorPointerEXT(CTX_ARG GLint size, GLenum type, GLsizei stride,
- GLsizei count, const GLvoid *ptr )
-{
- glColorPointer(CTX_PRM size, type, stride, ptr);
- (void) count;
-}
-
-
-void GLAPIENTRY glIndexPointerEXT(CTX_ARG GLenum type, GLsizei stride,
- GLsizei count, const GLvoid *ptr )
-{
- glIndexPointer(CTX_PRM type, stride, ptr);
- (void) count;
-}
-
-
-void GLAPIENTRY glTexCoordPointerEXT(CTX_ARG GLint size, GLenum type, GLsizei stride,
- GLsizei count, const GLvoid *ptr )
-{
- glTexCoordPointer(CTX_PRM size, type, stride, ptr);
- (void) count;
-}
-
-
-void GLAPIENTRY glEdgeFlagPointerEXT(CTX_ARG GLsizei stride, GLsizei count,
- const GLboolean *ptr )
-{
- glEdgeFlagPointer(CTX_PRM stride, ptr);
- (void) count;
-}
-
-
-void GLAPIENTRY glGetPointervEXT(CTX_ARG GLenum pname, GLvoid **params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetPointerv)(CC, pname, params);
-}
-
-
-/* glArrayElementEXT now hiding in api1.c.
- */
-
-
-void GLAPIENTRY glDrawArraysEXT(CTX_ARG GLenum mode, GLint first, GLsizei count )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- gl_DrawArrays(CC, mode, first, count);
-}
-
-
-
-
-/*
- * GL_EXT_texture_object
- */
-
-GLboolean GLAPIENTRY glAreTexturesResidentEXT(CTX_ARG GLsizei n,
- const GLuint *textures,
- GLboolean *residences )
-{
- return glAreTexturesResident(CTX_PRM n, textures, residences );
-}
-
-
-void GLAPIENTRY glBindTextureEXT(CTX_ARG GLenum target, GLuint texture )
-{
- glBindTexture(CTX_PRM target, texture );
-}
-
-
-void GLAPIENTRY glDeleteTexturesEXT(CTX_ARG GLsizei n, const GLuint *textures)
-{
- glDeleteTextures(CTX_PRM n, textures );
-}
-
-
-void GLAPIENTRY glGenTexturesEXT(CTX_ARG GLsizei n, GLuint *textures )
-{
- glGenTextures(CTX_PRM n, textures );
-}
-
-
-GLboolean GLAPIENTRY glIsTextureEXT(CTX_ARG GLuint texture )
-{
- return glIsTexture(CTX_PRM texture );
-}
-
-
-void GLAPIENTRY glPrioritizeTexturesEXT(CTX_ARG GLsizei n, const GLuint *textures,
- const GLclampf *priorities )
-{
- glPrioritizeTextures(CTX_PRM n, textures, priorities );
-}
-
-
-
-
-/*
- * GL_EXT_texture3D
- */
-
-void GLAPIENTRY glCopyTexSubImage3DEXT(CTX_ARG GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint zoffset,
- GLint x, GLint y, GLsizei width,
- GLsizei height )
-{
- glCopyTexSubImage3D(CTX_PRM target, level, xoffset, yoffset, zoffset,
- x, y, width, height);
-}
-
-
-
-void GLAPIENTRY glTexImage3DEXT(CTX_ARG GLenum target, GLint level,
- GLenum internalformat,
- GLsizei width, GLsizei height, GLsizei depth,
- GLint border, GLenum format, GLenum type,
- const GLvoid *pixels )
-{
- glTexImage3D(CTX_PRM target, level, internalformat, width, height, depth,
- border, format, type, pixels );
-}
-
-
-void GLAPIENTRY glTexSubImage3DEXT(CTX_ARG GLenum target, GLint level, GLint xoffset,
- GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height,
- GLsizei depth, GLenum format,
- GLenum type, const GLvoid *pixels )
-{
- glTexSubImage3D(CTX_PRM target, level, xoffset, yoffset, zoffset,
- width, height, depth, format, type, pixels );
-}
-
-
-
-
-/*
- * GL_EXT_point_parameters
- */
-
-void GLAPIENTRY glPointParameterfEXT(CTX_ARG GLenum pname, GLfloat param )
-{
- GLfloat params[3];
- GET_CONTEXT;
- CHECK_CONTEXT;
- params[0] = param;
- params[1] = 0.0;
- params[2] = 0.0;
- (*CC->API.PointParameterfvEXT)(CC, pname, params);
-}
-
-
-void GLAPIENTRY glPointParameterfvEXT(CTX_ARG GLenum pname, const GLfloat *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.PointParameterfvEXT)(CC, pname, params);
-}
-
-
-
-
-#ifdef GL_MESA_window_pos
-/*
- * Mesa implementation of glWindowPos*MESA()
- */
-void GLAPIENTRY glWindowPos4fMESA(CTX_ARG GLfloat x, GLfloat y, GLfloat z, GLfloat w )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.WindowPos4fMESA)( CC, x, y, z, w );
-}
-#else
-/* Implementation in winpos.c is used */
-#endif
-
-
-void GLAPIENTRY glWindowPos2iMESA(CTX_ARG GLint x, GLint y )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
-}
-
-void GLAPIENTRY glWindowPos2sMESA(CTX_ARG GLshort x, GLshort y )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
-}
-
-void GLAPIENTRY glWindowPos2fMESA(CTX_ARG GLfloat x, GLfloat y )
-{
- glWindowPos4fMESA(CTX_PRM x, y, 0.0F, 1.0F );
-}
-
-void GLAPIENTRY glWindowPos2dMESA(CTX_ARG GLdouble x, GLdouble y )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
-}
-
-void GLAPIENTRY glWindowPos2ivMESA(CTX_ARG const GLint *p )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) p[0], (GLfloat) p[1], 0.0F, 1.0F );
-}
-
-void GLAPIENTRY glWindowPos2svMESA(CTX_ARG const GLshort *p )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) p[0], (GLfloat) p[1], 0.0F, 1.0F );
-}
-
-void GLAPIENTRY glWindowPos2fvMESA(CTX_ARG const GLfloat *p )
-{
- glWindowPos4fMESA(CTX_PRM p[0], p[1], 0.0F, 1.0F );
-}
-
-void GLAPIENTRY glWindowPos2dvMESA(CTX_ARG const GLdouble *p )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) p[0], (GLfloat) p[1], 0.0F, 1.0F );
-}
-
-void GLAPIENTRY glWindowPos3iMESA(CTX_ARG GLint x, GLint y, GLint z )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
-}
-
-void GLAPIENTRY glWindowPos3sMESA(CTX_ARG GLshort x, GLshort y, GLshort z )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
-}
-
-void GLAPIENTRY glWindowPos3fMESA(CTX_ARG GLfloat x, GLfloat y, GLfloat z )
-{
- glWindowPos4fMESA(CTX_PRM x, y, z, 1.0F );
-}
-
-void GLAPIENTRY glWindowPos3dMESA(CTX_ARG GLdouble x, GLdouble y, GLdouble z )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
-}
-
-void GLAPIENTRY glWindowPos3ivMESA(CTX_ARG const GLint *p )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) p[0], (GLfloat) p[1], (GLfloat) p[2], 1.0F );
-}
-
-void GLAPIENTRY glWindowPos3svMESA(CTX_ARG const GLshort *p )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) p[0], (GLfloat) p[1], (GLfloat) p[2], 1.0F );
-}
-
-void GLAPIENTRY glWindowPos3fvMESA(CTX_ARG const GLfloat *p )
-{
- glWindowPos4fMESA(CTX_PRM p[0], p[1], p[2], 1.0F );
-}
-
-void GLAPIENTRY glWindowPos3dvMESA(CTX_ARG const GLdouble *p )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) p[0], (GLfloat) p[1], (GLfloat) p[2], 1.0F );
-}
-
-void GLAPIENTRY glWindowPos4iMESA(CTX_ARG GLint x, GLint y, GLint z, GLint w )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
-}
-
-void GLAPIENTRY glWindowPos4sMESA(CTX_ARG GLshort x, GLshort y, GLshort z, GLshort w )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
-}
-
-void GLAPIENTRY glWindowPos4dMESA(CTX_ARG GLdouble x, GLdouble y, GLdouble z, GLdouble w )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
-}
-
-
-void GLAPIENTRY glWindowPos4ivMESA(CTX_ARG const GLint *p )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) p[0], (GLfloat) p[1],
- (GLfloat) p[2], (GLfloat) p[3] );
-}
-
-void GLAPIENTRY glWindowPos4svMESA(CTX_ARG const GLshort *p )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) p[0], (GLfloat) p[1],
- (GLfloat) p[2], (GLfloat) p[3] );
-}
-
-void GLAPIENTRY glWindowPos4fvMESA(CTX_ARG const GLfloat *p )
-{
- glWindowPos4fMESA(CTX_PRM p[0], p[1], p[2], p[3] );
-}
-
-void GLAPIENTRY glWindowPos4dvMESA(CTX_ARG const GLdouble *p )
-{
- glWindowPos4fMESA(CTX_PRM (GLfloat) p[0], (GLfloat) p[1],
- (GLfloat) p[2], (GLfloat) p[3] );
-}
-
-
-
-
-/*
- * GL_MESA_resize_buffers
- */
-
-/*
- * Called by user application when window has been resized.
- */
-void GLAPIENTRY glResizeBuffersMESA(CTX_VOID )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.ResizeBuffersMESA)( CC );
-}
-
-
-
-/*
- * GL_SGIS_multitexture (obsolete - will be removed in near future)
- */
-
-#define TEXCOORD1(s) \
-{ \
- GLuint count; \
- GLfloat *tc; \
- count = IM->Count; \
- IM->Flag[count] |= IM->TF1[texSet]; \
- tc = IM->TexCoordPtr[texSet][count]; \
- ASSIGN_4V(tc, s,0,0,1); \
-}
-
-
-#define TEXCOORD2(s,t) \
-{ \
- GLuint count; \
- GLfloat *tc; \
- count = IM->Count; \
- IM->Flag[count] |= IM->TF2[texSet]; \
- tc = IM->TexCoordPtr[texSet][count]; \
- ASSIGN_4V(tc, s,t,0,1); \
-}
-
-#define TEXCOORD3(s,t,u) \
-{ \
- GLuint count; \
- GLfloat *tc; \
- count = IM->Count; \
- IM->Flag[count] |= IM->TF3[texSet]; \
- tc = IM->TexCoordPtr[texSet][count]; \
- ASSIGN_4V(tc, s,t,u,1); \
-}
-
-#define TEXCOORD4(s,t,u,v) \
-{ \
- GLuint count; \
- GLfloat *tc; \
- count = IM->Count; \
- IM->Flag[count] |= IM->TF4[texSet]; \
- tc = IM->TexCoordPtr[texSet][count]; \
- ASSIGN_4V(tc, s,t,u,v); \
-}
-
-
-/* KW: Do the check here so that we only have to do a single range
- * test. The possible compliance problem with this is that
- * we will throw out error-producing calls when compiling
- * display lists. There are ways around this if need be.
- */
-
-
-/*
- * GL_ARB_multitexture
- */
-
-#define CHECK_ARB \
- if (target >= GL_TEXTURE0_ARB && target <= GL_TEXTURE1_ARB) { \
- texSet = target - GL_TEXTURE0_ARB; \
- } \
- else { \
- gl_error(IM->backref, GL_INVALID_ENUM, "glMultiTexCoord(target)"); \
- return; \
- }
-
-void GLAPIENTRY glActiveTextureARB(CTX_ARG GLenum texture)
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.ActiveTexture)(CC, texture);
-}
-
-void GLAPIENTRY glClientActiveTextureARB(CTX_ARG GLenum texture)
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.ClientActiveTexture)(CC, texture);
-}
-
-void GLAPIENTRY glMultiTexCoord1dARB(CTX_ARG GLenum target, GLdouble s)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD1( s );
-}
-
-void GLAPIENTRY glMultiTexCoord1dvARB(CTX_ARG GLenum target, const GLdouble *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD1( v[0] );
-}
-
-void GLAPIENTRY glMultiTexCoord1fARB(CTX_ARG GLenum target, GLfloat s)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD1( s );
-}
-
-void GLAPIENTRY glMultiTexCoord1fvARB(CTX_ARG GLenum target, const GLfloat *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD1( v[0] );
-}
-
-void GLAPIENTRY glMultiTexCoord1iARB(CTX_ARG GLenum target, GLint s)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD1( s );
-}
-
-void GLAPIENTRY glMultiTexCoord1ivARB(CTX_ARG GLenum target, const GLint *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD1( v[0] );
-}
-
-void GLAPIENTRY glMultiTexCoord1sARB(CTX_ARG GLenum target, GLshort s)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD1( s );
-}
-
-void GLAPIENTRY glMultiTexCoord1svARB(CTX_ARG GLenum target, const GLshort *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD1( v[0] );
-}
-
-void GLAPIENTRY glMultiTexCoord2dARB(CTX_ARG GLenum target, GLdouble s, GLdouble t)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD2( s, t );
-}
-
-void GLAPIENTRY glMultiTexCoord2dvARB(CTX_ARG GLenum target, const GLdouble *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD2( v[0], v[1] );
-}
-
-void GLAPIENTRY glMultiTexCoord2fARB(CTX_ARG GLenum target, GLfloat s, GLfloat t)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD2( s, t );
-}
-
-void GLAPIENTRY glMultiTexCoord2fvARB(CTX_ARG GLenum target, const GLfloat *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD2( v[0], v[1] );
-}
-
-void GLAPIENTRY glMultiTexCoord2iARB(CTX_ARG GLenum target, GLint s, GLint t)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD2( s, t );
-}
-
-void GLAPIENTRY glMultiTexCoord2ivARB(CTX_ARG GLenum target, const GLint *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD2( v[0], v[1] );
-}
-
-void GLAPIENTRY glMultiTexCoord2sARB(CTX_ARG GLenum target, GLshort s, GLshort t)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD2( s, t );
-}
-
-void GLAPIENTRY glMultiTexCoord2svARB(CTX_ARG GLenum target, const GLshort *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD2( v[0], v[1] );
-}
-
-void GLAPIENTRY glMultiTexCoord3dARB(CTX_ARG GLenum target, GLdouble s, GLdouble t, GLdouble r)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD3( s, t, r );
-}
-
-void GLAPIENTRY glMultiTexCoord3dvARB(CTX_ARG GLenum target, const GLdouble *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD3( v[0], v[1], v[2] );
-}
-
-void GLAPIENTRY glMultiTexCoord3fARB(CTX_ARG GLenum target, GLfloat s, GLfloat t, GLfloat r)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD3( s, t, r );
-}
-
-void GLAPIENTRY glMultiTexCoord3fvARB(CTX_ARG GLenum target, const GLfloat *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD3( v[0], v[1], v[2] );
-}
-
-void GLAPIENTRY glMultiTexCoord3iARB(CTX_ARG GLenum target, GLint s, GLint t, GLint r)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD3( s, t, r );
-}
-
-void GLAPIENTRY glMultiTexCoord3ivARB(CTX_ARG GLenum target, const GLint *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD3( v[0], v[1], v[2] );
-}
-
-void GLAPIENTRY glMultiTexCoord3sARB(CTX_ARG GLenum target, GLshort s, GLshort t, GLshort r)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD3( s, t, r );
-}
-
-void GLAPIENTRY glMultiTexCoord3svARB(CTX_ARG GLenum target, const GLshort *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD3( v[0], v[1], v[2] );
-}
-
-void GLAPIENTRY glMultiTexCoord4dARB(CTX_ARG GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD4( s, t, r, q );
-}
-
-void GLAPIENTRY glMultiTexCoord4dvARB(CTX_ARG GLenum target, const GLdouble *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD4( v[0], v[1], v[2], v[3] );
-}
-
-void GLAPIENTRY glMultiTexCoord4fARB(CTX_ARG GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD4( s, t, r, q );
-}
-
-
-void GLAPIENTRY glMultiTexCoord4fvARB(CTX_ARG GLenum target, const GLfloat *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD4( v[0], v[1], v[2], v[3] );
-}
-
-void GLAPIENTRY glMultiTexCoord4iARB(CTX_ARG GLenum target, GLint s, GLint t, GLint r, GLint q)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD4( s, t, r, q );
-}
-
-void GLAPIENTRY glMultiTexCoord4ivARB(CTX_ARG GLenum target, const GLint *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD4( v[0], v[1], v[2], v[3] );
-}
-
-void GLAPIENTRY glMultiTexCoord4sARB(CTX_ARG GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD4( s, t, r, q );
-}
-
-void GLAPIENTRY glMultiTexCoord4svARB(CTX_ARG GLenum target, const GLshort *v)
-{
- GLint texSet;
- GET_IMMEDIATE;
- CHECK_ARB
- TEXCOORD4( v[0], v[1], v[2], v[3] );
-}
-
-
-
-/*
- * GL_INGR_blend_func_separate
- */
-
-void GLAPIENTRY glBlendFuncSeparateINGR(CTX_ARG GLenum sfactorRGB,
- GLenum dfactorRGB,
- GLenum sfactorAlpha,
- GLenum dfactorAlpha )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.BlendFuncSeparate)( CC, sfactorRGB, dfactorRGB,
- sfactorAlpha, dfactorAlpha );
-}
-
-
-
-/*
- * GL_PGI_misc_hints - I think this is a bit of a dead extension, but
- * it fits well with what I want the config. file to do.
- */
-/*** XXX there is no such entry point in gl.h
-void GLAPIENTRY glHintPGI(CTX_ARG GLenum target, GLint mode )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.Hint)( CC, target, mode );
-}
-***/
-
-
-/*
- * GL_EXT_compiled_vertex_array
- */
-
-/* functions are in cva.c */
-
-
-/*
- * GL_EXT_color_table
- */
-
-void GLAPIENTRY glColorTableEXT(CTX_ARG GLenum target, GLenum internalFormat,
- GLsizei width, GLenum format, GLenum type,
- const GLvoid *table )
-{
- struct gl_image *image;
- GET_CONTEXT;
- CHECK_CONTEXT;
- image = gl_unpack_image( CC, width, 1, format, type, table, &CC->Unpack );
- (*CC->API.ColorTable)( CC, target, internalFormat, image );
- if (image->RefCount == 0)
- gl_free_image(image);
-}
-
-
-void GLAPIENTRY glColorSubTableEXT(CTX_ARG GLenum target, GLsizei start,
- GLsizei count, GLenum format, GLenum type,
- const GLvoid *data )
-{
- struct gl_image *image;
- GET_CONTEXT;
- CHECK_CONTEXT;
- image = gl_unpack_image( CC, count, 1, format, type, data, &CC->Unpack );
- (*CC->API.ColorSubTable)( CC, target, start, image );
- if (image->RefCount == 0)
- gl_free_image(image);
-}
-
-
-void GLAPIENTRY glGetColorTableEXT(CTX_ARG GLenum target, GLenum format,
- GLenum type, GLvoid *table )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetColorTable)(CC, target, format, type, table);
-}
-
-
-void GLAPIENTRY glGetColorTableParameterivEXT(CTX_ARG GLenum target, GLenum pname,
- GLint *params )
-{
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetColorTableParameteriv)(CC, target, pname, params);
-}
-
-
-void GLAPIENTRY glGetColorTableParameterfvEXT(CTX_ARG GLenum target, GLenum pname,
- GLfloat *params )
-{
- GLint iparams;
- GET_CONTEXT;
- CHECK_CONTEXT;
- (*CC->API.GetColorTableParameteriv)(CC, target, pname, &iparams);
- *params = (GLfloat) iparams;
-}
-
-
-
-
-/*
- * OpenGL 1.2 imaging subset (most not implemented, just stubs)
- */
-
-void GLAPIENTRY
-glBlendEquation(CTX_ARG GLenum mode )
-{
- glBlendEquationEXT(CTX_PRM mode );
-}
-
-
-void GLAPIENTRY
-glBlendColor(CTX_ARG GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
-{
- glBlendColorEXT(CTX_PRM red, green, blue, alpha );
-}
-
-
-void GLAPIENTRY
-glHistogram(CTX_ARG GLenum target, GLsizei width, GLenum internalFormat,
- GLboolean sink )
-{
- GET_CONTEXT;
- (void) target;
- (void) width;
- (void) internalFormat;
- (void) sink;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glHistogram" );
-}
-
-
-void GLAPIENTRY
-glResetHistogram(CTX_ARG GLenum target )
-{
- GET_CONTEXT;
- (void) target;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glResetHistogram" );
-}
-
-
-void GLAPIENTRY
-glGetHistogram(CTX_ARG GLenum target, GLboolean reset, GLenum format,
- GLenum type, GLvoid *values )
-{
- GET_CONTEXT;
- (void) target;
- (void) reset;
- (void) format;
- (void) type;
- (void) values;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glGetHistogram" );
-}
-
-
-void GLAPIENTRY
-glGetHistogramParameterfv(CTX_ARG GLenum target, GLenum pname, GLfloat *params )
-{
- GET_CONTEXT;
- (void) target;
- (void) pname;
- (void) params;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glGetHistogramParameterfv" );
-}
-
-
-void GLAPIENTRY
-glGetHistogramParameteriv(CTX_ARG GLenum target, GLenum pname, GLint *params )
-{
- GET_CONTEXT;
- (void) target;
- (void) pname;
- (void) params;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glGetHistogramParameteriv" );
-}
-
-
-void GLAPIENTRY
-glMinmax(CTX_ARG GLenum target, GLenum internalFormat, GLboolean sink )
-{
- GET_CONTEXT;
- (void) target;
- (void) internalFormat;
- (void) sink;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glMinmax" );
-}
-
-
-void GLAPIENTRY
-glResetMinmax(CTX_ARG GLenum target )
-{
- GET_CONTEXT;
- (void) target;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glResetMinmax" );
-}
-
-
-void GLAPIENTRY
-glGetMinmax(CTX_ARG GLenum target, GLboolean reset, GLenum format, GLenum types,
- GLvoid *values )
-{
- GET_CONTEXT;
- (void) target;
- (void) reset;
- (void) format;
- (void) types;
- (void) values;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glGetMinmax" );
-}
-
-
-void GLAPIENTRY
-glGetMinmaxParameterfv(CTX_ARG GLenum target, GLenum pname, GLfloat *params )
-{
- GET_CONTEXT;
- (void) target;
- (void) pname;
- (void) params;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glGetMinmaxParameterfv" );
-}
-
-
-void GLAPIENTRY
-glGetMinmaxParameteriv(CTX_ARG GLenum target, GLenum pname, GLint *params )
-{
- GET_CONTEXT;
- (void) target;
- (void) pname;
- (void) params;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glGetMinmaxParameteriv" );
-}
-
-
-void GLAPIENTRY
-glConvolutionFilter1D(CTX_ARG GLenum target, GLenum internalFormat, GLsizei width,
- GLenum format, GLenum type, const GLvoid *image )
-{
- GET_CONTEXT;
- (void) target;
- (void) internalFormat;
- (void) width;
- (void) format;
- (void) type;
- (void) image;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glConvolutionFilter1D" );
-}
-
-
-void GLAPIENTRY
-glConvolutionFilter2D(CTX_ARG GLenum target, GLenum internalFormat, GLsizei width,
- GLsizei height, GLenum format, GLenum type,
- const GLvoid *image )
-{
- GET_CONTEXT;
- (void) target;
- (void) internalFormat;
- (void) width;
- (void) height;
- (void) format;
- (void) type;
- (void) image;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glConvolutionFilter2D" );
-}
-
-
-void GLAPIENTRY
-glConvolutionParameterf(CTX_ARG GLenum target, GLenum pname, GLfloat params )
-{
- GET_CONTEXT;
- (void) target;
- (void) pname;
- (void) params;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glConvolutionParameterf" );
-}
-
-
-void GLAPIENTRY
-glConvolutionParameterfv(CTX_ARG GLenum target, GLenum pname, const GLfloat *params )
-{
- GET_CONTEXT;
- (void) target;
- (void) pname;
- (void) params;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glConvolutionParameterfv" );
-}
-
-
-void GLAPIENTRY
-glConvolutionParameteri(CTX_ARG GLenum target, GLenum pname, GLint params )
-{
- GET_CONTEXT;
- (void) target;
- (void) pname;
- (void) params;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glConvolutionParameteri" );
-}
-
-
-void GLAPIENTRY
-glConvolutionParameteriv(CTX_ARG GLenum target, GLenum pname, const GLint *params )
-{
- GET_CONTEXT;
- (void) target;
- (void) pname;
- (void) params;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glConvolutionParameteriv" );
-}
-
-
-void GLAPIENTRY
-glCopyConvolutionFilter1D(CTX_ARG GLenum target, GLenum internalFormat,
- GLint x, GLint y, GLsizei width )
-{
- GET_CONTEXT;
- (void) target;
- (void) internalFormat;
- (void) x;
- (void) y;
- (void) width;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glCopyConvolutionFilter1D" );
-}
-
-
-void GLAPIENTRY
-glCopyConvolutionFilter2D(CTX_ARG GLenum target, GLenum internalFormat,
- GLint x, GLint y, GLsizei width, GLsizei height)
-{
- GET_CONTEXT;
- (void) target;
- (void) internalFormat;
- (void) x;
- (void) y;
- (void) width;
- (void) height;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glCopyConvolutionFilter2D" );
-}
-
-
-void GLAPIENTRY
-glGetConvolutionFilter(CTX_ARG GLenum target, GLenum format,
- GLenum type, GLvoid *image )
-{
- GET_CONTEXT;
- (void) target;
- (void) format;
- (void) type;
- (void) image;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glGetConvolutionFilter" );
-}
-
-
-void GLAPIENTRY
-glGetConvolutionParameterfv(CTX_ARG GLenum target, GLenum pname, GLfloat *params )
-{
- GET_CONTEXT;
- (void) target;
- (void) pname;
- (void) params;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glGetConvolutionParameterfv" );
-}
-
-
-void GLAPIENTRY
-glGetConvolutionParameteriv(CTX_ARG GLenum target, GLenum pname, GLint *params )
-{
- GET_CONTEXT;
- (void) target;
- (void) pname;
- (void) params;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glGetConvolutionParameteriv" );
-}
-
-
-void GLAPIENTRY
-glSeparableFilter2D(CTX_ARG GLenum target, GLenum internalFormat,
- GLsizei width, GLsizei height, GLenum format,
- GLenum type, const GLvoid *row, const GLvoid *column )
-{
- GET_CONTEXT;
- (void) target;
- (void) internalFormat;
- (void) width;
- (void) height;
- (void) format;
- (void) row;
- (void) type;
- (void) row;
- (void) column;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glSeperableFilter2D" );
-}
-
-
-void GLAPIENTRY
-glGetSeparableFilter(CTX_ARG GLenum target, GLenum format, GLenum type,
- GLvoid *row, GLvoid *column, GLvoid *span )
-{
- GET_CONTEXT;
- (void) target;
- (void) format;
- (void) type;
- (void) row;
- (void) column;
- (void) span;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glGetSeparableFilter" );
-}
-
-
-void GLAPIENTRY
-glCopyColorSubTable(CTX_ARG GLenum target, GLsizei start, GLint x, GLint y,
- GLsizei width )
-{
- GET_CONTEXT;
- (void) target;
- (void) start;
- (void) x;
- (void) y;
- (void) width;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glCopyColorSubTable" );
-}
-
-
-void GLAPIENTRY
-glCopyColorTable(CTX_ARG GLenum target, GLenum internalFormat,
- GLint x, GLint y, GLsizei width )
-{
- GET_CONTEXT;
- (void) target;
- (void) internalFormat;
- (void) x;
- (void) y;
- (void) width;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glCopyColorTable" );
-}
-
-
-void GLAPIENTRY
-glColorTable(CTX_ARG GLenum target, GLenum internalFormat,
- GLsizei width, GLenum format, GLenum type,
- const GLvoid *table )
-{
- glColorTableEXT(CTX_PRM target, internalFormat, width, format, type, table);
-}
-
-
-void GLAPIENTRY
-glColorSubTable(CTX_ARG GLenum target, GLsizei start,
- GLsizei count, GLenum format, GLenum type,
- const GLvoid *data )
-{
- GET_CONTEXT;
- (void) target;
- (void) start;
- (void) count;
- (void) format;
- (void) type;
- (void) data;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glColorSubTable" );
-}
-
-
-void GLAPIENTRY
-glColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
-{
- GET_CONTEXT;
- (void) target;
- (void) pname;
- (void) params;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glColorTableParameteriv" );
-}
-
-
-void GLAPIENTRY
-glColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params)
-{
- GET_CONTEXT;
- (void) target;
- (void) pname;
- (void) params;
- CHECK_CONTEXT;
- gl_error( CC, GL_INVALID_OPERATION, "glColorTableParameterfv" );
-}
-
-
-void GLAPIENTRY
-glGetColorTable(CTX_ARG GLenum target, GLenum format,
- GLenum type, GLvoid *table )
-{
- glGetColorTableEXT(CTX_PRM target, format, type, table);
-}
-
-
-void GLAPIENTRY
-glGetColorTableParameteriv(CTX_ARG GLenum target, GLenum pname,
- GLint *params )
-{
- glGetColorTableParameterivEXT(CTX_PRM target, pname, params);
-}
-
-
-void GLAPIENTRY
-glGetColorTableParameterfv(CTX_ARG GLenum target, GLenum pname,
- GLfloat *params )
-{
- glGetColorTableParameterfvEXT(CTX_PRM target, pname, params);
-}
-
-
diff --git a/xc/extras/Mesa/src/attrib.c b/xc/extras/Mesa/src/attrib.c
index 878f9f3ec..9bcf49c35 100644
--- a/xc/extras/Mesa/src/attrib.c
+++ b/xc/extras/Mesa/src/attrib.c
@@ -1,4 +1,4 @@
-/* $Id: attrib.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: attrib.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -25,23 +25,16 @@
*/
-
-#include <stdlib.h>
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "attrib.h"
#include "context.h"
#include "glmisc.h"
#include "enable.h"
#include "enums.h"
-#include "macros.h"
+#include "mem.h"
#include "simple_list.h"
#include "texstate.h"
#include "types.h"
@@ -92,11 +85,7 @@ static void copy_texobj_state( struct gl_texture_object *dest,
dest->P = src->P;
dest->M = src->M;
dest->MinMagThresh = src->MinMagThresh;
- memcpy( dest->Palette, src->Palette,
- sizeof(GLubyte) * MAX_TEXTURE_PALETTE_SIZE * 4 );
- dest->PaletteSize = src->PaletteSize;
- dest->PaletteIntFormat = src->PaletteIntFormat;
- dest->PaletteFormat = src->PaletteFormat;
+ dest->Palette = src->Palette;
dest->Complete = src->Complete;
dest->SampleFunc = src->SampleFunc;
}
@@ -428,11 +417,10 @@ void gl_PopAttrib( GLcontext* ctx )
GLubyte oldAlphaRef = ctx->Color.AlphaRef;
GLenum oldBlendSrc = ctx->Color.BlendSrcRGB;
GLenum oldBlendDst = ctx->Color.BlendDstRGB;
- GLenum oldLogicOp = ctx->Color.LogicOp;
MEMCPY( &ctx->Color, attr->data,
sizeof(struct gl_colorbuffer_attrib) );
if (ctx->Color.DrawBuffer != oldDrawBuffer) {
- gl_DrawBuffer(ctx, ctx->Color.DrawBuffer);
+ _mesa_DrawBuffer( ctx->Color.DrawBuffer);
}
if ((ctx->Color.AlphaFunc != oldAlphaFunc ||
ctx->Color.AlphaRef != oldAlphaRef) &&
@@ -444,9 +432,6 @@ void gl_PopAttrib( GLcontext* ctx )
ctx->Driver.BlendFunc)
(*ctx->Driver.BlendFunc)( ctx, ctx->Color.BlendSrcRGB,
ctx->Color.BlendDstRGB);
- if (ctx->Color.LogicOp != oldLogicOp &&
- ctx->Driver.LogicOpcode)
- ctx->Driver.LogicOpcode( ctx, ctx->Color.LogicOp );
}
break;
case GL_CURRENT_BIT:
@@ -475,7 +460,7 @@ void gl_PopAttrib( GLcontext* ctx )
#define TEST_AND_UPDATE(VALUE, NEWVALUE, ENUM) \
if ((VALUE) != (NEWVALUE)) { \
- gl_set_enable( ctx, ENUM, (NEWVALUE) ); \
+ _mesa_set_enable( ctx, ENUM, (NEWVALUE) ); \
}
TEST_AND_UPDATE(ctx->Color.AlphaEnabled, enable->AlphaTest, GL_ALPHA_TEST);
@@ -485,7 +470,7 @@ void gl_PopAttrib( GLcontext* ctx )
GLuint i;
for (i=0;i<MAX_CLIP_PLANES;i++) {
if (ctx->Transform.ClipEnabled[i] != enable->ClipPlane[i])
- gl_set_enable( ctx, (GLenum) (GL_CLIP_PLANE0 + i), enable->ClipPlane[i] );
+ _mesa_set_enable( ctx, (GLenum) (GL_CLIP_PLANE0 + i), enable->ClipPlane[i] );
}
}
TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial, GL_COLOR_MATERIAL);
@@ -752,8 +737,8 @@ void gl_PopAttrib( GLcontext* ctx )
struct gl_viewport_attrib *v =
(struct gl_viewport_attrib *)attr->data;
- gl_Viewport( ctx, v->X, v->Y, v->Width, v->Height );
- gl_DepthRange( ctx, v->Near, v->Far );
+ _mesa_Viewport( v->X, v->Y, v->Width, v->Height );
+ _mesa_DepthRange( v->Near, v->Far );
break;
}
default:
@@ -867,3 +852,37 @@ void gl_PopClientAttrib( GLcontext *ctx )
ctx->NewState = NEW_ALL;
}
+
+
+void
+_mesa_PushAttrib( GLbitfield mask )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ gl_PushAttrib(ctx, mask);
+}
+
+
+void
+_mesa_PopAttrib( void )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ gl_PopAttrib(ctx);
+}
+
+
+void
+_mesa_PushClientAttrib( GLbitfield mask )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ gl_PushClientAttrib(ctx, mask);
+}
+
+
+void
+_mesa_PopClientAttrib( void )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ gl_PopClientAttrib(ctx);
+}
+
+
diff --git a/xc/extras/Mesa/src/attrib.h b/xc/extras/Mesa/src/attrib.h
index 2dbb604d2..91700e684 100644
--- a/xc/extras/Mesa/src/attrib.h
+++ b/xc/extras/Mesa/src/attrib.h
@@ -1,8 +1,8 @@
-/* $Id: attrib.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: attrib.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef ATTRIB_H
#define ATTRIB_h
@@ -44,4 +41,17 @@ extern void gl_PushClientAttrib( GLcontext *ctx, GLbitfield mask );
extern void gl_PopClientAttrib( GLcontext *ctx );
+extern void
+_mesa_PushAttrib( GLbitfield mask );
+
+extern void
+_mesa_PopAttrib( void );
+
+extern void
+_mesa_PushClientAttrib( GLbitfield mask );
+
+extern void
+_mesa_PopClientAttrib( void );
+
+
#endif
diff --git a/xc/extras/Mesa/src/bbox.c b/xc/extras/Mesa/src/bbox.c
index e78ce26cd..d8e1c4a9d 100644
--- a/xc/extras/Mesa/src/bbox.c
+++ b/xc/extras/Mesa/src/bbox.c
@@ -1,4 +1,4 @@
-/* $Id: bbox.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: bbox.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -29,9 +29,16 @@
*/
+#ifdef PC_HEADER
+#include "all.h"
+#else
+#include "glheader.h"
#include "bbox.h"
#include "types.h"
#include "xform.h"
+#endif
+
+
static void cliptest_bounds( GLubyte *orMask,
GLubyte *andMask,
diff --git a/xc/extras/Mesa/src/bbox.h b/xc/extras/Mesa/src/bbox.h
index ed6ca802c..fa5636e8f 100644
--- a/xc/extras/Mesa/src/bbox.h
+++ b/xc/extras/Mesa/src/bbox.h
@@ -1,4 +1,4 @@
-/* $Id: bbox.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: bbox.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/bitmap.c b/xc/extras/Mesa/src/bitmap.c
index ea9a90e88..6732fe7f1 100644
--- a/xc/extras/Mesa/src/bitmap.c
+++ b/xc/extras/Mesa/src/bitmap.c
@@ -1,8 +1,8 @@
-/* $Id: bitmap.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: bitmap.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,20 +25,10 @@
*/
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "bitmap.h"
#include "context.h"
#include "feedback.h"
@@ -53,12 +43,13 @@
/*
- * Render bitmap data.
+ * Render a bitmap.
*/
-static void render_bitmap( GLcontext *ctx, GLint px, GLint py,
- GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap )
+static void
+render_bitmap( GLcontext *ctx, GLint px, GLint py,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap )
{
struct pixel_buffer *PB = ctx->PB;
GLint row, col;
@@ -75,6 +66,10 @@ static void render_bitmap( GLcontext *ctx, GLint px, GLint py,
gl_reduced_prim_change( ctx, GL_BITMAP );
}
+ if (ctx->PB->primitive!=GL_BITMAP) { /* A.W. 1.1.2000 */
+ gl_reduced_prim_change( ctx, GL_BITMAP );
+ }
+
/* Set bitmap drawing color */
if (ctx->Visual->RGBAflag) {
GLint r, g, b, a;
@@ -96,42 +91,46 @@ static void render_bitmap( GLcontext *ctx, GLint px, GLint py,
if (unpack->LsbFirst) {
/* Lsb first */
- GLubyte bitmask = 1;
+ GLubyte mask = 1U << (unpack->SkipPixels & 0x7);
for (col=0; col<width; col++) {
- if (*src & bitmask) {
+ if (*src & mask) {
PB_WRITE_PIXEL( PB, px+col, py+row, pz );
}
- bitmask = bitmask << 1;
- if (bitmask == 0U) {
+ if (mask == 128U) {
src++;
- bitmask = 1U;
+ mask = 1U;
+ }
+ else {
+ mask = mask << 1;
}
}
PB_CHECK_FLUSH( ctx, PB );
/* get ready for next row */
- if (bitmask != 1)
+ if (mask != 1)
src++;
}
else {
/* Msb first */
- GLubyte bitmask = 128;
+ GLubyte mask = 128U >> (unpack->SkipPixels & 0x7);
for (col=0; col<width; col++) {
- if (*src & bitmask) {
+ if (*src & mask) {
PB_WRITE_PIXEL( PB, px+col, py+row, pz );
}
- bitmask = bitmask >> 1;
- if (bitmask == 0U) {
+ if (mask == 1U) {
src++;
- bitmask = 128U;
+ mask = 128U;
+ }
+ else {
+ mask = mask >> 1;
}
}
PB_CHECK_FLUSH( ctx, PB );
/* get ready for next row */
- if (bitmask!=128)
+ if (mask != 128)
src++;
}
}
@@ -144,13 +143,12 @@ static void render_bitmap( GLcontext *ctx, GLint px, GLint py,
/*
* Execute a glBitmap command.
*/
-void gl_Bitmap( GLcontext *ctx,
- GLsizei width, GLsizei height,
- GLfloat xorig, GLfloat yorig,
- GLfloat xmove, GLfloat ymove,
- const GLubyte *bitmap,
- const struct gl_pixelstore_attrib *packing )
+void
+_mesa_Bitmap( GLsizei width, GLsizei height,
+ GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove,
+ const GLubyte *bitmap )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBitmap");
/* Error checking */
@@ -164,17 +162,19 @@ void gl_Bitmap( GLcontext *ctx,
}
if (ctx->RenderMode==GL_RENDER) {
- GLint x = (GLint) ( (ctx->Current.RasterPos[0] - xorig) + 0.0F );
- GLint y = (GLint) ( (ctx->Current.RasterPos[1] - yorig) + 0.0F );
- GLboolean completed = GL_FALSE;
- if (ctx->Driver.Bitmap) {
- /* let device driver try to render the bitmap */
- completed = (*ctx->Driver.Bitmap)( ctx, x, y, width, height,
- packing, bitmap );
- }
- if (!completed) {
- /* use generic function */
- render_bitmap( ctx, x, y, width, height, packing, bitmap );
+ if (bitmap) {
+ GLint x = (GLint) ( (ctx->Current.RasterPos[0] - xorig) + 0.0F );
+ GLint y = (GLint) ( (ctx->Current.RasterPos[1] - yorig) + 0.0F );
+ GLboolean completed = GL_FALSE;
+ if (ctx->Driver.Bitmap) {
+ /* let device driver try to render the bitmap */
+ completed = (*ctx->Driver.Bitmap)( ctx, x, y, width, height,
+ &ctx->Unpack, bitmap );
+ }
+ if (!completed) {
+ /* use generic function */
+ render_bitmap( ctx, x, y, width, height, &ctx->Unpack, bitmap );
+ }
}
}
else if (ctx->RenderMode==GL_FEEDBACK) {
diff --git a/xc/extras/Mesa/src/bitmap.h b/xc/extras/Mesa/src/bitmap.h
index 234125704..d68144e3b 100644
--- a/xc/extras/Mesa/src/bitmap.h
+++ b/xc/extras/Mesa/src/bitmap.h
@@ -1,4 +1,4 @@
-/* $Id: bitmap.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: bitmap.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -32,12 +32,11 @@
#include "types.h"
-extern void gl_Bitmap( GLcontext *ctx,
- GLsizei width, GLsizei height,
- GLfloat xorig, GLfloat yorig,
- GLfloat xmove, GLfloat ymove,
- const GLubyte *bitmap,
- const struct gl_pixelstore_attrib *packing );
+
+extern void
+_mesa_Bitmap( GLsizei width, GLsizei height,
+ GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove,
+ const GLubyte *bitmap );
#endif
diff --git a/xc/extras/Mesa/src/blend.c b/xc/extras/Mesa/src/blend.c
index e9bf7b434..047bfbe26 100644
--- a/xc/extras/Mesa/src/blend.c
+++ b/xc/extras/Mesa/src/blend.c
@@ -1,8 +1,8 @@
-/* $Id: blend.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: blend.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -29,13 +29,7 @@
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <stdio.h>
-#include <assert.h>
-#include <stdlib.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "alphabuf.h"
#include "blend.h"
#include "context.h"
@@ -47,8 +41,9 @@
#endif
-void gl_BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
+void _mesa_BlendFunc( GLenum sfactor, GLenum dfactor )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBlendFunc");
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
@@ -108,9 +103,10 @@ void gl_BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
/* GL_INGR_blend_func_separate */
void
-gl_BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA )
+_mesa_BlendFuncSeparateINGR( GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBlendFuncSeparate");
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
@@ -214,8 +210,10 @@ gl_BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB,
/* This is really an extension function! */
-void gl_BlendEquation( GLcontext *ctx, GLenum mode )
+void
+_mesa_BlendEquationEXT( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBlendEquation");
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
@@ -256,21 +254,26 @@ void gl_BlendEquation( GLcontext *ctx, GLenum mode )
-void gl_BlendColor( GLcontext *ctx, GLclampf red, GLclampf green,
- GLclampf blue, GLclampf alpha )
+void
+_mesa_BlendColorEXT( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
{
+ GET_CURRENT_CONTEXT(ctx);
ctx->Color.BlendColor[0] = CLAMP( red, 0.0F, 1.0F );
ctx->Color.BlendColor[1] = CLAMP( green, 0.0F, 1.0F );
ctx->Color.BlendColor[2] = CLAMP( blue, 0.0F, 1.0F );
ctx->Color.BlendColor[3] = CLAMP( alpha, 0.0F, 1.0F );
}
-
+#ifdef USE_MMX_ASM
+#define _BLENDAPI _ASMAPI
+#else
+#define _BLENDAPI
+#endif
/*
* Common transparency blending mode.
*/
-static void blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[],
+static void _BLENDAPI blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[],
GLubyte rgba[][4], CONST GLubyte dest[][4] )
{
GLuint i;
@@ -315,7 +318,7 @@ static void blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[],
/*
* Add src and dest.
*/
-static void blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[],
+static void _BLENDAPI blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[],
GLubyte rgba[][4], CONST GLubyte dest[][4] )
{
GLuint i;
@@ -334,7 +337,7 @@ static void blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[],
rgba[i][GCOMP] = (GLubyte) MIN2( g, 255 );
rgba[i][BCOMP] = (GLubyte) MIN2( b, 255 );
rgba[i][ACOMP] = (GLubyte) MIN2( a, 255 );
- }
+ }
}
}
@@ -343,20 +346,20 @@ static void blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[],
/*
* Blend min function (for GL_EXT_blend_minmax)
*/
-static void blend_min( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLubyte rgba[][4], CONST GLubyte dest[][4] )
+static void _BLENDAPI blend_min( GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLubyte rgba[][4], CONST GLubyte dest[][4] )
{
GLuint i;
ASSERT(ctx->Color.BlendEquation==GL_MIN_EXT);
(void) ctx;
for (i=0;i<n;i++) {
- if (mask[i]) {
- rgba[i][RCOMP] = (GLubyte) MIN2( rgba[i][RCOMP], dest[i][RCOMP] );
- rgba[i][GCOMP] = (GLubyte) MIN2( rgba[i][GCOMP], dest[i][GCOMP] );
- rgba[i][BCOMP] = (GLubyte) MIN2( rgba[i][BCOMP], dest[i][BCOMP] );
- rgba[i][ACOMP] = (GLubyte) MIN2( rgba[i][ACOMP], dest[i][ACOMP] );
- }
+ if (mask[i]) {
+ rgba[i][RCOMP] = (GLubyte) MIN2( rgba[i][RCOMP], dest[i][RCOMP] );
+ rgba[i][GCOMP] = (GLubyte) MIN2( rgba[i][GCOMP], dest[i][GCOMP] );
+ rgba[i][BCOMP] = (GLubyte) MIN2( rgba[i][BCOMP], dest[i][BCOMP] );
+ rgba[i][ACOMP] = (GLubyte) MIN2( rgba[i][ACOMP], dest[i][ACOMP] );
+ }
}
}
@@ -365,7 +368,7 @@ static void blend_min( GLcontext *ctx, GLuint n, const GLubyte mask[],
/*
* Blend max function (for GL_EXT_blend_minmax)
*/
-static void blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[],
+static void _BLENDAPI blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[],
GLubyte rgba[][4], CONST GLubyte dest[][4] )
{
GLuint i;
@@ -375,10 +378,10 @@ static void blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[],
for (i=0;i<n;i++) {
if (mask[i]) {
rgba[i][RCOMP] = (GLubyte) MAX2( rgba[i][RCOMP], dest[i][RCOMP] );
- rgba[i][GCOMP] = (GLubyte) MAX2( rgba[i][GCOMP], dest[i][GCOMP] );
- rgba[i][BCOMP] = (GLubyte) MAX2( rgba[i][BCOMP], dest[i][BCOMP] );
- rgba[i][ACOMP] = (GLubyte) MAX2( rgba[i][ACOMP], dest[i][ACOMP] );
- }
+ rgba[i][GCOMP] = (GLubyte) MAX2( rgba[i][GCOMP], dest[i][GCOMP] );
+ rgba[i][BCOMP] = (GLubyte) MAX2( rgba[i][BCOMP], dest[i][BCOMP] );
+ rgba[i][ACOMP] = (GLubyte) MAX2( rgba[i][ACOMP], dest[i][ACOMP] );
+ }
}
}
@@ -387,8 +390,8 @@ static void blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[],
/*
* Modulate: result = src * dest
*/
-static void blend_modulate( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLubyte rgba[][4], CONST GLubyte dest[][4] )
+static void _BLENDAPI blend_modulate( GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLubyte rgba[][4], CONST GLubyte dest[][4] )
{
GLuint i;
(void) ctx;
@@ -416,8 +419,8 @@ static void blend_modulate( GLcontext *ctx, GLuint n, const GLubyte mask[],
* In/Out: rgba - the incoming and modified pixels
* Input: dest - the pixels from the dest color buffer
*/
-static void blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLubyte rgba[][4], CONST GLubyte dest[][4] )
+static void _BLENDAPI blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLubyte rgba[][4], CONST GLubyte dest[][4] )
{
GLfloat rscale = 1.0F / 255.0F;
GLfloat gscale = 1.0F / 255.0F;
@@ -779,7 +782,7 @@ void gl_blend_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
}
/* Read span of current frame buffer pixels */
- gl_read_rgba_span( ctx, n, x, y, dest );
+ gl_read_rgba_span( ctx, ctx->DrawBuffer, n, x, y, dest );
if (!ctx->Color.BlendFunc)
set_blend_function(ctx);
diff --git a/xc/extras/Mesa/src/blend.h b/xc/extras/Mesa/src/blend.h
index 90e869bb8..786f2da19 100644
--- a/xc/extras/Mesa/src/blend.h
+++ b/xc/extras/Mesa/src/blend.h
@@ -1,4 +1,4 @@
-/* $Id: blend.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: blend.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef BLEND_H
#define BLEND_H
@@ -48,21 +45,20 @@ gl_blend_pixels( GLcontext *ctx,
extern void
-gl_BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor );
+_mesa_BlendFunc( GLenum sfactor, GLenum dfactor );
extern void
-gl_BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA );
+_mesa_BlendFuncSeparateINGR( GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA );
extern void
-gl_BlendEquation( GLcontext *ctx, GLenum mode );
+_mesa_BlendEquationEXT( GLenum mode );
extern void
-gl_BlendColor( GLcontext *ctx, GLclampf red, GLclampf green,
- GLclampf blue, GLclampf alpha );
+_mesa_BlendColorEXT(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
#endif
diff --git a/xc/extras/Mesa/src/clip.c b/xc/extras/Mesa/src/clip.c
index 60aece17b..38c276e36 100644
--- a/xc/extras/Mesa/src/clip.c
+++ b/xc/extras/Mesa/src/clip.c
@@ -1,8 +1,8 @@
-/* $Id: clip.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: clip.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,19 +25,10 @@
*/
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "clip.h"
#include "context.h"
#include "macros.h"
@@ -51,15 +42,6 @@
-#define CLIP_RGBA0 0x1
-#define CLIP_RGBA1 0x2
-#define CLIP_TEX0 0x4
-#define CLIP_TEX1 0x8
-#define CLIP_INDEX0 0x10
-#define CLIP_INDEX1 0x20
-#define CLIP_FOG_COORD 0x40
-
-
/* Linear interpolation between A and B: */
#define LINTERP( T, A, B ) ( (A) + (T) * ( (B) - (A) ) )
@@ -76,7 +58,16 @@ do { \
} while(0)
-static clip_interp_func clip_interp_tab[0x80];
+
+
+#define CLIP_RGBA0 0x1
+#define CLIP_RGBA1 0x2
+#define CLIP_TEX0 0x4
+#define CLIP_TEX1 0x8
+#define CLIP_INDEX0 0x10
+#define CLIP_INDEX1 0x20
+
+static clip_interp_func clip_interp_tab[0x40];
#define IND 0
#define NAME clip_nil
@@ -122,50 +113,6 @@ static clip_interp_func clip_interp_tab[0x80];
#define NAME clipINDEX0_INDEX1
#include "interp_tmp.h"
-#define IND (CLIP_FOG_COORD)
-#define NAME clip_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_RGBA0|CLIP_FOG_COORD)
-#define NAME clipRGBA0_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_RGBA0|CLIP_RGBA1|CLIP_FOG_COORD)
-#define NAME clipRGBA0_RGBA1_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_TEX0|CLIP_RGBA0|CLIP_FOG_COORD)
-#define NAME clipTEX0_RGBA0_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_TEX0|CLIP_RGBA0|CLIP_RGBA1|CLIP_FOG_COORD)
-#define NAME clipTEX0_RGBA0_RGBA1_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_TEX1|CLIP_TEX0|CLIP_RGBA0|CLIP_FOG_COORD)
-#define NAME clipTEX1_TEX0_RGBA0_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_TEX0|CLIP_FOG_COORD)
-#define NAME clipTEX0_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_TEX1|CLIP_TEX0|CLIP_FOG_COORD)
-#define NAME clipTEX1_TEX0_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_TEX1|CLIP_TEX0|CLIP_RGBA0|CLIP_RGBA1|CLIP_FOG_COORD)
-#define NAME clipTEX1_TEX0_RGBA0_RGBA1_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_INDEX0|CLIP_FOG_COORD)
-#define NAME clipINDEX0_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_INDEX0|CLIP_INDEX1|CLIP_FOG_COORD)
-#define NAME clipINDEX0_INDEX1_FOG
-#include "interp_tmp.h"
-
@@ -175,9 +122,17 @@ static clip_interp_func clip_interp_tab[0x80];
-void gl_ClipPlane( GLcontext* ctx, GLenum plane, const GLfloat *equation )
+void
+_mesa_ClipPlane( GLenum plane, const GLdouble *eq )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint p;
+ GLfloat equation[4];
+
+ equation[0] = eq[0];
+ equation[1] = eq[1];
+ equation[2] = eq[2];
+ equation[3] = eq[3];
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClipPlane");
@@ -228,8 +183,10 @@ void gl_update_userclip( GLcontext *ctx )
}
}
-void gl_GetClipPlane( GLcontext* ctx, GLenum plane, GLdouble *equation )
+void
+_mesa_GetClipPlane( GLenum plane, GLdouble *equation )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint p;
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetClipPlane");
@@ -396,8 +353,6 @@ void gl_update_clipmask( GLcontext *ctx )
mask |= CLIP_INDEX1;
}
- if (ctx->FogMode == FOG_FRAGMENT && (ctx->TriangleCaps & DD_CLIP_FOG_COORD))
- mask |= CLIP_FOG_COORD;
ctx->ClipInterpFunc = clip_interp_tab[mask];
ctx->poly_clip_tab = gl_poly_clip_tab[0];
@@ -493,22 +448,11 @@ void gl_init_clip(void)
clip_interp_tab[CLIP_TEX1|CLIP_TEX0|CLIP_RGBA0] = clipTEX1_TEX0_RGBA0;
clip_interp_tab[CLIP_TEX1|CLIP_TEX0|CLIP_RGBA0|CLIP_RGBA1] =
clipTEX1_TEX0_RGBA0_RGBA1;
+
clip_interp_tab[CLIP_TEX0] = clipTEX0;
clip_interp_tab[CLIP_TEX1|CLIP_TEX0] = clipTEX1_TEX0;
+
clip_interp_tab[CLIP_INDEX0] = clipINDEX0;
clip_interp_tab[CLIP_INDEX0|CLIP_INDEX1] = clipINDEX0_INDEX1;
-
- clip_interp_tab[CLIP_FOG_COORD] = clip_FOG;
- clip_interp_tab[CLIP_RGBA0|CLIP_FOG_COORD] = clipRGBA0_FOG;
- clip_interp_tab[CLIP_RGBA0|CLIP_RGBA1|CLIP_FOG_COORD] = clipRGBA0_RGBA1_FOG;
- clip_interp_tab[CLIP_TEX0|CLIP_RGBA0|CLIP_FOG_COORD] = clipTEX0_RGBA0_FOG;
- clip_interp_tab[CLIP_TEX0|CLIP_RGBA0|CLIP_RGBA1|CLIP_FOG_COORD] = clipTEX0_RGBA0_RGBA1_FOG;
- clip_interp_tab[CLIP_TEX1|CLIP_TEX0|CLIP_RGBA0|CLIP_FOG_COORD] = clipTEX1_TEX0_RGBA0_FOG;
- clip_interp_tab[CLIP_TEX1|CLIP_TEX0|CLIP_RGBA0|CLIP_RGBA1|CLIP_FOG_COORD] =
- clipTEX1_TEX0_RGBA0_RGBA1_FOG;
- clip_interp_tab[CLIP_TEX0|CLIP_FOG_COORD] = clipTEX0_FOG;
- clip_interp_tab[CLIP_TEX1|CLIP_TEX0|CLIP_FOG_COORD] = clipTEX1_TEX0_FOG;
- clip_interp_tab[CLIP_INDEX0|CLIP_FOG_COORD] = clipINDEX0_FOG;
- clip_interp_tab[CLIP_INDEX0|CLIP_INDEX1|CLIP_FOG_COORD] = clipINDEX0_INDEX1_FOG;
}
diff --git a/xc/extras/Mesa/src/clip.h b/xc/extras/Mesa/src/clip.h
index 4ee1c7dfd..f93638716 100644
--- a/xc/extras/Mesa/src/clip.h
+++ b/xc/extras/Mesa/src/clip.h
@@ -1,4 +1,4 @@
-/* $Id: clip.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: clip.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -63,11 +63,9 @@ extern GLuint gl_userclip_point( GLcontext* ctx, const GLfloat v[] );
extern void gl_user_cliptest( struct vertex_buffer *VB );
-extern void gl_ClipPlane( GLcontext* ctx,
- GLenum plane, const GLfloat *equation );
+extern void _mesa_ClipPlane( GLenum plane, const GLdouble *equation );
-extern void gl_GetClipPlane( GLcontext* ctx,
- GLenum plane, GLdouble *equation );
+extern void _mesa_GetClipPlane( GLenum plane, GLdouble *equation );
/*
diff --git a/xc/extras/Mesa/src/clip_funcs.h b/xc/extras/Mesa/src/clip_funcs.h
index acd24f893..02bd0e632 100644
--- a/xc/extras/Mesa/src/clip_funcs.h
+++ b/xc/extras/Mesa/src/clip_funcs.h
@@ -1,4 +1,4 @@
-/* $Id: clip_funcs.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: clip_funcs.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/clip_tmp.h b/xc/extras/Mesa/src/clip_tmp.h
index 3056b76de..d86f46e37 100644
--- a/xc/extras/Mesa/src/clip_tmp.h
+++ b/xc/extras/Mesa/src/clip_tmp.h
@@ -1,4 +1,4 @@
-/* $Id: clip_tmp.h,v 1.4 1999/12/18 16:51:05 daryll Exp $ */
+/* $Id: clip_tmp.h,v 1.5 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -35,7 +35,7 @@
* the case where the cliptest passes. This isn't essential,
* and an asm implementation needn't replicate that behaviour.
*/
-static GLvector4f * TAG(cliptest_points4)( GLvector4f *clip_vec,
+static GLvector4f * _XFORMAPI TAG(cliptest_points4)( GLvector4f *clip_vec,
GLvector4f *proj_vec,
GLubyte clipMask[],
GLubyte *orMask,
@@ -100,7 +100,7 @@ static GLvector4f * TAG(cliptest_points4)( GLvector4f *clip_vec,
return proj_vec;
}
-static GLvector4f * TAG(cliptest_points3)( GLvector4f *clip_vec,
+static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec,
GLvector4f *proj_vec,
GLubyte clipMask[],
GLubyte *orMask,
@@ -134,7 +134,7 @@ static GLvector4f * TAG(cliptest_points3)( GLvector4f *clip_vec,
return clip_vec;
}
-static GLvector4f * TAG(cliptest_points2)( GLvector4f *clip_vec,
+static GLvector4f * _XFORMAPI TAG(cliptest_points2)( GLvector4f *clip_vec,
GLvector4f *proj_vec,
GLubyte clipMask[],
GLubyte *orMask,
diff --git a/xc/extras/Mesa/src/colortab.c b/xc/extras/Mesa/src/colortab.c
index ce69fea0b..89dddd7b9 100644
--- a/xc/extras/Mesa/src/colortab.c
+++ b/xc/extras/Mesa/src/colortab.c
@@ -1,8 +1,8 @@
-/* $Id: colortab.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: colortab.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -23,20 +23,15 @@
* 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.
*/
-/* $XFree86: xc/lib/GL/mesa/src/colortab.c,v 1.2 1999/04/04 00:20:21 dawes Exp $ */
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifdef XFree86Server
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "colortab.h"
#include "context.h"
+#include "image.h"
#include "macros.h"
#endif
@@ -45,7 +40,8 @@
/*
* Return GL_TRUE if k is a power of two, else return GL_FALSE.
*/
-static GLboolean power_of_two( GLint k )
+static GLboolean
+power_of_two( GLint k )
{
GLint i, m = 1;
for (i=0; i<32; i++) {
@@ -57,7 +53,8 @@ static GLboolean power_of_two( GLint k )
}
-static GLint decode_internal_format( GLint format )
+static GLint
+decode_internal_format( GLint format )
{
switch (format) {
case GL_ALPHA:
@@ -114,81 +111,95 @@ static GLint decode_internal_format( GLint format )
}
-void gl_ColorTable( GLcontext *ctx, GLenum target,
- GLenum internalFormat, struct gl_image *table )
+void
+_mesa_ColorTableEXT( GLenum target, GLenum internalFormat,
+ GLsizei width, GLenum format, GLenum type,
+ const GLvoid *table )
{
+ GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
struct gl_texture_object *texObj;
+ struct gl_color_table *palette;
GLboolean proxy = GL_FALSE;
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glColorTable");
-
- if (decode_internal_format(internalFormat) < 0) {
- gl_error( ctx, GL_INVALID_ENUM, "glColorTable(internalFormat)" );
- return;
- }
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glColorTableEXT");
switch (target) {
case GL_TEXTURE_1D:
texObj = texUnit->CurrentD[1];
+ palette = &texObj->Palette;
break;
case GL_TEXTURE_2D:
texObj = texUnit->CurrentD[2];
+ palette = &texObj->Palette;
break;
- case GL_TEXTURE_3D_EXT:
+ case GL_TEXTURE_3D:
texObj = texUnit->CurrentD[3];
+ palette = &texObj->Palette;
break;
case GL_PROXY_TEXTURE_1D:
texObj = ctx->Texture.Proxy1D;
+ palette = &texObj->Palette;
proxy = GL_TRUE;
break;
case GL_PROXY_TEXTURE_2D:
texObj = ctx->Texture.Proxy2D;
+ palette = &texObj->Palette;
proxy = GL_TRUE;
break;
- case GL_PROXY_TEXTURE_3D_EXT:
+ case GL_PROXY_TEXTURE_3D:
texObj = ctx->Texture.Proxy3D;
+ palette = &texObj->Palette;
proxy = GL_TRUE;
break;
case GL_SHARED_TEXTURE_PALETTE_EXT:
texObj = NULL;
+ palette = &ctx->Texture.Palette;
break;
default:
gl_error(ctx, GL_INVALID_ENUM, "glColorTableEXT(target)");
return;
}
- /* internalformat = just like glTexImage */
+ assert(palette);
+
+ if (!gl_is_legal_format_and_type(format, type)) {
+ gl_error(ctx, GL_INVALID_ENUM, "glColorTableEXT(format or type)");
+ return;
+ }
+
+ if (decode_internal_format(internalFormat) < 0) {
+ gl_error( ctx, GL_INVALID_ENUM, "glColorTableEXT(internalFormat)" );
+ return;
+ }
- if (table->Width < 1 || table->Width > MAX_TEXTURE_PALETTE_SIZE
- || !power_of_two(table->Width)) {
+ if (width < 1 || width > MAX_TEXTURE_PALETTE_SIZE || !power_of_two(width)) {
gl_error(ctx, GL_INVALID_VALUE, "glColorTableEXT(width)");
if (proxy) {
- texObj->PaletteSize = 0;
- texObj->PaletteIntFormat = (GLenum) 0;
- texObj->PaletteFormat = (GLenum) 0;
+ palette->Size = 0;
+ palette->IntFormat = (GLenum) 0;
+ palette->Format = (GLenum) 0;
}
return;
}
+ palette->Size = width;
+ palette->IntFormat = internalFormat;
+ palette->Format = (GLenum) decode_internal_format(internalFormat);
+ if (!proxy) {
+ _mesa_unpack_ubyte_color_span(ctx, width, palette->Format,
+ palette->Table, /* dest */
+ format, type, table,
+ &ctx->Unpack, GL_FALSE);
+ }
if (texObj) {
/* per-texture object palette */
- texObj->PaletteSize = table->Width;
- texObj->PaletteIntFormat = internalFormat;
- texObj->PaletteFormat = (GLenum) decode_internal_format(internalFormat);
- if (!proxy) {
- MEMCPY(texObj->Palette, table->Data, table->Width*table->Components);
- if (ctx->Driver.UpdateTexturePalette) {
- (*ctx->Driver.UpdateTexturePalette)( ctx, texObj );
- }
+ if (ctx->Driver.UpdateTexturePalette) {
+ (*ctx->Driver.UpdateTexturePalette)( ctx, texObj );
}
}
else {
/* shared texture palette */
- ctx->Texture.PaletteSize = table->Width;
- ctx->Texture.PaletteIntFormat = internalFormat;
- ctx->Texture.PaletteFormat = (GLenum) decode_internal_format(internalFormat);
- MEMCPY(ctx->Texture.Palette, table->Data, table->Width*table->Components);
if (ctx->Driver.UpdateTexturePalette) {
(*ctx->Driver.UpdateTexturePalette)( ctx, NULL );
}
@@ -197,38 +208,171 @@ void gl_ColorTable( GLcontext *ctx, GLenum target,
-void gl_ColorSubTable( GLcontext *ctx, GLenum target,
- GLsizei start, struct gl_image *data )
+void
+_mesa_ColorSubTableEXT( GLenum target, GLsizei start,
+ GLsizei count, GLenum format, GLenum type,
+ const GLvoid *table )
{
- /* XXX TODO */
- gl_problem(ctx, "glColorSubTableEXT not implemented");
- (void) target;
- (void) start;
- (void) data;
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ struct gl_texture_object *texObj;
+ struct gl_color_table *palette;
+ GLint comps;
+ GLubyte *dest;
+
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glColorSubTableEXT");
+
+ switch (target) {
+ case GL_TEXTURE_1D:
+ texObj = texUnit->CurrentD[1];
+ palette = &texObj->Palette;
+ break;
+ case GL_TEXTURE_2D:
+ texObj = texUnit->CurrentD[2];
+ palette = &texObj->Palette;
+ break;
+ case GL_TEXTURE_3D:
+ texObj = texUnit->CurrentD[3];
+ palette = &texObj->Palette;
+ break;
+ case GL_SHARED_TEXTURE_PALETTE_EXT:
+ texObj = NULL;
+ palette = &ctx->Texture.Palette;
+ break;
+ default:
+ gl_error(ctx, GL_INVALID_ENUM, "glColorSubTableEXT(target)");
+ return;
+ }
+
+ assert(palette);
+
+ if (!gl_is_legal_format_and_type(format, type)) {
+ gl_error(ctx, GL_INVALID_ENUM, "glColorSubTableEXT(format or type)");
+ return;
+ }
+
+ if (count < 1) {
+ gl_error(ctx, GL_INVALID_VALUE, "glColorSubTableEXT(count)");
+ return;
+ }
+
+ comps = gl_components_in_format(format);
+ assert(comps > 0); /* error should be caught sooner */
+
+ if (start + count > palette->Size) {
+ gl_error(ctx, GL_INVALID_VALUE, "glColorSubTableEXT(count)");
+ return;
+ }
+ dest = palette->Table + start * comps * sizeof(GLubyte);
+ _mesa_unpack_ubyte_color_span(ctx, count, palette->Format, dest,
+ format, type, table,
+ &ctx->Unpack, GL_FALSE);
+
+ if (texObj) {
+ /* per-texture object palette */
+ if (ctx->Driver.UpdateTexturePalette) {
+ (*ctx->Driver.UpdateTexturePalette)( ctx, texObj );
+ }
+ }
+ else {
+ /* shared texture palette */
+ if (ctx->Driver.UpdateTexturePalette) {
+ (*ctx->Driver.UpdateTexturePalette)( ctx, NULL );
+ }
+ }
}
-void gl_GetColorTable( GLcontext *ctx, GLenum target, GLenum format,
- GLenum type, GLvoid *table )
+void
+_mesa_GetColorTableEXT( GLenum target, GLenum format,
+ GLenum type, GLvoid *table )
{
- ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetBooleanv");
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ struct gl_color_table *palette;
+ GLubyte rgba[MAX_TEXTURE_PALETTE_SIZE][4];
+ GLint i;
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetColorTableEXT");
switch (target) {
case GL_TEXTURE_1D:
+ palette = &texUnit->CurrentD[1]->Palette;
break;
case GL_TEXTURE_2D:
+ palette = &texUnit->CurrentD[2]->Palette;
break;
- case GL_TEXTURE_3D_EXT:
+ case GL_TEXTURE_3D:
+ palette = &texUnit->CurrentD[3]->Palette;
break;
case GL_SHARED_TEXTURE_PALETTE_EXT:
+ palette = &ctx->Texture.Palette;
break;
default:
gl_error(ctx, GL_INVALID_ENUM, "glGetColorTableEXT(target)");
return;
}
- gl_problem(ctx, "glGetColorTableEXT not implemented!");
+ assert(palette);
+
+ switch (palette->Format) {
+ case GL_ALPHA:
+ for (i = 0; i < palette->Size; i++) {
+ rgba[i][RCOMP] = 0;
+ rgba[i][GCOMP] = 0;
+ rgba[i][BCOMP] = 0;
+ rgba[i][ACOMP] = palette->Table[i];
+ }
+ break;
+ case GL_LUMINANCE:
+ for (i = 0; i < palette->Size; i++) {
+ rgba[i][RCOMP] = palette->Table[i];
+ rgba[i][GCOMP] = palette->Table[i];
+ rgba[i][BCOMP] = palette->Table[i];
+ rgba[i][ACOMP] = 255;
+ }
+ break;
+ case GL_LUMINANCE_ALPHA:
+ for (i = 0; i < palette->Size; i++) {
+ rgba[i][RCOMP] = palette->Table[i*2+0];
+ rgba[i][GCOMP] = palette->Table[i*2+0];
+ rgba[i][BCOMP] = palette->Table[i*2+0];
+ rgba[i][ACOMP] = palette->Table[i*2+1];
+ }
+ break;
+ case GL_INTENSITY:
+ for (i = 0; i < palette->Size; i++) {
+ rgba[i][RCOMP] = palette->Table[i];
+ rgba[i][GCOMP] = palette->Table[i];
+ rgba[i][BCOMP] = palette->Table[i];
+ rgba[i][ACOMP] = 255;
+ }
+ break;
+ case GL_RGB:
+ for (i = 0; i < palette->Size; i++) {
+ rgba[i][RCOMP] = palette->Table[i*3+0];
+ rgba[i][GCOMP] = palette->Table[i*3+1];
+ rgba[i][BCOMP] = palette->Table[i*3+2];
+ rgba[i][ACOMP] = 255;
+ }
+ break;
+ case GL_RGBA:
+ for (i = 0; i < palette->Size; i++) {
+ rgba[i][RCOMP] = palette->Table[i*4+0];
+ rgba[i][GCOMP] = palette->Table[i*4+1];
+ rgba[i][BCOMP] = palette->Table[i*4+2];
+ rgba[i][ACOMP] = palette->Table[i*4+3];
+ }
+ break;
+ default:
+ gl_problem(ctx, "bad palette format in glGetColorTableEXT");
+ return;
+ }
+
+ gl_pack_rgba_span(ctx, palette->Size, (const GLubyte (*)[]) rgba,
+ format, type, table, &ctx->Pack, GL_FALSE);
+
(void) format;
(void) type;
(void) table;
@@ -236,76 +380,70 @@ void gl_GetColorTable( GLcontext *ctx, GLenum target, GLenum format,
-void gl_GetColorTableParameterfv( GLcontext *ctx, GLenum target,
- GLenum pname, GLfloat *params )
+void
+_mesa_GetColorTableParameterfvEXT( GLenum target, GLenum pname, GLfloat *params )
{
GLint iparams[10];
-
- gl_GetColorTableParameteriv( ctx, target, pname, iparams );
+ _mesa_GetColorTableParameterivEXT( target, pname, iparams );
*params = (GLfloat) iparams[0];
}
-void gl_GetColorTableParameteriv( GLcontext *ctx, GLenum target,
- GLenum pname, GLint *params )
+void
+_mesa_GetColorTableParameterivEXT( GLenum target, GLenum pname, GLint *params )
{
+ GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- struct gl_texture_object *texObj;
+ struct gl_color_table *palette;
- ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetColorTableParameter");
+ ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetColorTableParameterEXT");
switch (target) {
case GL_TEXTURE_1D:
- texObj = texUnit->CurrentD[1];
+ palette = &texUnit->CurrentD[1]->Palette;
break;
case GL_TEXTURE_2D:
- texObj = texUnit->CurrentD[2];
+ palette = &texUnit->CurrentD[2]->Palette;
break;
- case GL_TEXTURE_3D_EXT:
- texObj = texUnit->CurrentD[3];
+ case GL_TEXTURE_3D:
+ palette = &texUnit->CurrentD[3]->Palette;
break;
case GL_SHARED_TEXTURE_PALETTE_EXT:
- texObj = NULL;
+ palette = &ctx->Texture.Palette;
break;
default:
- gl_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter(target)");
+ gl_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameterEXT(target)");
return;
}
switch (pname) {
- case GL_COLOR_TABLE_FORMAT_EXT:
- if (texObj)
- *params = texObj->PaletteIntFormat;
- else
- *params = ctx->Texture.PaletteIntFormat;
- break;
- case GL_COLOR_TABLE_WIDTH_EXT:
- if (texObj)
- *params = texObj->PaletteSize;
- else
- *params = ctx->Texture.PaletteSize;
- break;
- case GL_COLOR_TABLE_RED_SIZE_EXT:
+ case GL_COLOR_TABLE_FORMAT:
+ *params = palette->IntFormat;
+ break;
+ case GL_COLOR_TABLE_WIDTH:
+ *params = palette->Size;
+ break;
+ case GL_COLOR_TABLE_RED_SIZE:
*params = 8;
break;
- case GL_COLOR_TABLE_GREEN_SIZE_EXT:
+ case GL_COLOR_TABLE_GREEN_SIZE:
*params = 8;
break;
- case GL_COLOR_TABLE_BLUE_SIZE_EXT:
+ case GL_COLOR_TABLE_BLUE_SIZE:
*params = 8;
break;
- case GL_COLOR_TABLE_ALPHA_SIZE_EXT:
+ case GL_COLOR_TABLE_ALPHA_SIZE:
*params = 8;
break;
- case GL_COLOR_TABLE_LUMINANCE_SIZE_EXT:
+ case GL_COLOR_TABLE_LUMINANCE_SIZE:
*params = 8;
break;
- case GL_COLOR_TABLE_INTENSITY_SIZE_EXT:
+ case GL_COLOR_TABLE_INTENSITY_SIZE:
*params = 8;
break;
default:
- gl_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter" );
+ gl_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameterEXT" );
return;
}
}
diff --git a/xc/extras/Mesa/src/colortab.h b/xc/extras/Mesa/src/colortab.h
index c5e4e0f17..c98874655 100644
--- a/xc/extras/Mesa/src/colortab.h
+++ b/xc/extras/Mesa/src/colortab.h
@@ -1,8 +1,8 @@
-/* $Id: colortab.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: colortab.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef COLORTAB_H
#define COLORTAB_H
@@ -35,21 +32,30 @@
#include "types.h"
-extern void gl_ColorTable( GLcontext *ctx, GLenum target,
- GLenum internalformat,
- struct gl_image *table );
+extern void
+_mesa_ColorTableEXT( GLenum target, GLenum internalformat,
+ GLsizei width, GLenum format, GLenum type,
+ const GLvoid *table );
-extern void gl_ColorSubTable( GLcontext *ctx, GLenum target,
- GLsizei start, struct gl_image *data );
+extern void
+_mesa_ColorSubTableEXT( GLenum target, GLsizei start,
+ GLsizei count, GLenum format, GLenum type,
+ const GLvoid *table );
-extern void gl_GetColorTable( GLcontext *ctx, GLenum target, GLenum format,
- GLenum type, GLvoid *table );
+extern void
+_mesa_GetColorTableEXT( GLenum target, GLenum format,
+ GLenum type, GLvoid *table );
+#ifdef VMS
+/* VMS does not support externals longer than 32 characters. */
+#define _mesa_GetColorTableParameterfvEXT VMS_GCTParameterfvEXT
+#define _mesa_GetColorTableParameterivEXT VMS_GCTParameterivEXT
+#endif
-extern void gl_GetColorTableParameterfv( GLcontext *ctx, GLenum target,
- GLenum pname, GLfloat *params );
+extern void
+_mesa_GetColorTableParameterfvEXT( GLenum target, GLenum pname, GLfloat *params );
-extern void gl_GetColorTableParameteriv( GLcontext *ctx, GLenum target,
- GLenum pname, GLint *params );
+extern void
+_mesa_GetColorTableParameterivEXT( GLenum target, GLenum pname, GLint *params );
#endif
diff --git a/xc/extras/Mesa/src/config.c b/xc/extras/Mesa/src/config.c
index 1834fd73e..e10642f48 100644
--- a/xc/extras/Mesa/src/config.c
+++ b/xc/extras/Mesa/src/config.c
@@ -1,8 +1,8 @@
-/* $Id: config.c,v 1.4 1999/12/18 16:51:05 daryll Exp $ */
+/* $Id: config.c,v 1.5 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -31,19 +31,19 @@
* to parse and potentially very expressive.
*/
-#ifndef XFree86Server
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
+
+#ifdef PC_HEADER
+#include "all.h"
#else
-#include "GL/xf86glx.h"
-#endif
-#include "enums.h"
+#include "glheader.h"
#include "config.h"
-#include "types.h"
+#include "enums.h"
#include "extensions.h"
-#include "simple_list.h"
#include "glmisc.h"
+#include "simple_list.h"
+#include "mem.h"
+#include "types.h"
+#endif
typedef enum { nil_t, list_t, word_t } node_type;
@@ -229,7 +229,7 @@ static void default_hint( GLcontext *ctx, struct cnode *args )
(v = (GLenum) gl_lookup_enum_by_name(vname)) != -1)
{
printf("calling glHint(%s=%d, %s=%d)\n", hname, h, vname, v);
- if (!gl_Hint( ctx, h, v ))
+ if (!_mesa_try_Hint( ctx, h, v ))
error( hint, "glHint failed");
printf("allow draw mem: %d\n", ctx->Hint.AllowDrawMem);
return;
@@ -401,7 +401,7 @@ static void free_list( struct cnode *n )
*/
void gl_read_config_file( GLcontext *ctx )
{
- const char *default_config = "mesa3.1";
+ const char *default_config = "mesa3.1beta1";
#if defined(__WIN32__) || defined(__MSDOS__)
const char *filename = "mesa.cnf";
diff --git a/xc/extras/Mesa/src/config.h b/xc/extras/Mesa/src/config.h
index a80ac5922..297acc0b8 100644
--- a/xc/extras/Mesa/src/config.h
+++ b/xc/extras/Mesa/src/config.h
@@ -1,10 +1,10 @@
-/* $Id: config.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: config.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,10 +25,6 @@
*/
-
-
-
-
/*
* Tunable configuration parameters.
*/
@@ -42,13 +38,11 @@
#include "conf.h"
#endif
+
/*
- *
* OpenGL implementation limits
- *
*/
-
/* Maximum modelview matrix stack depth: */
#define MAX_MODELVIEW_STACK_DEPTH 32
@@ -116,10 +110,9 @@
#define MAX_ARRAY_LOCK_SIZE 3000
+
/*
- *
* Mesa-specific parameters
- *
*/
@@ -129,6 +122,9 @@
#define ACCUM_BITS 16
+/*
+ * Bits per depth buffer value: 16 or 32
+ */
#ifdef MESAD3D
/* Mesa / Direct3D driver only */
extern float g_DepthScale, g_MaxDepth;
@@ -136,9 +132,6 @@
# define DEPTH_SCALE g_DepthScale
# define MAX_DEPTH g_MaxDepth
#else
- /*
- * Bits per depth buffer value: 16 or 32
- */
# define DEPTH_BITS 16
# if DEPTH_BITS==16
# define MAX_DEPTH 0xffff
@@ -180,14 +173,11 @@
* this number, though things may go better for you if you choose a
* value of 12n + 3.
*/
-
#define VB_START 3
-#if defined(FX) && !defined(MITS)
-# define VB_MAX 72 + VB_START /* better performance */
-#else
-# define VB_MAX 480 + VB_START
-#endif
+#define VB_MAX (216 + VB_START)
+
+
/*
* Actual vertex buffer size.
@@ -201,22 +191,13 @@
#define VB_SIZE (VB_MAX + VB_MAX_CLIPPED_VERTS)
-/*
- *
- * For X11 driver only:
- *
- */
-
-/*
- * When defined, use 6x6x6 dithering instead of 5x9x5.
- * 5x9x5 better for general colors, 6x6x6 better for grayscale.
- */
-/*#define DITHER666*/
-
-
typedef struct gl_context GLcontext;
-extern void gl_read_config_file( struct gl_context *ctx );
+extern void
+gl_read_config_file( struct gl_context *ctx );
+
+extern void
+gl_register_config_var(const char *name, void (*notify)( const char *, int ));
#endif
diff --git a/xc/extras/Mesa/src/context.c b/xc/extras/Mesa/src/context.c
index 8de6040aa..00778331c 100644
--- a/xc/extras/Mesa/src/context.c
+++ b/xc/extras/Mesa/src/context.c
@@ -1,10 +1,10 @@
-/* $Id: context.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: context.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,54 +25,36 @@
*/
-/* $XFree86: xc/lib/GL/mesa/src/context.c,v 1.4 1999/04/04 00:20:21 dawes Exp $ */
-
-/*
- * If multi-threading is enabled (-DTHREADS) then each thread has it's
- * own rendering context. A thread obtains the pointer to its GLcontext
- * with the gl_get_thread_context() function. Otherwise, the global
- * pointer, CC, points to the current context used by all threads in
- * the address space.
- */
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "accum.h"
#include "alphabuf.h"
-#include "api.h"
#include "clip.h"
#include "context.h"
#include "cva.h"
#include "depth.h"
+#include "dispatch.h"
#include "dlist.h"
#include "eval.h"
#include "enums.h"
#include "extensions.h"
#include "fog.h"
#include "get.h"
+#include "glapi.h"
+#include "glapinoop.h"
#include "hash.h"
#include "light.h"
#include "lines.h"
#include "dlist.h"
#include "macros.h"
#include "matrix.h"
+#include "mem.h"
#include "mmath.h"
#include "pb.h"
#include "pipeline.h"
#include "points.h"
-#include "pointers.h"
#include "quads.h"
#include "shade.h"
#include "simple_list.h"
@@ -96,72 +78,17 @@
#endif
-/*
- * Memory allocation functions. Called via the MALLOC, CALLOC and
- * FREE macros when DEBUG symbol is defined.
- * You might want to set breakpoints on these functions or plug in
- * other memory allocation functions. The Mesa sources should only
- * use the MALLOC and FREE macros (which could also be overriden).
- *
- * XXX these functions should probably go into a new glmemory.c file.
- */
-
-/*
- * Allocate memory (uninitialized)
- */
-void *gl_malloc(size_t bytes)
-{
- return malloc(bytes);
-}
-
-/*
- * Allocate memory and initialize to zero.
- */
-void *gl_calloc(size_t bytes)
-{
- return calloc(1, bytes);
-}
-
-/*
- * Free memory
- */
-void gl_free(void *ptr)
-{
- free(ptr);
-}
-
/**********************************************************************/
/***** Context and Thread management *****/
/**********************************************************************/
-#ifdef THREADS
-
-#include "mthreads.h" /* Mesa platform independent threads interface */
+#if !defined(THREADS)
-static MesaTSD mesa_ctx_tsd;
-
-static void mesa_ctx_thread_init() {
- MesaInitTSD(&mesa_ctx_tsd);
-}
+struct immediate *_mesa_CurrentInput = NULL;
-GLcontext *gl_get_thread_context( void ) {
- return (GLcontext *) MesaGetTSD(&mesa_ctx_tsd);
-}
-
-static void set_thread_context( GLcontext *ctx ) {
- MesaSetTSD(&mesa_ctx_tsd, ctx, mesa_ctx_thread_init);
-}
-
-
-#else
-
-/* One Current Context pointer for all threads in the address space */
-GLcontext *CC = NULL;
-struct immediate *CURRENT_INPUT = NULL;
-
-#endif /*THREADS*/
+#endif
@@ -323,6 +250,176 @@ static void print_timings( GLcontext *ctx )
/**********************************************************************/
+/***** GL Visual allocation/destruction *****/
+/**********************************************************************/
+
+
+/*
+ * Allocate a new GLvisual object.
+ * Input: rgbFlag - GL_TRUE=RGB(A) mode, GL_FALSE=Color Index mode
+ * alphaFlag - alloc software alpha buffers?
+ * dbFlag - double buffering?
+ * stereoFlag - stereo buffer?
+ * depthFits - requested minimum bits per depth buffer value
+ * stencilFits - requested minimum bits per stencil buffer value
+ * accumFits - requested minimum bits per accum buffer component
+ * indexFits - number of bits per pixel if rgbFlag==GL_FALSE
+ * red/green/blue/alphaFits - number of bits per color component
+ * in frame buffer for RGB(A) mode.
+ * Return: pointer to new GLvisual or NULL if requested parameters can't
+ * be met.
+ */
+GLvisual *gl_create_visual( GLboolean rgbFlag,
+ GLboolean alphaFlag,
+ GLboolean dbFlag,
+ GLboolean stereoFlag,
+ GLint depthBits,
+ GLint stencilBits,
+ GLint accumBits,
+ GLint indexBits,
+ GLint redBits,
+ GLint greenBits,
+ GLint blueBits,
+ GLint alphaBits )
+{
+ GLvisual *vis;
+
+ if (depthBits > (GLint) (8*sizeof(GLdepth))) {
+ /* can't meet depth buffer requirements */
+ return NULL;
+ }
+ if (stencilBits > (GLint) (8*sizeof(GLstencil))) {
+ /* can't meet stencil buffer requirements */
+ return NULL;
+ }
+ if (accumBits > (GLint) (8*sizeof(GLaccum))) {
+ /* can't meet accum buffer requirements */
+ return NULL;
+ }
+
+ vis = (GLvisual *) CALLOC( sizeof(GLvisual) );
+ if (!vis) {
+ return NULL;
+ }
+
+ vis->RGBAflag = rgbFlag;
+ vis->DBflag = dbFlag;
+ vis->StereoFlag = stereoFlag;
+ vis->RedBits = redBits;
+ vis->GreenBits = greenBits;
+ vis->BlueBits = blueBits;
+ vis->AlphaBits = alphaFlag ? 8*sizeof(GLubyte) : alphaBits;
+
+ vis->IndexBits = indexBits;
+ vis->DepthBits = (depthBits>0) ? 8*sizeof(GLdepth) : 0;
+ vis->AccumBits = (accumBits>0) ? 8*sizeof(GLaccum) : 0;
+ vis->StencilBits = (stencilBits>0) ? 8*sizeof(GLstencil) : 0;
+
+ vis->SoftwareAlpha = alphaFlag;
+
+ return vis;
+}
+
+
+
+void gl_destroy_visual( GLvisual *vis )
+{
+ FREE( vis );
+}
+
+
+
+/**********************************************************************/
+/***** GL Framebuffer allocation/destruction *****/
+/**********************************************************************/
+
+
+/*
+ * Create a new framebuffer. A GLframebuffer is a struct which
+ * encapsulates the depth, stencil and accum buffers and related
+ * parameters.
+ * Input: visual - a GLvisual pointer
+ * softwareDepth - create/use a software depth buffer?
+ * softwareStencil - create/use a software stencil buffer?
+ * softwareAccum - create/use a software accum buffer?
+ * softwareAlpha - create/use a software alpha buffer?
+
+ * Return: pointer to new GLframebuffer struct or NULL if error.
+ */
+GLframebuffer *gl_create_framebuffer( GLvisual *visual,
+ GLboolean softwareDepth,
+ GLboolean softwareStencil,
+ GLboolean softwareAccum,
+ GLboolean softwareAlpha )
+{
+ GLframebuffer *buffer;
+
+ buffer = CALLOC_STRUCT(gl_frame_buffer);
+ if (!buffer) {
+ return NULL;
+ }
+
+ /* sanity checks */
+ if (softwareDepth ) {
+ assert(visual->DepthBits > 0);
+ }
+ if (softwareStencil) {
+ assert(visual->StencilBits > 0);
+ }
+ if (softwareAccum) {
+ assert(visual->RGBAflag);
+ assert(visual->AccumBits > 0);
+ }
+ if (softwareAlpha) {
+ assert(visual->RGBAflag);
+ assert(visual->AlphaBits > 0);
+ }
+
+ buffer->Visual = visual;
+ buffer->UseSoftwareDepthBuffer = softwareDepth;
+ buffer->UseSoftwareStencilBuffer = softwareStencil;
+ buffer->UseSoftwareAccumBuffer = softwareAccum;
+ buffer->UseSoftwareAlphaBuffers = softwareAlpha;
+
+ return buffer;
+}
+
+
+
+/*
+ * Free a framebuffer struct and its buffers.
+ */
+void gl_destroy_framebuffer( GLframebuffer *buffer )
+{
+ if (buffer) {
+ if (buffer->Depth) {
+ FREE( buffer->Depth );
+ }
+ if (buffer->Accum) {
+ FREE( buffer->Accum );
+ }
+ if (buffer->Stencil) {
+ FREE( buffer->Stencil );
+ }
+ if (buffer->FrontLeftAlpha) {
+ FREE( buffer->FrontLeftAlpha );
+ }
+ if (buffer->BackLeftAlpha) {
+ FREE( buffer->BackLeftAlpha );
+ }
+ if (buffer->FrontRightAlpha) {
+ FREE( buffer->FrontRightAlpha );
+ }
+ if (buffer->BackRightAlpha) {
+ FREE( buffer->BackRightAlpha );
+ }
+ FREE(buffer);
+ }
+}
+
+
+
+/**********************************************************************/
/***** Context allocation, initialization, destroying *****/
/**********************************************************************/
@@ -334,6 +431,14 @@ static void one_time_init( void )
{
static GLboolean alreadyCalled = GL_FALSE;
if (!alreadyCalled) {
+ /* do some implementation tests */
+ assert( sizeof(GLbyte) == 1 );
+ assert( sizeof(GLshort) >= 2 );
+ assert( sizeof(GLint) >= 4 );
+ assert( sizeof(GLubyte) == 1 );
+ assert( sizeof(GLushort) >= 2 );
+ assert( sizeof(GLuint) >= 4 );
+
gl_init_clip();
gl_init_eval();
gl_init_fog();
@@ -346,14 +451,24 @@ static void one_time_init( void )
gl_init_vbrender();
gl_init_vbxform();
gl_init_vertices();
- alreadyCalled = GL_TRUE;
- }
+
+ if (getenv("MESA_DEBUG")) {
+ _glapi_noop_enable_warnings(GL_TRUE);
+ }
+ else {
+ _glapi_noop_enable_warnings(GL_FALSE);
+ }
+
#if defined(DEBUG) && defined(__DATE__) && defined(__TIME__)
fprintf(stderr, "Mesa DEBUG build %s %s\n", __DATE__, __TIME__);
#endif
+
+ alreadyCalled = GL_TRUE;
+ }
}
+
/*
* Allocate and initialize a shared context state structure.
*/
@@ -367,9 +482,9 @@ static struct gl_shared_state *alloc_shared_state( void )
if (!ss)
return NULL;
- ss->DisplayList = NewHashTable();
+ ss->DisplayList = _mesa_NewHashTable();
- ss->TexObjects = NewHashTable();
+ ss->TexObjects = _mesa_NewHashTable();
/* Default Texture objects */
outOfMemory = GL_FALSE;
@@ -385,9 +500,9 @@ static struct gl_shared_state *alloc_shared_state( void )
if (!ss->DisplayList || !ss->TexObjects || outOfMemory) {
/* Ran out of memory at some point. Free everything and return NULL */
if (ss->DisplayList)
- DeleteHashTable(ss->DisplayList);
+ _mesa_DeleteHashTable(ss->DisplayList);
if (ss->TexObjects)
- DeleteHashTable(ss->TexObjects);
+ _mesa_DeleteHashTable(ss->TexObjects);
if (ss->DefaultD[1])
gl_free_texture_object(ss, ss->DefaultD[1]);
if (ss->DefaultD[2])
@@ -410,7 +525,7 @@ static void free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
{
/* Free display lists */
while (1) {
- GLuint list = HashFirstEntry(ss->DisplayList);
+ GLuint list = _mesa_HashFirstEntry(ss->DisplayList);
if (list) {
gl_destroy_list(ctx, list);
}
@@ -418,7 +533,7 @@ static void free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
break;
}
}
- DeleteHashTable(ss->DisplayList);
+ _mesa_DeleteHashTable(ss->DisplayList);
/* Free texture objects */
while (ss->TexObjectList)
@@ -428,16 +543,13 @@ static void free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
/* this function removes from linked list too! */
gl_free_texture_object(ss, ss->TexObjectList);
}
- DeleteHashTable(ss->TexObjects);
+ _mesa_DeleteHashTable(ss->TexObjects);
FREE(ss);
}
-
-
-
/*
* Initialize the nth light. Note that the defaults for light 0 are
* different than the other lights.
@@ -567,6 +679,7 @@ static void init_fallback_arrays( GLcontext *ctx )
cl->Enabled = 1;
}
+
/* Initialize a 1-D evaluator map */
static void init_1d_map( struct gl_1d_map *map, int n, const float *initial )
{
@@ -579,7 +692,6 @@ static void init_1d_map( struct gl_1d_map *map, int n, const float *initial )
for (i=0;i<n;i++)
map->Points[i] = initial[i];
}
- map->Retain = GL_FALSE;
}
@@ -598,568 +710,510 @@ static void init_2d_map( struct gl_2d_map *map, int n, const float *initial )
for (i=0;i<n;i++)
map->Points[i] = initial[i];
}
- map->Retain = GL_FALSE;
}
+static void init_color_table( struct gl_color_table *p )
+{
+ p->Table[0] = 255;
+ p->Table[1] = 255;
+ p->Table[2] = 255;
+ p->Table[3] = 255;
+ p->Size = 1;
+ p->IntFormat = GL_RGBA;
+ p->Format = GL_RGBA;
+}
+
/*
- * Initialize a gl_context structure to default values.
+ * Initialize the attribute groups in a GLcontext.
*/
-static void initialize_context( GLcontext *ctx )
+static void init_attrib_groups( GLcontext *ctx )
{
GLuint i, j;
- if (ctx) {
- /* Constants, may be overriden by device driver */
- ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS;
- ctx->Const.MaxTextureSize = 1 << (MAX_TEXTURE_LEVELS - 1);
- ctx->Const.MaxTextureUnits = MAX_TEXTURE_UNITS;
- ctx->Const.MaxArrayLockSize = MAX_ARRAY_LOCK_SIZE;
-
- /* Modelview matrix */
- gl_matrix_ctr( &ctx->ModelView );
- gl_matrix_alloc_inv( &ctx->ModelView );
-
- ctx->ModelViewStackDepth = 0;
- for (i = 0 ; i < MAX_MODELVIEW_STACK_DEPTH ; i++) {
- gl_matrix_ctr( &ctx->ModelViewStack[i] );
- gl_matrix_alloc_inv( &ctx->ModelViewStack[i] );
- }
+ assert(ctx);
- /* Projection matrix - need inv for user clipping in clip space*/
- gl_matrix_ctr( &ctx->ProjectionMatrix );
- gl_matrix_alloc_inv( &ctx->ProjectionMatrix );
+ /* Constants, may be overriden by device driver */
+ ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS;
+ ctx->Const.MaxTextureSize = 1 << (MAX_TEXTURE_LEVELS - 1);
+ ctx->Const.MaxTextureUnits = MAX_TEXTURE_UNITS;
+ ctx->Const.MaxArrayLockSize = MAX_ARRAY_LOCK_SIZE;
- gl_matrix_ctr( &ctx->ModelProjectMatrix );
- gl_matrix_ctr( &ctx->ModelProjectWinMatrix );
- ctx->ModelProjectWinMatrixUptodate = GL_FALSE;
+ /* Modelview matrix */
+ gl_matrix_ctr( &ctx->ModelView );
+ gl_matrix_alloc_inv( &ctx->ModelView );
- ctx->ProjectionStackDepth = 0;
- ctx->NearFarStack[0][0] = 1.0; /* These values seem weird by make */
- ctx->NearFarStack[0][1] = 0.0; /* sense mathematically. */
+ ctx->ModelViewStackDepth = 0;
+ for (i = 0 ; i < MAX_MODELVIEW_STACK_DEPTH ; i++) {
+ gl_matrix_ctr( &ctx->ModelViewStack[i] );
+ gl_matrix_alloc_inv( &ctx->ModelViewStack[i] );
+ }
- for (i = 0 ; i < MAX_PROJECTION_STACK_DEPTH ; i++) {
- gl_matrix_ctr( &ctx->ProjectionStack[i] );
- gl_matrix_alloc_inv( &ctx->ProjectionStack[i] );
- }
+ /* Projection matrix - need inv for user clipping in clip space*/
+ gl_matrix_ctr( &ctx->ProjectionMatrix );
+ gl_matrix_alloc_inv( &ctx->ProjectionMatrix );
- /* Texture matrix */
- for (i=0; i<MAX_TEXTURE_UNITS; i++) {
- gl_matrix_ctr( &ctx->TextureMatrix[i] );
- ctx->TextureStackDepth[i] = 0;
- for (j = 0 ; j < MAX_TEXTURE_STACK_DEPTH ; j++) {
- ctx->TextureStack[i][j].inv = 0;
- }
- }
+ gl_matrix_ctr( &ctx->ModelProjectMatrix );
+ gl_matrix_ctr( &ctx->ModelProjectWinMatrix );
+ ctx->ModelProjectWinMatrixUptodate = GL_FALSE;
- /* Accumulate buffer group */
- ASSIGN_4V( ctx->Accum.ClearColor, 0.0, 0.0, 0.0, 0.0 );
-
- /* Color buffer group */
- ctx->Color.IndexMask = 0xffffffff;
- ctx->Color.ColorMask[0] = 0xff;
- ctx->Color.ColorMask[1] = 0xff;
- ctx->Color.ColorMask[2] = 0xff;
- ctx->Color.ColorMask[3] = 0xff;
- ctx->Color.SWmasking = GL_FALSE;
- ctx->Color.ClearIndex = 0;
- ASSIGN_4V( ctx->Color.ClearColor, 0.0, 0.0, 0.0, 0.0 );
- ctx->Color.DrawBuffer = GL_FRONT;
- ctx->Color.AlphaEnabled = GL_FALSE;
- ctx->Color.AlphaFunc = GL_ALWAYS;
- ctx->Color.AlphaRef = 0;
- ctx->Color.BlendEnabled = GL_FALSE;
- ctx->Color.BlendSrcRGB = GL_ONE;
- ctx->Color.BlendDstRGB = GL_ZERO;
- ctx->Color.BlendSrcA = GL_ONE;
- ctx->Color.BlendDstA = GL_ZERO;
- ctx->Color.BlendEquation = GL_FUNC_ADD_EXT;
- ctx->Color.BlendFunc = NULL; /* this pointer set only when needed */
- ASSIGN_4V( ctx->Color.BlendColor, 0.0, 0.0, 0.0, 0.0 );
- ctx->Color.IndexLogicOpEnabled = GL_FALSE;
- ctx->Color.ColorLogicOpEnabled = GL_FALSE;
- ctx->Color.SWLogicOpEnabled = GL_FALSE;
- ctx->Color.LogicOp = GL_COPY;
- ctx->Color.DitherFlag = GL_TRUE;
- ctx->Color.MultiDrawBuffer = GL_FALSE;
-
- /* Current group */
- ASSIGN_4V( ctx->Current.ByteColor, 255, 255, 255, 255);
- ctx->Current.Index = 1;
- for (i=0; i<MAX_TEXTURE_UNITS; i++)
- ASSIGN_4V( ctx->Current.Texcoord[i], 0.0, 0.0, 0.0, 1.0 );
- ASSIGN_4V( ctx->Current.RasterPos, 0.0, 0.0, 0.0, 1.0 );
- ctx->Current.RasterDistance = 0.0;
- ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 );
- ctx->Current.RasterIndex = 1;
- for (i=0; i<MAX_TEXTURE_UNITS; i++)
- ASSIGN_4V( ctx->Current.RasterMultiTexCoord[i], 0.0, 0.0, 0.0, 1.0 );
- ctx->Current.RasterTexCoord = ctx->Current.RasterMultiTexCoord[0];
- ctx->Current.RasterPosValid = GL_TRUE;
- ctx->Current.EdgeFlag = GL_TRUE;
- ASSIGN_3V( ctx->Current.Normal, 0.0, 0.0, 1.0 );
- ctx->Current.Primitive = (GLenum) (GL_POLYGON + 1);
-
- ctx->Current.Flag = (VERT_NORM|VERT_INDEX|VERT_RGBA|VERT_EDGE|
- VERT_TEX0_1|VERT_TEX1_1|VERT_MATERIAL);
-
- init_fallback_arrays( ctx );
-
- /* Depth buffer group */
- ctx->Depth.Test = GL_FALSE;
- ctx->Depth.Clear = 1.0;
- ctx->Depth.Func = GL_LESS;
- ctx->Depth.Mask = GL_TRUE;
-
- /* Evaluators group */
- ctx->Eval.Map1Color4 = GL_FALSE;
- ctx->Eval.Map1Index = GL_FALSE;
- ctx->Eval.Map1Normal = GL_FALSE;
- ctx->Eval.Map1TextureCoord1 = GL_FALSE;
- ctx->Eval.Map1TextureCoord2 = GL_FALSE;
- ctx->Eval.Map1TextureCoord3 = GL_FALSE;
- ctx->Eval.Map1TextureCoord4 = GL_FALSE;
- ctx->Eval.Map1Vertex3 = GL_FALSE;
- ctx->Eval.Map1Vertex4 = GL_FALSE;
- ctx->Eval.Map2Color4 = GL_FALSE;
- ctx->Eval.Map2Index = GL_FALSE;
- ctx->Eval.Map2Normal = GL_FALSE;
- ctx->Eval.Map2TextureCoord1 = GL_FALSE;
- ctx->Eval.Map2TextureCoord2 = GL_FALSE;
- ctx->Eval.Map2TextureCoord3 = GL_FALSE;
- ctx->Eval.Map2TextureCoord4 = GL_FALSE;
- ctx->Eval.Map2Vertex3 = GL_FALSE;
- ctx->Eval.Map2Vertex4 = GL_FALSE;
- ctx->Eval.AutoNormal = GL_FALSE;
- ctx->Eval.MapGrid1un = 1;
- ctx->Eval.MapGrid1u1 = 0.0;
- ctx->Eval.MapGrid1u2 = 1.0;
- ctx->Eval.MapGrid2un = 1;
- ctx->Eval.MapGrid2vn = 1;
- ctx->Eval.MapGrid2u1 = 0.0;
- ctx->Eval.MapGrid2u2 = 1.0;
- ctx->Eval.MapGrid2v1 = 0.0;
- ctx->Eval.MapGrid2v2 = 1.0;
-
- /* Evaluator data */
- {
- static GLfloat vertex[4] = { 0.0, 0.0, 0.0, 1.0 };
- static GLfloat normal[3] = { 0.0, 0.0, 1.0 };
- static GLfloat index[1] = { 1.0 };
- static GLfloat color[4] = { 1.0, 1.0, 1.0, 1.0 };
- static GLfloat texcoord[4] = { 0.0, 0.0, 0.0, 1.0 };
-
- init_1d_map( &ctx->EvalMap.Map1Vertex3, 3, vertex );
- init_1d_map( &ctx->EvalMap.Map1Vertex4, 4, vertex );
- init_1d_map( &ctx->EvalMap.Map1Index, 1, index );
- init_1d_map( &ctx->EvalMap.Map1Color4, 4, color );
- init_1d_map( &ctx->EvalMap.Map1Normal, 3, normal );
- init_1d_map( &ctx->EvalMap.Map1Texture1, 1, texcoord );
- init_1d_map( &ctx->EvalMap.Map1Texture2, 2, texcoord );
- init_1d_map( &ctx->EvalMap.Map1Texture3, 3, texcoord );
- init_1d_map( &ctx->EvalMap.Map1Texture4, 4, texcoord );
-
- init_2d_map( &ctx->EvalMap.Map2Vertex3, 3, vertex );
- init_2d_map( &ctx->EvalMap.Map2Vertex4, 4, vertex );
- init_2d_map( &ctx->EvalMap.Map2Index, 1, index );
- init_2d_map( &ctx->EvalMap.Map2Color4, 4, color );
- init_2d_map( &ctx->EvalMap.Map2Normal, 3, normal );
- init_2d_map( &ctx->EvalMap.Map2Texture1, 1, texcoord );
- init_2d_map( &ctx->EvalMap.Map2Texture2, 2, texcoord );
- init_2d_map( &ctx->EvalMap.Map2Texture3, 3, texcoord );
- init_2d_map( &ctx->EvalMap.Map2Texture4, 4, texcoord );
- }
+ ctx->ProjectionStackDepth = 0;
+ ctx->NearFarStack[0][0] = 1.0; /* These values seem weird by make */
+ ctx->NearFarStack[0][1] = 0.0; /* sense mathematically. */
- /* Fog group */
- ctx->Fog.Enabled = GL_FALSE;
- ctx->Fog.Mode = GL_EXP;
- ASSIGN_4V( ctx->Fog.Color, 0.0, 0.0, 0.0, 0.0 );
- ctx->Fog.Index = 0.0;
- ctx->Fog.Density = 1.0;
- ctx->Fog.Start = 0.0;
- ctx->Fog.End = 1.0;
-
- /* Hint group */
- ctx->Hint.PerspectiveCorrection = GL_DONT_CARE;
- ctx->Hint.PointSmooth = GL_DONT_CARE;
- ctx->Hint.LineSmooth = GL_DONT_CARE;
- ctx->Hint.PolygonSmooth = GL_DONT_CARE;
- ctx->Hint.Fog = GL_DONT_CARE;
-
- ctx->Hint.AllowDrawWin = GL_TRUE;
- ctx->Hint.AllowDrawSpn = GL_TRUE;
- ctx->Hint.AllowDrawMem = GL_TRUE;
- ctx->Hint.StrictLighting = GL_TRUE;
-
- /* Pipeline */
- gl_pipeline_init( ctx );
- gl_cva_init( ctx );
-
- /* Extensions */
- gl_extensions_ctr( ctx );
-
- ctx->AllowVertexCull = CLIP_CULLED_BIT;
-
- /* Lighting group */
- for (i=0;i<MAX_LIGHTS;i++) {
- init_light( &ctx->Light.Light[i], i );
- }
- make_empty_list( &ctx->Light.EnabledList );
-
- init_lightmodel( &ctx->Light.Model );
- init_material( &ctx->Light.Material[0] );
- init_material( &ctx->Light.Material[1] );
- ctx->Light.ShadeModel = GL_SMOOTH;
- ctx->Light.Enabled = GL_FALSE;
- ctx->Light.ColorMaterialFace = GL_FRONT_AND_BACK;
- ctx->Light.ColorMaterialMode = GL_AMBIENT_AND_DIFFUSE;
- ctx->Light.ColorMaterialBitmask
- = gl_material_bitmask( ctx,
- GL_FRONT_AND_BACK,
- GL_AMBIENT_AND_DIFFUSE, ~0, 0 );
-
- ctx->Light.ColorMaterialEnabled = GL_FALSE;
-
- /* Line group */
- ctx->Line.SmoothFlag = GL_FALSE;
- ctx->Line.StippleFlag = GL_FALSE;
- ctx->Line.Width = 1.0;
- ctx->Line.StipplePattern = 0xffff;
- ctx->Line.StippleFactor = 1;
-
- /* Display List group */
- ctx->List.ListBase = 0;
-
- /* Pixel group */
- ctx->Pixel.RedBias = 0.0;
- ctx->Pixel.RedScale = 1.0;
- ctx->Pixel.GreenBias = 0.0;
- ctx->Pixel.GreenScale = 1.0;
- ctx->Pixel.BlueBias = 0.0;
- ctx->Pixel.BlueScale = 1.0;
- ctx->Pixel.AlphaBias = 0.0;
- ctx->Pixel.AlphaScale = 1.0;
- ctx->Pixel.ScaleOrBiasRGBA = GL_FALSE;
- ctx->Pixel.DepthBias = 0.0;
- ctx->Pixel.DepthScale = 1.0;
- ctx->Pixel.IndexOffset = 0;
- ctx->Pixel.IndexShift = 0;
- ctx->Pixel.ZoomX = 1.0;
- ctx->Pixel.ZoomY = 1.0;
- ctx->Pixel.MapColorFlag = GL_FALSE;
- ctx->Pixel.MapStencilFlag = GL_FALSE;
- ctx->Pixel.MapStoSsize = 1;
- ctx->Pixel.MapItoIsize = 1;
- ctx->Pixel.MapItoRsize = 1;
- ctx->Pixel.MapItoGsize = 1;
- ctx->Pixel.MapItoBsize = 1;
- ctx->Pixel.MapItoAsize = 1;
- ctx->Pixel.MapRtoRsize = 1;
- ctx->Pixel.MapGtoGsize = 1;
- ctx->Pixel.MapBtoBsize = 1;
- ctx->Pixel.MapAtoAsize = 1;
- ctx->Pixel.MapStoS[0] = 0;
- ctx->Pixel.MapItoI[0] = 0;
- ctx->Pixel.MapItoR[0] = 0.0;
- ctx->Pixel.MapItoG[0] = 0.0;
- ctx->Pixel.MapItoB[0] = 0.0;
- ctx->Pixel.MapItoA[0] = 0.0;
- ctx->Pixel.MapItoR8[0] = 0;
- ctx->Pixel.MapItoG8[0] = 0;
- ctx->Pixel.MapItoB8[0] = 0;
- ctx->Pixel.MapItoA8[0] = 0;
- ctx->Pixel.MapRtoR[0] = 0.0;
- ctx->Pixel.MapGtoG[0] = 0.0;
- ctx->Pixel.MapBtoB[0] = 0.0;
- ctx->Pixel.MapAtoA[0] = 0.0;
-
- /* Point group */
- ctx->Point.SmoothFlag = GL_FALSE;
- ctx->Point.Size = 1.0;
- ctx->Point.Params[0] = 1.0;
- ctx->Point.Params[1] = 0.0;
- ctx->Point.Params[2] = 0.0;
- ctx->Point.Attenuated = GL_FALSE;
- ctx->Point.MinSize = 0.0;
- ctx->Point.MaxSize = (GLfloat) MAX_POINT_SIZE;
- ctx->Point.Threshold = 1.0;
-
- /* Polygon group */
- ctx->Polygon.CullFlag = GL_FALSE;
- ctx->Polygon.CullFaceMode = GL_BACK;
- ctx->Polygon.FrontFace = GL_CCW;
- ctx->Polygon.FrontBit = 0;
- ctx->Polygon.FrontMode = GL_FILL;
- ctx->Polygon.BackMode = GL_FILL;
- ctx->Polygon.Unfilled = GL_FALSE;
- ctx->Polygon.SmoothFlag = GL_FALSE;
- ctx->Polygon.StippleFlag = GL_FALSE;
- ctx->Polygon.OffsetFactor = 0.0F;
- ctx->Polygon.OffsetUnits = 0.0F;
- ctx->Polygon.OffsetPoint = GL_FALSE;
- ctx->Polygon.OffsetLine = GL_FALSE;
- ctx->Polygon.OffsetFill = GL_FALSE;
-
- /* Polygon Stipple group */
- MEMSET( ctx->PolygonStipple, 0xff, 32*sizeof(GLuint) );
-
- /* Scissor group */
- ctx->Scissor.Enabled = GL_FALSE;
- ctx->Scissor.X = 0;
- ctx->Scissor.Y = 0;
- ctx->Scissor.Width = 0;
- ctx->Scissor.Height = 0;
-
- /* Stencil group */
- ctx->Stencil.Enabled = GL_FALSE;
- ctx->Stencil.Function = GL_ALWAYS;
- ctx->Stencil.FailFunc = GL_KEEP;
- ctx->Stencil.ZPassFunc = GL_KEEP;
- ctx->Stencil.ZFailFunc = GL_KEEP;
- ctx->Stencil.Ref = 0;
- ctx->Stencil.ValueMask = STENCIL_MAX;
- ctx->Stencil.Clear = 0;
- ctx->Stencil.WriteMask = STENCIL_MAX;
-
- /* Texture group */
- ctx->Texture.CurrentUnit = 0; /* multitexture */
- ctx->Texture.CurrentTransformUnit = 0; /* multitexture */
- ctx->Texture.Enabled = 0;
-
- for (i=0; i<MAX_TEXTURE_UNITS; i++)
- init_texture_unit( ctx, i );
-
- ctx->Texture.SharedPalette = GL_FALSE;
- ctx->Texture.Palette[0] = 255;
- ctx->Texture.Palette[1] = 255;
- ctx->Texture.Palette[2] = 255;
- ctx->Texture.Palette[3] = 255;
- ctx->Texture.PaletteSize = 1;
- ctx->Texture.PaletteIntFormat = GL_RGBA;
- ctx->Texture.PaletteFormat = GL_RGBA;
-
- /* Transformation group */
- ctx->Transform.MatrixMode = GL_MODELVIEW;
- ctx->Transform.Normalize = GL_FALSE;
- ctx->Transform.RescaleNormals = GL_FALSE;
- for (i=0;i<MAX_CLIP_PLANES;i++) {
- ctx->Transform.ClipEnabled[i] = GL_FALSE;
- ASSIGN_4V( ctx->Transform.EyeUserPlane[i], 0.0, 0.0, 0.0, 0.0 );
+ for (i = 0 ; i < MAX_PROJECTION_STACK_DEPTH ; i++) {
+ gl_matrix_ctr( &ctx->ProjectionStack[i] );
+ gl_matrix_alloc_inv( &ctx->ProjectionStack[i] );
+ }
+
+ /* Texture matrix */
+ for (i=0; i<MAX_TEXTURE_UNITS; i++) {
+ gl_matrix_ctr( &ctx->TextureMatrix[i] );
+ ctx->TextureStackDepth[i] = 0;
+ for (j = 0 ; j < MAX_TEXTURE_STACK_DEPTH ; j++) {
+ ctx->TextureStack[i][j].inv = 0;
}
- ctx->Transform.AnyClip = GL_FALSE;
+ }
- /* Viewport group */
- ctx->Viewport.X = 0;
- ctx->Viewport.Y = 0;
- ctx->Viewport.Width = 0;
- ctx->Viewport.Height = 0;
- ctx->Viewport.Near = 0.0;
- ctx->Viewport.Far = 1.0;
- gl_matrix_ctr(&ctx->Viewport.WindowMap);
+ /* Accumulate buffer group */
+ ASSIGN_4V( ctx->Accum.ClearColor, 0.0, 0.0, 0.0, 0.0 );
+
+ /* Color buffer group */
+ ctx->Color.IndexMask = 0xffffffff;
+ ctx->Color.ColorMask[0] = 0xff;
+ ctx->Color.ColorMask[1] = 0xff;
+ ctx->Color.ColorMask[2] = 0xff;
+ ctx->Color.ColorMask[3] = 0xff;
+ ctx->Color.SWmasking = GL_FALSE;
+ ctx->Color.ClearIndex = 0;
+ ASSIGN_4V( ctx->Color.ClearColor, 0.0, 0.0, 0.0, 0.0 );
+ ctx->Color.DrawBuffer = GL_FRONT;
+ ctx->Color.AlphaEnabled = GL_FALSE;
+ ctx->Color.AlphaFunc = GL_ALWAYS;
+ ctx->Color.AlphaRef = 0;
+ ctx->Color.BlendEnabled = GL_FALSE;
+ ctx->Color.BlendSrcRGB = GL_ONE;
+ ctx->Color.BlendDstRGB = GL_ZERO;
+ ctx->Color.BlendSrcA = GL_ONE;
+ ctx->Color.BlendDstA = GL_ZERO;
+ ctx->Color.BlendEquation = GL_FUNC_ADD_EXT;
+ ctx->Color.BlendFunc = NULL; /* this pointer set only when needed */
+ ASSIGN_4V( ctx->Color.BlendColor, 0.0, 0.0, 0.0, 0.0 );
+ ctx->Color.IndexLogicOpEnabled = GL_FALSE;
+ ctx->Color.ColorLogicOpEnabled = GL_FALSE;
+ ctx->Color.SWLogicOpEnabled = GL_FALSE;
+ ctx->Color.LogicOp = GL_COPY;
+ ctx->Color.DitherFlag = GL_TRUE;
+ ctx->Color.MultiDrawBuffer = GL_FALSE;
+
+ /* Current group */
+ ASSIGN_4V( ctx->Current.ByteColor, 255, 255, 255, 255);
+ ctx->Current.Index = 1;
+ for (i=0; i<MAX_TEXTURE_UNITS; i++)
+ ASSIGN_4V( ctx->Current.Texcoord[i], 0.0, 0.0, 0.0, 1.0 );
+ ASSIGN_4V( ctx->Current.RasterPos, 0.0, 0.0, 0.0, 1.0 );
+ ctx->Current.RasterDistance = 0.0;
+ ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 );
+ ctx->Current.RasterIndex = 1;
+ for (i=0; i<MAX_TEXTURE_UNITS; i++)
+ ASSIGN_4V( ctx->Current.RasterMultiTexCoord[i], 0.0, 0.0, 0.0, 1.0 );
+ ctx->Current.RasterTexCoord = ctx->Current.RasterMultiTexCoord[0];
+ ctx->Current.RasterPosValid = GL_TRUE;
+ ctx->Current.EdgeFlag = GL_TRUE;
+ ASSIGN_3V( ctx->Current.Normal, 0.0, 0.0, 1.0 );
+ ctx->Current.Primitive = (GLenum) (GL_POLYGON + 1);
+
+ ctx->Current.Flag = (VERT_NORM|VERT_INDEX|VERT_RGBA|VERT_EDGE|
+ VERT_TEX0_1|VERT_TEX1_1|VERT_MATERIAL);
+
+ init_fallback_arrays( ctx );
+
+ /* Depth buffer group */
+ ctx->Depth.Test = GL_FALSE;
+ ctx->Depth.Clear = 1.0;
+ ctx->Depth.Func = GL_LESS;
+ ctx->Depth.Mask = GL_TRUE;
+
+ /* Evaluators group */
+ ctx->Eval.Map1Color4 = GL_FALSE;
+ ctx->Eval.Map1Index = GL_FALSE;
+ ctx->Eval.Map1Normal = GL_FALSE;
+ ctx->Eval.Map1TextureCoord1 = GL_FALSE;
+ ctx->Eval.Map1TextureCoord2 = GL_FALSE;
+ ctx->Eval.Map1TextureCoord3 = GL_FALSE;
+ ctx->Eval.Map1TextureCoord4 = GL_FALSE;
+ ctx->Eval.Map1Vertex3 = GL_FALSE;
+ ctx->Eval.Map1Vertex4 = GL_FALSE;
+ ctx->Eval.Map2Color4 = GL_FALSE;
+ ctx->Eval.Map2Index = GL_FALSE;
+ ctx->Eval.Map2Normal = GL_FALSE;
+ ctx->Eval.Map2TextureCoord1 = GL_FALSE;
+ ctx->Eval.Map2TextureCoord2 = GL_FALSE;
+ ctx->Eval.Map2TextureCoord3 = GL_FALSE;
+ ctx->Eval.Map2TextureCoord4 = GL_FALSE;
+ ctx->Eval.Map2Vertex3 = GL_FALSE;
+ ctx->Eval.Map2Vertex4 = GL_FALSE;
+ ctx->Eval.AutoNormal = GL_FALSE;
+ ctx->Eval.MapGrid1un = 1;
+ ctx->Eval.MapGrid1u1 = 0.0;
+ ctx->Eval.MapGrid1u2 = 1.0;
+ ctx->Eval.MapGrid2un = 1;
+ ctx->Eval.MapGrid2vn = 1;
+ ctx->Eval.MapGrid2u1 = 0.0;
+ ctx->Eval.MapGrid2u2 = 1.0;
+ ctx->Eval.MapGrid2v1 = 0.0;
+ ctx->Eval.MapGrid2v2 = 1.0;
+
+ /* Evaluator data */
+ {
+ static GLfloat vertex[4] = { 0.0, 0.0, 0.0, 1.0 };
+ static GLfloat normal[3] = { 0.0, 0.0, 1.0 };
+ static GLfloat index[1] = { 1.0 };
+ static GLfloat color[4] = { 1.0, 1.0, 1.0, 1.0 };
+ static GLfloat texcoord[4] = { 0.0, 0.0, 0.0, 1.0 };
+
+ init_1d_map( &ctx->EvalMap.Map1Vertex3, 3, vertex );
+ init_1d_map( &ctx->EvalMap.Map1Vertex4, 4, vertex );
+ init_1d_map( &ctx->EvalMap.Map1Index, 1, index );
+ init_1d_map( &ctx->EvalMap.Map1Color4, 4, color );
+ init_1d_map( &ctx->EvalMap.Map1Normal, 3, normal );
+ init_1d_map( &ctx->EvalMap.Map1Texture1, 1, texcoord );
+ init_1d_map( &ctx->EvalMap.Map1Texture2, 2, texcoord );
+ init_1d_map( &ctx->EvalMap.Map1Texture3, 3, texcoord );
+ init_1d_map( &ctx->EvalMap.Map1Texture4, 4, texcoord );
+
+ init_2d_map( &ctx->EvalMap.Map2Vertex3, 3, vertex );
+ init_2d_map( &ctx->EvalMap.Map2Vertex4, 4, vertex );
+ init_2d_map( &ctx->EvalMap.Map2Index, 1, index );
+ init_2d_map( &ctx->EvalMap.Map2Color4, 4, color );
+ init_2d_map( &ctx->EvalMap.Map2Normal, 3, normal );
+ init_2d_map( &ctx->EvalMap.Map2Texture1, 1, texcoord );
+ init_2d_map( &ctx->EvalMap.Map2Texture2, 2, texcoord );
+ init_2d_map( &ctx->EvalMap.Map2Texture3, 3, texcoord );
+ init_2d_map( &ctx->EvalMap.Map2Texture4, 4, texcoord );
+ }
+
+ /* Fog group */
+ ctx->Fog.Enabled = GL_FALSE;
+ ctx->Fog.Mode = GL_EXP;
+ ASSIGN_4V( ctx->Fog.Color, 0.0, 0.0, 0.0, 0.0 );
+ ctx->Fog.Index = 0.0;
+ ctx->Fog.Density = 1.0;
+ ctx->Fog.Start = 0.0;
+ ctx->Fog.End = 1.0;
+
+ /* Hint group */
+ ctx->Hint.PerspectiveCorrection = GL_DONT_CARE;
+ ctx->Hint.PointSmooth = GL_DONT_CARE;
+ ctx->Hint.LineSmooth = GL_DONT_CARE;
+ ctx->Hint.PolygonSmooth = GL_DONT_CARE;
+ ctx->Hint.Fog = GL_DONT_CARE;
+
+ ctx->Hint.AllowDrawWin = GL_TRUE;
+ ctx->Hint.AllowDrawSpn = GL_TRUE;
+ ctx->Hint.AllowDrawMem = GL_TRUE;
+ ctx->Hint.StrictLighting = GL_TRUE;
+
+ /* Pipeline */
+ gl_pipeline_init( ctx );
+ gl_cva_init( ctx );
+
+ /* Extensions */
+ gl_extensions_ctr( ctx );
+
+ ctx->AllowVertexCull = CLIP_CULLED_BIT;
+
+ /* Lighting group */
+ for (i=0;i<MAX_LIGHTS;i++) {
+ init_light( &ctx->Light.Light[i], i );
+ }
+ make_empty_list( &ctx->Light.EnabledList );
+
+ init_lightmodel( &ctx->Light.Model );
+ init_material( &ctx->Light.Material[0] );
+ init_material( &ctx->Light.Material[1] );
+ ctx->Light.ShadeModel = GL_SMOOTH;
+ ctx->Light.Enabled = GL_FALSE;
+ ctx->Light.ColorMaterialFace = GL_FRONT_AND_BACK;
+ ctx->Light.ColorMaterialMode = GL_AMBIENT_AND_DIFFUSE;
+ ctx->Light.ColorMaterialBitmask
+ = gl_material_bitmask( ctx,
+ GL_FRONT_AND_BACK,
+ GL_AMBIENT_AND_DIFFUSE, ~0, 0 );
+
+ ctx->Light.ColorMaterialEnabled = GL_FALSE;
+
+ /* Lighting miscellaneous */
+ ctx->ShineTabList = MALLOC_STRUCT( gl_shine_tab );
+ make_empty_list( ctx->ShineTabList );
+ for (i = 0 ; i < 10 ; i++) {
+ struct gl_shine_tab *s = MALLOC_STRUCT( gl_shine_tab );
+ s->shininess = -1;
+ s->refcount = 0;
+ insert_at_tail( ctx->ShineTabList, s );
+ }
+ for (i = 0 ; i < 4 ; i++) {
+ ctx->ShineTable[i] = ctx->ShineTabList->prev;
+ ctx->ShineTable[i]->refcount++;
+ }
+
+
+ /* Line group */
+ ctx->Line.SmoothFlag = GL_FALSE;
+ ctx->Line.StippleFlag = GL_FALSE;
+ ctx->Line.Width = 1.0;
+ ctx->Line.StipplePattern = 0xffff;
+ ctx->Line.StippleFactor = 1;
+
+ /* Display List group */
+ ctx->List.ListBase = 0;
+
+ /* Pixel group */
+ ctx->Pixel.RedBias = 0.0;
+ ctx->Pixel.RedScale = 1.0;
+ ctx->Pixel.GreenBias = 0.0;
+ ctx->Pixel.GreenScale = 1.0;
+ ctx->Pixel.BlueBias = 0.0;
+ ctx->Pixel.BlueScale = 1.0;
+ ctx->Pixel.AlphaBias = 0.0;
+ ctx->Pixel.AlphaScale = 1.0;
+ ctx->Pixel.ScaleOrBiasRGBA = GL_FALSE;
+ ctx->Pixel.DepthBias = 0.0;
+ ctx->Pixel.DepthScale = 1.0;
+ ctx->Pixel.IndexOffset = 0;
+ ctx->Pixel.IndexShift = 0;
+ ctx->Pixel.ZoomX = 1.0;
+ ctx->Pixel.ZoomY = 1.0;
+ ctx->Pixel.MapColorFlag = GL_FALSE;
+ ctx->Pixel.MapStencilFlag = GL_FALSE;
+ ctx->Pixel.MapStoSsize = 1;
+ ctx->Pixel.MapItoIsize = 1;
+ ctx->Pixel.MapItoRsize = 1;
+ ctx->Pixel.MapItoGsize = 1;
+ ctx->Pixel.MapItoBsize = 1;
+ ctx->Pixel.MapItoAsize = 1;
+ ctx->Pixel.MapRtoRsize = 1;
+ ctx->Pixel.MapGtoGsize = 1;
+ ctx->Pixel.MapBtoBsize = 1;
+ ctx->Pixel.MapAtoAsize = 1;
+ ctx->Pixel.MapStoS[0] = 0;
+ ctx->Pixel.MapItoI[0] = 0;
+ ctx->Pixel.MapItoR[0] = 0.0;
+ ctx->Pixel.MapItoG[0] = 0.0;
+ ctx->Pixel.MapItoB[0] = 0.0;
+ ctx->Pixel.MapItoA[0] = 0.0;
+ ctx->Pixel.MapItoR8[0] = 0;
+ ctx->Pixel.MapItoG8[0] = 0;
+ ctx->Pixel.MapItoB8[0] = 0;
+ ctx->Pixel.MapItoA8[0] = 0;
+ ctx->Pixel.MapRtoR[0] = 0.0;
+ ctx->Pixel.MapGtoG[0] = 0.0;
+ ctx->Pixel.MapBtoB[0] = 0.0;
+ ctx->Pixel.MapAtoA[0] = 0.0;
+
+ /* Point group */
+ ctx->Point.SmoothFlag = GL_FALSE;
+ ctx->Point.Size = 1.0;
+ ctx->Point.Params[0] = 1.0;
+ ctx->Point.Params[1] = 0.0;
+ ctx->Point.Params[2] = 0.0;
+ ctx->Point.Attenuated = GL_FALSE;
+ ctx->Point.MinSize = 0.0;
+ ctx->Point.MaxSize = (GLfloat) MAX_POINT_SIZE;
+ ctx->Point.Threshold = 1.0;
+
+ /* Polygon group */
+ ctx->Polygon.CullFlag = GL_FALSE;
+ ctx->Polygon.CullFaceMode = GL_BACK;
+ ctx->Polygon.FrontFace = GL_CCW;
+ ctx->Polygon.FrontBit = 0;
+ ctx->Polygon.FrontMode = GL_FILL;
+ ctx->Polygon.BackMode = GL_FILL;
+ ctx->Polygon.Unfilled = GL_FALSE;
+ ctx->Polygon.SmoothFlag = GL_FALSE;
+ ctx->Polygon.StippleFlag = GL_FALSE;
+ ctx->Polygon.OffsetFactor = 0.0F;
+ ctx->Polygon.OffsetUnits = 0.0F;
+ ctx->Polygon.OffsetPoint = GL_FALSE;
+ ctx->Polygon.OffsetLine = GL_FALSE;
+ ctx->Polygon.OffsetFill = GL_FALSE;
+
+ /* Polygon Stipple group */
+ MEMSET( ctx->PolygonStipple, 0xff, 32*sizeof(GLuint) );
+
+ /* Scissor group */
+ ctx->Scissor.Enabled = GL_FALSE;
+ ctx->Scissor.X = 0;
+ ctx->Scissor.Y = 0;
+ ctx->Scissor.Width = 0;
+ ctx->Scissor.Height = 0;
+
+ /* Stencil group */
+ ctx->Stencil.Enabled = GL_FALSE;
+ ctx->Stencil.Function = GL_ALWAYS;
+ ctx->Stencil.FailFunc = GL_KEEP;
+ ctx->Stencil.ZPassFunc = GL_KEEP;
+ ctx->Stencil.ZFailFunc = GL_KEEP;
+ ctx->Stencil.Ref = 0;
+ ctx->Stencil.ValueMask = STENCIL_MAX;
+ ctx->Stencil.Clear = 0;
+ ctx->Stencil.WriteMask = STENCIL_MAX;
+
+ /* Texture group */
+ ctx->Texture.CurrentUnit = 0; /* multitexture */
+ ctx->Texture.CurrentTransformUnit = 0; /* multitexture */
+ ctx->Texture.Enabled = 0;
+ for (i=0; i<MAX_TEXTURE_UNITS; i++)
+ init_texture_unit( ctx, i );
+ init_color_table(&ctx->Texture.Palette);
+
+ /* Transformation group */
+ ctx->Transform.MatrixMode = GL_MODELVIEW;
+ ctx->Transform.Normalize = GL_FALSE;
+ ctx->Transform.RescaleNormals = GL_FALSE;
+ for (i=0;i<MAX_CLIP_PLANES;i++) {
+ ctx->Transform.ClipEnabled[i] = GL_FALSE;
+ ASSIGN_4V( ctx->Transform.EyeUserPlane[i], 0.0, 0.0, 0.0, 0.0 );
+ }
+ ctx->Transform.AnyClip = GL_FALSE;
+
+ /* Viewport group */
+ ctx->Viewport.X = 0;
+ ctx->Viewport.Y = 0;
+ ctx->Viewport.Width = 0;
+ ctx->Viewport.Height = 0;
+ ctx->Viewport.Near = 0.0;
+ ctx->Viewport.Far = 1.0;
+ gl_matrix_ctr(&ctx->Viewport.WindowMap);
#define Sz 10
#define Tz 14
- ctx->Viewport.WindowMap.m[Sz] = 0.5 * DEPTH_SCALE;
- ctx->Viewport.WindowMap.m[Tz] = 0.5 * DEPTH_SCALE;
+ ctx->Viewport.WindowMap.m[Sz] = 0.5 * DEPTH_SCALE;
+ ctx->Viewport.WindowMap.m[Tz] = 0.5 * DEPTH_SCALE;
#undef Sz
#undef Tz
- ctx->Viewport.WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION;
- ctx->Viewport.WindowMap.type = MATRIX_3D_NO_ROT;
-
- /* Vertex arrays */
- ctx->Array.Vertex.Size = 4;
- ctx->Array.Vertex.Type = GL_FLOAT;
- ctx->Array.Vertex.Stride = 0;
- ctx->Array.Vertex.StrideB = 0;
- ctx->Array.Vertex.Ptr = NULL;
- ctx->Array.Vertex.Enabled = GL_FALSE;
- ctx->Array.Normal.Type = GL_FLOAT;
- ctx->Array.Normal.Stride = 0;
- ctx->Array.Normal.StrideB = 0;
- ctx->Array.Normal.Ptr = NULL;
- ctx->Array.Normal.Enabled = GL_FALSE;
- ctx->Array.Color.Size = 4;
- ctx->Array.Color.Type = GL_FLOAT;
- ctx->Array.Color.Stride = 0;
- ctx->Array.Color.StrideB = 0;
- ctx->Array.Color.Ptr = NULL;
- ctx->Array.Color.Enabled = GL_FALSE;
- ctx->Array.Index.Type = GL_FLOAT;
- ctx->Array.Index.Stride = 0;
- ctx->Array.Index.StrideB = 0;
- ctx->Array.Index.Ptr = NULL;
- ctx->Array.Index.Enabled = GL_FALSE;
- for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
- ctx->Array.TexCoord[i].Size = 4;
- ctx->Array.TexCoord[i].Type = GL_FLOAT;
- ctx->Array.TexCoord[i].Stride = 0;
- ctx->Array.TexCoord[i].StrideB = 0;
- ctx->Array.TexCoord[i].Ptr = NULL;
- ctx->Array.TexCoord[i].Enabled = GL_FALSE;
- }
- ctx->Array.TexCoordInterleaveFactor = 1;
- ctx->Array.EdgeFlag.Stride = 0;
- ctx->Array.EdgeFlag.StrideB = 0;
- ctx->Array.EdgeFlag.Ptr = NULL;
- ctx->Array.EdgeFlag.Enabled = GL_FALSE;
- ctx->Array.ActiveTexture = 0; /* GL_ARB_multitexture */
-
- /* Pixel transfer */
- ctx->Pack.Alignment = 4;
- ctx->Pack.RowLength = 0;
- ctx->Pack.ImageHeight = 0;
- ctx->Pack.SkipPixels = 0;
- ctx->Pack.SkipRows = 0;
- ctx->Pack.SkipImages = 0;
- ctx->Pack.SwapBytes = GL_FALSE;
- ctx->Pack.LsbFirst = GL_FALSE;
- ctx->Unpack.Alignment = 4;
- ctx->Unpack.RowLength = 0;
- ctx->Unpack.ImageHeight = 0;
- ctx->Unpack.SkipPixels = 0;
- ctx->Unpack.SkipRows = 0;
- ctx->Unpack.SkipImages = 0;
- ctx->Unpack.SwapBytes = GL_FALSE;
- ctx->Unpack.LsbFirst = GL_FALSE;
-
- /* Feedback */
- ctx->Feedback.Type = GL_2D; /* TODO: verify */
- ctx->Feedback.Buffer = NULL;
- ctx->Feedback.BufferSize = 0;
- ctx->Feedback.Count = 0;
-
- /* Selection/picking */
- ctx->Select.Buffer = NULL;
- ctx->Select.BufferSize = 0;
- ctx->Select.BufferCount = 0;
- ctx->Select.Hits = 0;
- ctx->Select.NameStackDepth = 0;
-
- /* Optimized Accum buffer */
- ctx->IntegerAccumMode = GL_TRUE;
- ctx->IntegerAccumScaler = 0.0;
-
- /* Renderer and client attribute stacks */
- ctx->AttribStackDepth = 0;
- ctx->ClientAttribStackDepth = 0;
-
- /*** Miscellaneous ***/
- ctx->NewState = NEW_ALL;
- ctx->RenderMode = GL_RENDER;
- ctx->StippleCounter = 0;
- ctx->NeedNormals = GL_FALSE;
- ctx->DoViewportMapping = GL_TRUE;
-
- ctx->NeedEyeCoords = GL_FALSE;
- ctx->NeedEyeNormals = GL_FALSE;
- ctx->vb_proj_matrix = &ctx->ModelProjectMatrix;
-
- /* Display list */
- ctx->CallDepth = 0;
- ctx->ExecuteFlag = GL_TRUE;
- ctx->CompileFlag = GL_FALSE;
- ctx->CurrentListPtr = NULL;
- ctx->CurrentBlock = NULL;
- ctx->CurrentListNum = 0;
- ctx->CurrentPos = 0;
+ ctx->Viewport.WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION;
+ ctx->Viewport.WindowMap.type = MATRIX_3D_NO_ROT;
+
+ /* Vertex arrays */
+ ctx->Array.Vertex.Size = 4;
+ ctx->Array.Vertex.Type = GL_FLOAT;
+ ctx->Array.Vertex.Stride = 0;
+ ctx->Array.Vertex.StrideB = 0;
+ ctx->Array.Vertex.Ptr = NULL;
+ ctx->Array.Vertex.Enabled = GL_FALSE;
+ ctx->Array.Normal.Type = GL_FLOAT;
+ ctx->Array.Normal.Stride = 0;
+ ctx->Array.Normal.StrideB = 0;
+ ctx->Array.Normal.Ptr = NULL;
+ ctx->Array.Normal.Enabled = GL_FALSE;
+ ctx->Array.Color.Size = 4;
+ ctx->Array.Color.Type = GL_FLOAT;
+ ctx->Array.Color.Stride = 0;
+ ctx->Array.Color.StrideB = 0;
+ ctx->Array.Color.Ptr = NULL;
+ ctx->Array.Color.Enabled = GL_FALSE;
+ ctx->Array.Index.Type = GL_FLOAT;
+ ctx->Array.Index.Stride = 0;
+ ctx->Array.Index.StrideB = 0;
+ ctx->Array.Index.Ptr = NULL;
+ ctx->Array.Index.Enabled = GL_FALSE;
+ for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
+ ctx->Array.TexCoord[i].Size = 4;
+ ctx->Array.TexCoord[i].Type = GL_FLOAT;
+ ctx->Array.TexCoord[i].Stride = 0;
+ ctx->Array.TexCoord[i].StrideB = 0;
+ ctx->Array.TexCoord[i].Ptr = NULL;
+ ctx->Array.TexCoord[i].Enabled = GL_FALSE;
+ }
+ ctx->Array.TexCoordInterleaveFactor = 1;
+ ctx->Array.EdgeFlag.Stride = 0;
+ ctx->Array.EdgeFlag.StrideB = 0;
+ ctx->Array.EdgeFlag.Ptr = NULL;
+ ctx->Array.EdgeFlag.Enabled = GL_FALSE;
+ ctx->Array.ActiveTexture = 0; /* GL_ARB_multitexture */
+
+ /* Pixel transfer */
+ ctx->Pack.Alignment = 4;
+ ctx->Pack.RowLength = 0;
+ ctx->Pack.ImageHeight = 0;
+ ctx->Pack.SkipPixels = 0;
+ ctx->Pack.SkipRows = 0;
+ ctx->Pack.SkipImages = 0;
+ ctx->Pack.SwapBytes = GL_FALSE;
+ ctx->Pack.LsbFirst = GL_FALSE;
+ ctx->Unpack.Alignment = 4;
+ ctx->Unpack.RowLength = 0;
+ ctx->Unpack.ImageHeight = 0;
+ ctx->Unpack.SkipPixels = 0;
+ ctx->Unpack.SkipRows = 0;
+ ctx->Unpack.SkipImages = 0;
+ ctx->Unpack.SwapBytes = GL_FALSE;
+ ctx->Unpack.LsbFirst = GL_FALSE;
+
+ /* Feedback */
+ ctx->Feedback.Type = GL_2D; /* TODO: verify */
+ ctx->Feedback.Buffer = NULL;
+ ctx->Feedback.BufferSize = 0;
+ ctx->Feedback.Count = 0;
+
+ /* Selection/picking */
+ ctx->Select.Buffer = NULL;
+ ctx->Select.BufferSize = 0;
+ ctx->Select.BufferCount = 0;
+ ctx->Select.Hits = 0;
+ ctx->Select.NameStackDepth = 0;
+
+ /* Optimized Accum buffer */
+ ctx->IntegerAccumMode = GL_TRUE;
+ ctx->IntegerAccumScaler = 0.0;
+
+ /* Renderer and client attribute stacks */
+ ctx->AttribStackDepth = 0;
+ ctx->ClientAttribStackDepth = 0;
+
+ /* Miscellaneous */
+ ctx->NewState = NEW_ALL;
+ ctx->RenderMode = GL_RENDER;
+ ctx->StippleCounter = 0;
+ ctx->NeedNormals = GL_FALSE;
+ ctx->DoViewportMapping = GL_TRUE;
+
+ ctx->NeedEyeCoords = GL_FALSE;
+ ctx->NeedEyeNormals = GL_FALSE;
+ ctx->vb_proj_matrix = &ctx->ModelProjectMatrix;
+
+ /* Display list */
+ ctx->CallDepth = 0;
+ ctx->ExecuteFlag = GL_TRUE;
+ ctx->CompileFlag = GL_FALSE;
+ ctx->CurrentListPtr = NULL;
+ ctx->CurrentBlock = NULL;
+ ctx->CurrentListNum = 0;
+ ctx->CurrentPos = 0;
- ctx->ErrorValue = (GLenum) GL_NO_ERROR;
+ ctx->ErrorValue = (GLenum) GL_NO_ERROR;
- ctx->CatchSignals = GL_TRUE;
+ ctx->CatchSignals = GL_TRUE;
- /* For debug/development only */
- ctx->NoRaster = getenv("MESA_NO_RASTER") ? GL_TRUE : GL_FALSE;
- ctx->FirstTimeCurrent = GL_TRUE;
+ /* For debug/development only */
+ ctx->NoRaster = getenv("MESA_NO_RASTER") ? GL_TRUE : GL_FALSE;
+ ctx->FirstTimeCurrent = GL_TRUE;
- /* Dither disable */
- ctx->NoDither = getenv("MESA_NO_DITHER") ? GL_TRUE : GL_FALSE;
- if (ctx->NoDither) {
- if (getenv("MESA_DEBUG")) {
- fprintf(stderr, "MESA_NO_DITHER set - dithering disabled\n");
- }
- ctx->Color.DitherFlag = GL_FALSE;
+ /* Dither disable */
+ ctx->NoDither = getenv("MESA_NO_DITHER") ? GL_TRUE : GL_FALSE;
+ if (ctx->NoDither) {
+ if (getenv("MESA_DEBUG")) {
+ fprintf(stderr, "MESA_NO_DITHER set - dithering disabled\n");
}
+ ctx->Color.DitherFlag = GL_FALSE;
}
}
-/*
- * Allocate a new GLvisual object.
- * Input: rgbFlag - GL_TRUE=RGB(A) mode, GL_FALSE=Color Index mode
- * alphaFlag - alloc software alpha buffers?
- * dbFlag - double buffering?
- * stereoFlag - stereo buffer?
- * depthFits - requested minimum bits per depth buffer value
- * stencilFits - requested minimum bits per stencil buffer value
- * accumFits - requested minimum bits per accum buffer component
- * indexFits - number of bits per pixel if rgbFlag==GL_FALSE
- * red/green/blue/alphaFits - number of bits per color component
- * in frame buffer for RGB(A) mode.
- * Return: pointer to new GLvisual or NULL if requested parameters can't
- * be met.
- */
-GLvisual *gl_create_visual( GLboolean rgbFlag,
- GLboolean alphaFlag,
- GLboolean dbFlag,
- GLboolean stereoFlag,
- GLint depthBits,
- GLint stencilBits,
- GLint accumBits,
- GLint indexBits,
- GLint redBits,
- GLint greenBits,
- GLint blueBits,
- GLint alphaBits )
-{
- GLvisual *vis;
-
- if (depthBits > (GLint) (8*sizeof(GLdepth))) {
- /* can't meet depth buffer requirements */
- return NULL;
- }
- if (stencilBits > (GLint) (8*sizeof(GLstencil))) {
- /* can't meet stencil buffer requirements */
- return NULL;
- }
- if (accumBits > (GLint) (8*sizeof(GLaccum))) {
- /* can't meet accum buffer requirements */
- return NULL;
- }
-
- vis = (GLvisual *) CALLOC( sizeof(GLvisual) );
- if (!vis) {
- return NULL;
- }
-
- vis->RGBAflag = rgbFlag;
- vis->DBflag = dbFlag;
- vis->StereoFlag = stereoFlag;
- vis->RedBits = redBits;
- vis->GreenBits = greenBits;
- vis->BlueBits = blueBits;
- vis->AlphaBits = alphaFlag ? 8*sizeof(GLubyte) : alphaBits;
-
- vis->IndexBits = indexBits;
- vis->DepthBits = (depthBits>0) ? 8*sizeof(GLdepth) : 0;
- vis->AccumBits = (accumBits>0) ? 8*sizeof(GLaccum) : 0;
- vis->StencilBits = (stencilBits>0) ? 8*sizeof(GLstencil) : 0;
-
- vis->SoftwareAlpha = alphaFlag;
-
- return vis;
-}
-
-
-
-void gl_destroy_visual( GLvisual *vis )
-{
- FREE( vis );
-}
-
-
/*
* Allocate the proxy textures. If we run out of memory part way through
@@ -1225,46 +1279,28 @@ static GLboolean alloc_proxy_textures( GLcontext *ctx )
/*
- * Allocate and initialize a GLcontext structure.
- * Input: visual - a GLvisual pointer
- * sharelist - another context to share display lists with or NULL
- * driver_ctx - pointer to device driver's context state struct
- * Return: pointer to a new gl_context struct or NULL if error.
+ * Initialize a GLcontext struct.
*/
-GLcontext *gl_create_context( GLvisual *visual,
- GLcontext *share_list,
- void *driver_ctx,
- GLboolean direct )
+GLboolean gl_initialize_context_data( GLcontext *ctx,
+ GLvisual *visual,
+ GLcontext *share_list,
+ void *driver_ctx,
+ GLboolean direct )
{
- GLcontext *ctx;
- GLuint i;
-
(void) direct; /* not used */
- /* do some implementation tests */
- assert( sizeof(GLbyte) == 1 );
- assert( sizeof(GLshort) >= 2 );
- assert( sizeof(GLint) >= 4 );
- assert( sizeof(GLubyte) == 1 );
- assert( sizeof(GLushort) >= 2 );
- assert( sizeof(GLuint) >= 4 );
-
/* misc one-time initializations */
one_time_init();
- ctx = (GLcontext *) CALLOC( sizeof(GLcontext) );
- if (!ctx) {
- return NULL;
- }
-
ctx->DriverCtx = driver_ctx;
ctx->Visual = visual;
- ctx->Buffer = NULL;
+ ctx->DrawBuffer = NULL;
+ ctx->ReadBuffer = NULL;
ctx->VB = gl_vb_create_for_immediate( ctx );
if (!ctx->VB) {
FREE( ctx );
- return NULL;
+ return GL_FALSE;
}
ctx->input = ctx->VB->IM;
@@ -1272,7 +1308,7 @@ GLcontext *gl_create_context( GLvisual *visual,
if (!ctx->PB) {
FREE( ctx->VB );
FREE( ctx );
- return NULL;
+ return GL_FALSE;
}
if (share_list) {
@@ -1286,31 +1322,16 @@ GLcontext *gl_create_context( GLvisual *visual,
FREE(ctx->VB);
FREE(ctx->PB);
FREE(ctx);
- return NULL;
+ return GL_FALSE;
}
}
ctx->Shared->RefCount++;
- initialize_context( ctx );
+ init_attrib_groups( ctx );
+
gl_reset_vb( ctx->VB );
gl_reset_input( ctx );
-
- ctx->ShineTabList = MALLOC_STRUCT( gl_shine_tab );
- make_empty_list( ctx->ShineTabList );
-
- for (i = 0 ; i < 10 ; i++) {
- struct gl_shine_tab *s = MALLOC_STRUCT( gl_shine_tab );
- s->shininess = -1;
- s->refcount = 0;
- insert_at_tail( ctx->ShineTabList, s );
- }
-
- for (i = 0 ; i < 4 ; i++) {
- ctx->ShineTable[i] = ctx->ShineTabList->prev;
- ctx->ShineTable[i]->refcount++;
- }
-
if (visual->DBflag) {
ctx->Color.DrawBuffer = GL_BACK;
ctx->Color.DriverDrawBuffer = GL_BACK_LEFT;
@@ -1326,273 +1347,180 @@ GLcontext *gl_create_context( GLvisual *visual,
ctx->Pixel.DriverReadBuffer = GL_FRONT_LEFT;
}
-
- /* Fill in some driver defaults now.
- */
- ctx->Driver.AllocDepthBuffer = gl_alloc_depth_buffer;
- ctx->Driver.ReadDepthSpanFloat = gl_read_depth_span_float;
- ctx->Driver.ReadDepthSpanInt = gl_read_depth_span_int;
-
-
#ifdef PROFILE
init_timings( ctx );
#endif
-#ifdef GL_VERSION_1_1
if (!alloc_proxy_textures(ctx)) {
free_shared_state(ctx, ctx->Shared);
FREE(ctx->VB);
FREE(ctx->PB);
FREE(ctx);
- return NULL;
+ return GL_FALSE;
}
-#endif
- gl_init_api_function_pointers( ctx );
- ctx->API = ctx->Exec; /* GL_EXECUTE is default */
+ /* setup API dispatch tables */
+ _mesa_init_exec_table( &ctx->Exec );
+ _mesa_init_dlist_table( &ctx->Save );
+ ctx->CurrentDispatch = &ctx->Exec;
- return ctx;
-}
-
-/* Just reads the config files...
- */
-void gl_context_initialize( GLcontext *ctx )
-{
- gl_read_config_file( ctx );
+ return GL_TRUE;
}
-
/*
- * Destroy a gl_context structure.
+ * Allocate and initialize a GLcontext structure.
+ * Input: visual - a GLvisual pointer
+ * sharelist - another context to share display lists with or NULL
+ * driver_ctx - pointer to device driver's context state struct
+ * Return: pointer to a new gl_context struct or NULL if error.
*/
-void gl_destroy_context( GLcontext *ctx )
+GLcontext *gl_create_context( GLvisual *visual,
+ GLcontext *share_list,
+ void *driver_ctx,
+ GLboolean direct )
{
- if (ctx) {
-
- GLuint i;
- struct gl_shine_tab *s, *tmps;
-
-#ifdef PROFILE
- if (getenv("MESA_PROFILE")) {
- print_timings( ctx );
- }
-#endif
-
- gl_matrix_dtr( &ctx->ModelView );
- for (i = 0 ; i < MAX_MODELVIEW_STACK_DEPTH ; i++) {
- gl_matrix_dtr( &ctx->ModelViewStack[i] );
- }
- gl_matrix_dtr( &ctx->ProjectionMatrix );
- for (i = 0 ; i < MAX_PROJECTION_STACK_DEPTH ; i++) {
- gl_matrix_dtr( &ctx->ProjectionStack[i] );
- }
-
- FREE( ctx->PB );
-
- if(ctx->input != ctx->VB->IM)
- gl_immediate_free( ctx->input );
-
- gl_vb_free( ctx->VB );
-
- ctx->Shared->RefCount--;
- assert(ctx->Shared->RefCount>=0);
- if (ctx->Shared->RefCount==0) {
- /* free shared state */
- free_shared_state( ctx, ctx->Shared );
- }
-
- foreach_s( s, tmps, ctx->ShineTabList ) {
- FREE( s );
- }
- FREE( ctx->ShineTabList );
-
- /* Free proxy texture objects */
- gl_free_texture_object( NULL, ctx->Texture.Proxy1D );
- gl_free_texture_object( NULL, ctx->Texture.Proxy2D );
- gl_free_texture_object( NULL, ctx->Texture.Proxy3D );
-
- /* Free evaluator data */
- if (ctx->EvalMap.Map1Vertex3.Points)
- FREE( ctx->EvalMap.Map1Vertex3.Points );
- if (ctx->EvalMap.Map1Vertex4.Points)
- FREE( ctx->EvalMap.Map1Vertex4.Points );
- if (ctx->EvalMap.Map1Index.Points)
- FREE( ctx->EvalMap.Map1Index.Points );
- if (ctx->EvalMap.Map1Color4.Points)
- FREE( ctx->EvalMap.Map1Color4.Points );
- if (ctx->EvalMap.Map1Normal.Points)
- FREE( ctx->EvalMap.Map1Normal.Points );
- if (ctx->EvalMap.Map1Texture1.Points)
- FREE( ctx->EvalMap.Map1Texture1.Points );
- if (ctx->EvalMap.Map1Texture2.Points)
- FREE( ctx->EvalMap.Map1Texture2.Points );
- if (ctx->EvalMap.Map1Texture3.Points)
- FREE( ctx->EvalMap.Map1Texture3.Points );
- if (ctx->EvalMap.Map1Texture4.Points)
- FREE( ctx->EvalMap.Map1Texture4.Points );
-
- if (ctx->EvalMap.Map2Vertex3.Points)
- FREE( ctx->EvalMap.Map2Vertex3.Points );
- if (ctx->EvalMap.Map2Vertex4.Points)
- FREE( ctx->EvalMap.Map2Vertex4.Points );
- if (ctx->EvalMap.Map2Index.Points)
- FREE( ctx->EvalMap.Map2Index.Points );
- if (ctx->EvalMap.Map2Color4.Points)
- FREE( ctx->EvalMap.Map2Color4.Points );
- if (ctx->EvalMap.Map2Normal.Points)
- FREE( ctx->EvalMap.Map2Normal.Points );
- if (ctx->EvalMap.Map2Texture1.Points)
- FREE( ctx->EvalMap.Map2Texture1.Points );
- if (ctx->EvalMap.Map2Texture2.Points)
- FREE( ctx->EvalMap.Map2Texture2.Points );
- if (ctx->EvalMap.Map2Texture3.Points)
- FREE( ctx->EvalMap.Map2Texture3.Points );
- if (ctx->EvalMap.Map2Texture4.Points)
- FREE( ctx->EvalMap.Map2Texture4.Points );
-
- /* Free cache of immediate buffers. */
- while (ctx->nr_im_queued-- > 0) {
- struct immediate * next = ctx->freed_im_queue->next;
- FREE( ctx->freed_im_queue );
- ctx->freed_im_queue = next;
- }
- gl_extensions_dtr(ctx);
-
- FREE( (void *) ctx );
-
-#ifndef THREADS
- if (ctx==CC) {
- CC = NULL;
- CURRENT_INPUT = NULL;
- }
-#endif
+ GLcontext *ctx = (GLcontext *) CALLOC( sizeof(GLcontext) );
+ if (!ctx) {
+ return NULL;
+ }
+ if (gl_initialize_context_data(ctx, visual, share_list,
+ driver_ctx, direct)) {
+ return ctx;
+ }
+ else {
+ FREE(ctx);
+ return NULL;
}
}
/*
- * Create a new framebuffer. A GLframebuffer is a struct which
- * encapsulates the depth, stencil and accum buffers and related
- * parameters.
- * Input: visual - a GLvisual pointer
- * Return: pointer to new GLframebuffer struct or NULL if error.
+ * Free the data associated with the given context.
+ * But don't free() the GLcontext struct itself!
*/
-GLframebuffer *gl_create_framebuffer( GLvisual *visual )
+void gl_free_context_data( GLcontext *ctx )
{
- GLframebuffer *buffer;
+ GLuint i;
+ struct gl_shine_tab *s, *tmps;
- buffer = (GLframebuffer *) CALLOC( sizeof(GLframebuffer) );
- if (!buffer) {
- return NULL;
+ /* if we're destroying the current context, unbind it first */
+ if (ctx == gl_get_current_context()) {
+ gl_make_current(NULL, NULL);
}
- buffer->Visual = visual;
-
- return buffer;
-}
-
-
-
-/*
- * Free a framebuffer struct and its buffers.
- */
-void gl_destroy_framebuffer( GLframebuffer *buffer )
-{
- if (buffer) {
- if (buffer->Depth) {
- FREE( buffer->Depth );
- }
- if (buffer->Accum) {
- FREE( buffer->Accum );
- }
- if (buffer->Stencil) {
- FREE( buffer->Stencil );
- }
- if (buffer->FrontLeftAlpha) {
- FREE( buffer->FrontLeftAlpha );
- }
- if (buffer->BackLeftAlpha) {
- FREE( buffer->BackLeftAlpha );
- }
- if (buffer->FrontRightAlpha) {
- FREE( buffer->FrontRightAlpha );
- }
- if (buffer->BackRightAlpha) {
- FREE( buffer->BackRightAlpha );
- }
- FREE(buffer);
+#ifdef PROFILE
+ if (getenv("MESA_PROFILE")) {
+ print_timings( ctx );
}
+#endif
+
+ gl_matrix_dtr( &ctx->ModelView );
+ for (i = 0 ; i < MAX_MODELVIEW_STACK_DEPTH ; i++) {
+ gl_matrix_dtr( &ctx->ModelViewStack[i] );
+ }
+ gl_matrix_dtr( &ctx->ProjectionMatrix );
+ for (i = 0 ; i < MAX_PROJECTION_STACK_DEPTH ; i++) {
+ gl_matrix_dtr( &ctx->ProjectionStack[i] );
+ }
+
+ FREE( ctx->PB );
+
+ if(ctx->input != ctx->VB->IM)
+ gl_immediate_free( ctx->input );
+
+ gl_vb_free( ctx->VB );
+
+ ctx->Shared->RefCount--;
+ assert(ctx->Shared->RefCount>=0);
+ if (ctx->Shared->RefCount==0) {
+ /* free shared state */
+ free_shared_state( ctx, ctx->Shared );
+ }
+
+ foreach_s( s, tmps, ctx->ShineTabList ) {
+ FREE( s );
+ }
+ FREE( ctx->ShineTabList );
+
+ /* Free proxy texture objects */
+ gl_free_texture_object( NULL, ctx->Texture.Proxy1D );
+ gl_free_texture_object( NULL, ctx->Texture.Proxy2D );
+ gl_free_texture_object( NULL, ctx->Texture.Proxy3D );
+
+ /* Free evaluator data */
+ if (ctx->EvalMap.Map1Vertex3.Points)
+ FREE( ctx->EvalMap.Map1Vertex3.Points );
+ if (ctx->EvalMap.Map1Vertex4.Points)
+ FREE( ctx->EvalMap.Map1Vertex4.Points );
+ if (ctx->EvalMap.Map1Index.Points)
+ FREE( ctx->EvalMap.Map1Index.Points );
+ if (ctx->EvalMap.Map1Color4.Points)
+ FREE( ctx->EvalMap.Map1Color4.Points );
+ if (ctx->EvalMap.Map1Normal.Points)
+ FREE( ctx->EvalMap.Map1Normal.Points );
+ if (ctx->EvalMap.Map1Texture1.Points)
+ FREE( ctx->EvalMap.Map1Texture1.Points );
+ if (ctx->EvalMap.Map1Texture2.Points)
+ FREE( ctx->EvalMap.Map1Texture2.Points );
+ if (ctx->EvalMap.Map1Texture3.Points)
+ FREE( ctx->EvalMap.Map1Texture3.Points );
+ if (ctx->EvalMap.Map1Texture4.Points)
+ FREE( ctx->EvalMap.Map1Texture4.Points );
+
+ if (ctx->EvalMap.Map2Vertex3.Points)
+ FREE( ctx->EvalMap.Map2Vertex3.Points );
+ if (ctx->EvalMap.Map2Vertex4.Points)
+ FREE( ctx->EvalMap.Map2Vertex4.Points );
+ if (ctx->EvalMap.Map2Index.Points)
+ FREE( ctx->EvalMap.Map2Index.Points );
+ if (ctx->EvalMap.Map2Color4.Points)
+ FREE( ctx->EvalMap.Map2Color4.Points );
+ if (ctx->EvalMap.Map2Normal.Points)
+ FREE( ctx->EvalMap.Map2Normal.Points );
+ if (ctx->EvalMap.Map2Texture1.Points)
+ FREE( ctx->EvalMap.Map2Texture1.Points );
+ if (ctx->EvalMap.Map2Texture2.Points)
+ FREE( ctx->EvalMap.Map2Texture2.Points );
+ if (ctx->EvalMap.Map2Texture3.Points)
+ FREE( ctx->EvalMap.Map2Texture3.Points );
+ if (ctx->EvalMap.Map2Texture4.Points)
+ FREE( ctx->EvalMap.Map2Texture4.Points );
+
+ /* Free cache of immediate buffers. */
+ while (ctx->nr_im_queued-- > 0) {
+ struct immediate * next = ctx->freed_im_queue->next;
+ FREE( ctx->freed_im_queue );
+ ctx->freed_im_queue = next;
+ }
+ gl_extensions_dtr(ctx);
}
/*
- * Set the current context, binding the given frame buffer to the context.
+ * Destroy a GLcontext structure.
*/
-void gl_make_current( GLcontext *ctx, GLframebuffer *buffer )
+void gl_destroy_context( GLcontext *ctx )
{
- GET_CONTEXT;
-
- /* Flush the old context
- */
- if (CC) {
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(CC, "gl_make_current");
- }
-
-#ifdef THREADS
- /* TODO: unbind old buffer from context? */
- set_thread_context( ctx );
-#else
- if (CC && CC->Buffer) {
- /* unbind frame buffer from context */
- CC->Buffer = NULL;
- }
- CC = ctx;
if (ctx) {
- SET_IMMEDIATE(ctx, ctx->input);
- }
-#endif
-
- if (MESA_VERBOSE) fprintf(stderr, "gl_make_current()\n");
-
- if (ctx && buffer) {
- /* TODO: check if ctx and buffer's visual match??? */
- ctx->Buffer = buffer; /* Bind the frame buffer to the context */
- ctx->NewState = NEW_ALL; /* just to be safe */
- gl_update_state( ctx );
- }
-
- /* We can use this to help debug user's problems. Tell the to set
- * the MESA_INFO env variable before running their app. Then the
- * first time each context is made current we'll print some useful
- * information.
- */
- if (ctx && ctx->FirstTimeCurrent) {
- if (getenv("MESA_INFO")) {
- fprintf(stderr, "Mesa GL_VERSION = %s\n", (char *) gl_GetString(ctx, GL_VERSION));
- fprintf(stderr, "Mesa GL_RENDERER = %s\n", (char *) gl_GetString(ctx, GL_RENDERER));
- fprintf(stderr, "Mesa GL_VENDOR = %s\n", (char *) gl_GetString(ctx, GL_VENDOR));
- fprintf(stderr, "Mesa GL_EXTENSIONS = %s\n", (char *) gl_GetString(ctx, GL_EXTENSIONS));
- }
- ctx->FirstTimeCurrent = GL_FALSE;
+ gl_free_context_data(ctx);
+ FREE( (void *) ctx );
}
}
+
/*
- * Return current context handle.
+ * Called by the driver after both the context and driver are fully
+ * initialized. Currently just reads the config file.
*/
-GLcontext *gl_get_current_context( void )
+void gl_context_initialize( GLcontext *ctx )
{
-#ifdef THREADS
- return gl_get_thread_context();
-#else
- return CC;
-#endif
+ gl_read_config_file( ctx );
}
@@ -1631,7 +1559,7 @@ void gl_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask )
}
if (mask & GL_LIGHTING_BIT) {
MEMCPY( &dst->Light, &src->Light, sizeof(struct gl_light_attrib) );
-/* gl_reinit_light_attrib( &dst->Light ); */
+ /* gl_reinit_light_attrib( &dst->Light ); */
}
if (mask & GL_LINE_BIT) {
MEMCPY( &dst->Line, &src->Line, sizeof(struct gl_line_attrib) );
@@ -1675,26 +1603,170 @@ void gl_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask )
}
+/*
+ * Set the current context, binding the given frame buffer to the context.
+ */
+void gl_make_current( GLcontext *newCtx, GLframebuffer *buffer )
+{
+ gl_make_current2( newCtx, buffer, buffer );
+}
+
/*
- * Someday a GLS library or OpenGL-like debugger may call this function
- * to register it's own set of API entry points.
- * Input: ctx - the context to set API pointers for
- * api - if NULL, restore original API pointers
- * else, set API function table to this table.
+ * Bind the given context to the given draw-buffer and read-buffer
+ * and make it the current context for this thread.
*/
-void gl_set_api_table( GLcontext *ctx, const struct gl_api_table *api )
+void gl_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer,
+ GLframebuffer *readBuffer )
{
- if (api) {
- MEMCPY( &ctx->API, api, sizeof(struct gl_api_table) );
+#if 0
+ GLcontext *oldCtx = gl_get_context();
+
+ /* Flush the old context
+ */
+ if (oldCtx) {
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(oldCtx, "gl_make_current");
+
+ /* unbind frame buffers from context */
+ if (oldCtx->DrawBuffer) {
+ oldCtx->DrawBuffer = NULL;
+ }
+ if (oldCtx->ReadBuffer) {
+ oldCtx->ReadBuffer = NULL;
+ }
+ }
+#endif
+
+ /* We call this function periodically (just here for now) in
+ * order to detect when multithreading has begun.
+ */
+ _glapi_check_multithread();
+
+ _glapi_set_context((void *) newCtx);
+ ASSERT(gl_get_current_context() == newCtx);
+ if (newCtx) {
+ SET_IMMEDIATE(newCtx, newCtx->input);
+ _glapi_set_dispatch(newCtx->CurrentDispatch);
}
else {
- MEMCPY( &ctx->API, &ctx->Exec, sizeof(struct gl_api_table) );
+ _glapi_set_dispatch(NULL); /* none current */
+ }
+
+ if (MESA_VERBOSE) fprintf(stderr, "gl_make_current()\n");
+
+ if (newCtx && drawBuffer && readBuffer) {
+ /* TODO: check if newCtx and buffer's visual match??? */
+ newCtx->DrawBuffer = drawBuffer;
+ newCtx->ReadBuffer = readBuffer;
+ newCtx->NewState = NEW_ALL; /* just to be safe */
+ gl_update_state( newCtx );
+ }
+
+ /* We can use this to help debug user's problems. Tell the to set
+ * the MESA_INFO env variable before running their app. Then the
+ * first time each context is made current we'll print some useful
+ * information.
+ */
+ if (newCtx && newCtx->FirstTimeCurrent) {
+ if (getenv("MESA_INFO")) {
+ fprintf(stderr, "Mesa GL_VERSION = %s\n", (char *) _mesa_GetString(GL_VERSION));
+ fprintf(stderr, "Mesa GL_RENDERER = %s\n", (char *) _mesa_GetString(GL_RENDERER));
+ fprintf(stderr, "Mesa GL_VENDOR = %s\n", (char *) _mesa_GetString(GL_VENDOR));
+ fprintf(stderr, "Mesa GL_EXTENSIONS = %s\n", (char *) _mesa_GetString(GL_EXTENSIONS));
+#if defined(THREADS)
+ fprintf(stderr, "Mesa thread-safe: YES\n");
+#else
+ fprintf(stderr, "Mesa thread-safe: NO\n");
+#endif
+#if defined(USE_X86_ASM)
+ fprintf(stderr, "Mesa x86-optimized: YES\n");
+#else
+ fprintf(stderr, "Mesa x86-optimized: NO\n");
+#endif
+ }
+ newCtx->FirstTimeCurrent = GL_FALSE;
}
}
+/*
+ * Return current context handle for the calling thread.
+ * This isn't the fastest way to get the current context.
+ * If you need speed, see the GET_CURRENT_CONTEXT() macro in context.h
+ */
+GLcontext *gl_get_current_context( void )
+{
+ return (GLcontext *) _glapi_get_context();
+}
+
+
+
+/*
+ * This should be called by device drivers just before they do a
+ * swapbuffers. Any pending rendering commands will be executed.
+ */
+void
+_mesa_swapbuffers(GLcontext *ctx)
+{
+ FLUSH_VB( ctx, "swap buffers" );
+}
+
+
+
+/*
+ * Return pointer to this context's current API dispatch table.
+ * It'll either be the immediate-mode execute dispatcher or the
+ * display list compile dispatcher.
+ */
+struct _glapi_table *
+_mesa_get_dispatch(GLcontext *ctx)
+{
+ return ctx->CurrentDispatch;
+}
+
+
+
+void
+_mesa_ResizeBuffersMESA( void )
+{
+ GLcontext *ctx = gl_get_current_context();
+
+ GLuint buf_width, buf_height;
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ fprintf(stderr, "glResizeBuffersMESA\n");
+
+ /* ask device driver for size of output buffer */
+ (*ctx->Driver.GetBufferSize)( ctx, &buf_width, &buf_height );
+
+ /* see if size of device driver's color buffer (window) has changed */
+ if (ctx->DrawBuffer->Width == (GLint) buf_width &&
+ ctx->DrawBuffer->Height == (GLint) buf_height)
+ return;
+
+ ctx->NewState |= NEW_RASTER_OPS; /* to update scissor / window bounds */
+
+ /* save buffer size */
+ ctx->DrawBuffer->Width = buf_width;
+ ctx->DrawBuffer->Height = buf_height;
+
+ /* Reallocate other buffers if needed. */
+ if (ctx->DrawBuffer->UseSoftwareDepthBuffer) {
+ gl_alloc_depth_buffer( ctx );
+ }
+ if (ctx->DrawBuffer->UseSoftwareStencilBuffer) {
+ gl_alloc_stencil_buffer( ctx );
+ }
+ if (ctx->DrawBuffer->UseSoftwareAccumBuffer) {
+ gl_alloc_accum_buffer( ctx );
+ }
+ if (ctx->Visual->SoftwareAlpha) {
+ gl_alloc_alpha_buffers( ctx );
+ }
+}
+
+
/**********************************************************************/
/***** Miscellaneous functions *****/
@@ -1817,66 +1889,6 @@ void gl_error( GLcontext *ctx, GLenum error, const char *s )
-/*
- * Execute a glGetError command
- */
-GLenum gl_GetError( GLcontext *ctx )
-{
- GLenum e = ctx->ErrorValue;
-
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL( ctx, "glGetError", (GLenum) 0);
-
- if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetError <-- %s\n", gl_lookup_enum_by_nr(e));
-
- ctx->ErrorValue = (GLenum) GL_NO_ERROR;
- return e;
-}
-
-
-
-void gl_ResizeBuffersMESA( GLcontext *ctx )
-{
- GLuint buf_width, buf_height;
-
- if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glResizeBuffersMESA\n");
-
- /* ask device driver for size of output buffer */
- (*ctx->Driver.GetBufferSize)( ctx, &buf_width, &buf_height );
-
- /* see if size of device driver's color buffer (window) has changed */
- if (ctx->Buffer->Width == (GLint) buf_width &&
- ctx->Buffer->Height == (GLint) buf_height)
- return;
-
- ctx->NewState |= NEW_RASTER_OPS; /* to update scissor / window bounds */
-
- /* save buffer size */
- ctx->Buffer->Width = buf_width;
- ctx->Buffer->Height = buf_height;
-
- /* Reallocate other buffers if needed. */
- if (ctx->Visual->DepthBits>0) {
- /* reallocate depth buffer */
- (*ctx->Driver.AllocDepthBuffer)( ctx );
- }
- if (ctx->Visual->StencilBits>0) {
- /* reallocate stencil buffer */
- gl_alloc_stencil_buffer( ctx );
- }
- if (ctx->Visual->AccumBits>0) {
- /* reallocate accum buffer */
- gl_alloc_accum_buffer( ctx );
- }
- if (ctx->Visual->SoftwareAlpha) {
- gl_alloc_alpha_buffers( ctx );
- }
-}
-
-
-
-
/**********************************************************************/
/***** State update logic *****/
/**********************************************************************/
@@ -1993,17 +2005,21 @@ static void update_pixel_masking( GLcontext *ctx )
static void update_fog_mode( GLcontext *ctx )
{
int old_mode = ctx->FogMode;
- ctx->FogMode = FOG_NONE;
if (ctx->Fog.Enabled) {
- ctx->FogMode = FOG_VERTEX;
+ if (ctx->Texture.Enabled)
+ ctx->FogMode = FOG_FRAGMENT;
+ else if (ctx->Hint.Fog == GL_NICEST)
+ ctx->FogMode = FOG_FRAGMENT;
+ else
+ ctx->FogMode = FOG_VERTEX;
- if (ctx->Texture.Enabled || ctx->Hint.Fog == GL_NICEST)
- ctx->FogMode = FOG_FRAGMENT;
-
- if ( ctx->Driver.GetParameteri &&
- ctx->Driver.GetParameteri( ctx, DD_HAVE_HARDWARE_FOG ) )
- ctx->FogMode = FOG_FRAGMENT;
+ if (ctx->Driver.GetParameteri)
+ if ((ctx->Driver.GetParameteri)( ctx, DD_HAVE_HARDWARE_FOG ))
+ ctx->FogMode = FOG_FRAGMENT;
+ }
+ else {
+ ctx->FogMode = FOG_NONE;
}
if (old_mode != ctx->FogMode)
@@ -2033,9 +2049,9 @@ static void update_rasterflags( GLcontext *ctx )
ctx->RasterMask |= ALPHABUF_BIT;
if ( ctx->Viewport.X<0
- || ctx->Viewport.X + ctx->Viewport.Width > ctx->Buffer->Width
+ || ctx->Viewport.X + ctx->Viewport.Width > ctx->DrawBuffer->Width
|| ctx->Viewport.Y<0
- || ctx->Viewport.Y + ctx->Viewport.Height > ctx->Buffer->Height) {
+ || ctx->Viewport.Y + ctx->Viewport.Height > ctx->DrawBuffer->Height) {
ctx->RasterMask |= WINCLIP_BIT;
}
@@ -2218,47 +2234,22 @@ void gl_update_state( GLcontext *ctx )
/* update scissor region */
- ctx->Buffer->Xmin = 0;
- ctx->Buffer->Ymin = 0;
- ctx->Buffer->Xmax = ctx->Buffer->Width-1;
- ctx->Buffer->Ymax = ctx->Buffer->Height-1;
+ ctx->DrawBuffer->Xmin = 0;
+ ctx->DrawBuffer->Ymin = 0;
+ ctx->DrawBuffer->Xmax = ctx->DrawBuffer->Width-1;
+ ctx->DrawBuffer->Ymax = ctx->DrawBuffer->Height-1;
if (ctx->Scissor.Enabled) {
- if (ctx->Scissor.X > ctx->Buffer->Xmin) {
- ctx->Buffer->Xmin = ctx->Scissor.X;
- }
- if (ctx->Scissor.Y > ctx->Buffer->Ymin) {
- ctx->Buffer->Ymin = ctx->Scissor.Y;
- }
- if (ctx->Scissor.X + ctx->Scissor.Width - 1 < ctx->Buffer->Xmax) {
- ctx->Buffer->Xmax = ctx->Scissor.X + ctx->Scissor.Width - 1;
+ if (ctx->Scissor.X > ctx->DrawBuffer->Xmin) {
+ ctx->DrawBuffer->Xmin = ctx->Scissor.X;
}
- if (ctx->Scissor.Y + ctx->Scissor.Height - 1 < ctx->Buffer->Ymax) {
- ctx->Buffer->Ymax = ctx->Scissor.Y + ctx->Scissor.Height - 1;
+ if (ctx->Scissor.Y > ctx->DrawBuffer->Ymin) {
+ ctx->DrawBuffer->Ymin = ctx->Scissor.Y;
}
- }
-
- /* The driver isn't managing the depth buffer.
- */
- if (ctx->Driver.AllocDepthBuffer == gl_alloc_depth_buffer)
- {
- if (ctx->Depth.Mask) {
- switch (ctx->Depth.Func) {
- case GL_LESS:
- ctx->Driver.DepthTestSpan = gl_depth_test_span_less;
- ctx->Driver.DepthTestPixels = gl_depth_test_pixels_less;
- break;
- case GL_GREATER:
- ctx->Driver.DepthTestSpan = gl_depth_test_span_greater;
- ctx->Driver.DepthTestPixels = gl_depth_test_pixels_greater;
- break;
- default:
- ctx->Driver.DepthTestSpan = gl_depth_test_span_generic;
- ctx->Driver.DepthTestPixels = gl_depth_test_pixels_generic;
- }
+ if (ctx->Scissor.X + ctx->Scissor.Width - 1 < ctx->DrawBuffer->Xmax) {
+ ctx->DrawBuffer->Xmax = ctx->Scissor.X + ctx->Scissor.Width - 1;
}
- else {
- ctx->Driver.DepthTestSpan = gl_depth_test_span_generic;
- ctx->Driver.DepthTestPixels = gl_depth_test_pixels_generic;
+ if (ctx->Scissor.Y + ctx->Scissor.Height - 1 < ctx->DrawBuffer->Ymax) {
+ ctx->DrawBuffer->Ymax = ctx->Scissor.Y + ctx->Scissor.Height - 1;
}
}
}
@@ -2424,7 +2415,7 @@ void gl_update_state( GLcontext *ctx )
oldnorm = ctx->NeedEyeNormals;
ctx->NeedNormals = (ctx->Light.Enabled || ctx->Texture.NeedNormals);
- ctx->NeedEyeCoords = (ctx->FogMode == FOG_VERTEX ||
+ ctx->NeedEyeCoords = ((ctx->Fog.Enabled && ctx->Hint.Fog != GL_NICEST) ||
ctx->Point.Attenuated);
ctx->NeedEyeNormals = GL_FALSE;
diff --git a/xc/extras/Mesa/src/context.h b/xc/extras/Mesa/src/context.h
index 382e2a4bc..ee8d74b6e 100644
--- a/xc/extras/Mesa/src/context.h
+++ b/xc/extras/Mesa/src/context.h
@@ -1,10 +1,10 @@
-/* $Id: context.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: context.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,32 +25,14 @@
*/
-
-
-
#ifndef CONTEXT_H
#define CONTEXT_H
+#include "glapi.h"
#include "types.h"
-
-#ifdef THREADS
- /*
- * A seperate GLcontext for each thread
- */
- extern GLcontext *gl_get_thread_context( void );
-#else
- /*
- * All threads use same pointer to current context.
- */
- extern GLcontext *CC;
- extern struct immediate *CURRENT_INPUT;
-#endif
-
-
-
/*
* There are three Mesa datatypes which are meant to be used by device
* drivers:
@@ -92,6 +74,21 @@ extern void gl_destroy_visual( GLvisual *vis );
/*
+ * Create/destroy a GLframebuffer. A GLframebuffer is like a GLX drawable.
+ * It bundles up the depth buffer, stencil buffer and accum buffers into a
+ * single entity.
+ */
+extern GLframebuffer *gl_create_framebuffer( GLvisual *visual,
+ GLboolean softwareDepth,
+ GLboolean softwareStencil,
+ GLboolean softwareAccum,
+ GLboolean softwareAlpha );
+
+extern void gl_destroy_framebuffer( GLframebuffer *buffer );
+
+
+
+/*
* Create/destroy a GLcontext. A GLcontext is like a GLX context. It
* contains the rendering state.
*/
@@ -100,38 +97,78 @@ extern GLcontext *gl_create_context( GLvisual *visual,
void *driver_ctx,
GLboolean direct);
+extern GLboolean gl_initialize_context_data( GLcontext *ctx,
+ GLvisual *visual,
+ GLcontext *share_list,
+ void *driver_ctx,
+ GLboolean direct );
+
+extern void gl_free_context_data( GLcontext *ctx );
+
extern void gl_destroy_context( GLcontext *ctx );
-/* Called by the driver after both the context and driver are fully
- * initialized. Currently just reads the config file.
- */
+
extern void gl_context_initialize( GLcontext *ctx );
+
+extern void gl_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask);
+
+
+extern void gl_make_current( GLcontext *ctx, GLframebuffer *buffer );
+
+
+extern void gl_make_current2( GLcontext *ctx, GLframebuffer *drawBuffer,
+ GLframebuffer *readBuffer );
+
+
+extern GLcontext *gl_get_current_context(void);
+
+
/*
- * Create/destroy a GLframebuffer. A GLframebuffer is like a GLX drawable.
- * It bundles up the depth buffer, stencil buffer and accum buffers into a
- * single entity.
+ * Macros for fetching current context, input buffer, etc.
*/
-extern GLframebuffer *gl_create_framebuffer( GLvisual *visual );
+#ifdef THREADS
-extern void gl_destroy_framebuffer( GLframebuffer *buffer );
+#define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context())
+#define GET_IMMEDIATE struct immediate *IM = ((GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context()))->input
+#define SET_IMMEDIATE(ctx, im) \
+do { \
+ ctx->input = im; \
+} while (0)
-extern void gl_make_current( GLcontext *ctx, GLframebuffer *buffer );
+#else
-extern GLcontext *gl_get_current_context(void);
+extern struct immediate *_mesa_CurrentInput;
-extern void gl_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask);
+#define GET_CURRENT_CONTEXT(C) GLcontext *C = _glapi_Context
+
+#define GET_IMMEDIATE struct immediate *IM = _mesa_CurrentInput
+
+#define SET_IMMEDIATE(ctx, im) \
+do { \
+ ctx->input = im; \
+ _mesa_CurrentInput = im; \
+} while (0)
+
+#endif
-extern void gl_set_api_table( GLcontext *ctx, const struct gl_api_table *api );
+
+
+extern void
+_mesa_swapbuffers(GLcontext *ctx);
+
+
+extern struct _glapi_table *
+_mesa_get_dispatch(GLcontext *ctx);
/*
* GL_MESA_resize_buffers extension
*/
-extern void gl_ResizeBuffersMESA( GLcontext *ctx );
+extern void _mesa_ResizeBuffersMESA( void );
@@ -144,10 +181,8 @@ extern void gl_problem( const GLcontext *ctx, const char *s );
extern void gl_warning( const GLcontext *ctx, const char *s );
extern void gl_error( GLcontext *ctx, GLenum error, const char *s );
-extern void gl_compile_error( GLcontext *ctx, GLenum error, const char *s );
-
-extern GLenum gl_GetError( GLcontext *ctx );
+extern void gl_compile_error( GLcontext *ctx, GLenum error, const char *s );
extern void gl_update_state( GLcontext *ctx );
diff --git a/xc/extras/Mesa/src/copy_tmp.h b/xc/extras/Mesa/src/copy_tmp.h
index c9088505c..821c1a2db 100644
--- a/xc/extras/Mesa/src/copy_tmp.h
+++ b/xc/extras/Mesa/src/copy_tmp.h
@@ -1,4 +1,4 @@
-/* $Id: copy_tmp.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: copy_tmp.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/copypix.c b/xc/extras/Mesa/src/copypix.c
index 912fb6a4b..192471bbe 100644
--- a/xc/extras/Mesa/src/copypix.c
+++ b/xc/extras/Mesa/src/copypix.c
@@ -1,10 +1,10 @@
-/* $Id: copypix.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: copypix.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,22 +25,16 @@
*/
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "copypix.h"
#include "depth.h"
#include "feedback.h"
#include "macros.h"
+#include "mem.h"
#include "mmath.h"
#include "pixel.h"
#include "span.h"
@@ -50,6 +44,7 @@
#endif
+
/*
* Determine if there's overlap in an image copy
*/
@@ -73,8 +68,7 @@ regions_overlap(int srcx, int srcy, int dstx, int dsty, int width, int height,
-
-static void copy_rgba_pixels( GLcontext* ctx,
+static void copy_rgba_pixels( GLcontext *ctx,
GLint srcx, GLint srcy,
GLint width, GLint height,
GLint destx, GLint desty )
@@ -86,12 +80,12 @@ static void copy_rgba_pixels( GLcontext* ctx,
GLint sy, dy, stepy;
GLint i, j;
GLboolean changeBuffer;
- GLubyte *saveAlpha;
- const GLboolean zoom = ctx->Pixel.ZoomX!=1.0F || ctx->Pixel.ZoomY!=1.0F;
- GLboolean needbuffer;
+ GLubyte *saveReadAlpha;
+ const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
+ GLint overlapping;
/* Determine if copy should be done bottom-to-top or top-to-bottom */
- if (srcy<desty) {
+ if (srcy < desty) {
/* top-down max-to-min */
sy = srcy + height - 1;
dy = desty + height - 1;
@@ -104,8 +98,8 @@ static void copy_rgba_pixels( GLcontext* ctx,
stepy = 1;
}
- needbuffer = regions_overlap(srcx, srcy, destx, desty, width, height,
- ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
+ overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
+ ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
@@ -115,8 +109,10 @@ static void copy_rgba_pixels( GLcontext* ctx,
}
}
- if (ctx->RasterMask==0 && !zoom
- && destx>=0 && destx+width<=ctx->Buffer->Width) {
+ if (ctx->RasterMask == 0
+ && !zoom
+ && destx >= 0
+ && destx + width <= ctx->DrawBuffer->Width) {
quick_draw = GL_TRUE;
}
else {
@@ -124,64 +120,83 @@ static void copy_rgba_pixels( GLcontext* ctx,
}
/* If read and draw buffer are different we must do buffer switching */
- saveAlpha = ctx->Buffer->Alpha;
- changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer;
+ saveReadAlpha = ctx->ReadBuffer->Alpha;
+ changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer
+ || ctx->DrawBuffer != ctx->ReadBuffer;
- if (needbuffer) {
+ if (overlapping) {
GLint ssy = sy;
- prgba = (GLubyte *) MALLOC(width*height*sizeof(GLubyte)*4);
+ prgba = (GLubyte *) MALLOC(width * height * sizeof(GLubyte) * 4);
if (!prgba) {
gl_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
return;
}
p = prgba;
if (changeBuffer) {
- (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.DriverReadBuffer );
+ (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
+ ctx->Pixel.DriverReadBuffer );
if (ctx->Pixel.DriverReadBuffer == GL_FRONT_LEFT)
- ctx->Buffer->Alpha = ctx->Buffer->FrontLeftAlpha;
+ ctx->ReadBuffer->Alpha = ctx->ReadBuffer->FrontLeftAlpha;
else if (ctx->Pixel.DriverReadBuffer == GL_BACK_LEFT)
- ctx->Buffer->Alpha = ctx->Buffer->BackLeftAlpha;
+ ctx->ReadBuffer->Alpha = ctx->ReadBuffer->BackLeftAlpha;
else if (ctx->Pixel.DriverReadBuffer == GL_FRONT_RIGHT)
- ctx->Buffer->Alpha = ctx->Buffer->FrontRightAlpha;
+ ctx->ReadBuffer->Alpha = ctx->ReadBuffer->FrontRightAlpha;
else
- ctx->Buffer->Alpha = ctx->Buffer->BackRightAlpha;
+ ctx->ReadBuffer->Alpha = ctx->ReadBuffer->BackRightAlpha;
}
- for (j=0; j<height; j++, ssy+=stepy) {
- gl_read_rgba_span( ctx, width, srcx, ssy,(GLubyte (*)[4]) p );
- p += (width*sizeof(GLubyte)*4);
+ for (j = 0; j < height; j++, ssy += stepy) {
+ gl_read_rgba_span( ctx, ctx->ReadBuffer, width, srcx, ssy,
+ (GLubyte (*)[4]) p );
+ p += (width * sizeof(GLubyte) * 4);
}
p = prgba;
}
+ else {
+ prgba = NULL; /* silence compiler warnings */
+ p = NULL;
+ }
- for (j=0; j<height; j++, sy+=stepy, dy+=stepy) {
- if (needbuffer) {
+ for (j = 0; j < height; j++, sy += stepy, dy += stepy) {
+ if (overlapping) {
MEMCPY(rgba, p, width * sizeof(GLubyte) * 4);
p += (width * sizeof(GLubyte) * 4);
}
else {
if (changeBuffer) {
- (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.DriverReadBuffer );
- if (ctx->Pixel.DriverReadBuffer == GL_FRONT_LEFT)
- ctx->Buffer->Alpha = ctx->Buffer->FrontLeftAlpha;
- else if (ctx->Pixel.DriverReadBuffer == GL_BACK_LEFT)
- ctx->Buffer->Alpha = ctx->Buffer->BackLeftAlpha;
- else if (ctx->Pixel.DriverReadBuffer == GL_FRONT_RIGHT)
- ctx->Buffer->Alpha = ctx->Buffer->FrontRightAlpha;
- else
- ctx->Buffer->Alpha = ctx->Buffer->BackRightAlpha;
+ (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
+ ctx->Pixel.DriverReadBuffer );
+ if (ctx->Pixel.DriverReadBuffer == GL_FRONT_LEFT) {
+ ctx->ReadBuffer->Alpha = ctx->ReadBuffer->FrontLeftAlpha;
+ }
+ else if (ctx->Pixel.DriverReadBuffer == GL_BACK_LEFT) {
+ ctx->ReadBuffer->Alpha = ctx->ReadBuffer->BackLeftAlpha;
+ }
+ else if (ctx->Pixel.DriverReadBuffer == GL_FRONT_RIGHT) {
+ ctx->ReadBuffer->Alpha = ctx->ReadBuffer->FrontRightAlpha;
+ }
+ else {
+ ctx->ReadBuffer->Alpha = ctx->ReadBuffer->BackRightAlpha;
+ }
}
- gl_read_rgba_span( ctx, width, srcx, sy, rgba );
+ gl_read_rgba_span( ctx, ctx->ReadBuffer, width, srcx, sy, rgba );
+ }
+
+ if (changeBuffer) {
+ /* read from the draw buffer again (in case of blending) */
+ (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
+ ctx->Color.DriverDrawBuffer );
+ ctx->ReadBuffer->Alpha = saveReadAlpha;
}
+
if (ctx->Pixel.ScaleOrBiasRGBA) {
gl_scale_and_bias_rgba( ctx, width, rgba );
}
if (ctx->Pixel.MapColorFlag) {
gl_map_rgba( ctx, width, rgba );
}
- if (quick_draw && dy>=0 && dy<ctx->Buffer->Height) {
+ if (quick_draw && dy >= 0 && dy < ctx->DrawBuffer->Height) {
(*ctx->Driver.WriteRGBASpan)( ctx, width, destx, dy,
(const GLubyte (*)[4])rgba, NULL );
-
}
else if (zoom) {
gl_write_zoomed_rgba_span( ctx, width, destx, dy, zspan,
@@ -192,17 +207,12 @@ static void copy_rgba_pixels( GLcontext* ctx,
}
}
- if (needbuffer)
+ if (overlapping)
FREE(prgba);
-
- /* Restore current alpha buffer pointer */
- ctx->Buffer->Alpha = saveAlpha;
- if (changeBuffer)
- (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer );
}
-static void copy_ci_pixels( GLcontext* ctx,
+static void copy_ci_pixels( GLcontext *ctx,
GLint srcx, GLint srcy, GLint width, GLint height,
GLint destx, GLint desty )
{
@@ -211,9 +221,9 @@ static void copy_ci_pixels( GLcontext* ctx,
GLint sy, dy, stepy;
GLint i, j;
GLboolean changeBuffer;
- const GLboolean zoom = ctx->Pixel.ZoomX!=1.0F || ctx->Pixel.ZoomY!=1.0F;
+ const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
const GLboolean shift_or_offset = ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset;
- GLboolean needbuffer;
+ GLint overlapping;
/* Determine if copy should be bottom-to-top or top-to-bottom */
if (srcy<desty) {
@@ -229,8 +239,8 @@ static void copy_ci_pixels( GLcontext* ctx,
stepy = 1;
}
- needbuffer = regions_overlap(srcx, srcy, destx, desty, width, height,
- ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
+ overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
+ ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
@@ -241,9 +251,10 @@ static void copy_ci_pixels( GLcontext* ctx,
}
/* If read and draw buffer are different we must do buffer switching */
- changeBuffer = ctx->Pixel.ReadBuffer!=ctx->Color.DrawBuffer;
+ changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer
+ || ctx->DrawBuffer != ctx->ReadBuffer;
- if (needbuffer) {
+ if (overlapping) {
GLint ssy = sy;
pci = (GLuint *) MALLOC(width * height * sizeof(GLuint));
if (!pci) {
@@ -252,26 +263,38 @@ static void copy_ci_pixels( GLcontext* ctx,
}
p = pci;
if (changeBuffer) {
- (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.DriverReadBuffer );
+ (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
+ ctx->Pixel.DriverReadBuffer );
}
- for (j=0; j<height; j++, ssy+=stepy) {
- gl_read_index_span( ctx, width, srcx, ssy, p );
+ for (j = 0; j < height; j++, ssy += stepy) {
+ gl_read_index_span( ctx, ctx->ReadBuffer, width, srcx, ssy, p );
p += width;
}
p = pci;
}
+ else {
+ pci = NULL; /* silence compiler warning */
+ p = NULL;
+ }
- for (j=0; j<height; j++, sy+=stepy, dy+=stepy) {
+ for (j = 0; j < height; j++, sy += stepy, dy += stepy) {
GLuint indexes[MAX_WIDTH];
- if (needbuffer) {
+ if (overlapping) {
MEMCPY(indexes, p, width * sizeof(GLuint));
p += width;
}
else {
if (changeBuffer) {
- (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.DriverReadBuffer );
+ (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
+ ctx->Pixel.DriverReadBuffer );
}
- gl_read_index_span( ctx, width, srcx, sy, indexes );
+ gl_read_index_span( ctx, ctx->ReadBuffer, width, srcx, sy, indexes );
+ }
+
+ if (changeBuffer) {
+ /* set read buffer back to draw buffer (in case of logicops) */
+ (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
+ ctx->Color.DriverDrawBuffer );
}
if (shift_or_offset) {
@@ -281,22 +304,16 @@ static void copy_ci_pixels( GLcontext* ctx,
gl_map_ci( ctx, width, indexes );
}
- if (changeBuffer) {
- (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DrawBuffer );
- }
if (zoom) {
gl_write_zoomed_index_span( ctx, width, destx, dy, zspan, indexes, desty );
}
else {
- gl_write_index_span( ctx, width, destx, dy, zspan, indexes, GL_BITMAP );
+ gl_write_index_span(ctx, width, destx, dy, zspan, indexes, GL_BITMAP);
}
}
- if (needbuffer)
+ if (overlapping)
FREE(pci);
-
- if (changeBuffer)
- (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer );
}
@@ -304,7 +321,7 @@ static void copy_ci_pixels( GLcontext* ctx,
/*
* TODO: Optimize!!!!
*/
-static void copy_depth_pixels( GLcontext* ctx, GLint srcx, GLint srcy,
+static void copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
GLint width, GLint height,
GLint destx, GLint desty )
{
@@ -315,10 +332,10 @@ static void copy_depth_pixels( GLcontext* ctx, GLint srcx, GLint srcy,
GLubyte rgba[MAX_WIDTH][4];
GLint sy, dy, stepy;
GLint i, j;
- const GLboolean zoom = ctx->Pixel.ZoomX!=1.0F || ctx->Pixel.ZoomY!=1.0F;
- GLboolean needbuffer;
+ const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
+ GLint overlapping;
- if (!ctx->Buffer->Depth) {
+ if (!ctx->ReadBuffer->Depth || !ctx->DrawBuffer->Depth) {
gl_error( ctx, GL_INVALID_OPERATION, "glCopyPixels" );
return;
}
@@ -337,25 +354,24 @@ static void copy_depth_pixels( GLcontext* ctx, GLint srcx, GLint srcy,
stepy = 1;
}
-
- needbuffer = regions_overlap(srcx, srcy, destx, desty, width, height,
- ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
+ overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
+ ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
/* setup colors or indexes */
if (ctx->Visual->RGBAflag) {
GLuint *rgba32 = (GLuint *) rgba;
GLuint color = *(GLuint*)( ctx->Current.ByteColor );
- for (i=0; i<width; i++) {
+ for (i = 0; i < width; i++) {
rgba32[i] = color;
}
}
else {
- for (i=0;i<width;i++) {
+ for (i = 0; i < width; i++) {
indexes[i] = ctx->Current.Index;
}
}
- if (needbuffer) {
+ if (overlapping) {
GLint ssy = sy;
pdepth = (GLfloat *) MALLOC(width * height * sizeof(GLfloat));
if (!pdepth) {
@@ -363,23 +379,27 @@ static void copy_depth_pixels( GLcontext* ctx, GLint srcx, GLint srcy,
return;
}
p = pdepth;
- for (j=0; j<height; j++, ssy+=stepy) {
- (*ctx->Driver.ReadDepthSpanFloat)( ctx, width, srcx, ssy, p );
+ for (j = 0; j < height; j++, ssy += stepy) {
+ gl_read_depth_span_float(ctx, width, srcx, ssy, p);
p += width;
}
p = pdepth;
}
+ else {
+ pdepth = NULL; /* silence compiler warning */
+ p = NULL;
+ }
- for (j=0; j<height; j++, sy+=stepy, dy+=stepy) {
- if (needbuffer) {
+ for (j = 0; j < height; j++, sy += stepy, dy += stepy) {
+ if (overlapping) {
MEMCPY(depth, p, width * sizeof(GLfloat));
p += width;
}
else {
- (*ctx->Driver.ReadDepthSpanFloat)( ctx, width, srcx, sy, depth );
+ gl_read_depth_span_float(ctx, width, srcx, sy, depth);
}
- for (i=0;i<width;i++) {
+ for (i = 0; i < width; i++) {
GLfloat d = depth[i] * ctx->Pixel.DepthScale + ctx->Pixel.DepthBias;
zspan[i] = (GLint) (CLAMP( d, 0.0F, 1.0F ) * DEPTH_SCALE);
}
@@ -405,30 +425,30 @@ static void copy_depth_pixels( GLcontext* ctx, GLint srcx, GLint srcy,
}
}
- if (needbuffer)
+ if (overlapping)
FREE(pdepth);
}
-static void copy_stencil_pixels( GLcontext* ctx, GLint srcx, GLint srcy,
+static void copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
GLint width, GLint height,
GLint destx, GLint desty )
{
GLint sy, dy, stepy;
GLint j;
- GLstencil *p,*psten;
- const GLboolean zoom = (ctx->Pixel.ZoomX!=1.0F || ctx->Pixel.ZoomY!=1.0F);
- const GLboolean shift_or_offset = ctx->Pixel.IndexShift!=0 || ctx->Pixel.IndexOffset!=0;
- GLboolean needbuffer;
+ GLstencil *p, *psten;
+ const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
+ const GLboolean shift_or_offset = ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset;
+ GLint overlapping;
- if (!ctx->Buffer->Stencil) {
+ if (!ctx->DrawBuffer->Stencil || !ctx->ReadBuffer->Stencil) {
gl_error( ctx, GL_INVALID_OPERATION, "glCopyPixels" );
return;
}
/* Determine if copy should be bottom-to-top or top-to-bottom */
- if (srcy<desty) {
+ if (srcy < desty) {
/* top-down max-to-min */
sy = srcy + height - 1;
dy = desty + height - 1;
@@ -441,10 +461,10 @@ static void copy_stencil_pixels( GLcontext* ctx, GLint srcx, GLint srcy,
stepy = 1;
}
- needbuffer = regions_overlap(srcx, srcy, destx, desty, width, height,
- ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
+ overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
+ ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
- if (needbuffer) {
+ if (overlapping) {
GLint ssy = sy;
psten = (GLstencil *) MALLOC(width * height * sizeof(GLstencil));
if (!psten) {
@@ -452,17 +472,21 @@ static void copy_stencil_pixels( GLcontext* ctx, GLint srcx, GLint srcy,
return;
}
p = psten;
- for (j=0; j<height; j++, ssy+=stepy) {
+ for (j = 0; j < height; j++, ssy += stepy) {
gl_read_stencil_span( ctx, width, srcx, ssy, p );
p += width;
}
p = psten;
}
+ else {
+ psten = NULL; /* silence compiler warning */
+ p = NULL;
+ }
- for (j=0; j<height; j++, sy+=stepy, dy+=stepy) {
+ for (j = 0; j < height; j++, sy += stepy, dy += stepy) {
GLstencil stencil[MAX_WIDTH];
- if (needbuffer) {
+ if (overlapping) {
MEMCPY(stencil, p, width * sizeof(GLstencil));
p += width;
}
@@ -485,21 +509,23 @@ static void copy_stencil_pixels( GLcontext* ctx, GLint srcx, GLint srcy,
}
}
- if (needbuffer)
+ if (overlapping)
FREE(psten);
}
-void gl_CopyPixels( GLcontext* ctx, GLint srcx, GLint srcy,
- GLsizei width, GLsizei height, GLenum type )
+void
+_mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
+ GLenum type )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint destx, desty;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyPixels");
- if (width<0 || height<0) {
+ if (width < 0 || height < 0) {
gl_error( ctx, GL_INVALID_VALUE, "glCopyPixels" );
return;
}
@@ -516,23 +542,23 @@ void gl_CopyPixels( GLcontext* ctx, GLint srcx, GLint srcy,
destx = (GLint) (ctx->Current.RasterPos[0] + 0.5F);
desty = (GLint) (ctx->Current.RasterPos[1] + 0.5F);
- if (type==GL_COLOR && ctx->Visual->RGBAflag) {
+ if (type == GL_COLOR && ctx->Visual->RGBAflag) {
copy_rgba_pixels( ctx, srcx, srcy, width, height, destx, desty );
}
- else if (type==GL_COLOR && !ctx->Visual->RGBAflag) {
+ else if (type == GL_COLOR && !ctx->Visual->RGBAflag) {
copy_ci_pixels( ctx, srcx, srcy, width, height, destx, desty );
}
- else if (type==GL_DEPTH) {
+ else if (type == GL_DEPTH) {
copy_depth_pixels( ctx, srcx, srcy, width, height, destx, desty );
}
- else if (type==GL_STENCIL) {
+ else if (type == GL_STENCIL) {
copy_stencil_pixels( ctx, srcx, srcy, width, height, destx, desty );
}
else {
gl_error( ctx, GL_INVALID_ENUM, "glCopyPixels" );
}
}
- else if (ctx->RenderMode==GL_FEEDBACK) {
+ else if (ctx->RenderMode == GL_FEEDBACK) {
GLfloat color[4];
UBYTE_RGBA_TO_FLOAT_RGBA(color, ctx->Current.ByteColor );
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_COPY_PIXEL_TOKEN );
@@ -540,7 +566,7 @@ void gl_CopyPixels( GLcontext* ctx, GLint srcx, GLint srcy,
color, ctx->Current.Index,
ctx->Current.Texcoord[0] );
}
- else if (ctx->RenderMode==GL_SELECT) {
+ else if (ctx->RenderMode == GL_SELECT) {
gl_update_hitflag( ctx, ctx->Current.RasterPos[2] );
}
diff --git a/xc/extras/Mesa/src/copypix.h b/xc/extras/Mesa/src/copypix.h
index 783e252dd..c81ca4ea4 100644
--- a/xc/extras/Mesa/src/copypix.h
+++ b/xc/extras/Mesa/src/copypix.h
@@ -1,8 +1,8 @@
-/* $Id: copypix.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: copypix.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef COPYPIXELS_H
#define COPYPIXELS_H
@@ -35,10 +32,9 @@
#include "types.h"
-extern void gl_CopyPixels( GLcontext* ctx,
- GLint srcx, GLint srcy,
- GLsizei width, GLsizei height,
- GLenum type );
+extern void
+_mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
+ GLenum type );
#endif
diff --git a/xc/extras/Mesa/src/cull_tmp.h b/xc/extras/Mesa/src/cull_tmp.h
index 00a09a43b..b0aa9aa18 100644
--- a/xc/extras/Mesa/src/cull_tmp.h
+++ b/xc/extras/Mesa/src/cull_tmp.h
@@ -1,4 +1,4 @@
-/* $Id: cull_tmp.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: cull_tmp.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/cva.c b/xc/extras/Mesa/src/cva.c
index 8e700c3e0..bffc9c411 100644
--- a/xc/extras/Mesa/src/cva.c
+++ b/xc/extras/Mesa/src/cva.c
@@ -1,8 +1,8 @@
-/* $Id: cva.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: cva.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -28,27 +28,23 @@
* Copyright (C) 1999 Keith Whitwell
*/
-#ifndef XFree86Server
-#include <stdlib.h>
-#include <stdio.h>
+
+#ifdef PC_HEADER
+#include "all.h"
#else
-#include "GL/xf86glx.h"
-#endif
-#include "api.h"
+#include "glheader.h"
#include "types.h"
#include "cva.h"
#include "context.h"
#include "macros.h"
+#include "mem.h"
#include "pipeline.h"
#include "varray.h"
#include "vbcull.h"
#include "vbrender.h"
#include "vbxform.h"
#include "vector.h"
-
-/* Mesa CVA implementation.
- * Copyright (C) 1999 Keith Whitwell
- */
+#endif
@@ -377,12 +373,10 @@ void gl_rescue_cva( GLcontext *ctx, struct immediate *IM )
* actual draw commands arrive, the data will be merged prior to
* calling render_vb.
*/
-void GLAPIENTRY glLockArraysEXT(CTX_ARG GLint first, GLsizei count )
+void
+_mesa_LockArraysEXT(GLint first, GLsizei count)
{
- GLcontext *ctx;
- GET_CONTEXT;
- CHECK_CONTEXT;
- ctx = CC;
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "unlock arrays" );
if (MESA_VERBOSE & VERBOSE_API)
@@ -430,12 +424,10 @@ void GLAPIENTRY glLockArraysEXT(CTX_ARG GLint first, GLsizei count )
-void GLAPIENTRY glUnlockArraysEXT(CTX_VOID )
+void
+_mesa_UnlockArraysEXT( void )
{
- GLcontext *ctx;
- GET_CONTEXT;
- CHECK_CONTEXT;
- ctx = CC;
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "unlock arrays" );
if (MESA_VERBOSE & VERBOSE_API)
diff --git a/xc/extras/Mesa/src/cva.h b/xc/extras/Mesa/src/cva.h
index 071e4339b..ba0abf0a9 100644
--- a/xc/extras/Mesa/src/cva.h
+++ b/xc/extras/Mesa/src/cva.h
@@ -1,8 +1,8 @@
-/* $Id: cva.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: cva.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -49,8 +49,11 @@ extern void gl_free_cva_store( struct gl_cva *cva );
extern void gl_rescue_cva( GLcontext *ctx, struct immediate *IM );
extern void gl_cva_force_precalc( GLcontext *ctx );
-extern void gl_LockArrays( GLcontext *ctx, GLuint first, GLuint count );
-extern void gl_UnlockArrays( GLcontext *ctx );
+extern void
+_mesa_LockArraysEXT(GLint first, GLsizei count);
+
+extern void
+_mesa_UnlockArraysEXT( void );
diff --git a/xc/extras/Mesa/src/dd.h b/xc/extras/Mesa/src/dd.h
index 92027595b..e6e3e63c2 100644
--- a/xc/extras/Mesa/src/dd.h
+++ b/xc/extras/Mesa/src/dd.h
@@ -1,8 +1,8 @@
-/* $Id: dd.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: dd.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -118,6 +118,15 @@ struct gl_pipeline_stage;
+/* Mask bits sent to the driver Clear() function */
+#define DD_FRONT_LEFT_BIT FRONT_LEFT_BIT /* 1 */
+#define DD_FRONT_RIGHT_BIT FRONT_RIGHT_BIT /* 2 */
+#define DD_BACK_LEFT_BIT BACK_LEFT_BIT /* 4 */
+#define DD_BACK_RIGHT_BIT BACK_RIGHT_BIT /* 8 */
+#define DD_DEPTH_BIT GL_DEPTH_BUFFER_BIT /* 0x00000100 */
+#define DD_STENCIL_BIT GL_STENCIL_BUFFER_BIT /* 0x00000400 */
+#define DD_ACCUM_BIT GL_ACCUM_BUFFER_BIT /* 0x00000200 */
+
/*
@@ -161,10 +170,14 @@ struct dd_function_table {
GLbitfield (*Clear)( GLcontext *ctx, GLbitfield mask, GLboolean all,
GLint x, GLint y, GLint width, GLint height );
/* Clear the color/depth/stencil/accum buffer(s).
- * 'mask' indicates which buffers need to be cleared. Return a bitmask
- * indicating which buffers weren't cleared by the driver function.
- * If 'all' is true then the clear the whole buffer, else clear the
- * region defined by (x,y,width,height).
+ * 'mask' is a bitmask of the DD_*_BIT values defined above that indicates
+ * which buffers need to be cleared. The driver should clear those
+ * buffers then return a new bitmask indicating which buffers should be
+ * cleared by software Mesa.
+ * If 'all' is true then the clear the whole buffer, else clear only the
+ * region defined by (x,y,width,height).
+ * This function must obey the glColorMask, glIndexMask and glStencilMask
+ * settings! Software Mesa can do masked clears if the device driver can't.
*/
void (*Index)( GLcontext *ctx, GLuint index );
@@ -180,9 +193,9 @@ struct dd_function_table {
* This color should also be used in the "mono" drawing functions.
*/
- GLboolean (*SetBuffer)( GLcontext *ctx, GLenum buffer );
+ GLboolean (*SetDrawBuffer)( GLcontext *ctx, GLenum buffer );
/*
- * Selects the color buffer(s) for reading and writing.
+ * Specifies the current buffer for writing.
* The following values must be accepted when applicable:
* GL_FRONT_LEFT - this buffer always exists
* GL_BACK_LEFT - when double buffering
@@ -200,6 +213,17 @@ struct dd_function_table {
* GL_NONE - disable buffer write in device driver.
*/
+ void (*SetReadBuffer)( GLcontext *ctx, GLframebuffer *colorBuffer,
+ GLenum buffer );
+ /*
+ * Specifies the current buffer for reading.
+ * colorBuffer will be one of:
+ * GL_FRONT_LEFT - this buffer always exists
+ * GL_BACK_LEFT - when double buffering
+ * GL_FRONT_RIGHT - when using stereo
+ * GL_BACK_RIGHT - when using stereo and double buffering
+ */
+
void (*GetBufferSize)( GLcontext *ctx, GLuint *width, GLuint *height );
/*
* Returns the width and height of the current color buffer.
@@ -216,8 +240,7 @@ struct dd_function_table {
void (*WriteRGBSpan)( const GLcontext *ctx,
GLuint n, GLint x, GLint y,
CONST GLubyte rgb[][3], const GLubyte mask[] );
- /* Write a horizontal run of RGB[A] pixels. The later version is only
- * used to accelerate GL_RGB, GL_UNSIGNED_BYTE glDrawPixels() calls.
+ /* Write a horizontal run of RGBA or RGB pixels.
* If mask is NULL, draw all pixels.
* If mask is not null, only draw pixel [i] when mask [i] is true.
*/
@@ -380,34 +403,70 @@ struct dd_function_table {
/***
*** For supporting hardware Z buffers:
+ *** Either ALL or NONE of these functions must be implemented!
***/
- void (*AllocDepthBuffer)( GLcontext *ctx );
- /*
- * Called when the depth buffer must be allocated or possibly resized.
+ void (*WriteDepthSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y,
+ const GLdepth depth[], const GLubyte mask[] );
+ /* Write a horizontal span of values into the depth buffer. Only write
+ * depth[i] value if mask[i] is nonzero.
*/
- GLuint (*DepthTestSpan)( GLcontext *ctx,
- GLuint n, GLint x, GLint y, const GLdepth z[],
- GLubyte mask[] );
- void (*DepthTestPixels)( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLdepth z[], GLubyte mask[] );
- /*
- * Apply the depth buffer test to an span/array of pixels and return
- * an updated pixel mask. This function is not used when accelerated
- * point, line, polygon functions are used.
+ void (*ReadDepthSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y,
+ GLdepth depth[] );
+ /* Read a horizontal span of values from the depth buffer.
*/
- void (*ReadDepthSpanFloat)( GLcontext *ctx,
- GLuint n, GLint x, GLint y, GLfloat depth[]);
- void (*ReadDepthSpanInt)( GLcontext *ctx,
- GLuint n, GLint x, GLint y, GLdepth depth[] );
- /*
- * Return depth values as integers for glReadPixels.
- * Floats should be returned in the range [0,1].
- * Ints (GLdepth) values should be in the range [0,MAXDEPTH].
+
+ void (*WriteDepthPixels)( GLcontext *ctx, GLuint n,
+ const GLint x[], const GLint y[],
+ const GLdepth depth[], const GLubyte mask[] );
+ /* Write an array of randomly positioned depth values into the
+ * depth buffer. Only write depth[i] value if mask[i] is nonzero.
+ */
+
+ void (*ReadDepthPixels)( GLcontext *ctx, GLuint n,
+ const GLint x[], const GLint y[],
+ GLdepth depth[] );
+ /* Read an array of randomly positioned depth values from the depth buffer.
+ */
+
+
+
+ /***
+ *** For supporting hardware stencil buffers:
+ *** Either ALL or NONE of these functions must be implemented!
+ ***/
+
+ void (*WriteStencilSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y,
+ const GLstencil stencil[], const GLubyte mask[] );
+ /* Write a horizontal span of stencil values into the stencil buffer.
+ * If mask is NULL, write all stencil values.
+ * Else, only write stencil[i] if mask[i] is non-zero.
+ */
+
+
+ void (*ReadStencilSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y,
+ GLstencil stencil[] );
+ /* Read a horizontal span of stencil values from the stencil buffer.
+ */
+
+
+ void (*WriteStencilPixels)( GLcontext *ctx, GLuint n,
+ const GLint x[], const GLint y[],
+ const GLstencil stencil[],
+ const GLubyte mask[] );
+ /* Write an array of stencil values into the stencil buffer.
+ * If mask is NULL, write all stencil values.
+ * Else, only write stencil[i] if mask[i] is non-zero.
+ */
+
+ void (*ReadStencilPixels)( GLcontext *ctx, GLuint n,
+ const GLint x[], const GLint y[],
+ GLstencil stencil[] );
+ /* Read an array of stencil values from the stencil buffer.
*/
+
/***
@@ -659,7 +718,6 @@ struct dd_function_table {
void (*Lightfv)(GLcontext *ctx, GLenum light,
GLenum pname, const GLfloat *params, GLint nparams );
void (*LightModelfv)(GLcontext *ctx, GLenum pname, const GLfloat *params);
- void (*LogicOpcode)(GLcontext *ctx, GLenum opcode);
void (*PolygonMode)(GLcontext *ctx, GLenum face, GLenum mode);
void (*Scissor)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
void (*ShadeModel)(GLcontext *ctx, GLenum mode);
diff --git a/xc/extras/Mesa/src/ddsample.c b/xc/extras/Mesa/src/ddsample.c
index f4af736f6..c390f4c54 100644
--- a/xc/extras/Mesa/src/ddsample.c
+++ b/xc/extras/Mesa/src/ddsample.c
@@ -1,8 +1,8 @@
-/* $Id: ddsample.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: ddsample.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,10 +25,6 @@
*/
-
-
-
-
/*
* This is a sample template for writing new Mesa device drivers.
* You'll have to rewrite much of the code below.
@@ -56,16 +52,17 @@
* the core Mesa library.
*/
-#ifndef XFree86Server
-#include <stdlib.h>
+
+#ifdef PC_HEADER
+#include "all.h"
#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "GL/FooMesa.h"
#include "context.h"
#include "matrix.h"
#include "types.h"
#include "vb.h"
+#endif
diff --git a/xc/extras/Mesa/src/debug_xform.c b/xc/extras/Mesa/src/debug_xform.c
index 0792f7a88..99d67091a 100644
--- a/xc/extras/Mesa/src/debug_xform.c
+++ b/xc/extras/Mesa/src/debug_xform.c
@@ -1,8 +1,8 @@
-/* $Id: debug_xform.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: debug_xform.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -24,18 +24,16 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifndef XFree86Server
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
+
+#ifdef PC_HEADER
+#include "all.h"
#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "types.h"
#include "xform.h"
#include "debug_xform.h"
+#endif
/* comment this out to deactivate the cycle counter.
@@ -237,10 +235,11 @@ static int test_transform_function( transform_func fn, int psize, int mtype,
GLfloat *m = mat->m;
GLubyte mask[TEST_COUNT];
int i, j;
-
+#ifdef RUN_XFORM_BENCHMARK
int cycle_i; /* the counter for the benchmarks we run */
+#endif
- (void) cycles; (void) cycle_i;
+ (void) cycles;
if (psize > 4) {
gl_problem( NULL, "test_transform_function called with psize > 4\n");
@@ -585,10 +584,11 @@ static int test_norm_function( normal_func fn, int mtype,
GLfloat *m = mat->m;
GLubyte mask[TEST_COUNT];
int i, j;
-
+#ifdef RUN_XFORM_BENCHMARK
int cycle_i; /* the counter for the benchmarks we run */
+#endif
- (void) cycles; (void) cycle_i;
+ (void) cycles;
mat->inv = mat->m;
diff --git a/xc/extras/Mesa/src/debug_xform.h b/xc/extras/Mesa/src/debug_xform.h
index f0bf4dba6..4ea036959 100644
--- a/xc/extras/Mesa/src/debug_xform.h
+++ b/xc/extras/Mesa/src/debug_xform.h
@@ -1,4 +1,4 @@
-/* $Id: debug_xform.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: debug_xform.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/depth.c b/xc/extras/Mesa/src/depth.c
index 71de246b1..c5d31766e 100644
--- a/xc/extras/Mesa/src/depth.c
+++ b/xc/extras/Mesa/src/depth.c
@@ -1,8 +1,8 @@
-/* $Id: depth.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: depth.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,27 +25,15 @@
*/
-/* $XFree86: xc/lib/GL/mesa/src/depth.c,v 1.3 1999/04/04 00:20:22 dawes Exp $ */
-
-/*
- * Depth buffer functions
- */
-
-#include <stdlib.h>
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <stdio.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "enums.h"
#include "depth.h"
-#include "macros.h"
+#include "mem.h"
+#include "pb.h"
#include "types.h"
#endif
@@ -57,8 +45,10 @@
-void gl_ClearDepth( GLcontext* ctx, GLclampd depth )
+void
+_mesa_ClearDepth( GLclampd depth )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClearDepth");
ctx->Depth.Clear = (GLfloat) CLAMP( depth, 0.0, 1.0 );
if (ctx->Driver.ClearDepth)
@@ -67,8 +57,10 @@ void gl_ClearDepth( GLcontext* ctx, GLclampd depth )
-void gl_DepthFunc( GLcontext* ctx, GLenum func )
+void
+_mesa_DepthFunc( GLenum func )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDepthFunc");
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
@@ -108,8 +100,10 @@ void gl_DepthFunc( GLcontext* ctx, GLenum func )
-void gl_DepthMask( GLcontext* ctx, GLboolean flag )
+void
+_mesa_DepthMask( GLboolean flag )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDepthMask");
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
@@ -136,28 +130,16 @@ void gl_DepthMask( GLcontext* ctx, GLboolean flag )
/*
- * Depth test horizontal spans of fragments. These functions are called
- * via ctx->Driver.depth_test_span only.
- *
- * Input: n - number of pixels in the span
- * x, y - location of leftmost pixel in span in window coords
- * z - array [n] of integer depth values
- * In/Out: mask - array [n] of flags (1=draw pixel, 0=don't draw)
- * Return: number of pixels which passed depth test
- */
-
-
-/*
- * glDepthFunc( any ) and glDepthMask( GL_TRUE or GL_FALSE ).
+ * Do depth test for an array of fragments. This is used both for
+ * software and hardware Z buffers.
+ * Input: zbuffer - array of z values in the zbuffer
+ * z - array of fragment z values
+ * Return: number of fragments which pass the test.
*/
-GLuint gl_depth_test_span_generic( GLcontext* ctx,
- GLuint n, GLint x, GLint y,
- const GLdepth z[],
- GLubyte mask[] )
+static GLuint
+depth_test_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
+ GLdepth zbuffer[], const GLdepth z[], GLubyte mask[] )
{
- GLdepth *zptr = Z_ADDRESS( ctx, x, y );
- GLubyte *m = mask;
- GLuint i;
GLuint passed = 0;
/* switch cases ordered from most frequent to less frequent */
@@ -165,30 +147,32 @@ GLuint gl_depth_test_span_generic( GLcontext* ctx,
case GL_LESS:
if (ctx->Depth.Mask) {
/* Update Z buffer */
- for (i=0; i<n; i++,zptr++,m++) {
- if (*m) {
- if (z[i] < *zptr) {
+ GLuint i;
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ if (z[i] < zbuffer[i]) {
/* pass */
- *zptr = z[i];
+ zbuffer[i] = z[i];
passed++;
}
else {
/* fail */
- *m = 0;
+ mask[i] = 0;
}
}
}
}
else {
/* Don't update Z buffer */
- for (i=0; i<n; i++,zptr++,m++) {
- if (*m) {
- if (z[i] < *zptr) {
+ GLuint i;
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ if (z[i] < zbuffer[i]) {
/* pass */
passed++;
}
else {
- *m = 0;
+ mask[i] = 0;
}
}
}
@@ -197,28 +181,30 @@ GLuint gl_depth_test_span_generic( GLcontext* ctx,
case GL_LEQUAL:
if (ctx->Depth.Mask) {
/* Update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] <= *zptr) {
- *zptr = z[i];
+ GLuint i;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ if (z[i] <= zbuffer[i]) {
+ zbuffer[i] = z[i];
passed++;
}
else {
- *m = 0;
+ mask[i] = 0;
}
}
}
}
else {
/* Don't update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] <= *zptr) {
+ GLuint i;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ if (z[i] <= zbuffer[i]) {
/* pass */
passed++;
}
else {
- *m = 0;
+ mask[i] = 0;
}
}
}
@@ -227,28 +213,30 @@ GLuint gl_depth_test_span_generic( GLcontext* ctx,
case GL_GEQUAL:
if (ctx->Depth.Mask) {
/* Update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] >= *zptr) {
- *zptr = z[i];
+ GLuint i;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ if (z[i] >= zbuffer[i]) {
+ zbuffer[i] = z[i];
passed++;
}
else {
- *m = 0;
+ mask[i] = 0;
}
}
}
}
else {
/* Don't update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] >= *zptr) {
+ GLuint i;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ if (z[i] >= zbuffer[i]) {
/* pass */
passed++;
}
else {
- *m = 0;
+ mask[i] = 0;
}
}
}
@@ -257,28 +245,30 @@ GLuint gl_depth_test_span_generic( GLcontext* ctx,
case GL_GREATER:
if (ctx->Depth.Mask) {
/* Update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] > *zptr) {
- *zptr = z[i];
+ GLuint i;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ if (z[i] > zbuffer[i]) {
+ zbuffer[i] = z[i];
passed++;
}
else {
- *m = 0;
+ mask[i] = 0;
}
}
}
}
else {
/* Don't update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] > *zptr) {
+ GLuint i;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ if (z[i] > zbuffer[i]) {
/* pass */
passed++;
}
else {
- *m = 0;
+ mask[i] = 0;
}
}
}
@@ -287,28 +277,30 @@ GLuint gl_depth_test_span_generic( GLcontext* ctx,
case GL_NOTEQUAL:
if (ctx->Depth.Mask) {
/* Update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] != *zptr) {
- *zptr = z[i];
+ GLuint i;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ if (z[i] != zbuffer[i]) {
+ zbuffer[i] = z[i];
passed++;
}
else {
- *m = 0;
+ mask[i] = 0;
}
}
}
}
else {
/* Don't update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] != *zptr) {
+ GLuint i;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ if (z[i] != zbuffer[i]) {
/* pass */
passed++;
}
else {
- *m = 0;
+ mask[i] = 0;
}
}
}
@@ -317,28 +309,30 @@ GLuint gl_depth_test_span_generic( GLcontext* ctx,
case GL_EQUAL:
if (ctx->Depth.Mask) {
/* Update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] == *zptr) {
- *zptr = z[i];
+ GLuint i;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ if (z[i] == zbuffer[i]) {
+ zbuffer[i] = z[i];
passed++;
}
else {
- *m =0;
+ mask[i] = 0;
}
}
}
}
else {
/* Don't update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- if (z[i] == *zptr) {
+ GLuint i;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ if (z[i] == zbuffer[i]) {
/* pass */
passed++;
}
else {
- *m =0;
+ mask[i] = 0;
}
}
}
@@ -347,9 +341,10 @@ GLuint gl_depth_test_span_generic( GLcontext* ctx,
case GL_ALWAYS:
if (ctx->Depth.Mask) {
/* Update Z buffer */
- for (i=0;i<n;i++,zptr++,m++) {
- if (*m) {
- *zptr = z[i];
+ GLuint i;
+ for (i=0;i<n;i++) {
+ if (mask[i]) {
+ zbuffer[i] = z[i];
passed++;
}
}
@@ -360,13 +355,11 @@ GLuint gl_depth_test_span_generic( GLcontext* ctx,
}
break;
case GL_NEVER:
- for (i=0;i<n;i++) {
- mask[i] = 0;
- }
+ MEMSET(mask, 0, n * sizeof(GLubyte));
break;
default:
- gl_problem(ctx, "Bad depth func in gl_depth_test_span_generic");
- } /*switch*/
+ gl_problem(ctx, "Bad depth func in depth_test_span");
+ }
return passed;
}
@@ -374,93 +367,57 @@ GLuint gl_depth_test_span_generic( GLcontext* ctx,
/*
- * glDepthFunc(GL_LESS) and glDepthMask(GL_TRUE).
+ * Apply depth test to span of fragments. Hardware or software z buffer.
*/
-GLuint gl_depth_test_span_less( GLcontext* ctx,
- GLuint n, GLint x, GLint y, const GLdepth z[],
- GLubyte mask[] )
+GLuint
+gl_depth_test_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
+ const GLdepth z[], GLubyte mask[] )
{
- GLdepth *zptr = Z_ADDRESS( ctx, x, y );
- GLuint i;
- GLuint passed = 0;
+ GLdepth zbuffer[MAX_WIDTH];
+ GLdepth *zptr;
+ GLuint passed;
- for (i=0; i<n; i++) {
- if (mask[i]) {
- if (z[i] < zptr[i]) {
- /* pass */
- zptr[i] = z[i];
- passed++;
- }
- else {
- /* fail */
- mask[i] = 0;
- }
- }
+ if (ctx->Driver.ReadDepthSpan) {
+ /* read depth values out of hardware Z buffer */
+ (*ctx->Driver.ReadDepthSpan)(ctx, n, x, y, zbuffer);
+ zptr = zbuffer;
+ }
+ else {
+ /* test against software depth buffer values */
+ zptr = Z_ADDRESS( ctx, x, y );
}
- return passed;
-}
+ passed = depth_test_span( ctx, n, x, y, zptr, z, mask );
-/*
- * glDepthFunc(GL_GREATER) and glDepthMask(GL_TRUE).
- */
-GLuint gl_depth_test_span_greater( GLcontext* ctx,
- GLuint n, GLint x, GLint y,
- const GLdepth z[],
- GLubyte mask[] )
-{
- GLdepth *zptr = Z_ADDRESS( ctx, x, y );
- GLuint i;
- GLuint passed = 0;
-
- for (i=0; i<n; i++) {
- if (mask[i]) {
- if (z[i] > zptr[i]) {
- /* pass */
- zptr[i] = z[i];
- passed++;
- }
- else {
- /* fail */
- mask[i] = 0;
- }
- }
+ if (ctx->Driver.WriteDepthSpan) {
+ /* write updated depth values into hardware Z buffer */
+ assert(zptr == zbuffer);
+ (*ctx->Driver.WriteDepthSpan)(ctx, n, x, y, zbuffer, mask);
}
+
return passed;
}
-/*
- * Depth test an array of randomly positioned fragments.
- */
-
-
-#define ZADDR_SETUP GLdepth *depthbuffer = ctx->Buffer->Depth; \
- GLint width = ctx->Buffer->Width;
-
-#define ZADDR( X, Y ) (depthbuffer + (Y) * width + (X) )
-
-
/*
- * glDepthFunc( any ) and glDepthMask( GL_TRUE or GL_FALSE ).
+ * Do depth testing for an array of fragments using software Z buffer.
*/
-void gl_depth_test_pixels_generic( GLcontext* ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLdepth z[], GLubyte mask[] )
+static void
+software_depth_test_pixels( GLcontext *ctx, GLuint n,
+ const GLint x[], const GLint y[],
+ const GLdepth z[], GLubyte mask[] )
{
- register GLdepth *zptr;
- register GLuint i;
-
/* switch cases ordered from most frequent to less frequent */
switch (ctx->Depth.Func) {
case GL_LESS:
if (ctx->Depth.Mask) {
/* Update Z buffer */
+ GLuint i;
for (i=0; i<n; i++) {
if (mask[i]) {
- zptr = Z_ADDRESS(ctx,x[i],y[i]);
+ GLdepth *zptr = Z_ADDRESS(ctx,x[i],y[i]);
if (z[i] < *zptr) {
/* pass */
*zptr = z[i];
@@ -474,9 +431,10 @@ void gl_depth_test_pixels_generic( GLcontext* ctx,
}
else {
/* Don't update Z buffer */
+ GLuint i;
for (i=0; i<n; i++) {
if (mask[i]) {
- zptr = Z_ADDRESS(ctx,x[i],y[i]);
+ GLdepth *zptr = Z_ADDRESS(ctx,x[i],y[i]);
if (z[i] < *zptr) {
/* pass */
}
@@ -491,9 +449,10 @@ void gl_depth_test_pixels_generic( GLcontext* ctx,
case GL_LEQUAL:
if (ctx->Depth.Mask) {
/* Update Z buffer */
+ GLuint i;
for (i=0; i<n; i++) {
if (mask[i]) {
- zptr = Z_ADDRESS(ctx,x[i],y[i]);
+ GLdepth *zptr = Z_ADDRESS(ctx,x[i],y[i]);
if (z[i] <= *zptr) {
/* pass */
*zptr = z[i];
@@ -507,9 +466,10 @@ void gl_depth_test_pixels_generic( GLcontext* ctx,
}
else {
/* Don't update Z buffer */
+ GLuint i;
for (i=0; i<n; i++) {
if (mask[i]) {
- zptr = Z_ADDRESS(ctx,x[i],y[i]);
+ GLdepth *zptr = Z_ADDRESS(ctx,x[i],y[i]);
if (z[i] <= *zptr) {
/* pass */
}
@@ -524,9 +484,10 @@ void gl_depth_test_pixels_generic( GLcontext* ctx,
case GL_GEQUAL:
if (ctx->Depth.Mask) {
/* Update Z buffer */
+ GLuint i;
for (i=0; i<n; i++) {
if (mask[i]) {
- zptr = Z_ADDRESS(ctx,x[i],y[i]);
+ GLdepth *zptr = Z_ADDRESS(ctx,x[i],y[i]);
if (z[i] >= *zptr) {
/* pass */
*zptr = z[i];
@@ -540,9 +501,10 @@ void gl_depth_test_pixels_generic( GLcontext* ctx,
}
else {
/* Don't update Z buffer */
+ GLuint i;
for (i=0; i<n; i++) {
if (mask[i]) {
- zptr = Z_ADDRESS(ctx,x[i],y[i]);
+ GLdepth *zptr = Z_ADDRESS(ctx,x[i],y[i]);
if (z[i] >= *zptr) {
/* pass */
}
@@ -557,9 +519,10 @@ void gl_depth_test_pixels_generic( GLcontext* ctx,
case GL_GREATER:
if (ctx->Depth.Mask) {
/* Update Z buffer */
+ GLuint i;
for (i=0; i<n; i++) {
if (mask[i]) {
- zptr = Z_ADDRESS(ctx,x[i],y[i]);
+ GLdepth *zptr = Z_ADDRESS(ctx,x[i],y[i]);
if (z[i] > *zptr) {
/* pass */
*zptr = z[i];
@@ -573,9 +536,10 @@ void gl_depth_test_pixels_generic( GLcontext* ctx,
}
else {
/* Don't update Z buffer */
+ GLuint i;
for (i=0; i<n; i++) {
if (mask[i]) {
- zptr = Z_ADDRESS(ctx,x[i],y[i]);
+ GLdepth *zptr = Z_ADDRESS(ctx,x[i],y[i]);
if (z[i] > *zptr) {
/* pass */
}
@@ -590,9 +554,10 @@ void gl_depth_test_pixels_generic( GLcontext* ctx,
case GL_NOTEQUAL:
if (ctx->Depth.Mask) {
/* Update Z buffer */
+ GLuint i;
for (i=0; i<n; i++) {
if (mask[i]) {
- zptr = Z_ADDRESS(ctx,x[i],y[i]);
+ GLdepth *zptr = Z_ADDRESS(ctx,x[i],y[i]);
if (z[i] != *zptr) {
/* pass */
*zptr = z[i];
@@ -606,9 +571,10 @@ void gl_depth_test_pixels_generic( GLcontext* ctx,
}
else {
/* Don't update Z buffer */
+ GLuint i;
for (i=0; i<n; i++) {
if (mask[i]) {
- zptr = Z_ADDRESS(ctx,x[i],y[i]);
+ GLdepth *zptr = Z_ADDRESS(ctx,x[i],y[i]);
if (z[i] != *zptr) {
/* pass */
}
@@ -623,9 +589,10 @@ void gl_depth_test_pixels_generic( GLcontext* ctx,
case GL_EQUAL:
if (ctx->Depth.Mask) {
/* Update Z buffer */
+ GLuint i;
for (i=0; i<n; i++) {
if (mask[i]) {
- zptr = Z_ADDRESS(ctx,x[i],y[i]);
+ GLdepth *zptr = Z_ADDRESS(ctx,x[i],y[i]);
if (z[i] == *zptr) {
/* pass */
*zptr = z[i];
@@ -639,9 +606,10 @@ void gl_depth_test_pixels_generic( GLcontext* ctx,
}
else {
/* Don't update Z buffer */
+ GLuint i;
for (i=0; i<n; i++) {
if (mask[i]) {
- zptr = Z_ADDRESS(ctx,x[i],y[i]);
+ GLdepth *zptr = Z_ADDRESS(ctx,x[i],y[i]);
if (z[i] == *zptr) {
/* pass */
}
@@ -656,9 +624,10 @@ void gl_depth_test_pixels_generic( GLcontext* ctx,
case GL_ALWAYS:
if (ctx->Depth.Mask) {
/* Update Z buffer */
+ GLuint i;
for (i=0; i<n; i++) {
if (mask[i]) {
- zptr = Z_ADDRESS(ctx,x[i],y[i]);
+ GLdepth *zptr = Z_ADDRESS(ctx,x[i],y[i]);
*zptr = z[i];
}
}
@@ -669,71 +638,274 @@ void gl_depth_test_pixels_generic( GLcontext* ctx,
break;
case GL_NEVER:
/* depth test never passes */
- for (i=0;i<n;i++) {
- mask[i] = 0;
- }
+ MEMSET(mask, 0, n * sizeof(GLubyte));
break;
default:
- gl_problem(ctx, "Bad depth func in gl_depth_test_pixels_generic");
- } /*switch*/
+ gl_problem(ctx, "Bad depth func in software_depth_test_pixels");
+ }
}
/*
- * glDepthFunc( GL_LESS ) and glDepthMask( GL_TRUE ).
+ * Do depth testing for an array of pixels using hardware Z buffer.
+ * Input/output: zbuffer - array of depth values from Z buffer
+ * Input: z - array of fragment z values.
*/
-void gl_depth_test_pixels_less( GLcontext* ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLdepth z[], GLubyte mask[] )
+static void
+hardware_depth_test_pixels( GLcontext *ctx, GLuint n, GLdepth zbuffer[],
+ const GLdepth z[], GLubyte mask[] )
{
- GLdepth *zptr;
- GLuint i;
-
- for (i=0; i<n; i++) {
- if (mask[i]) {
- zptr = Z_ADDRESS(ctx,x[i],y[i]);
- if (z[i] < *zptr) {
- /* pass */
- *zptr = z[i];
- }
- else {
- /* fail */
- mask[i] = 0;
- }
- }
+ /* switch cases ordered from most frequent to less frequent */
+ switch (ctx->Depth.Func) {
+ case GL_LESS:
+ if (ctx->Depth.Mask) {
+ /* Update Z buffer */
+ GLuint i;
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ if (z[i] < zbuffer[i]) {
+ /* pass */
+ zbuffer[i] = z[i];
+ }
+ else {
+ /* fail */
+ mask[i] = 0;
+ }
+ }
+ }
+ }
+ else {
+ /* Don't update Z buffer */
+ GLuint i;
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ if (z[i] < zbuffer[i]) {
+ /* pass */
+ }
+ else {
+ /* fail */
+ mask[i] = 0;
+ }
+ }
+ }
+ }
+ break;
+ case GL_LEQUAL:
+ if (ctx->Depth.Mask) {
+ /* Update Z buffer */
+ GLuint i;
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ if (z[i] <= zbuffer[i]) {
+ /* pass */
+ zbuffer[i] = z[i];
+ }
+ else {
+ /* fail */
+ mask[i] = 0;
+ }
+ }
+ }
+ }
+ else {
+ /* Don't update Z buffer */
+ GLuint i;
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ if (z[i] <= zbuffer[i]) {
+ /* pass */
+ }
+ else {
+ /* fail */
+ mask[i] = 0;
+ }
+ }
+ }
+ }
+ break;
+ case GL_GEQUAL:
+ if (ctx->Depth.Mask) {
+ /* Update Z buffer */
+ GLuint i;
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ if (z[i] >= zbuffer[i]) {
+ /* pass */
+ zbuffer[i] = z[i];
+ }
+ else {
+ /* fail */
+ mask[i] = 0;
+ }
+ }
+ }
+ }
+ else {
+ /* Don't update Z buffer */
+ GLuint i;
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ if (z[i] >= zbuffer[i]) {
+ /* pass */
+ }
+ else {
+ /* fail */
+ mask[i] = 0;
+ }
+ }
+ }
+ }
+ break;
+ case GL_GREATER:
+ if (ctx->Depth.Mask) {
+ /* Update Z buffer */
+ GLuint i;
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ if (z[i] > zbuffer[i]) {
+ /* pass */
+ zbuffer[i] = z[i];
+ }
+ else {
+ /* fail */
+ mask[i] = 0;
+ }
+ }
+ }
+ }
+ else {
+ /* Don't update Z buffer */
+ GLuint i;
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ if (z[i] > zbuffer[i]) {
+ /* pass */
+ }
+ else {
+ /* fail */
+ mask[i] = 0;
+ }
+ }
+ }
+ }
+ break;
+ case GL_NOTEQUAL:
+ if (ctx->Depth.Mask) {
+ /* Update Z buffer */
+ GLuint i;
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ if (z[i] != zbuffer[i]) {
+ /* pass */
+ zbuffer[i] = z[i];
+ }
+ else {
+ /* fail */
+ mask[i] = 0;
+ }
+ }
+ }
+ }
+ else {
+ /* Don't update Z buffer */
+ GLuint i;
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ if (z[i] != zbuffer[i]) {
+ /* pass */
+ }
+ else {
+ /* fail */
+ mask[i] = 0;
+ }
+ }
+ }
+ }
+ break;
+ case GL_EQUAL:
+ if (ctx->Depth.Mask) {
+ /* Update Z buffer */
+ GLuint i;
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ if (z[i] == zbuffer[i]) {
+ /* pass */
+ zbuffer[i] = z[i];
+ }
+ else {
+ /* fail */
+ mask[i] = 0;
+ }
+ }
+ }
+ }
+ else {
+ /* Don't update Z buffer */
+ GLuint i;
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ if (z[i] == zbuffer[i]) {
+ /* pass */
+ }
+ else {
+ /* fail */
+ mask[i] = 0;
+ }
+ }
+ }
+ }
+ break;
+ case GL_ALWAYS:
+ if (ctx->Depth.Mask) {
+ /* Update Z buffer */
+ GLuint i;
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ zbuffer[i] = z[i];
+ }
+ }
+ }
+ else {
+ /* Don't update Z buffer or mask */
+ }
+ break;
+ case GL_NEVER:
+ /* depth test never passes */
+ MEMSET(mask, 0, n * sizeof(GLubyte));
+ break;
+ default:
+ gl_problem(ctx, "Bad depth func in hardware_depth_test_pixels");
}
}
-/*
- * glDepthFunc( GL_GREATER ) and glDepthMask( GL_TRUE ).
- */
-void gl_depth_test_pixels_greater( GLcontext* ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLdepth z[], GLubyte mask[] )
+
+void gl_depth_test_pixels( GLcontext *ctx,
+ GLuint n, const GLint x[], const GLint y[],
+ const GLdepth z[], GLubyte mask[] )
{
- GLdepth *zptr;
- GLuint i;
-
- for (i=0; i<n; i++) {
- if (mask[i]) {
- zptr = Z_ADDRESS(ctx,x[i],y[i]);
- if (z[i] > *zptr) {
- /* pass */
- *zptr = z[i];
- }
- else {
- /* fail */
- mask[i] = 0;
- }
- }
+ if (ctx->Driver.ReadDepthPixels) {
+ /* read depth values from hardware Z buffer */
+ GLdepth zbuffer[PB_SIZE];
+ (*ctx->Driver.ReadDepthPixels)(ctx, n, x, y, zbuffer);
+
+ hardware_depth_test_pixels( ctx, n, zbuffer, z, mask );
+
+ /* update hardware Z buffer with new values */
+ assert(ctx->Driver.WriteDepthPixels);
+ (*ctx->Driver.WriteDepthPixels)(ctx, n, x, y, z, mask );
+ }
+ else {
+ /* software depth testing */
+ software_depth_test_pixels(ctx, n, x, y, z, mask);
}
}
+
/**********************************************************************/
/***** Read Depth Buffer *****/
/**********************************************************************/
@@ -741,7 +913,7 @@ void gl_depth_test_pixels_greater( GLcontext* ctx,
/*
* Return a span of depth values from the depth buffer as floats in [0,1].
- * This function is only called through Driver.read_depth_span_float()
+ * This is used for both hardware and software depth buffers.
* Input: n - how many pixels
* x,y - location of first pixel
* Output: depth - the array of depth values
@@ -749,46 +921,29 @@ void gl_depth_test_pixels_greater( GLcontext* ctx,
void gl_read_depth_span_float( GLcontext* ctx,
GLuint n, GLint x, GLint y, GLfloat depth[] )
{
- GLdepth *zptr;
- GLfloat scale;
- GLuint i;
+ const GLfloat scale = 1.0F / DEPTH_SCALE;
- scale = 1.0F / DEPTH_SCALE;
-
- if (ctx->Buffer->Depth) {
- zptr = Z_ADDRESS( ctx, x, y );
- for (i=0;i<n;i++) {
+ if (ctx->DrawBuffer->Depth) {
+ /* read from software depth buffer */
+ const GLdepth *zptr = Z_ADDRESS( ctx, x, y );
+ GLuint i;
+ for (i = 0; i < n; i++) {
depth[i] = (GLfloat) zptr[i] * scale;
}
}
- else {
- for (i=0;i<n;i++) {
- depth[i] = 0.0F;
+ else if (ctx->Driver.ReadDepthSpan) {
+ /* read from hardware depth buffer */
+ GLdepth d[MAX_WIDTH];
+ GLuint i;
+ assert(n <= MAX_WIDTH);
+ (*ctx->Driver.ReadDepthSpan)( ctx, n, x, y, d );
+ for (i = 0; i < n; i++) {
+ depth[i] = d[i] * scale;
}
}
-}
-
-
-/*
- * Return a span of depth values from the depth buffer as integers in
- * [0,MAX_DEPTH].
- * This function is only called through Driver.read_depth_span_int()
- * Input: n - how many pixels
- * x,y - location of first pixel
- * Output: depth - the array of depth values
- */
-void gl_read_depth_span_int( GLcontext* ctx,
- GLuint n, GLint x, GLint y, GLdepth depth[] )
-{
- if (ctx->Buffer->Depth) {
- GLdepth *zptr = Z_ADDRESS( ctx, x, y );
- MEMCPY( depth, zptr, n * sizeof(GLdepth) );
- }
else {
- GLuint i;
- for (i=0;i<n;i++) {
- depth[i] = 0;
- }
+ /* no depth buffer */
+ MEMSET(depth, 0, n * sizeof(GLfloat));
}
}
@@ -808,20 +963,22 @@ void gl_read_depth_span_int( GLcontext* ctx,
void gl_alloc_depth_buffer( GLcontext* ctx )
{
/* deallocate current depth buffer if present */
- if (ctx->Buffer->Depth) {
- FREE(ctx->Buffer->Depth);
- ctx->Buffer->Depth = NULL;
- }
+ if (ctx->DrawBuffer->UseSoftwareDepthBuffer) {
+ if (ctx->DrawBuffer->Depth) {
+ FREE(ctx->DrawBuffer->Depth);
+ ctx->DrawBuffer->Depth = NULL;
+ }
- /* allocate new depth buffer, but don't initialize it */
- ctx->Buffer->Depth = (GLdepth *) MALLOC( ctx->Buffer->Width
- * ctx->Buffer->Height
- * sizeof(GLdepth) );
- if (!ctx->Buffer->Depth) {
- /* out of memory */
- ctx->Depth.Test = GL_FALSE;
- ctx->NewState |= NEW_RASTER_OPS;
- gl_error( ctx, GL_OUT_OF_MEMORY, "Couldn't allocate depth buffer" );
+ /* allocate new depth buffer, but don't initialize it */
+ ctx->DrawBuffer->Depth = (GLdepth *) MALLOC( ctx->DrawBuffer->Width
+ * ctx->DrawBuffer->Height
+ * sizeof(GLdepth) );
+ if (!ctx->DrawBuffer->Depth) {
+ /* out of memory */
+ ctx->Depth.Test = GL_FALSE;
+ ctx->NewState |= NEW_RASTER_OPS;
+ gl_error( ctx, GL_OUT_OF_MEMORY, "Couldn't allocate depth buffer" );
+ }
}
}
@@ -837,7 +994,7 @@ void gl_clear_depth_buffer( GLcontext* ctx )
{
GLdepth clear_value = (GLdepth) (ctx->Depth.Clear * DEPTH_SCALE);
- if (ctx->Visual->DepthBits==0 || !ctx->Buffer->Depth || !ctx->Depth.Mask) {
+ if (ctx->Visual->DepthBits==0 || !ctx->DrawBuffer->Depth || !ctx->Depth.Mask) {
/* no depth buffer, or writing to it is disabled */
return;
}
@@ -849,9 +1006,9 @@ void gl_clear_depth_buffer( GLcontext* ctx )
if (ctx->Scissor.Enabled) {
/* only clear scissor region */
GLint y;
- for (y=ctx->Buffer->Ymin; y<=ctx->Buffer->Ymax; y++) {
- GLdepth *d = Z_ADDRESS( ctx, ctx->Buffer->Xmin, y );
- GLint n = ctx->Buffer->Xmax - ctx->Buffer->Xmin + 1;
+ for (y=ctx->DrawBuffer->Ymin; y<=ctx->DrawBuffer->Ymax; y++) {
+ GLdepth *d = Z_ADDRESS( ctx, ctx->DrawBuffer->Xmin, y );
+ GLint n = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1;
do {
*d++ = clear_value;
n--;
@@ -862,12 +1019,12 @@ void gl_clear_depth_buffer( GLcontext* ctx )
/* clear whole buffer */
if (sizeof(GLdepth)==2 && (clear_value&0xff)==(clear_value>>8)) {
/* lower and upper bytes of clear_value are same, use MEMSET */
- MEMSET( ctx->Buffer->Depth, clear_value&0xff,
- 2*ctx->Buffer->Width*ctx->Buffer->Height);
+ MEMSET( ctx->DrawBuffer->Depth, clear_value & 0xff,
+ 2*ctx->DrawBuffer->Width * ctx->DrawBuffer->Height);
}
else {
- GLdepth *d = ctx->Buffer->Depth;
- GLint n = ctx->Buffer->Width * ctx->Buffer->Height;
+ GLdepth *d = ctx->DrawBuffer->Depth;
+ GLint n = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height;
while (n>=16) {
d[0] = clear_value; d[1] = clear_value;
d[2] = clear_value; d[3] = clear_value;
@@ -887,6 +1044,3 @@ void gl_clear_depth_buffer( GLcontext* ctx )
}
}
}
-
-
-
diff --git a/xc/extras/Mesa/src/depth.h b/xc/extras/Mesa/src/depth.h
index e23d7d99d..50bb74da7 100644
--- a/xc/extras/Mesa/src/depth.h
+++ b/xc/extras/Mesa/src/depth.h
@@ -1,9 +1,8 @@
-
-/* $Id: depth.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: depth.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -26,9 +25,6 @@
*/
-
-
-
#ifndef DEPTH_H
#define DEPTH_H
@@ -37,63 +33,54 @@
/*
- * Return the address of the Z-buffer value for window coordinate (x,y):
+ * Immediate-mode API entrpoints
*/
-#define Z_ADDRESS( CTX, X, Y ) \
- ((CTX)->Buffer->Depth + (CTX)->Buffer->Width * (Y) + (X))
-
+extern void
+_mesa_ClearDepth( GLclampd depth );
-extern GLuint
-gl_depth_test_span_generic( GLcontext* ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], GLubyte mask[] );
+extern void
+_mesa_DepthFunc( GLenum func );
-extern GLuint
-gl_depth_test_span_less( GLcontext* ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], GLubyte mask[] );
-extern GLuint
-gl_depth_test_span_greater( GLcontext* ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], GLubyte mask[] );
+extern void
+_mesa_DepthMask( GLboolean flag );
-extern void
-gl_depth_test_pixels_generic( GLcontext* ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLdepth z[], GLubyte mask[] );
-extern void
-gl_depth_test_pixels_less( GLcontext* ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLdepth z[], GLubyte mask[] );
+/*
+ * Return the address of the Z-buffer value for window coordinate (x,y):
+ */
+#define Z_ADDRESS( CTX, X, Y ) \
+ ((CTX)->DrawBuffer->Depth + (CTX)->DrawBuffer->Width * (Y) + (X))
-extern void
-gl_depth_test_pixels_greater( GLcontext* ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLdepth z[], GLubyte mask[] );
-extern void gl_read_depth_span_float( GLcontext* ctx,
- GLuint n, GLint x, GLint y,
- GLfloat depth[] );
+extern GLuint
+gl_depth_test_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
+ const GLdepth z[], GLubyte mask[] );
-extern void gl_read_depth_span_int( GLcontext* ctx, GLuint n, GLint x, GLint y,
- GLdepth depth[] );
+extern void
+gl_depth_test_pixels( GLcontext *ctx,
+ GLuint n, const GLint x[], const GLint y[],
+ const GLdepth z[], GLubyte mask[] );
-extern void gl_alloc_depth_buffer( GLcontext* ctx );
+extern void
+gl_read_depth_span_float( GLcontext *ctx, GLuint n, GLint x, GLint y,
+ GLfloat depth[] );
-extern void gl_clear_depth_buffer( GLcontext* ctx );
+extern void
+gl_alloc_depth_buffer( GLcontext* ctx );
-extern void gl_ClearDepth( GLcontext* ctx, GLclampd depth );
+extern void
+gl_clear_depth_buffer( GLcontext* ctx );
-extern void gl_DepthFunc( GLcontext* ctx, GLenum func );
-extern void gl_DepthMask( GLcontext* ctx, GLboolean flag );
#endif
diff --git a/xc/extras/Mesa/src/dispatch.c b/xc/extras/Mesa/src/dispatch.c
new file mode 100644
index 000000000..2fb07e235
--- /dev/null
+++ b/xc/extras/Mesa/src/dispatch.c
@@ -0,0 +1,640 @@
+/* $Id: dispatch.c,v 1.2 2000/01/30 00:27:01 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999-2000 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+#ifdef PC_HEADER
+#include "all.h"
+#else
+#include "glheader.h"
+#include "accum.h"
+#include "alpha.h"
+#include "attrib.h"
+#include "bitmap.h"
+#include "blend.h"
+#include "clip.h"
+#include "context.h"
+#include "colortab.h"
+#include "copypix.h"
+#include "cva.h"
+#include "depth.h"
+#include "dispatch.h"
+#include "dlist.h"
+#include "drawpix.h"
+#include "enable.h"
+#include "eval.h"
+#include "feedback.h"
+#include "fog.h"
+#include "get.h"
+#include "glapi.h"
+#include "glmisc.h"
+#include "imaging.h"
+#include "light.h"
+#include "lines.h"
+#include "logic.h"
+#include "masking.h"
+#include "matrix.h"
+#include "pixel.h"
+#include "points.h"
+#include "polygon.h"
+#include "rastpos.h"
+#include "readpix.h"
+#include "rect.h"
+#include "scissor.h"
+#include "stencil.h"
+#include "teximage.h"
+#include "texobj.h"
+#include "texstate.h"
+#include "types.h"
+#include "varray.h"
+#include "vbfill.h"
+#include "winpos.h"
+#endif
+
+
+
+/**********************************************************************
+ * Generate the GL entrypoint functions here.
+ */
+
+#define KEYWORD1
+#define KEYWORD2 GLAPIENTRY
+#if defined(USE_X86_ASM) && !defined(__WIN32__)
+#define NAME(func) _glapi_fallback_##func
+#elif defined(USE_MGL_NAMESPACE)
+#define NAME(func) mgl##func
+#else
+#define NAME(func) gl##func
+#endif
+
+#ifdef DEBUG
+
+static int
+trace(void)
+{
+ static int trace = -1;
+ if (trace < 0)
+ trace = getenv("MESA_TRACE") ? 1 : 0;
+ return trace > 0;
+}
+
+#define DISPATCH(FUNC, ARGS, MESSAGE) \
+ const struct _glapi_table *dispatch; \
+ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
+ if (trace()) printf MESSAGE; \
+ (dispatch->FUNC) ARGS
+
+#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
+ const struct _glapi_table *dispatch; \
+ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
+ if (trace()) printf MESSAGE; \
+ return (dispatch->FUNC) ARGS
+
+#else
+
+#define DISPATCH(FUNC, ARGS, MESSAGE) \
+ const struct _glapi_table *dispatch; \
+ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
+ (dispatch->FUNC) ARGS
+
+#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
+ const struct _glapi_table *dispatch; \
+ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
+ return (dispatch->FUNC) ARGS
+
+#endif
+
+
+#ifndef GLAPIENTRY
+#define GLAPIENTRY
+#endif
+
+#include "glapitemp.h"
+
+
+
+/**********************************************************************/
+
+
+static int
+generic_noop(void)
+{
+#ifdef DEBUG
+ gl_problem(NULL, "undefined function dispatch");
+#endif
+ return 0;
+}
+
+
+void
+_mesa_init_no_op_table(struct _glapi_table *table)
+{
+ /* Check to be sure the dispatcher's table is at least as big as Mesa's. */
+ const GLuint size = sizeof(struct _glapi_table) / sizeof(void *);
+ assert(_glapi_get_dispatch_table_size() >= size);
+
+ {
+ const GLuint n = _glapi_get_dispatch_table_size();
+ GLuint i;
+ void **dispatch = (void **) table;
+ for (i = 0; i < n; i++) {
+ dispatch[i] = (void *) generic_noop;
+ }
+ }
+}
+
+
+/*
+ * Initialize the given dispatch table with pointers to Mesa's
+ * immediate-mode commands.
+ */
+void
+_mesa_init_exec_table(struct _glapi_table *exec)
+{
+ /* first initialize all dispatch slots to no-op */
+ _mesa_init_no_op_table(exec);
+
+ /* load the dispatch slots we understand */
+ exec->Accum = _mesa_Accum;
+ exec->AlphaFunc = _mesa_AlphaFunc;
+ exec->Begin = _mesa_Begin;
+ exec->Bitmap = _mesa_Bitmap;
+ exec->BlendFunc = _mesa_BlendFunc;
+ exec->CallList = _mesa_CallList;
+ exec->CallLists = _mesa_CallLists;
+ exec->Clear = _mesa_Clear;
+ exec->ClearAccum = _mesa_ClearAccum;
+ exec->ClearColor = _mesa_ClearColor;
+ exec->ClearDepth = _mesa_ClearDepth;
+ exec->ClearIndex = _mesa_ClearIndex;
+ exec->ClearStencil = _mesa_ClearStencil;
+ exec->ClipPlane = _mesa_ClipPlane;
+ exec->Color3b = _mesa_Color3b;
+ exec->Color3bv = _mesa_Color3bv;
+ exec->Color3d = _mesa_Color3d;
+ exec->Color3dv = _mesa_Color3dv;
+ exec->Color3f = _mesa_Color3f;
+ exec->Color3fv = _mesa_Color3fv;
+ exec->Color3i = _mesa_Color3i;
+ exec->Color3iv = _mesa_Color3iv;
+ exec->Color3s = _mesa_Color3s;
+ exec->Color3sv = _mesa_Color3sv;
+ exec->Color3ub = _mesa_Color3ub;
+ exec->Color3ubv = _mesa_Color3ubv;
+ exec->Color3ui = _mesa_Color3ui;
+ exec->Color3uiv = _mesa_Color3uiv;
+ exec->Color3us = _mesa_Color3us;
+ exec->Color3usv = _mesa_Color3usv;
+ exec->Color4b = _mesa_Color4b;
+ exec->Color4bv = _mesa_Color4bv;
+ exec->Color4d = _mesa_Color4d;
+ exec->Color4dv = _mesa_Color4dv;
+ exec->Color4f = _mesa_Color4f;
+ exec->Color4fv = _mesa_Color4fv;
+ exec->Color4i = _mesa_Color4i;
+ exec->Color4iv = _mesa_Color4iv;
+ exec->Color4s = _mesa_Color4s;
+ exec->Color4sv = _mesa_Color4sv;
+ exec->Color4ub = _mesa_Color4ub;
+ exec->Color4ubv = _mesa_Color4ubv;
+ exec->Color4ui = _mesa_Color4ui;
+ exec->Color4uiv = _mesa_Color4uiv;
+ exec->Color4us = _mesa_Color4us;
+ exec->Color4usv = _mesa_Color4usv;
+ exec->ColorMask = _mesa_ColorMask;
+ exec->ColorMaterial = _mesa_ColorMaterial;
+ exec->CopyPixels = _mesa_CopyPixels;
+ exec->CullFace = _mesa_CullFace;
+ exec->DeleteLists = _mesa_DeleteLists;
+ exec->DepthFunc = _mesa_DepthFunc;
+ exec->DepthMask = _mesa_DepthMask;
+ exec->DepthRange = _mesa_DepthRange;
+ exec->Disable = _mesa_Disable;
+ exec->DrawBuffer = _mesa_DrawBuffer;
+ exec->DrawPixels = _mesa_DrawPixels;
+ exec->EdgeFlag = _mesa_EdgeFlag;
+ exec->EdgeFlagv = _mesa_EdgeFlagv;
+ exec->Enable = _mesa_Enable;
+ exec->End = _mesa_End;
+ exec->EndList = _mesa_EndList;
+ exec->EvalCoord1d = _mesa_EvalCoord1d;
+ exec->EvalCoord1dv = _mesa_EvalCoord1dv;
+ exec->EvalCoord1f = _mesa_EvalCoord1f;
+ exec->EvalCoord1fv = _mesa_EvalCoord1fv;
+ exec->EvalCoord2d = _mesa_EvalCoord2d;
+ exec->EvalCoord2dv = _mesa_EvalCoord2dv;
+ exec->EvalCoord2f = _mesa_EvalCoord2f;
+ exec->EvalCoord2fv = _mesa_EvalCoord2fv;
+ exec->EvalMesh1 = _mesa_EvalMesh1;
+ exec->EvalMesh2 = _mesa_EvalMesh2;
+ exec->EvalPoint1 = _mesa_EvalPoint1;
+ exec->EvalPoint2 = _mesa_EvalPoint2;
+ exec->FeedbackBuffer = _mesa_FeedbackBuffer;
+ exec->Finish = _mesa_Finish;
+ exec->Flush = _mesa_Flush;
+ exec->Fogf = _mesa_Fogf;
+ exec->Fogfv = _mesa_Fogfv;
+ exec->Fogi = _mesa_Fogi;
+ exec->Fogiv = _mesa_Fogiv;
+ exec->FrontFace = _mesa_FrontFace;
+ exec->Frustum = _mesa_Frustum;
+ exec->GenLists = _mesa_GenLists;
+ exec->GetBooleanv = _mesa_GetBooleanv;
+ exec->GetClipPlane = _mesa_GetClipPlane;
+ exec->GetDoublev = _mesa_GetDoublev;
+ exec->GetError = _mesa_GetError;
+ exec->GetFloatv = _mesa_GetFloatv;
+ exec->GetIntegerv = _mesa_GetIntegerv;
+ exec->GetLightfv = _mesa_GetLightfv;
+ exec->GetLightiv = _mesa_GetLightiv;
+ exec->GetMapdv = _mesa_GetMapdv;
+ exec->GetMapfv = _mesa_GetMapfv;
+ exec->GetMapiv = _mesa_GetMapiv;
+ exec->GetMaterialfv = _mesa_GetMaterialfv;
+ exec->GetMaterialiv = _mesa_GetMaterialiv;
+ exec->GetPixelMapfv = _mesa_GetPixelMapfv;
+ exec->GetPixelMapuiv = _mesa_GetPixelMapuiv;
+ exec->GetPixelMapusv = _mesa_GetPixelMapusv;
+ exec->GetPolygonStipple = _mesa_GetPolygonStipple;
+ exec->GetString = _mesa_GetString;
+ exec->GetTexEnvfv = _mesa_GetTexEnvfv;
+ exec->GetTexEnviv = _mesa_GetTexEnviv;
+ exec->GetTexGendv = _mesa_GetTexGendv;
+ exec->GetTexGenfv = _mesa_GetTexGenfv;
+ exec->GetTexGeniv = _mesa_GetTexGeniv;
+ exec->GetTexImage = _mesa_GetTexImage;
+ exec->GetTexLevelParameterfv = _mesa_GetTexLevelParameterfv;
+ exec->GetTexLevelParameteriv = _mesa_GetTexLevelParameteriv;
+ exec->GetTexParameterfv = _mesa_GetTexParameterfv;
+ exec->GetTexParameteriv = _mesa_GetTexParameteriv;
+ exec->Hint = _mesa_Hint;
+ exec->IndexMask = _mesa_IndexMask;
+ exec->Indexd = _mesa_Indexd;
+ exec->Indexdv = _mesa_Indexdv;
+ exec->Indexf = _mesa_Indexf;
+ exec->Indexfv = _mesa_Indexfv;
+ exec->Indexi = _mesa_Indexi;
+ exec->Indexiv = _mesa_Indexiv;
+ exec->Indexs = _mesa_Indexs;
+ exec->Indexsv = _mesa_Indexsv;
+ exec->InitNames = _mesa_InitNames;
+ exec->IsEnabled = _mesa_IsEnabled;
+ exec->IsList = _mesa_IsList;
+ exec->LightModelf = _mesa_LightModelf;
+ exec->LightModelfv = _mesa_LightModelfv;
+ exec->LightModeli = _mesa_LightModeli;
+ exec->LightModeliv = _mesa_LightModeliv;
+ exec->Lightf = _mesa_Lightf;
+ exec->Lightfv = _mesa_Lightfv;
+ exec->Lighti = _mesa_Lighti;
+ exec->Lightiv = _mesa_Lightiv;
+ exec->LineStipple = _mesa_LineStipple;
+ exec->LineWidth = _mesa_LineWidth;
+ exec->ListBase = _mesa_ListBase;
+ exec->LoadIdentity = _mesa_LoadIdentity;
+ exec->LoadMatrixd = _mesa_LoadMatrixd;
+ exec->LoadMatrixf = _mesa_LoadMatrixf;
+ exec->LoadName = _mesa_LoadName;
+ exec->LogicOp = _mesa_LogicOp;
+ exec->Map1d = _mesa_Map1d;
+ exec->Map1f = _mesa_Map1f;
+ exec->Map2d = _mesa_Map2d;
+ exec->Map2f = _mesa_Map2f;
+ exec->MapGrid1d = _mesa_MapGrid1d;
+ exec->MapGrid1f = _mesa_MapGrid1f;
+ exec->MapGrid2d = _mesa_MapGrid2d;
+ exec->MapGrid2f = _mesa_MapGrid2f;
+ exec->Materialf = _mesa_Materialf;
+ exec->Materialfv = _mesa_Materialfv;
+ exec->Materiali = _mesa_Materiali;
+ exec->Materialiv = _mesa_Materialiv;
+ exec->MatrixMode = _mesa_MatrixMode;
+ exec->MultMatrixd = _mesa_MultMatrixd;
+ exec->MultMatrixf = _mesa_MultMatrixf;
+ exec->NewList = _mesa_NewList;
+ exec->Normal3b = _mesa_Normal3b;
+ exec->Normal3bv = _mesa_Normal3bv;
+ exec->Normal3d = _mesa_Normal3d;
+ exec->Normal3dv = _mesa_Normal3dv;
+ exec->Normal3f = _mesa_Normal3f;
+ exec->Normal3fv = _mesa_Normal3fv;
+ exec->Normal3i = _mesa_Normal3i;
+ exec->Normal3iv = _mesa_Normal3iv;
+ exec->Normal3s = _mesa_Normal3s;
+ exec->Normal3sv = _mesa_Normal3sv;
+ exec->Ortho = _mesa_Ortho;
+ exec->PassThrough = _mesa_PassThrough;
+ exec->PixelMapfv = _mesa_PixelMapfv;
+ exec->PixelMapuiv = _mesa_PixelMapuiv;
+ exec->PixelMapusv = _mesa_PixelMapusv;
+ exec->PixelStoref = _mesa_PixelStoref;
+ exec->PixelStorei = _mesa_PixelStorei;
+ exec->PixelTransferf = _mesa_PixelTransferf;
+ exec->PixelTransferi = _mesa_PixelTransferi;
+ exec->PixelZoom = _mesa_PixelZoom;
+ exec->PointSize = _mesa_PointSize;
+ exec->PolygonMode = _mesa_PolygonMode;
+ exec->PolygonOffset = _mesa_PolygonOffset;
+ exec->PolygonStipple = _mesa_PolygonStipple;
+ exec->PopAttrib = _mesa_PopAttrib;
+ exec->PopMatrix = _mesa_PopMatrix;
+ exec->PopName = _mesa_PopName;
+ exec->PushAttrib = _mesa_PushAttrib;
+ exec->PushMatrix = _mesa_PushMatrix;
+ exec->PushName = _mesa_PushName;
+ exec->RasterPos2d = _mesa_RasterPos2d;
+ exec->RasterPos2dv = _mesa_RasterPos2dv;
+ exec->RasterPos2f = _mesa_RasterPos2f;
+ exec->RasterPos2fv = _mesa_RasterPos2fv;
+ exec->RasterPos2i = _mesa_RasterPos2i;
+ exec->RasterPos2iv = _mesa_RasterPos2iv;
+ exec->RasterPos2s = _mesa_RasterPos2s;
+ exec->RasterPos2sv = _mesa_RasterPos2sv;
+ exec->RasterPos3d = _mesa_RasterPos3d;
+ exec->RasterPos3dv = _mesa_RasterPos3dv;
+ exec->RasterPos3f = _mesa_RasterPos3f;
+ exec->RasterPos3fv = _mesa_RasterPos3fv;
+ exec->RasterPos3i = _mesa_RasterPos3i;
+ exec->RasterPos3iv = _mesa_RasterPos3iv;
+ exec->RasterPos3s = _mesa_RasterPos3s;
+ exec->RasterPos3sv = _mesa_RasterPos3sv;
+ exec->RasterPos4d = _mesa_RasterPos4d;
+ exec->RasterPos4dv = _mesa_RasterPos4dv;
+ exec->RasterPos4f = _mesa_RasterPos4f;
+ exec->RasterPos4fv = _mesa_RasterPos4fv;
+ exec->RasterPos4i = _mesa_RasterPos4i;
+ exec->RasterPos4iv = _mesa_RasterPos4iv;
+ exec->RasterPos4s = _mesa_RasterPos4s;
+ exec->RasterPos4sv = _mesa_RasterPos4sv;
+ exec->ReadBuffer = _mesa_ReadBuffer;
+ exec->ReadPixels = _mesa_ReadPixels;
+ exec->Rectd = _mesa_Rectd;
+ exec->Rectdv = _mesa_Rectdv;
+ exec->Rectf = _mesa_Rectf;
+ exec->Rectfv = _mesa_Rectfv;
+ exec->Recti = _mesa_Recti;
+ exec->Rectiv = _mesa_Rectiv;
+ exec->Rects = _mesa_Rects;
+ exec->Rectsv = _mesa_Rectsv;
+ exec->RenderMode = _mesa_RenderMode;
+ exec->Rotated = _mesa_Rotated;
+ exec->Rotatef = _mesa_Rotatef;
+ exec->Scaled = _mesa_Scaled;
+ exec->Scalef = _mesa_Scalef;
+ exec->Scissor = _mesa_Scissor;
+ exec->SelectBuffer = _mesa_SelectBuffer;
+ exec->ShadeModel = _mesa_ShadeModel;
+ exec->StencilFunc = _mesa_StencilFunc;
+ exec->StencilMask = _mesa_StencilMask;
+ exec->StencilOp = _mesa_StencilOp;
+ exec->TexCoord1d = _mesa_TexCoord1d;
+ exec->TexCoord1dv = _mesa_TexCoord1dv;
+ exec->TexCoord1f = _mesa_TexCoord1f;
+ exec->TexCoord1fv = _mesa_TexCoord1fv;
+ exec->TexCoord1i = _mesa_TexCoord1i;
+ exec->TexCoord1iv = _mesa_TexCoord1iv;
+ exec->TexCoord1s = _mesa_TexCoord1s;
+ exec->TexCoord1sv = _mesa_TexCoord1sv;
+ exec->TexCoord2d = _mesa_TexCoord2d;
+ exec->TexCoord2dv = _mesa_TexCoord2dv;
+ exec->TexCoord2f = _mesa_TexCoord2f;
+ exec->TexCoord2fv = _mesa_TexCoord2fv;
+ exec->TexCoord2i = _mesa_TexCoord2i;
+ exec->TexCoord2iv = _mesa_TexCoord2iv;
+ exec->TexCoord2s = _mesa_TexCoord2s;
+ exec->TexCoord2sv = _mesa_TexCoord2sv;
+ exec->TexCoord3d = _mesa_TexCoord3d;
+ exec->TexCoord3dv = _mesa_TexCoord3dv;
+ exec->TexCoord3f = _mesa_TexCoord3f;
+ exec->TexCoord3fv = _mesa_TexCoord3fv;
+ exec->TexCoord3i = _mesa_TexCoord3i;
+ exec->TexCoord3iv = _mesa_TexCoord3iv;
+ exec->TexCoord3s = _mesa_TexCoord3s;
+ exec->TexCoord3sv = _mesa_TexCoord3sv;
+ exec->TexCoord4d = _mesa_TexCoord4d;
+ exec->TexCoord4dv = _mesa_TexCoord4dv;
+ exec->TexCoord4f = _mesa_TexCoord4f;
+ exec->TexCoord4fv = _mesa_TexCoord4fv;
+ exec->TexCoord4i = _mesa_TexCoord4i;
+ exec->TexCoord4iv = _mesa_TexCoord4iv;
+ exec->TexCoord4s = _mesa_TexCoord4s;
+ exec->TexCoord4sv = _mesa_TexCoord4sv;
+ exec->TexEnvf = _mesa_TexEnvf;
+ exec->TexEnvfv = _mesa_TexEnvfv;
+ exec->TexEnvi = _mesa_TexEnvi;
+ exec->TexEnviv = _mesa_TexEnviv;
+ exec->TexGend = _mesa_TexGend;
+ exec->TexGendv = _mesa_TexGendv;
+ exec->TexGenf = _mesa_TexGenf;
+ exec->TexGenfv = _mesa_TexGenfv;
+ exec->TexGeni = _mesa_TexGeni;
+ exec->TexGeniv = _mesa_TexGeniv;
+ exec->TexImage1D = _mesa_TexImage1D;
+ exec->TexImage2D = _mesa_TexImage2D;
+ exec->TexParameterf = _mesa_TexParameterf;
+ exec->TexParameterfv = _mesa_TexParameterfv;
+ exec->TexParameteri = _mesa_TexParameteri;
+ exec->TexParameteriv = _mesa_TexParameteriv;
+ exec->Translated = _mesa_Translated;
+ exec->Translatef = _mesa_Translatef;
+ exec->Vertex2d = _mesa_Vertex2d;
+ exec->Vertex2dv = _mesa_Vertex2dv;
+ exec->Vertex2f = _mesa_Vertex2f;
+ exec->Vertex2fv = _mesa_Vertex2fv;
+ exec->Vertex2i = _mesa_Vertex2i;
+ exec->Vertex2iv = _mesa_Vertex2iv;
+ exec->Vertex2s = _mesa_Vertex2s;
+ exec->Vertex2sv = _mesa_Vertex2sv;
+ exec->Vertex3d = _mesa_Vertex3d;
+ exec->Vertex3dv = _mesa_Vertex3dv;
+ exec->Vertex3f = _mesa_Vertex3f;
+ exec->Vertex3fv = _mesa_Vertex3fv;
+ exec->Vertex3i = _mesa_Vertex3i;
+ exec->Vertex3iv = _mesa_Vertex3iv;
+ exec->Vertex3s = _mesa_Vertex3s;
+ exec->Vertex3sv = _mesa_Vertex3sv;
+ exec->Vertex4d = _mesa_Vertex4d;
+ exec->Vertex4dv = _mesa_Vertex4dv;
+ exec->Vertex4f = _mesa_Vertex4f;
+ exec->Vertex4fv = _mesa_Vertex4fv;
+ exec->Vertex4i = _mesa_Vertex4i;
+ exec->Vertex4iv = _mesa_Vertex4iv;
+ exec->Vertex4s = _mesa_Vertex4s;
+ exec->Vertex4sv = _mesa_Vertex4sv;
+ exec->Viewport = _mesa_Viewport;
+
+ /* 1.1 */
+ exec->AreTexturesResident = _mesa_AreTexturesResident;
+ exec->ArrayElement = _mesa_ArrayElement;
+ exec->BindTexture = _mesa_BindTexture;
+ exec->ColorPointer = _mesa_ColorPointer;
+ exec->CopyTexImage1D = _mesa_CopyTexImage1D;
+ exec->CopyTexImage2D = _mesa_CopyTexImage2D;
+ exec->CopyTexSubImage1D = _mesa_CopyTexSubImage1D;
+ exec->CopyTexSubImage2D = _mesa_CopyTexSubImage2D;
+ exec->DeleteTextures = _mesa_DeleteTextures;
+ exec->DisableClientState = _mesa_DisableClientState;
+ exec->DrawArrays = _mesa_DrawArrays;
+ exec->DrawElements = _mesa_DrawElements;
+ exec->EdgeFlagPointer = _mesa_EdgeFlagPointer;
+ exec->EnableClientState = _mesa_EnableClientState;
+ exec->GenTextures = _mesa_GenTextures;
+ exec->GetPointerv = _mesa_GetPointerv;
+ exec->IndexPointer = _mesa_IndexPointer;
+ exec->Indexub = _mesa_Indexub;
+ exec->Indexubv = _mesa_Indexubv;
+ exec->InterleavedArrays = _mesa_InterleavedArrays;
+ exec->IsTexture = _mesa_IsTexture;
+ exec->NormalPointer = _mesa_NormalPointer;
+ exec->PopClientAttrib = _mesa_PopClientAttrib;
+ exec->PrioritizeTextures = _mesa_PrioritizeTextures;
+ exec->PushClientAttrib = _mesa_PushClientAttrib;
+ exec->TexCoordPointer = _mesa_TexCoordPointer;
+ exec->TexSubImage1D = _mesa_TexSubImage1D;
+ exec->TexSubImage2D = _mesa_TexSubImage2D;
+ exec->VertexPointer = _mesa_VertexPointer;
+
+ /* 1.2 */
+ exec->CopyTexSubImage3D = _mesa_CopyTexSubImage3D;
+ exec->DrawRangeElements = _mesa_DrawRangeElements;
+ exec->TexImage3D = _mesa_TexImage3D;
+ exec->TexSubImage3D = _mesa_TexSubImage3D;
+
+
+ /* OpenGL 1.2 GL_ARB_imaging */
+ exec->BlendColor = _mesa_BlendColor;
+ exec->BlendEquation = _mesa_BlendEquation;
+ exec->ColorSubTable = _mesa_ColorSubTable;
+ exec->ColorTable = _mesa_ColorTable;
+ exec->ColorTableParameterfv = _mesa_ColorTableParameterfv;
+ exec->ColorTableParameteriv = _mesa_ColorTableParameteriv;
+ exec->ConvolutionFilter1D = _mesa_ConvolutionFilter1D;
+ exec->ConvolutionFilter2D = _mesa_ConvolutionFilter2D;
+ exec->ConvolutionParameterf = _mesa_ConvolutionParameterf;
+ exec->ConvolutionParameterfv = _mesa_ConvolutionParameterfv;
+ exec->ConvolutionParameteri = _mesa_ConvolutionParameteri;
+ exec->ConvolutionParameteriv = _mesa_ConvolutionParameteriv;
+ exec->CopyColorSubTable = _mesa_CopyColorSubTable;
+ exec->CopyColorTable = _mesa_CopyColorTable;
+ exec->CopyConvolutionFilter1D = _mesa_CopyConvolutionFilter1D;
+ exec->CopyConvolutionFilter2D = _mesa_CopyConvolutionFilter2D;
+ exec->GetColorTable = _mesa_GetColorTable;
+ exec->GetColorTableParameterfv = _mesa_GetColorTableParameterfv;
+ exec->GetColorTableParameteriv = _mesa_GetColorTableParameteriv;
+ exec->GetConvolutionFilter = _mesa_GetConvolutionFilter;
+ exec->GetConvolutionParameterfv = _mesa_GetConvolutionParameterfv;
+ exec->GetConvolutionParameteriv = _mesa_GetConvolutionParameteriv;
+ exec->GetHistogram = _mesa_GetHistogram;
+ exec->GetHistogramParameterfv = _mesa_GetHistogramParameterfv;
+ exec->GetHistogramParameteriv = _mesa_GetHistogramParameteriv;
+ exec->GetMinmax = _mesa_GetMinmax;
+ exec->GetMinmaxParameterfv = _mesa_GetMinmaxParameterfv;
+ exec->GetMinmaxParameteriv = _mesa_GetMinmaxParameteriv;
+ exec->GetSeparableFilter = _mesa_GetSeparableFilter;
+ exec->Histogram = _mesa_Histogram;
+ exec->Minmax = _mesa_Minmax;
+ exec->ResetHistogram = _mesa_ResetHistogram;
+ exec->ResetMinmax = _mesa_ResetMinmax;
+ exec->SeparableFilter2D = _mesa_SeparableFilter2D;
+
+ /* GL_EXT_paletted_texture */
+ exec->ColorTableEXT = _mesa_ColorTableEXT;
+ exec->ColorSubTableEXT = _mesa_ColorSubTableEXT;
+ exec->GetColorTableEXT = _mesa_GetColorTableEXT;
+ exec->GetColorTableParameterfvEXT = _mesa_GetColorTableParameterfvEXT;
+ exec->GetColorTableParameterivEXT = _mesa_GetColorTableParameterivEXT;
+
+ /* GL_EXT_compiled_vertex_array */
+ exec->LockArraysEXT = _mesa_LockArraysEXT;
+ exec->UnlockArraysEXT = _mesa_UnlockArraysEXT;
+
+ /* GL_EXT_point_parameters */
+ exec->PointParameterfEXT = _mesa_PointParameterfEXT;
+ exec->PointParameterfvEXT = _mesa_PointParameterfvEXT;
+
+ /* 77. GL_PGI_misc_hints */
+ exec->HintPGI = _mesa_HintPGI;
+
+ /* GL_EXT_polygon_offset */
+ exec->PolygonOffsetEXT = _mesa_PolygonOffsetEXT;
+
+ /* GL_EXT_blend_minmax */
+ exec->BlendEquationEXT = _mesa_BlendEquationEXT;
+
+ /* GL_EXT_blend_color */
+ exec->BlendColorEXT = _mesa_BlendColorEXT;
+
+ /* GL_ARB_multitexture */
+ exec->ActiveTextureARB = _mesa_ActiveTextureARB;
+ exec->ClientActiveTextureARB = _mesa_ClientActiveTextureARB;
+ exec->MultiTexCoord1dARB = _mesa_MultiTexCoord1dARB;
+ exec->MultiTexCoord1dvARB = _mesa_MultiTexCoord1dvARB;
+ exec->MultiTexCoord1fARB = _mesa_MultiTexCoord1fARB;
+ exec->MultiTexCoord1fvARB = _mesa_MultiTexCoord1fvARB;
+ exec->MultiTexCoord1iARB = _mesa_MultiTexCoord1iARB;
+ exec->MultiTexCoord1ivARB = _mesa_MultiTexCoord1ivARB;
+ exec->MultiTexCoord1sARB = _mesa_MultiTexCoord1sARB;
+ exec->MultiTexCoord1svARB = _mesa_MultiTexCoord1svARB;
+ exec->MultiTexCoord2dARB = _mesa_MultiTexCoord2dARB;
+ exec->MultiTexCoord2dvARB = _mesa_MultiTexCoord2dvARB;
+ exec->MultiTexCoord2fARB = _mesa_MultiTexCoord2fARB;
+ exec->MultiTexCoord2fvARB = _mesa_MultiTexCoord2fvARB;
+ exec->MultiTexCoord2iARB = _mesa_MultiTexCoord2iARB;
+ exec->MultiTexCoord2ivARB = _mesa_MultiTexCoord2ivARB;
+ exec->MultiTexCoord2sARB = _mesa_MultiTexCoord2sARB;
+ exec->MultiTexCoord2svARB = _mesa_MultiTexCoord2svARB;
+ exec->MultiTexCoord3dARB = _mesa_MultiTexCoord3dARB;
+ exec->MultiTexCoord3dvARB = _mesa_MultiTexCoord3dvARB;
+ exec->MultiTexCoord3fARB = _mesa_MultiTexCoord3fARB;
+ exec->MultiTexCoord3fvARB = _mesa_MultiTexCoord3fvARB;
+ exec->MultiTexCoord3iARB = _mesa_MultiTexCoord3iARB;
+ exec->MultiTexCoord3ivARB = _mesa_MultiTexCoord3ivARB;
+ exec->MultiTexCoord3sARB = _mesa_MultiTexCoord3sARB;
+ exec->MultiTexCoord3svARB = _mesa_MultiTexCoord3svARB;
+ exec->MultiTexCoord4dARB = _mesa_MultiTexCoord4dARB;
+ exec->MultiTexCoord4dvARB = _mesa_MultiTexCoord4dvARB;
+ exec->MultiTexCoord4fARB = _mesa_MultiTexCoord4fARB;
+ exec->MultiTexCoord4fvARB = _mesa_MultiTexCoord4fvARB;
+ exec->MultiTexCoord4iARB = _mesa_MultiTexCoord4iARB;
+ exec->MultiTexCoord4ivARB = _mesa_MultiTexCoord4ivARB;
+ exec->MultiTexCoord4sARB = _mesa_MultiTexCoord4sARB;
+ exec->MultiTexCoord4svARB = _mesa_MultiTexCoord4svARB;
+
+ /* GL_INGR_blend_func_separate */
+ exec->BlendFuncSeparateINGR = _mesa_BlendFuncSeparateINGR;
+
+ /* GL_MESA_window_pos */
+ exec->WindowPos4fMESA = _mesa_WindowPos4fMESA;
+
+ /* GL_MESA_resize_buffers */
+ exec->ResizeBuffersMESA = _mesa_ResizeBuffersMESA;
+
+ /* GL_ARB_transpose_matrix */
+ exec->LoadTransposeMatrixdARB = _mesa_LoadTransposeMatrixdARB;
+ exec->LoadTransposeMatrixfARB = _mesa_LoadTransposeMatrixfARB;
+ exec->MultTransposeMatrixdARB = _mesa_MultTransposeMatrixdARB;
+ exec->MultTransposeMatrixfARB = _mesa_MultTransposeMatrixfARB;
+}
+
diff --git a/xc/extras/Mesa/src/dispatch.h b/xc/extras/Mesa/src/dispatch.h
new file mode 100644
index 000000000..855ef14e1
--- /dev/null
+++ b/xc/extras/Mesa/src/dispatch.h
@@ -0,0 +1,44 @@
+/* $Id: dispatch.h,v 1.2 2000/01/30 00:27:01 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.1
+ *
+ * Copyright (C) 1999 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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 DISPATCH_H
+#define DISPATCH_H
+
+
+struct _glapi_table;
+
+
+extern void
+_mesa_init_no_op_table(struct _glapi_table *exec);
+
+
+extern void
+_mesa_init_exec_table(struct _glapi_table *exec);
+
+
+#endif
+
diff --git a/xc/extras/Mesa/src/dlist.c b/xc/extras/Mesa/src/dlist.c
index c5849ddc1..ec5ac2e3e 100644
--- a/xc/extras/Mesa/src/dlist.c
+++ b/xc/extras/Mesa/src/dlist.c
@@ -1,10 +1,10 @@
-/* $Id: dlist.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: dlist.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,21 +25,11 @@
*/
-/* $XFree86: xc/lib/GL/mesa/src/dlist.c,v 1.3 1999/04/04 00:20:22 dawes Exp $ */
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "accum.h"
-#include "api.h"
#include "alpha.h"
#include "attrib.h"
#include "bitmap.h"
@@ -49,7 +39,9 @@
#include "colortab.h"
#include "context.h"
#include "copypix.h"
+#include "cva.h"
#include "depth.h"
+#include "dispatch.h"
#include "drawpix.h"
#include "enable.h"
#include "enums.h"
@@ -58,9 +50,11 @@
#include "feedback.h"
#include "fog.h"
#include "get.h"
+#include "glapi.h"
#include "glmisc.h"
#include "hash.h"
#include "image.h"
+#include "imaging.h"
#include "light.h"
#include "lines.h"
#include "dlist.h"
@@ -68,6 +62,7 @@
#include "macros.h"
#include "masking.h"
#include "matrix.h"
+#include "mem.h"
#include "pipeline.h"
#include "pixel.h"
#include "points.h"
@@ -159,7 +154,6 @@ typedef enum {
OPCODE_COPY_PIXELS,
OPCODE_COPY_TEX_IMAGE1D,
OPCODE_COPY_TEX_IMAGE2D,
- OPCODE_COPY_TEX_IMAGE3D,
OPCODE_COPY_TEX_SUB_IMAGE1D,
OPCODE_COPY_TEX_SUB_IMAGE2D,
OPCODE_COPY_TEX_SUB_IMAGE3D,
@@ -181,6 +175,7 @@ typedef enum {
OPCODE_FRONT_FACE,
OPCODE_FRUSTUM,
OPCODE_HINT,
+ OPCODE_HINT_PGI,
OPCODE_INDEX_MASK,
OPCODE_INIT_NAMES,
OPCODE_LIGHT,
@@ -344,7 +339,7 @@ void gl_destroy_list( GLcontext *ctx, GLuint list )
if (list==0)
return;
- block = (Node *) HashLookup(ctx->Shared->DisplayList, list);
+ block = (Node *) _mesa_HashLookup(ctx->Shared->DisplayList, list);
n = block;
done = block ? GL_FALSE : GL_TRUE;
@@ -357,27 +352,27 @@ void gl_destroy_list( GLcontext *ctx, GLuint list )
n += InstSize[n[0].opcode];
break;
case OPCODE_MAP1:
- gl_free_control_points( ctx, n[1].e, (GLfloat *) n[6].data );
+ FREE(n[6].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_MAP2:
- gl_free_control_points( ctx, n[1].e, (GLfloat *) n[10].data );
+ FREE(n[10].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_DRAW_PIXELS:
- gl_free_image( (struct gl_image *) n[1].data );
+ FREE( n[5].data );
n += InstSize[n[0].opcode];
break;
case OPCODE_BITMAP:
- gl_free_image( (struct gl_image *) n[7].data );
+ FREE( n[7].data );
n += InstSize[n[0].opcode];
break;
case OPCODE_COLOR_TABLE:
- gl_free_image( (struct gl_image *) n[3].data );
+ FREE( n[6].data );
n += InstSize[n[0].opcode];
break;
case OPCODE_COLOR_SUB_TABLE:
- gl_free_image( (struct gl_image *) n[3].data );
+ FREE( n[6].data );
n += InstSize[n[0].opcode];
break;
case OPCODE_POLYGON_STIPPLE:
@@ -385,27 +380,27 @@ void gl_destroy_list( GLcontext *ctx, GLuint list )
n += InstSize[n[0].opcode];
break;
case OPCODE_TEX_IMAGE1D:
- FREE( n[8]. data );
+ FREE(n[8].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_TEX_IMAGE2D:
- FREE( n[9].data );
+ FREE( n[9]. data );
n += InstSize[n[0].opcode];
break;
case OPCODE_TEX_IMAGE3D:
- FREE( n[10].data );
+ FREE( n[10]. data );
n += InstSize[n[0].opcode];
break;
case OPCODE_TEX_SUB_IMAGE1D:
- FREE( n[7].data );
+ FREE(n[7].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_TEX_SUB_IMAGE2D:
- FREE( n[9].data );
+ FREE(n[9].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_TEX_SUB_IMAGE3D:
- FREE( n[11].data );
+ FREE(n[11].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_CONTINUE:
@@ -424,7 +419,7 @@ void gl_destroy_list( GLcontext *ctx, GLuint list )
}
}
- HashRemove(ctx->Shared->DisplayList, list);
+ _mesa_HashRemove(ctx->Shared->DisplayList, list);
}
@@ -514,8 +509,8 @@ void gl_init_lists( void )
InstSize[OPCODE_CLIP_PLANE] = 6;
InstSize[OPCODE_COLOR_MASK] = 5;
InstSize[OPCODE_COLOR_MATERIAL] = 3;
- InstSize[OPCODE_COLOR_TABLE] = 4;
- InstSize[OPCODE_COLOR_SUB_TABLE] = 4;
+ InstSize[OPCODE_COLOR_TABLE] = 7;
+ InstSize[OPCODE_COLOR_SUB_TABLE] = 7;
InstSize[OPCODE_COPY_PIXELS] = 6;
InstSize[OPCODE_COPY_TEX_IMAGE1D] = 8;
InstSize[OPCODE_COPY_TEX_IMAGE2D] = 9;
@@ -528,7 +523,7 @@ void gl_init_lists( void )
InstSize[OPCODE_DEPTH_RANGE] = 3;
InstSize[OPCODE_DISABLE] = 2;
InstSize[OPCODE_DRAW_BUFFER] = 2;
- InstSize[OPCODE_DRAW_PIXELS] = 2;
+ InstSize[OPCODE_DRAW_PIXELS] = 6;
InstSize[OPCODE_ENABLE] = 2;
InstSize[OPCODE_EVALCOORD1] = 2;
InstSize[OPCODE_EVALCOORD2] = 3;
@@ -540,6 +535,7 @@ void gl_init_lists( void )
InstSize[OPCODE_FRONT_FACE] = 2;
InstSize[OPCODE_FRUSTUM] = 7;
InstSize[OPCODE_HINT] = 3;
+ InstSize[OPCODE_HINT_PGI] = 3;
InstSize[OPCODE_INDEX_MASK] = 2;
InstSize[OPCODE_INIT_NAMES] = 1;
InstSize[OPCODE_LIGHT] = 7;
@@ -613,8 +609,9 @@ void gl_init_lists( void )
-static void save_Accum( GLcontext *ctx, GLenum op, GLfloat value )
+static void save_Accum( GLenum op, GLfloat value )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_ACCUM, 2 );
@@ -623,13 +620,14 @@ static void save_Accum( GLcontext *ctx, GLenum op, GLfloat value )
n[2].f = value;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Accum)( ctx, op, value );
+ (*ctx->Exec.Accum)( op, value );
}
}
-static void save_AlphaFunc( GLcontext *ctx, GLenum func, GLclampf ref )
+static void save_AlphaFunc( GLenum func, GLclampf ref )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_ALPHA_FUNC, 2 );
@@ -638,12 +636,20 @@ static void save_AlphaFunc( GLcontext *ctx, GLenum func, GLclampf ref )
n[2].f = (GLfloat) ref;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.AlphaFunc)( ctx, func, ref );
+ (*ctx->Exec.AlphaFunc)( func, ref );
}
}
-static void save_BindTexture( GLcontext *ctx, GLenum target, GLuint texture )
+
+static void save_Begin( GLenum mode )
+{
+ _mesa_Begin(mode); /* special case */
+}
+
+
+static void save_BindTexture( GLenum target, GLuint texture )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_BIND_TEXTURE, 2 );
@@ -652,44 +658,43 @@ static void save_BindTexture( GLcontext *ctx, GLenum target, GLuint texture )
n[2].ui = texture;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.BindTexture)( ctx, target, texture );
+ (*ctx->Exec.BindTexture)( target, texture );
}
}
-static void save_Bitmap( GLcontext *ctx,
- GLsizei width, GLsizei height,
+static void save_Bitmap( GLsizei width, GLsizei height,
GLfloat xorig, GLfloat yorig,
GLfloat xmove, GLfloat ymove,
- const GLubyte *bitmap,
- const struct gl_pixelstore_attrib *packing )
+ const GLubyte *pixels )
{
+ GET_CURRENT_CONTEXT(ctx);
+ GLvoid *image = _mesa_unpack_bitmap( width, height, pixels, &ctx->Unpack );
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_BITMAP, 7 );
if (n) {
- struct gl_image *image = gl_unpack_bitmap( ctx, width, height,
- bitmap, packing );
- if (image) {
- image->RefCount = 1;
- }
n[1].i = (GLint) width;
n[2].i = (GLint) height;
n[3].f = xorig;
n[4].f = yorig;
n[5].f = xmove;
n[6].f = ymove;
- n[7].data = (void *) image;
+ n[7].data = image;
+ }
+ else if (image) {
+ FREE(image);
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Bitmap)( ctx, width, height,
- xorig, yorig, xmove, ymove, bitmap, packing );
+ (*ctx->Exec.Bitmap)( width, height,
+ xorig, yorig, xmove, ymove, pixels );
}
}
-static void save_BlendEquation( GLcontext *ctx, GLenum mode )
+static void save_BlendEquation( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_BLEND_EQUATION, 1 );
@@ -697,13 +702,14 @@ static void save_BlendEquation( GLcontext *ctx, GLenum mode )
n[1].e = mode;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.BlendEquation)( ctx, mode );
+ (*ctx->Exec.BlendEquationEXT)( mode );
}
}
-static void save_BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
+static void save_BlendFunc( GLenum sfactor, GLenum dfactor )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_BLEND_FUNC, 2 );
@@ -712,15 +718,15 @@ static void save_BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
n[2].e = dfactor;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.BlendFunc)( ctx, sfactor, dfactor );
+ (*ctx->Exec.BlendFunc)( sfactor, dfactor );
}
}
-static void save_BlendFuncSeparate( GLcontext *ctx,
- GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA)
+static void save_BlendFuncSeparateINGR(GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA)
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_BLEND_FUNC_SEPARATE, 4 );
@@ -731,15 +737,16 @@ static void save_BlendFuncSeparate( GLcontext *ctx,
n[4].e = dfactorA;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.BlendFuncSeparate)( ctx, sfactorRGB, dfactorRGB,
- sfactorA, dfactorA);
+ (*ctx->Exec.BlendFuncSeparateINGR)( sfactorRGB, dfactorRGB,
+ sfactorA, dfactorA);
}
}
-static void save_BlendColor( GLcontext *ctx, GLfloat red, GLfloat green,
- GLfloat blue, GLfloat alpha )
+static void save_BlendColor( GLfloat red, GLfloat green,
+ GLfloat blue, GLfloat alpha )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_BLEND_COLOR, 4 );
@@ -750,13 +757,14 @@ static void save_BlendColor( GLcontext *ctx, GLfloat red, GLfloat green,
n[4].f = alpha;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.BlendColor)( ctx, red, green, blue, alpha );
+ (*ctx->Exec.BlendColorEXT)( red, green, blue, alpha );
}
}
-static void save_CallList( GLcontext *ctx, GLuint list )
+static void save_CallList( GLuint list )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_CALL_LIST, 1 );
@@ -764,14 +772,14 @@ static void save_CallList( GLcontext *ctx, GLuint list )
n[1].ui = list;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.CallList)( ctx, list );
+ (*ctx->Exec.CallList)( list );
}
}
-static void save_CallLists( GLcontext *ctx,
- GLsizei n, GLenum type, const GLvoid *lists )
+static void save_CallLists( GLsizei n, GLenum type, const GLvoid *lists )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint i;
FLUSH_VB(ctx, "dlist");
@@ -783,13 +791,14 @@ static void save_CallLists( GLcontext *ctx,
}
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.CallLists)( ctx, n, type, lists );
+ (*ctx->Exec.CallLists)( n, type, lists );
}
}
-static void save_Clear( GLcontext *ctx, GLbitfield mask )
+static void save_Clear( GLbitfield mask )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_CLEAR, 1 );
@@ -797,14 +806,15 @@ static void save_Clear( GLcontext *ctx, GLbitfield mask )
n[1].bf = mask;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Clear)( ctx, mask );
+ (*ctx->Exec.Clear)( mask );
}
}
-static void save_ClearAccum( GLcontext *ctx, GLfloat red, GLfloat green,
- GLfloat blue, GLfloat alpha )
+static void save_ClearAccum( GLfloat red, GLfloat green,
+ GLfloat blue, GLfloat alpha )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_CLEAR_ACCUM, 4 );
@@ -815,14 +825,15 @@ static void save_ClearAccum( GLcontext *ctx, GLfloat red, GLfloat green,
n[4].f = alpha;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.ClearAccum)( ctx, red, green, blue, alpha );
+ (*ctx->Exec.ClearAccum)( red, green, blue, alpha );
}
}
-static void save_ClearColor( GLcontext *ctx, GLclampf red, GLclampf green,
- GLclampf blue, GLclampf alpha )
+static void save_ClearColor( GLclampf red, GLclampf green,
+ GLclampf blue, GLclampf alpha )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_CLEAR_COLOR, 4 );
@@ -833,13 +844,14 @@ static void save_ClearColor( GLcontext *ctx, GLclampf red, GLclampf green,
n[4].f = alpha;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.ClearColor)( ctx, red, green, blue, alpha );
+ (*ctx->Exec.ClearColor)( red, green, blue, alpha );
}
}
-static void save_ClearDepth( GLcontext *ctx, GLclampd depth )
+static void save_ClearDepth( GLclampd depth )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_CLEAR_DEPTH, 1 );
@@ -847,13 +859,14 @@ static void save_ClearDepth( GLcontext *ctx, GLclampd depth )
n[1].f = (GLfloat) depth;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.ClearDepth)( ctx, depth );
+ (*ctx->Exec.ClearDepth)( depth );
}
}
-static void save_ClearIndex( GLcontext *ctx, GLfloat c )
+static void save_ClearIndex( GLfloat c )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_CLEAR_INDEX, 1 );
@@ -861,13 +874,14 @@ static void save_ClearIndex( GLcontext *ctx, GLfloat c )
n[1].f = c;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.ClearIndex)( ctx, c );
+ (*ctx->Exec.ClearIndex)( c );
}
}
-static void save_ClearStencil( GLcontext *ctx, GLint s )
+static void save_ClearStencil( GLint s )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_CLEAR_STENCIL, 1 );
@@ -875,13 +889,14 @@ static void save_ClearStencil( GLcontext *ctx, GLint s )
n[1].i = s;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.ClearStencil)( ctx, s );
+ (*ctx->Exec.ClearStencil)( s );
}
}
-static void save_ClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *equ )
+static void save_ClipPlane( GLenum plane, const GLdouble *equ )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_CLIP_PLANE, 5 );
@@ -893,15 +908,16 @@ static void save_ClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *equ )
n[5].f = equ[3];
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.ClipPlane)( ctx, plane, equ );
+ (*ctx->Exec.ClipPlane)( plane, equ );
}
}
-static void save_ColorMask( GLcontext *ctx, GLboolean red, GLboolean green,
- GLboolean blue, GLboolean alpha )
+static void save_ColorMask( GLboolean red, GLboolean green,
+ GLboolean blue, GLboolean alpha )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_COLOR_MASK, 4 );
@@ -912,13 +928,14 @@ static void save_ColorMask( GLcontext *ctx, GLboolean red, GLboolean green,
n[4].b = alpha;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.ColorMask)( ctx, red, green, blue, alpha );
+ (*ctx->Exec.ColorMask)( red, green, blue, alpha );
}
}
-static void save_ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode )
+static void save_ColorMaterial( GLenum face, GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_COLOR_MATERIAL, 2 );
@@ -927,57 +944,80 @@ static void save_ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode )
n[2].e = mode;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.ColorMaterial)( ctx, face, mode );
+ (*ctx->Exec.ColorMaterial)( face, mode );
}
}
-static void save_ColorTable( GLcontext *ctx, GLenum target, GLenum internalFormat,
- struct gl_image *table )
+static void save_ColorTableEXT( GLenum target, GLenum internalFormat,
+ GLsizei width, GLenum format, GLenum type,
+ const GLvoid *table )
{
- Node *n;
- FLUSH_VB(ctx, "dlist");
- n = alloc_instruction( ctx, OPCODE_COLOR_TABLE, 3 );
- if (n) {
- n[1].e = target;
- n[2].e = internalFormat;
- n[3].data = (GLvoid *) table;
- if (table) {
- /* must retain this image */
- table->RefCount = 1;
- }
+ GET_CURRENT_CONTEXT(ctx);
+ if (target == GL_PROXY_TEXTURE_1D ||
+ target == GL_PROXY_TEXTURE_2D ||
+ target == GL_PROXY_TEXTURE_3D) {
+ /* execute immediately */
+ (*ctx->Exec.ColorTableEXT)( target, internalFormat, width,
+ format, type, table );
}
- if (ctx->ExecuteFlag) {
- (*ctx->Exec.ColorTable)( ctx, target, internalFormat, table );
+ else {
+ GLvoid *image = _mesa_unpack_image(width, 1, 1, format, type, table,
+ &ctx->Unpack);
+ Node *n;
+ FLUSH_VB(ctx, "dlist");
+ n = alloc_instruction( ctx, OPCODE_COLOR_TABLE, 6 );
+ if (n) {
+ n[1].e = target;
+ n[2].e = internalFormat;
+ n[3].i = width;
+ n[4].e = format;
+ n[5].e = type;
+ n[6].data = image;
+ }
+ else if (image) {
+ FREE(image);
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec.ColorTableEXT)( target, internalFormat, width,
+ format, type, table );
+ }
}
}
-static void save_ColorSubTable( GLcontext *ctx, GLenum target,
- GLsizei start, struct gl_image *data )
+static void save_ColorSubTableEXT( GLenum target, GLsizei start, GLsizei count,
+ GLenum format, GLenum type,
+ const GLvoid *table)
{
+ GET_CURRENT_CONTEXT(ctx);
+ GLvoid *image = _mesa_unpack_image(count, 1, 1, format, type, table,
+ &ctx->Unpack);
Node *n;
FLUSH_VB(ctx, "dlist");
- n = alloc_instruction( ctx, OPCODE_COLOR_SUB_TABLE, 3 );
+ n = alloc_instruction( ctx, OPCODE_COLOR_SUB_TABLE, 6 );
if (n) {
n[1].e = target;
n[2].i = start;
- n[3].data = (GLvoid *) data;
- if (data) {
- /* must retain this image */
- data->RefCount = 1;
- }
+ n[3].i = count;
+ n[4].e = format;
+ n[5].e = type;
+ n[6].data = image;
+ }
+ else if (image) {
+ FREE(image);
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.ColorSubTable)( ctx, target, start, data );
+ (*ctx->Exec.ColorSubTableEXT)(target, start, count, format, type, table);
}
}
-static void save_CopyPixels( GLcontext *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height, GLenum type )
+static void save_CopyPixels( GLint x, GLint y,
+ GLsizei width, GLsizei height, GLenum type )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_COPY_PIXELS, 5 );
@@ -989,18 +1029,17 @@ static void save_CopyPixels( GLcontext *ctx, GLint x, GLint y,
n[5].e = type;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.CopyPixels)( ctx, x, y, width, height, type );
+ (*ctx->Exec.CopyPixels)( x, y, width, height, type );
}
}
-static void save_CopyTexImage1D( GLcontext *ctx,
- GLenum target, GLint level,
- GLenum internalformat,
- GLint x, GLint y, GLsizei width,
- GLint border )
+static void
+save_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat,
+ GLint x, GLint y, GLsizei width, GLint border )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_COPY_TEX_IMAGE1D, 7 );
@@ -1014,18 +1053,19 @@ static void save_CopyTexImage1D( GLcontext *ctx,
n[7].i = border;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.CopyTexImage1D)( ctx, target, level, internalformat,
- x, y, width, border );
+ (*ctx->Exec.CopyTexImage1D)( target, level, internalformat,
+ x, y, width, border );
}
}
-static void save_CopyTexImage2D( GLcontext *ctx,
- GLenum target, GLint level,
- GLenum internalformat,
- GLint x, GLint y, GLsizei width,
- GLsizei height, GLint border )
+static void
+save_CopyTexImage2D( GLenum target, GLint level,
+ GLenum internalformat,
+ GLint x, GLint y, GLsizei width,
+ GLsizei height, GLint border )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_COPY_TEX_IMAGE2D, 8 );
@@ -1040,18 +1080,19 @@ static void save_CopyTexImage2D( GLcontext *ctx,
n[8].i = border;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.CopyTexImage2D)( ctx, target, level, internalformat,
- x, y, width, height, border );
+ (*ctx->Exec.CopyTexImage2D)( target, level, internalformat,
+ x, y, width, height, border );
}
}
-static void save_CopyTexSubImage1D( GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y,
- GLsizei width )
+static void
+save_CopyTexSubImage1D( GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y,
+ GLsizei width )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6 );
@@ -1064,17 +1105,18 @@ static void save_CopyTexSubImage1D( GLcontext *ctx,
n[6].i = width;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.CopyTexSubImage1D)( ctx, target, level, xoffset, x, y, width );
+ (*ctx->Exec.CopyTexSubImage1D)( target, level, xoffset, x, y, width );
}
}
-static void save_CopyTexSubImage2D( GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y,
- GLsizei width, GLint height )
+static void
+save_CopyTexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y,
+ GLsizei width, GLint height )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8 );
@@ -1089,19 +1131,19 @@ static void save_CopyTexSubImage2D( GLcontext *ctx,
n[8].i = height;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.CopyTexSubImage2D)( ctx, target, level, xoffset, yoffset,
+ (*ctx->Exec.CopyTexSubImage2D)( target, level, xoffset, yoffset,
x, y, width, height );
}
}
-static void save_CopyTexSubImage3D( GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint zoffset,
- GLint x, GLint y,
- GLsizei width, GLint height )
+static void
+save_CopyTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint x, GLint y,
+ GLsizei width, GLint height )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9 );
@@ -1117,14 +1159,16 @@ static void save_CopyTexSubImage3D( GLcontext *ctx,
n[9].i = height;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.CopyTexSubImage3D)(ctx, target, level, xoffset, yoffset,
- zoffset, x, y, width, height );
+ (*ctx->Exec.CopyTexSubImage3D)( target, level,
+ xoffset, yoffset, zoffset,
+ x, y, width, height );
}
}
-static void save_CullFace( GLcontext *ctx, GLenum mode )
+static void save_CullFace( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_CULL_FACE, 1 );
@@ -1132,13 +1176,14 @@ static void save_CullFace( GLcontext *ctx, GLenum mode )
n[1].e = mode;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.CullFace)( ctx, mode );
+ (*ctx->Exec.CullFace)( mode );
}
}
-static void save_DepthFunc( GLcontext *ctx, GLenum func )
+static void save_DepthFunc( GLenum func )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_DEPTH_FUNC, 1 );
@@ -1146,13 +1191,14 @@ static void save_DepthFunc( GLcontext *ctx, GLenum func )
n[1].e = func;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.DepthFunc)( ctx, func );
+ (*ctx->Exec.DepthFunc)( func );
}
}
-static void save_DepthMask( GLcontext *ctx, GLboolean mask )
+static void save_DepthMask( GLboolean mask )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_DEPTH_MASK, 1 );
@@ -1160,13 +1206,14 @@ static void save_DepthMask( GLcontext *ctx, GLboolean mask )
n[1].b = mask;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.DepthMask)( ctx, mask );
+ (*ctx->Exec.DepthMask)( mask );
}
}
-static void save_DepthRange( GLcontext *ctx, GLclampd nearval, GLclampd farval )
+static void save_DepthRange( GLclampd nearval, GLclampd farval )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_DEPTH_RANGE, 2 );
@@ -1175,13 +1222,14 @@ static void save_DepthRange( GLcontext *ctx, GLclampd nearval, GLclampd farval )
n[2].f = (GLfloat) farval;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.DepthRange)( ctx, nearval, farval );
+ (*ctx->Exec.DepthRange)( nearval, farval );
}
}
-static void save_Disable( GLcontext *ctx, GLenum cap )
+static void save_Disable( GLenum cap )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_DISABLE, 1 );
@@ -1189,13 +1237,14 @@ static void save_Disable( GLcontext *ctx, GLenum cap )
n[1].e = cap;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Disable)( ctx, cap );
+ (*ctx->Exec.Disable)( cap );
}
}
-static void save_DrawBuffer( GLcontext *ctx, GLenum mode )
+static void save_DrawBuffer( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_DRAW_BUFFER, 1 );
@@ -1203,31 +1252,41 @@ static void save_DrawBuffer( GLcontext *ctx, GLenum mode )
n[1].e = mode;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.DrawBuffer)( ctx, mode );
+ (*ctx->Exec.DrawBuffer)( mode );
}
}
-static void save_DrawPixels( GLcontext *ctx, struct gl_image *image )
+static void save_DrawPixels( GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels )
{
+ GET_CURRENT_CONTEXT(ctx);
+ GLvoid *image = _mesa_unpack_image(width, height, 1, format, type,
+ pixels, &ctx->Unpack);
Node *n;
FLUSH_VB(ctx, "dlist");
- n = alloc_instruction( ctx, OPCODE_DRAW_PIXELS, 1 );
+ n = alloc_instruction( ctx, OPCODE_DRAW_PIXELS, 5 );
if (n) {
- n[1].data = (GLvoid *) image;
+ n[1].i = width;
+ n[2].i = height;
+ n[3].e = format;
+ n[4].e = type;
+ n[5].data = image;
}
- if (image) {
- image->RefCount = 1;
+ else if (image) {
+ FREE(image);
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.DrawPixels)( ctx, image );
+ (*ctx->Exec.DrawPixels)( width, height, format, type, pixels );
}
}
-static void save_Enable( GLcontext *ctx, GLenum cap )
+static void save_Enable( GLenum cap )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_ENABLE, 1 );
@@ -1235,15 +1294,15 @@ static void save_Enable( GLcontext *ctx, GLenum cap )
n[1].e = cap;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Enable)( ctx, cap );
+ (*ctx->Exec.Enable)( cap );
}
}
-static void save_EvalMesh1( GLcontext *ctx,
- GLenum mode, GLint i1, GLint i2 )
+static void save_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_EVALMESH1, 3 );
@@ -1253,14 +1312,15 @@ static void save_EvalMesh1( GLcontext *ctx,
n[3].i = i2;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.EvalMesh1)( ctx, mode, i1, i2 );
+ (*ctx->Exec.EvalMesh1)( mode, i1, i2 );
}
}
-static void save_EvalMesh2( GLcontext *ctx,
+static void save_EvalMesh2(
GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_EVALMESH2, 5 );
@@ -1272,15 +1332,16 @@ static void save_EvalMesh2( GLcontext *ctx,
n[5].i = j2;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.EvalMesh2)( ctx, mode, i1, i2, j1, j2 );
+ (*ctx->Exec.EvalMesh2)( mode, i1, i2, j1, j2 );
}
}
-static void save_Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
+static void save_Fogfv( GLenum pname, const GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_FOG, 5 );
@@ -1292,13 +1353,51 @@ static void save_Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
n[5].f = params[3];
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Fogfv)( ctx, pname, params );
+ (*ctx->Exec.Fogfv)( pname, params );
+ }
+}
+
+
+static void save_Fogf( GLenum pname, GLfloat param )
+{
+ save_Fogfv(pname, &param);
+}
+
+
+static void save_Fogiv(GLenum pname, const GLint *params )
+{
+ GLfloat p[4];
+ switch (pname) {
+ case GL_FOG_MODE:
+ case GL_FOG_DENSITY:
+ case GL_FOG_START:
+ case GL_FOG_END:
+ case GL_FOG_INDEX:
+ p[0] = (GLfloat) *params;
+ break;
+ case GL_FOG_COLOR:
+ p[0] = INT_TO_FLOAT( params[0] );
+ p[1] = INT_TO_FLOAT( params[1] );
+ p[2] = INT_TO_FLOAT( params[2] );
+ p[3] = INT_TO_FLOAT( params[3] );
+ break;
+ default:
+ /* Error will be caught later in gl_Fogfv */
+ ;
}
+ save_Fogfv(pname, p);
+}
+
+
+static void save_Fogi(GLenum pname, GLint param )
+{
+ save_Fogiv(pname, &param);
}
-static void save_FrontFace( GLcontext *ctx, GLenum mode )
+static void save_FrontFace( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_FRONT_FACE, 1 );
@@ -1306,15 +1405,16 @@ static void save_FrontFace( GLcontext *ctx, GLenum mode )
n[1].e = mode;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.FrontFace)( ctx, mode );
+ (*ctx->Exec.FrontFace)( mode );
}
}
-static void save_Frustum( GLcontext *ctx, GLdouble left, GLdouble right,
+static void save_Frustum( GLdouble left, GLdouble right,
GLdouble bottom, GLdouble top,
GLdouble nearval, GLdouble farval )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_FRUSTUM, 6 );
@@ -1327,13 +1427,14 @@ static void save_Frustum( GLcontext *ctx, GLdouble left, GLdouble right,
n[6].f = farval;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Frustum)( ctx, left, right, bottom, top, nearval, farval );
+ (*ctx->Exec.Frustum)( left, right, bottom, top, nearval, farval );
}
}
-static GLboolean save_Hint( GLcontext *ctx, GLenum target, GLenum mode )
+static void save_Hint( GLenum target, GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_HINT, 2 );
@@ -1342,15 +1443,31 @@ static GLboolean save_Hint( GLcontext *ctx, GLenum target, GLenum mode )
n[2].e = mode;
}
if (ctx->ExecuteFlag) {
- return (*ctx->Exec.Hint)( ctx, target, mode );
+ (*ctx->Exec.Hint)( target, mode );
}
- return GL_TRUE; /* not queried */
}
+/* GL_PGI_misc_hints*/
+static void save_HintPGI( GLenum target, GLint mode )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ FLUSH_VB(ctx, "dlist");
+ n = alloc_instruction( ctx, OPCODE_HINT_PGI, 2 );
+ if (n) {
+ n[1].e = target;
+ n[2].i = mode;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec.HintPGI)( target, mode );
+ }
+}
-static void save_IndexMask( GLcontext *ctx, GLuint mask )
+
+static void save_IndexMask( GLuint mask )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_INDEX_MASK, 1 );
@@ -1358,44 +1475,129 @@ static void save_IndexMask( GLcontext *ctx, GLuint mask )
n[1].ui = mask;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.IndexMask)( ctx, mask );
+ (*ctx->Exec.IndexMask)( mask );
}
}
-static void save_InitNames( GLcontext *ctx )
+static void save_InitNames( void )
{
+ GET_CURRENT_CONTEXT(ctx);
FLUSH_VB(ctx, "dlist");
(void) alloc_instruction( ctx, OPCODE_INIT_NAMES, 0 );
if (ctx->ExecuteFlag) {
- (*ctx->Exec.InitNames)( ctx );
+ (*ctx->Exec.InitNames)();
}
}
-static void save_Lightfv( GLcontext *ctx, GLenum light, GLenum pname,
- const GLfloat *params, GLint numparams )
+static void save_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_LIGHT, 6 );
if (OPCODE_LIGHT) {
- GLint i;
+ GLint i, nParams;
n[1].e = light;
n[2].e = pname;
- for (i=0;i<numparams;i++) {
+ switch (pname) {
+ case GL_AMBIENT:
+ nParams = 4;
+ break;
+ case GL_DIFFUSE:
+ nParams = 4;
+ break;
+ case GL_SPECULAR:
+ nParams = 4;
+ break;
+ case GL_POSITION:
+ nParams = 4;
+ break;
+ case GL_SPOT_DIRECTION:
+ nParams = 3;
+ break;
+ case GL_SPOT_EXPONENT:
+ nParams = 1;
+ break;
+ case GL_SPOT_CUTOFF:
+ nParams = 1;
+ break;
+ case GL_CONSTANT_ATTENUATION:
+ nParams = 1;
+ break;
+ case GL_LINEAR_ATTENUATION:
+ nParams = 1;
+ break;
+ case GL_QUADRATIC_ATTENUATION:
+ nParams = 1;
+ break;
+ default:
+ nParams = 0;
+ }
+ for (i = 0; i < nParams; i++) {
n[3+i].f = params[i];
}
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Lightfv)( ctx, light, pname, params, numparams );
+ (*ctx->Exec.Lightfv)( light, pname, params );
+ }
+}
+
+
+static void save_Lightf( GLenum light, GLenum pname, GLfloat params )
+{
+ save_Lightfv(light, pname, &params);
+}
+
+
+static void save_Lightiv( GLenum light, GLenum pname, const GLint *params )
+{
+ GLfloat fparam[4];
+ switch (pname) {
+ case GL_AMBIENT:
+ case GL_DIFFUSE:
+ case GL_SPECULAR:
+ fparam[0] = INT_TO_FLOAT( params[0] );
+ fparam[1] = INT_TO_FLOAT( params[1] );
+ fparam[2] = INT_TO_FLOAT( params[2] );
+ fparam[3] = INT_TO_FLOAT( params[3] );
+ break;
+ case GL_POSITION:
+ fparam[0] = (GLfloat) params[0];
+ fparam[1] = (GLfloat) params[1];
+ fparam[2] = (GLfloat) params[2];
+ fparam[3] = (GLfloat) params[3];
+ break;
+ case GL_SPOT_DIRECTION:
+ fparam[0] = (GLfloat) params[0];
+ fparam[1] = (GLfloat) params[1];
+ fparam[2] = (GLfloat) params[2];
+ break;
+ case GL_SPOT_EXPONENT:
+ case GL_SPOT_CUTOFF:
+ case GL_CONSTANT_ATTENUATION:
+ case GL_LINEAR_ATTENUATION:
+ case GL_QUADRATIC_ATTENUATION:
+ fparam[0] = (GLfloat) params[0];
+ break;
+ default:
+ /* error will be caught later in gl_Lightfv */
+ ;
}
+ save_Lightfv( light, pname, fparam );
}
-static void save_LightModelfv( GLcontext *ctx,
- GLenum pname, const GLfloat *params )
+static void save_Lighti( GLenum light, GLenum pname, GLint param )
{
+ save_Lightiv( light, pname, &param );
+}
+
+
+static void save_LightModelfv( GLenum pname, const GLfloat *params )
+{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_LIGHT_MODEL, 5 );
@@ -1407,13 +1609,49 @@ static void save_LightModelfv( GLcontext *ctx,
n[5].f = params[3];
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.LightModelfv)( ctx, pname, params );
+ (*ctx->Exec.LightModelfv)( pname, params );
+ }
+}
+
+
+static void save_LightModelf( GLenum pname, GLfloat param )
+{
+ save_LightModelfv(pname, &param);
+}
+
+
+static void save_LightModeliv( GLenum pname, const GLint *params )
+{
+ GLfloat fparam[4];
+ switch (pname) {
+ case GL_LIGHT_MODEL_AMBIENT:
+ fparam[0] = INT_TO_FLOAT( params[0] );
+ fparam[1] = INT_TO_FLOAT( params[1] );
+ fparam[2] = INT_TO_FLOAT( params[2] );
+ fparam[3] = INT_TO_FLOAT( params[3] );
+ break;
+ case GL_LIGHT_MODEL_LOCAL_VIEWER:
+ case GL_LIGHT_MODEL_TWO_SIDE:
+ case GL_LIGHT_MODEL_COLOR_CONTROL:
+ fparam[0] = (GLfloat) params[0];
+ break;
+ default:
+ /* Error will be caught later in gl_LightModelfv */
+ ;
}
+ save_LightModelfv(pname, fparam);
}
-static void save_LineStipple( GLcontext *ctx, GLint factor, GLushort pattern )
+static void save_LightModeli( GLenum pname, GLint param )
{
+ save_LightModeliv(pname, &param);
+}
+
+
+static void save_LineStipple( GLint factor, GLushort pattern )
+{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_LINE_STIPPLE, 2 );
@@ -1422,13 +1660,14 @@ static void save_LineStipple( GLcontext *ctx, GLint factor, GLushort pattern )
n[2].us = pattern;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.LineStipple)( ctx, factor, pattern );
+ (*ctx->Exec.LineStipple)( factor, pattern );
}
}
-static void save_LineWidth( GLcontext *ctx, GLfloat width )
+static void save_LineWidth( GLfloat width )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_LINE_WIDTH, 1 );
@@ -1436,13 +1675,14 @@ static void save_LineWidth( GLcontext *ctx, GLfloat width )
n[1].f = width;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.LineWidth)( ctx, width );
+ (*ctx->Exec.LineWidth)( width );
}
}
-static void save_ListBase( GLcontext *ctx, GLuint base )
+static void save_ListBase( GLuint base )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_LIST_BASE, 1 );
@@ -1450,23 +1690,25 @@ static void save_ListBase( GLcontext *ctx, GLuint base )
n[1].ui = base;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.ListBase)( ctx, base );
+ (*ctx->Exec.ListBase)( base );
}
}
-static void save_LoadIdentity( GLcontext *ctx )
+static void save_LoadIdentity( void )
{
+ GET_CURRENT_CONTEXT(ctx);
FLUSH_VB(ctx, "dlist");
(void) alloc_instruction( ctx, OPCODE_LOAD_IDENTITY, 0 );
if (ctx->ExecuteFlag) {
- (*ctx->Exec.LoadIdentity)( ctx );
+ (*ctx->Exec.LoadIdentity)();
}
}
-static void save_LoadMatrixf( GLcontext *ctx, const GLfloat *m )
+static void save_LoadMatrixf( const GLfloat *m )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_LOAD_MATRIX, 16 );
@@ -1477,13 +1719,25 @@ static void save_LoadMatrixf( GLcontext *ctx, const GLfloat *m )
}
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.LoadMatrixf)( ctx, m );
+ (*ctx->Exec.LoadMatrixf)( m );
+ }
+}
+
+
+static void save_LoadMatrixd( const GLdouble *m )
+{
+ GLfloat f[16];
+ GLint i;
+ for (i = 0; i < 16; i++) {
+ f[i] = m[i];
}
+ save_LoadMatrixf(f);
}
-static void save_LoadName( GLcontext *ctx, GLuint name )
+static void save_LoadName( GLuint name )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_LOAD_NAME, 1 );
@@ -1491,13 +1745,14 @@ static void save_LoadName( GLcontext *ctx, GLuint name )
n[1].ui = name;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.LoadName)( ctx, name );
+ (*ctx->Exec.LoadName)( name );
}
}
-static void save_LogicOp( GLcontext *ctx, GLenum opcode )
+static void save_LogicOp( GLenum opcode )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_LOGIC_OP, 1 );
@@ -1505,64 +1760,120 @@ static void save_LogicOp( GLcontext *ctx, GLenum opcode )
n[1].e = opcode;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.LogicOp)( ctx, opcode );
+ (*ctx->Exec.LogicOp)( opcode );
}
}
-static void save_Map1f( GLcontext *ctx,
- GLenum target, GLfloat u1, GLfloat u2, GLint stride,
- GLint order, const GLfloat *points, GLboolean retain )
+static void save_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride,
+ GLint order, const GLdouble *points)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ FLUSH_VB(ctx, "dlist");
+ n = alloc_instruction( ctx, OPCODE_MAP1, 6 );
+ if (n) {
+ GLfloat *pnts = gl_copy_map_points1d( target, stride, order, points );
+ n[1].e = target;
+ n[2].f = u1;
+ n[3].f = u2;
+ n[4].i = _mesa_evaluator_components(target); /* stride */
+ n[5].i = order;
+ n[6].data = (void *) pnts;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec.Map1d)( target, u1, u2, stride, order, points );
+ }
+}
+
+static void save_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride,
+ GLint order, const GLfloat *points)
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_MAP1, 6 );
if (n) {
+ GLfloat *pnts = gl_copy_map_points1f( target, stride, order, points );
n[1].e = target;
n[2].f = u1;
n[3].f = u2;
- n[4].i = stride;
+ n[4].i = _mesa_evaluator_components(target); /* stride */
n[5].i = order;
- n[6].data = (void *) points;
+ n[6].data = (void *) pnts;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Map1f)( ctx, target, u1, u2, stride, order, points, GL_TRUE );
+ (*ctx->Exec.Map1f)( target, u1, u2, stride, order, points );
}
- (void) retain;
}
-static void save_Map2f( GLcontext *ctx, GLenum target,
- GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
- GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
- const GLfloat *points, GLboolean retain )
+static void save_Map2d( GLenum target,
+ GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
+ GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
+ const GLdouble *points )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_MAP2, 10 );
if (n) {
+ GLfloat *pnts = gl_copy_map_points2d( target, ustride, uorder,
+ vstride, vorder, points );
n[1].e = target;
n[2].f = u1;
n[3].f = u2;
n[4].f = v1;
n[5].f = v2;
- n[6].i = ustride;
- n[7].i = vstride;
+ /* XXX verify these strides are correct */
+ n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride*/
+ n[7].i = _mesa_evaluator_components(target); /*vstride*/
n[8].i = uorder;
n[9].i = vorder;
- n[10].data = (void *) points;
+ n[10].data = (void *) pnts;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Map2f)( ctx, target,
- u1, u2, ustride, uorder,
- v1, v2, vstride, vorder, points, GL_TRUE );
+ (*ctx->Exec.Map2d)( target,
+ u1, u2, ustride, uorder,
+ v1, v2, vstride, vorder, points );
}
- (void) retain;
}
-static void save_MapGrid1f( GLcontext *ctx, GLint un, GLfloat u1, GLfloat u2 )
+static void save_Map2f( GLenum target,
+ GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
+ GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
+ const GLfloat *points )
{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ FLUSH_VB(ctx, "dlist");
+ n = alloc_instruction( ctx, OPCODE_MAP2, 10 );
+ if (n) {
+ GLfloat *pnts = gl_copy_map_points2f( target, ustride, uorder,
+ vstride, vorder, points );
+ n[1].e = target;
+ n[2].f = u1;
+ n[3].f = u2;
+ n[4].f = v1;
+ n[5].f = v2;
+ /* XXX verify these strides are correct */
+ n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride*/
+ n[7].i = _mesa_evaluator_components(target); /*vstride*/
+ n[8].i = uorder;
+ n[9].i = vorder;
+ n[10].data = (void *) pnts;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec.Map2f)( target, u1, u2, ustride, uorder,
+ v1, v2, vstride, vorder, points );
+ }
+}
+
+
+static void save_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 )
+{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_MAPGRID1, 3 );
@@ -1572,15 +1883,21 @@ static void save_MapGrid1f( GLcontext *ctx, GLint un, GLfloat u1, GLfloat u2 )
n[3].f = u2;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.MapGrid1f)( ctx, un, u1, u2 );
+ (*ctx->Exec.MapGrid1f)( un, u1, u2 );
}
}
-static void save_MapGrid2f( GLcontext *ctx,
- GLint un, GLfloat u1, GLfloat u2,
- GLint vn, GLfloat v1, GLfloat v2 )
+static void save_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 )
{
+ save_MapGrid1f(un, u1, u2);
+}
+
+
+static void save_MapGrid2f( GLint un, GLfloat u1, GLfloat u2,
+ GLint vn, GLfloat v1, GLfloat v2 )
+{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_MAPGRID2, 6 );
@@ -1593,13 +1910,22 @@ static void save_MapGrid2f( GLcontext *ctx,
n[6].f = v2;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.MapGrid2f)( ctx, un, u1, u2, vn, v1, v2 );
+ (*ctx->Exec.MapGrid2f)( un, u1, u2, vn, v1, v2 );
}
}
-static void save_MatrixMode( GLcontext *ctx, GLenum mode )
+
+static void save_MapGrid2d( GLint un, GLdouble u1, GLdouble u2,
+ GLint vn, GLdouble v1, GLdouble v2 )
+{
+ save_MapGrid2f(un, u1, u2, vn, v1, v2);
+}
+
+
+static void save_MatrixMode( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_MATRIX_MODE, 1 );
@@ -1607,13 +1933,14 @@ static void save_MatrixMode( GLcontext *ctx, GLenum mode )
n[1].e = mode;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.MatrixMode)( ctx, mode );
+ (*ctx->Exec.MatrixMode)( mode );
}
}
-static void save_MultMatrixf( GLcontext *ctx, const GLfloat *m )
+static void save_MultMatrixf( const GLfloat *m )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_MULT_MATRIX, 16 );
@@ -1624,13 +1951,25 @@ static void save_MultMatrixf( GLcontext *ctx, const GLfloat *m )
}
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.MultMatrixf)( ctx, m );
+ (*ctx->Exec.MultMatrixf)( m );
+ }
+}
+
+
+static void save_MultMatrixd( const GLdouble *m )
+{
+ GLfloat f[16];
+ GLint i;
+ for (i = 0; i < 16; i++) {
+ f[i] = m[i];
}
+ save_MultMatrixf(f);
}
-static void save_NewList( GLcontext *ctx, GLuint list, GLenum mode )
+static void save_NewList( GLuint list, GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
/* It's an error to call this function while building a display list */
gl_error( ctx, GL_INVALID_OPERATION, "glNewList" );
(void) list;
@@ -1639,10 +1978,11 @@ static void save_NewList( GLcontext *ctx, GLuint list, GLenum mode )
-static void save_Ortho( GLcontext *ctx, GLdouble left, GLdouble right,
+static void save_Ortho( GLdouble left, GLdouble right,
GLdouble bottom, GLdouble top,
GLdouble nearval, GLdouble farval )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_ORTHO, 6 );
@@ -1655,14 +1995,14 @@ static void save_Ortho( GLcontext *ctx, GLdouble left, GLdouble right,
n[6].f = farval;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Ortho)( ctx, left, right, bottom, top, nearval, farval );
+ (*ctx->Exec.Ortho)( left, right, bottom, top, nearval, farval );
}
}
-static void save_PixelMapfv( GLcontext *ctx,
- GLenum map, GLint mapsize, const GLfloat *values )
+static void save_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_PIXEL_MAP, 3 );
@@ -1673,13 +2013,50 @@ static void save_PixelMapfv( GLcontext *ctx,
MEMCPY( n[3].data, (void *) values, mapsize * sizeof(GLfloat) );
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PixelMapfv)( ctx, map, mapsize, values );
+ (*ctx->Exec.PixelMapfv)( map, mapsize, values );
}
}
-static void save_PixelTransferf( GLcontext *ctx, GLenum pname, GLfloat param )
+static void save_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values )
{
+ GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
+ GLint i;
+ if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
+ for (i=0;i<mapsize;i++) {
+ fvalues[i] = (GLfloat) values[i];
+ }
+ }
+ else {
+ for (i=0;i<mapsize;i++) {
+ fvalues[i] = UINT_TO_FLOAT( values[i] );
+ }
+ }
+ save_PixelMapfv(map, mapsize, fvalues);
+}
+
+
+static void save_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values)
+{
+ GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
+ GLint i;
+ if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
+ for (i=0;i<mapsize;i++) {
+ fvalues[i] = (GLfloat) values[i];
+ }
+ }
+ else {
+ for (i=0;i<mapsize;i++) {
+ fvalues[i] = USHORT_TO_FLOAT( values[i] );
+ }
+ }
+ save_PixelMapfv(map, mapsize, fvalues);
+}
+
+
+static void save_PixelTransferf( GLenum pname, GLfloat param )
+{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_PIXEL_TRANSFER, 2 );
@@ -1688,13 +2065,20 @@ static void save_PixelTransferf( GLcontext *ctx, GLenum pname, GLfloat param )
n[2].f = param;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PixelTransferf)( ctx, pname, param );
+ (*ctx->Exec.PixelTransferf)( pname, param );
}
}
-static void save_PixelZoom( GLcontext *ctx, GLfloat xfactor, GLfloat yfactor )
+static void save_PixelTransferi( GLenum pname, GLint param )
+{
+ save_PixelTransferf( pname, (GLfloat) param );
+}
+
+
+static void save_PixelZoom( GLfloat xfactor, GLfloat yfactor )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_PIXEL_ZOOM, 2 );
@@ -1703,14 +2087,14 @@ static void save_PixelZoom( GLcontext *ctx, GLfloat xfactor, GLfloat yfactor )
n[2].f = yfactor;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PixelZoom)( ctx, xfactor, yfactor );
+ (*ctx->Exec.PixelZoom)( xfactor, yfactor );
}
}
-static void save_PointParameterfvEXT( GLcontext *ctx, GLenum pname,
- const GLfloat *params)
+static void save_PointParameterfvEXT( GLenum pname, const GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_POINT_PARAMETERS, 4 );
@@ -1721,13 +2105,20 @@ static void save_PointParameterfvEXT( GLcontext *ctx, GLenum pname,
n[4].f = params[2];
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PointParameterfvEXT)( ctx, pname, params );
+ (*ctx->Exec.PointParameterfvEXT)( pname, params );
}
}
-static void save_PointSize( GLcontext *ctx, GLfloat size )
+static void save_PointParameterfEXT( GLenum pname, GLfloat param )
+{
+ save_PointParameterfvEXT(pname, &param);
+}
+
+
+static void save_PointSize( GLfloat size )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_POINT_SIZE, 1 );
@@ -1735,13 +2126,14 @@ static void save_PointSize( GLcontext *ctx, GLfloat size )
n[1].f = size;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PointSize)( ctx, size );
+ (*ctx->Exec.PointSize)( size );
}
}
-static void save_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode )
+static void save_PolygonMode( GLenum face, GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_POLYGON_MODE, 2 );
@@ -1750,7 +2142,7 @@ static void save_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode )
n[2].e = mode;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PolygonMode)( ctx, face, mode );
+ (*ctx->Exec.PolygonMode)( face, mode );
}
}
@@ -1758,8 +2150,9 @@ static void save_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode )
/*
* Polygon stipple must have been upacked already!
*/
-static void save_PolygonStipple( GLcontext *ctx, const GLuint *pattern )
+static void save_PolygonStipple( const GLubyte *pattern )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_POLYGON_STIPPLE, 1 );
@@ -1770,13 +2163,14 @@ static void save_PolygonStipple( GLcontext *ctx, const GLuint *pattern )
MEMCPY( data, pattern, 32 * 4 );
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PolygonStipple)( ctx, pattern );
+ (*ctx->Exec.PolygonStipple)( (GLubyte*) pattern );
}
}
-static void save_PolygonOffset( GLcontext *ctx, GLfloat factor, GLfloat units )
+static void save_PolygonOffset( GLfloat factor, GLfloat units )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_POLYGON_OFFSET, 2 );
@@ -1785,45 +2179,54 @@ static void save_PolygonOffset( GLcontext *ctx, GLfloat factor, GLfloat units )
n[2].f = units;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PolygonOffset)( ctx, factor, units );
+ (*ctx->Exec.PolygonOffset)( factor, units );
}
}
-static void save_PopAttrib( GLcontext *ctx )
+static void save_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
{
+ save_PolygonOffset(factor, DEPTH_SCALE * bias);
+}
+
+
+static void save_PopAttrib( void )
+{
+ GET_CURRENT_CONTEXT(ctx);
FLUSH_VB(ctx, "dlist");
(void) alloc_instruction( ctx, OPCODE_POP_ATTRIB, 0 );
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PopAttrib)( ctx );
+ (*ctx->Exec.PopAttrib)();
}
}
-static void save_PopMatrix( GLcontext *ctx )
+static void save_PopMatrix( void )
{
+ GET_CURRENT_CONTEXT(ctx);
FLUSH_VB(ctx, "dlist");
(void) alloc_instruction( ctx, OPCODE_POP_MATRIX, 0 );
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PopMatrix)( ctx );
+ (*ctx->Exec.PopMatrix)();
}
}
-static void save_PopName( GLcontext *ctx )
+static void save_PopName( void )
{
+ GET_CURRENT_CONTEXT(ctx);
FLUSH_VB(ctx, "dlist");
(void) alloc_instruction( ctx, OPCODE_POP_NAME, 0 );
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PopName)( ctx );
+ (*ctx->Exec.PopName)();
}
}
-static void save_PrioritizeTextures( GLcontext *ctx,
- GLsizei num, const GLuint *textures,
- const GLclampf *priorities )
+static void save_PrioritizeTextures( GLsizei num, const GLuint *textures,
+ const GLclampf *priorities )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint i;
FLUSH_VB(ctx, "dlist");
@@ -1836,13 +2239,14 @@ static void save_PrioritizeTextures( GLcontext *ctx,
}
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PrioritizeTextures)( ctx, num, textures, priorities );
+ (*ctx->Exec.PrioritizeTextures)( num, textures, priorities );
}
}
-static void save_PushAttrib( GLcontext *ctx, GLbitfield mask )
+static void save_PushAttrib( GLbitfield mask )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_PUSH_ATTRIB, 1 );
@@ -1850,23 +2254,25 @@ static void save_PushAttrib( GLcontext *ctx, GLbitfield mask )
n[1].bf = mask;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PushAttrib)( ctx, mask );
+ (*ctx->Exec.PushAttrib)( mask );
}
}
-static void save_PushMatrix( GLcontext *ctx )
+static void save_PushMatrix( void )
{
+ GET_CURRENT_CONTEXT(ctx);
FLUSH_VB(ctx, "dlist");
(void) alloc_instruction( ctx, OPCODE_PUSH_MATRIX, 0 );
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PushMatrix)( ctx );
+ (*ctx->Exec.PushMatrix)();
}
}
-static void save_PushName( GLcontext *ctx, GLuint name )
+static void save_PushName( GLuint name )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_PUSH_NAME, 1 );
@@ -1874,14 +2280,14 @@ static void save_PushName( GLcontext *ctx, GLuint name )
n[1].ui = name;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PushName)( ctx, name );
+ (*ctx->Exec.PushName)( name );
}
}
-static void save_RasterPos4f( GLcontext *ctx,
- GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+static void save_RasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_RASTER_POS, 4 );
@@ -1892,13 +2298,129 @@ static void save_RasterPos4f( GLcontext *ctx,
n[4].f = w;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.RasterPos4f)( ctx, x, y, z, w );
+ (*ctx->Exec.RasterPos4f)( x, y, z, w );
}
}
+static void save_RasterPos2d(GLdouble x, GLdouble y)
+{
+ save_RasterPos4f(x, y, 0.0F, 1.0F);
+}
+
+static void save_RasterPos2f(GLfloat x, GLfloat y)
+{
+ save_RasterPos4f(x, y, 0.0F, 1.0F);
+}
+
+static void save_RasterPos2i(GLint x, GLint y)
+{
+ save_RasterPos4f(x, y, 0.0F, 1.0F);
+}
+
+static void save_RasterPos2s(GLshort x, GLshort y)
+{
+ save_RasterPos4f(x, y, 0.0F, 1.0F);
+}
+
+static void save_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
+{
+ save_RasterPos4f(x, y, z, 1.0F);
+}
+
+static void save_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
+{
+ save_RasterPos4f(x, y, z, 1.0F);
+}
+
+static void save_RasterPos3i(GLint x, GLint y, GLint z)
+{
+ save_RasterPos4f(x, y, z, 1.0F);
+}
+
+static void save_RasterPos3s(GLshort x, GLshort y, GLshort z)
+{
+ save_RasterPos4f(x, y, z, 1.0F);
+}
+
+static void save_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ save_RasterPos4f(x, y, z, w);
+}
+
+static void save_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
+{
+ save_RasterPos4f(x, y, z, w);
+}
+
+static void save_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ save_RasterPos4f(x, y, z, w);
+}
+
+static void save_RasterPos2dv(const GLdouble *v)
+{
+ save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
+}
+
+static void save_RasterPos2fv(const GLfloat *v)
+{
+ save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
+}
+
+static void save_RasterPos2iv(const GLint *v)
+{
+ save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
+}
+
+static void save_RasterPos2sv(const GLshort *v)
+{
+ save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
+}
+
+static void save_RasterPos3dv(const GLdouble *v)
+{
+ save_RasterPos4f(v[0], v[1], v[2], 1.0F);
+}
+
+static void save_RasterPos3fv(const GLfloat *v)
+{
+ save_RasterPos4f(v[0], v[1], v[2], 1.0F);
+}
+
+static void save_RasterPos3iv(const GLint *v)
+{
+ save_RasterPos4f(v[0], v[1], v[2], 1.0F);
+}
-static void save_PassThrough( GLcontext *ctx, GLfloat token )
+static void save_RasterPos3sv(const GLshort *v)
{
+ save_RasterPos4f(v[0], v[1], v[2], 1.0F);
+}
+
+static void save_RasterPos4dv(const GLdouble *v)
+{
+ save_RasterPos4f(v[0], v[1], v[2], v[3]);
+}
+
+static void save_RasterPos4fv(const GLfloat *v)
+{
+ save_RasterPos4f(v[0], v[1], v[2], v[3]);
+}
+
+static void save_RasterPos4iv(const GLint *v)
+{
+ save_RasterPos4f(v[0], v[1], v[2], v[3]);
+}
+
+static void save_RasterPos4sv(const GLshort *v)
+{
+ save_RasterPos4f(v[0], v[1], v[2], v[3]);
+}
+
+
+static void save_PassThrough( GLfloat token )
+{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_PASSTHROUGH, 1 );
@@ -1906,13 +2428,14 @@ static void save_PassThrough( GLcontext *ctx, GLfloat token )
n[1].f = token;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.PassThrough)( ctx, token );
+ (*ctx->Exec.PassThrough)( token );
}
}
-static void save_ReadBuffer( GLcontext *ctx, GLenum mode )
+static void save_ReadBuffer( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_READ_BUFFER, 1 );
@@ -1920,14 +2443,14 @@ static void save_ReadBuffer( GLcontext *ctx, GLenum mode )
n[1].e = mode;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.ReadBuffer)( ctx, mode );
+ (*ctx->Exec.ReadBuffer)( mode );
}
}
-static void save_Rectf( GLcontext *ctx,
- GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
+static void save_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_RECTF, 4 );
@@ -1938,22 +2461,63 @@ static void save_Rectf( GLcontext *ctx,
n[4].f = y2;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Rectf)( ctx, x1, y1, x2, y2 );
+ (*ctx->Exec.Rectf)( x1, y1, x2, y2 );
}
}
+static void save_Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
+{
+ save_Rectf(x1, y1, x2, y2);
+}
+
+static void save_Rectdv(const GLdouble *v1, const GLdouble *v2)
+{
+ save_Rectf(v1[0], v1[1], v2[0], v2[1]);
+}
+
+static void save_Rectfv( const GLfloat *v1, const GLfloat *v2 )
+{
+ save_Rectf(v1[0], v1[1], v2[0], v2[1]);
+}
+
+static void save_Recti(GLint x1, GLint y1, GLint x2, GLint y2)
+{
+ save_Rectf(x1, y1, x2, y2);
+}
+
+static void save_Rectiv(const GLint *v1, const GLint *v2)
+{
+ save_Rectf(v1[0], v1[1], v2[0], v2[1]);
+}
+
+static void save_Rects(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
+{
+ save_Rectf(x1, y1, x2, y2);
+}
+
+static void save_Rectsv(const GLshort *v1, const GLshort *v2)
+{
+ save_Rectf(v1[0], v1[1], v2[0], v2[1]);
+}
+
-static void save_Rotatef( GLcontext *ctx, GLfloat angle,
- GLfloat x, GLfloat y, GLfloat z )
+static void save_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
{
GLfloat m[16];
gl_rotation_matrix( angle, x, y, z, m );
- save_MultMatrixf( ctx, m ); /* save and maybe execute */
+ save_MultMatrixf( m ); /* save and maybe execute */
}
-static void save_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z )
+static void save_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z )
{
+ save_Rotatef(angle, x, y, z);
+}
+
+
+static void save_Scalef( GLfloat x, GLfloat y, GLfloat z )
+{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_SCALE, 3 );
@@ -1963,14 +2527,20 @@ static void save_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z )
n[3].f = z;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Scalef)( ctx, x, y, z );
+ (*ctx->Exec.Scalef)( x, y, z );
}
}
-static void save_Scissor( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height )
+static void save_Scaled( GLdouble x, GLdouble y, GLdouble z )
{
+ save_Scalef(x, y, z);
+}
+
+
+static void save_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
+{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_SCISSOR, 4 );
@@ -1981,13 +2551,14 @@ static void save_Scissor( GLcontext *ctx,
n[4].i = height;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Scissor)( ctx, x, y, width, height );
+ (*ctx->Exec.Scissor)( x, y, width, height );
}
}
-static void save_ShadeModel( GLcontext *ctx, GLenum mode )
+static void save_ShadeModel( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_SHADE_MODEL, 1 );
@@ -1995,13 +2566,14 @@ static void save_ShadeModel( GLcontext *ctx, GLenum mode )
n[1].e = mode;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.ShadeModel)( ctx, mode );
+ (*ctx->Exec.ShadeModel)( mode );
}
}
-static void save_StencilFunc( GLcontext *ctx, GLenum func, GLint ref, GLuint mask )
+static void save_StencilFunc( GLenum func, GLint ref, GLuint mask )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_STENCIL_FUNC, 3 );
@@ -2011,13 +2583,14 @@ static void save_StencilFunc( GLcontext *ctx, GLenum func, GLint ref, GLuint mas
n[3].ui = mask;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.StencilFunc)( ctx, func, ref, mask );
+ (*ctx->Exec.StencilFunc)( func, ref, mask );
}
}
-static void save_StencilMask( GLcontext *ctx, GLuint mask )
+static void save_StencilMask( GLuint mask )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_STENCIL_MASK, 1 );
@@ -2025,14 +2598,14 @@ static void save_StencilMask( GLcontext *ctx, GLuint mask )
n[1].ui = mask;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.StencilMask)( ctx, mask );
+ (*ctx->Exec.StencilMask)( mask );
}
}
-static void save_StencilOp( GLcontext *ctx,
- GLenum fail, GLenum zfail, GLenum zpass )
+static void save_StencilOp( GLenum fail, GLenum zfail, GLenum zpass )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_STENCIL_OP, 3 );
@@ -2042,16 +2615,14 @@ static void save_StencilOp( GLcontext *ctx,
n[3].e = zpass;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.StencilOp)( ctx, fail, zfail, zpass );
+ (*ctx->Exec.StencilOp)( fail, zfail, zpass );
}
}
-
-
-static void save_TexEnvfv( GLcontext *ctx,
- GLenum target, GLenum pname, const GLfloat *params )
+static void save_TexEnvfv( GLenum target, GLenum pname, const GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_TEXENV, 6 );
@@ -2064,14 +2635,40 @@ static void save_TexEnvfv( GLcontext *ctx,
n[6].f = params[3];
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.TexEnvfv)( ctx, target, pname, params );
+ (*ctx->Exec.TexEnvfv)( target, pname, params );
}
}
-static void save_TexGenfv( GLcontext *ctx,
- GLenum coord, GLenum pname, const GLfloat *params )
+static void save_TexEnvf( GLenum target, GLenum pname, GLfloat param )
+{
+ save_TexEnvfv( target, pname, &param );
+}
+
+
+static void save_TexEnvi( GLenum target, GLenum pname, GLint param )
+{
+ GLfloat p[4];
+ p[0] = (GLfloat) param;
+ p[1] = p[2] = p[3] = 0.0;
+ save_TexEnvfv( target, pname, p );
+}
+
+
+static void save_TexEnviv( GLenum target, GLenum pname, const GLint *param )
+{
+ GLfloat p[4];
+ p[0] = INT_TO_FLOAT( param[0] );
+ p[1] = INT_TO_FLOAT( param[1] );
+ p[2] = INT_TO_FLOAT( param[2] );
+ p[3] = INT_TO_FLOAT( param[3] );
+ save_TexEnvfv( target, pname, p );
+}
+
+
+static void save_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_TEXGEN, 6 );
@@ -2084,14 +2681,56 @@ static void save_TexGenfv( GLcontext *ctx,
n[6].f = params[3];
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.TexGenfv)( ctx, coord, pname, params );
+ (*ctx->Exec.TexGenfv)( coord, pname, params );
}
}
-static void save_TexParameterfv( GLcontext *ctx, GLenum target,
+static void save_TexGeniv(GLenum coord, GLenum pname, const GLint *params )
+{
+ GLfloat p[4];
+ p[0] = params[0];
+ p[1] = params[1];
+ p[2] = params[2];
+ p[3] = params[3];
+ save_TexGenfv(coord, pname, p);
+}
+
+
+static void save_TexGend(GLenum coord, GLenum pname, GLdouble param )
+{
+ GLfloat p = (GLfloat) param;
+ save_TexGenfv( coord, pname, &p );
+}
+
+
+static void save_TexGendv(GLenum coord, GLenum pname, const GLdouble *params )
+{
+ GLfloat p[4];
+ p[0] = params[0];
+ p[1] = params[1];
+ p[2] = params[2];
+ p[3] = params[3];
+ save_TexGenfv( coord, pname, p );
+}
+
+
+static void save_TexGenf( GLenum coord, GLenum pname, GLfloat param )
+{
+ save_TexGenfv(coord, pname, &param);
+}
+
+
+static void save_TexGeni( GLenum coord, GLenum pname, GLint param )
+{
+ save_TexGeniv( coord, pname, &param );
+}
+
+
+static void save_TexParameterfv( GLenum target,
GLenum pname, const GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_TEXPARAMETER, 6 );
@@ -2104,26 +2743,52 @@ static void save_TexParameterfv( GLcontext *ctx, GLenum target,
n[6].f = params[3];
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.TexParameterfv)( ctx, target, pname, params );
+ (*ctx->Exec.TexParameterfv)( target, pname, params );
}
}
-static void save_TexImage1D( GLcontext *ctx, GLenum target,
+static void save_TexParameterf( GLenum target, GLenum pname, GLfloat param )
+{
+ save_TexParameterfv(target, pname, &param);
+}
+
+
+static void save_TexParameteri( GLenum target, GLenum pname, const GLint param )
+{
+ GLfloat fparam[4];
+ fparam[0] = (GLfloat) param;
+ fparam[1] = fparam[2] = fparam[3] = 0.0;
+ save_TexParameterfv(target, pname, fparam);
+}
+
+
+static void save_TexParameteriv( GLenum target, GLenum pname, const GLint *params )
+{
+ GLfloat fparam[4];
+ fparam[0] = (GLfloat) params[0];
+ fparam[1] = fparam[2] = fparam[3] = 0.0;
+ save_TexParameterfv(target, pname, fparam);
+}
+
+
+static void save_TexImage1D( GLenum target,
GLint level, GLint components,
GLsizei width, GLint border,
GLenum format, GLenum type,
const GLvoid *pixels )
{
- FLUSH_VB(ctx, "dlist");
+ GET_CURRENT_CONTEXT(ctx);
if (target == GL_PROXY_TEXTURE_1D) {
- (*ctx->Exec.TexImage1D)( ctx, target, level, components, width,
+ /* don't compile, execute immediately */
+ (*ctx->Exec.TexImage1D)( target, level, components, width,
border, format, type, pixels );
}
else {
- Node *n;
GLvoid *image = _mesa_unpack_image(width, 1, 1, format, type,
pixels, &ctx->Unpack);
+ Node *n;
+ FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_TEX_IMAGE1D, 8 );
if (n) {
n[1].e = target;
@@ -2135,32 +2800,34 @@ static void save_TexImage1D( GLcontext *ctx, GLenum target,
n[7].e = type;
n[8].data = image;
}
- else {
+ else if (image) {
FREE(image);
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.TexImage1D)( ctx, target, level, components, width,
+ (*ctx->Exec.TexImage1D)( target, level, components, width,
border, format, type, pixels );
}
}
}
-static void save_TexImage2D( GLcontext *ctx, GLenum target,
+static void save_TexImage2D( GLenum target,
GLint level, GLint components,
GLsizei width, GLsizei height, GLint border,
GLenum format, GLenum type,
- const GLvoid *pixels )
+ const GLvoid *pixels)
{
- FLUSH_VB(ctx, "dlist");
+ GET_CURRENT_CONTEXT(ctx);
if (target == GL_PROXY_TEXTURE_2D) {
- (*ctx->Exec.TexImage2D)( ctx, target, level, components, width,
+ /* don't compile, execute immediately */
+ (*ctx->Exec.TexImage2D)( target, level, components, width,
height, border, format, type, pixels );
}
else {
- Node *n;
GLvoid *image = _mesa_unpack_image(width, height, 1, format, type,
pixels, &ctx->Unpack);
+ Node *n;
+ FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_TEX_IMAGE2D, 9 );
if (n) {
n[1].e = target;
@@ -2173,33 +2840,35 @@ static void save_TexImage2D( GLcontext *ctx, GLenum target,
n[8].e = type;
n[9].data = image;
}
- else {
+ else if (image) {
FREE(image);
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.TexImage2D)( ctx, target, level, components, width,
+ (*ctx->Exec.TexImage2D)( target, level, components, width,
height, border, format, type, pixels );
}
}
}
-static void save_TexImage3D( GLcontext *ctx, GLenum target,
+static void save_TexImage3D( GLenum target,
GLint level, GLint components,
GLsizei width, GLsizei height, GLsizei depth,
GLint border,
GLenum format, GLenum type,
const GLvoid *pixels )
{
- FLUSH_VB(ctx, "dlist");
+ GET_CURRENT_CONTEXT(ctx);
if (target == GL_PROXY_TEXTURE_3D) {
- (*ctx->Exec.TexImage3D)( ctx, target, level, components, width,
+ /* don't compile, execute immediately */
+ (*ctx->Exec.TexImage3D)( target, level, components, width,
height, depth, border, format, type, pixels );
}
else {
+ Node *n;
GLvoid *image = _mesa_unpack_image(width, height, depth, format, type,
pixels, &ctx->Unpack);
- Node *n;
+ FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_TEX_IMAGE3D, 10 );
if (n) {
n[1].e = target;
@@ -2213,22 +2882,22 @@ static void save_TexImage3D( GLcontext *ctx, GLenum target,
n[9].e = type;
n[10].data = image;
}
- else {
+ else if (image) {
FREE(image);
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.TexImage3D)( ctx, target, level, components, width,
- height, depth, border, format, type, pixels );
+ (*ctx->Exec.TexImage3D)( target, level, components, width,
+ height, depth, border, format, type, pixels );
}
}
}
-static void save_TexSubImage1D( GLcontext *ctx,
- GLenum target, GLint level, GLint xoffset,
+static void save_TexSubImage1D( GLenum target, GLint level, GLint xoffset,
GLsizei width, GLenum format, GLenum type,
const GLvoid *pixels )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
GLvoid *image = _mesa_unpack_image(width, 1, 1, format, type,
pixels, &ctx->Unpack);
@@ -2243,23 +2912,23 @@ static void save_TexSubImage1D( GLcontext *ctx,
n[6].e = type;
n[7].data = image;
}
- else {
+ else if (image) {
FREE(image);
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.TexSubImage1D)( ctx, target, level, xoffset, width,
+ (*ctx->Exec.TexSubImage1D)( target, level, xoffset, width,
format, type, pixels );
}
}
-static void save_TexSubImage2D( GLcontext *ctx,
- GLenum target, GLint level,
+static void save_TexSubImage2D( GLenum target, GLint level,
GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height,
GLenum format, GLenum type,
const GLvoid *pixels )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
GLvoid *image = _mesa_unpack_image(width, height, 1, format, type,
pixels, &ctx->Unpack);
@@ -2276,23 +2945,23 @@ static void save_TexSubImage2D( GLcontext *ctx,
n[8].e = type;
n[9].data = image;
}
- else {
+ else if (image) {
FREE(image);
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.TexSubImage2D)( ctx, target, level, xoffset, yoffset,
- width, height, format, type, pixels );
+ (*ctx->Exec.TexSubImage2D)( target, level, xoffset, yoffset,
+ width, height, format, type, pixels );
}
}
-static void save_TexSubImage3D( GLcontext *ctx,
- GLenum target, GLint level,
+static void save_TexSubImage3D( GLenum target, GLint level,
GLint xoffset, GLint yoffset,GLint zoffset,
GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLenum type,
const GLvoid *pixels )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
GLvoid *image = _mesa_unpack_image(width, height, depth, format, type,
pixels, &ctx->Unpack);
@@ -2311,18 +2980,20 @@ static void save_TexSubImage3D( GLcontext *ctx,
n[10].e = type;
n[11].data = image;
}
- else {
+ else if (image) {
FREE(image);
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.TexSubImage3D)(ctx, target, level, xoffset, yoffset, zoffset,
- width, height, depth, format, type, pixels );
+ (*ctx->Exec.TexSubImage3D)( target, level,
+ xoffset, yoffset, zoffset,
+ width, height, depth, format, type, pixels );
}
}
-static void save_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z )
+static void save_Translatef( GLfloat x, GLfloat y, GLfloat z )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_TRANSLATE, 3 );
@@ -2332,15 +3003,21 @@ static void save_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z )
n[3].f = z;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Translatef)( ctx, x, y, z );
+ (*ctx->Exec.Translatef)( x, y, z );
}
}
+static void save_Translated( GLdouble x, GLdouble y, GLdouble z )
+{
+ save_Translatef(x, y, z);
+}
-static void save_Viewport( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height )
+
+
+static void save_Viewport( GLint x, GLint y, GLsizei width, GLsizei height )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_VIEWPORT, 4 );
@@ -2351,14 +3028,14 @@ static void save_Viewport( GLcontext *ctx,
n[4].i = (GLint) height;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.Viewport)( ctx, x, y, width, height );
+ (*ctx->Exec.Viewport)( x, y, width, height );
}
}
-static void save_WindowPos4fMESA( GLcontext *ctx,
- GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+static void save_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_WINDOW_POS, 4 );
@@ -2369,18 +3046,17 @@ static void save_WindowPos4fMESA( GLcontext *ctx,
n[4].f = w;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.WindowPos4fMESA)( ctx, x, y, z, w );
+ (*ctx->Exec.WindowPos4fMESA)( x, y, z, w );
}
}
-
-
/* GL_ARB_multitexture */
-static void save_ActiveTexture( GLcontext *ctx, GLenum target )
+static void save_ActiveTextureARB( GLenum target )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_ACTIVE_TEXTURE, 1 );
@@ -2388,14 +3064,15 @@ static void save_ActiveTexture( GLcontext *ctx, GLenum target )
n[1].e = target;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.ActiveTexture)( ctx, target );
+ (*ctx->Exec.ActiveTextureARB)( target );
}
}
/* GL_ARB_multitexture */
-static void save_ClientActiveTexture( GLcontext *ctx, GLenum target )
+static void save_ClientActiveTextureARB( GLenum target )
{
+ GET_CURRENT_CONTEXT(ctx);
Node *n;
FLUSH_VB(ctx, "dlist");
n = alloc_instruction( ctx, OPCODE_CLIENT_ACTIVE_TEXTURE, 1 );
@@ -2403,12 +3080,45 @@ static void save_ClientActiveTexture( GLcontext *ctx, GLenum target )
n[1].e = target;
}
if (ctx->ExecuteFlag) {
- (*ctx->Exec.ClientActiveTexture)( ctx, target );
+ (*ctx->Exec.ClientActiveTextureARB)( target );
}
}
+static void save_LoadTransposeMatrixdARB( const GLdouble m[16] )
+{
+ GLdouble tm[16];
+ gl_matrix_transposed(tm, m);
+ save_LoadMatrixd(tm);
+}
+
+
+static void save_LoadTransposeMatrixfARB( const GLfloat m[16] )
+{
+ GLfloat tm[16];
+ gl_matrix_transposef(tm, m);
+ save_LoadMatrixf(tm);
+}
+
+
+static void save_MultTransposeMatrixdARB( const GLdouble m[16] )
+{
+ GLdouble tm[16];
+ gl_matrix_transposed(tm, m);
+ save_MultMatrixd(tm);
+}
+
+
+static void save_MultTransposeMatrixfARB( const GLfloat m[16] )
+{
+ GLfloat tm[16];
+ gl_matrix_transposef(tm, m);
+ save_MultMatrixf(tm);
+}
+
+
+
void gl_compile_cassette( GLcontext *ctx )
{
Node *n = alloc_instruction( ctx, OPCODE_VERTEX_CASSETTE, 8 );
@@ -2476,6 +3186,20 @@ void gl_save_error( GLcontext *ctx, GLenum error, const char *s )
/* execute already done */
}
+
+static GLboolean
+islist(GLcontext *ctx, GLuint list)
+{
+ if (list > 0 && _mesa_HashLookup(ctx->Shared->DisplayList, list)) {
+ return GL_TRUE;
+ }
+ else {
+ return GL_FALSE;
+ }
+}
+
+
+
/**********************************************************************/
/* Display list execution */
/**********************************************************************/
@@ -2489,28 +3213,18 @@ void gl_save_error( GLcontext *ctx, GLenum error, const char *s )
*/
static void execute_list( GLcontext *ctx, GLuint list )
{
- static struct gl_pixelstore_attrib defaultPacking = {
- 1, /* Alignment */
- 0, /* RowLength */
- 0, /* SkipPixels */
- 0, /* SkipRows */
- 0, /* ImageHeight */
- 0, /* SkipImages */
- GL_FALSE, /* SwapBytes */
- GL_FALSE /* LsbFirst */
- };
Node *n;
GLboolean done;
OpCode opcode;
- if (!gl_IsList(ctx,list))
+ if (!islist(ctx,list))
return;
/* mesa_print_display_list( list ); */
ctx->CallDepth++;
- n = (Node *) HashLookup(ctx->Shared->DisplayList, list);
+ n = (Node *) _mesa_HashLookup(ctx->Shared->DisplayList, list);
done = GL_FALSE;
while (!done) {
@@ -2556,34 +3270,34 @@ static void execute_list( GLcontext *ctx, GLuint list )
break;
}
case OPCODE_ACCUM:
- gl_Accum( ctx, n[1].e, n[2].f );
+ (*ctx->Exec.Accum)( n[1].e, n[2].f );
break;
case OPCODE_ALPHA_FUNC:
- gl_AlphaFunc( ctx, n[1].e, n[2].f );
+ (*ctx->Exec.AlphaFunc)( n[1].e, n[2].f );
break;
case OPCODE_BIND_TEXTURE:
- gl_BindTexture( ctx, n[1].e, n[2].ui );
+ (*ctx->Exec.BindTexture)( n[1].e, n[2].ui );
break;
case OPCODE_BITMAP:
{
- const struct gl_image *image = (struct gl_image *) n[7].data;
- const GLubyte *bitmap = image ? image->Data : NULL;
- gl_Bitmap( ctx, (GLsizei) n[1].i, (GLsizei) n[2].i,
- n[3].f, n[4].f, n[5].f, n[6].f,
- bitmap, &defaultPacking );
+ struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = _mesa_native_packing;
+ (*ctx->Exec.Bitmap)( (GLsizei) n[1].i, (GLsizei) n[2].i,
+ n[3].f, n[4].f, n[5].f, n[6].f, n[7].data );
+ ctx->Unpack = save; /* restore */
}
break;
case OPCODE_BLEND_COLOR:
- gl_BlendColor( ctx, n[1].f, n[2].f, n[3].f, n[4].f );
+ (*ctx->Exec.BlendColorEXT)( n[1].f, n[2].f, n[3].f, n[4].f );
break;
case OPCODE_BLEND_EQUATION:
- gl_BlendEquation( ctx, n[1].e );
+ (*ctx->Exec.BlendEquationEXT)( n[1].e );
break;
case OPCODE_BLEND_FUNC:
- gl_BlendFunc( ctx, n[1].e, n[2].e );
+ (*ctx->Exec.BlendFunc)( n[1].e, n[2].e );
break;
case OPCODE_BLEND_FUNC_SEPARATE:
- gl_BlendFuncSeparate( ctx, n[1].e, n[2].e, n[3].e, n[4].e );
+ (*ctx->Exec.BlendFuncSeparateINGR)(n[1].e, n[2].e, n[3].e, n[4].e);
break;
case OPCODE_CALL_LIST:
/* Generated by glCallList(), don't add ListBase */
@@ -2598,99 +3312,116 @@ static void execute_list( GLcontext *ctx, GLuint list )
}
break;
case OPCODE_CLEAR:
- gl_Clear( ctx, n[1].bf );
+ (*ctx->Exec.Clear)( n[1].bf );
break;
case OPCODE_CLEAR_COLOR:
- gl_ClearColor( ctx, n[1].f, n[2].f, n[3].f, n[4].f );
+ (*ctx->Exec.ClearColor)( n[1].f, n[2].f, n[3].f, n[4].f );
break;
case OPCODE_CLEAR_ACCUM:
- gl_ClearAccum( ctx, n[1].f, n[2].f, n[3].f, n[4].f );
+ (*ctx->Exec.ClearAccum)( n[1].f, n[2].f, n[3].f, n[4].f );
break;
case OPCODE_CLEAR_DEPTH:
- gl_ClearDepth( ctx, (GLclampd) n[1].f );
+ (*ctx->Exec.ClearDepth)( (GLclampd) n[1].f );
break;
case OPCODE_CLEAR_INDEX:
- gl_ClearIndex( ctx, n[1].ui );
+ (*ctx->Exec.ClearIndex)( n[1].ui );
break;
case OPCODE_CLEAR_STENCIL:
- gl_ClearStencil( ctx, n[1].i );
+ (*ctx->Exec.ClearStencil)( n[1].i );
break;
case OPCODE_CLIP_PLANE:
{
- GLfloat equ[4];
- equ[0] = n[2].f;
- equ[1] = n[3].f;
- equ[2] = n[4].f;
- equ[3] = n[5].f;
- gl_ClipPlane( ctx, n[1].e, equ );
+ GLdouble eq[4];
+ eq[0] = n[2].f;
+ eq[1] = n[3].f;
+ eq[2] = n[4].f;
+ eq[3] = n[5].f;
+ (*ctx->Exec.ClipPlane)( n[1].e, eq );
}
break;
case OPCODE_COLOR_MASK:
- gl_ColorMask( ctx, n[1].b, n[2].b, n[3].b, n[4].b );
+ (*ctx->Exec.ColorMask)( n[1].b, n[2].b, n[3].b, n[4].b );
break;
case OPCODE_COLOR_MATERIAL:
- gl_ColorMaterial( ctx, n[1].e, n[2].e );
+ (*ctx->Exec.ColorMaterial)( n[1].e, n[2].e );
break;
case OPCODE_COLOR_TABLE:
- gl_ColorTable( ctx, n[1].e, n[2].e, (struct gl_image *) n[3].data);
+ {
+ struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = _mesa_native_packing;
+ (*ctx->Exec.ColorTableEXT)( n[1].e, n[2].e, n[3].i, n[4].e,
+ n[5].e, n[6].data );
+ ctx->Unpack = save; /* restore */
+ }
break;
case OPCODE_COLOR_SUB_TABLE:
- gl_ColorSubTable( ctx, n[1].e, n[2].i,
- (struct gl_image *) n[3].data);
+ {
+ struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = _mesa_native_packing;
+ (*ctx->Exec.ColorSubTableEXT)( n[1].e, n[2].i, n[3].i,
+ n[4].e, n[5].e, n[6].data );
+ ctx->Unpack = save; /* restore */
+ }
break;
case OPCODE_COPY_PIXELS:
- gl_CopyPixels( ctx, n[1].i, n[2].i,
+ (*ctx->Exec.CopyPixels)( n[1].i, n[2].i,
(GLsizei) n[3].i, (GLsizei) n[4].i, n[5].e );
break;
case OPCODE_COPY_TEX_IMAGE1D:
- gl_CopyTexImage1D( ctx, n[1].e, n[2].i, n[3].e, n[4].i,
- n[5].i, n[6].i, n[7].i );
+ (*ctx->Exec.CopyTexImage1D)( n[1].e, n[2].i, n[3].e, n[4].i,
+ n[5].i, n[6].i, n[7].i );
break;
case OPCODE_COPY_TEX_IMAGE2D:
- gl_CopyTexImage2D( ctx, n[1].e, n[2].i, n[3].e, n[4].i,
- n[5].i, n[6].i, n[7].i, n[8].i );
+ (*ctx->Exec.CopyTexImage2D)( n[1].e, n[2].i, n[3].e, n[4].i,
+ n[5].i, n[6].i, n[7].i, n[8].i );
break;
case OPCODE_COPY_TEX_SUB_IMAGE1D:
- gl_CopyTexSubImage1D( ctx, n[1].e, n[2].i, n[3].i, n[4].i,
- n[5].i, n[6].i );
+ (*ctx->Exec.CopyTexSubImage1D)( n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].i, n[6].i );
break;
case OPCODE_COPY_TEX_SUB_IMAGE2D:
- gl_CopyTexSubImage2D( ctx, n[1].e, n[2].i, n[3].i, n[4].i,
- n[5].i, n[6].i, n[7].i, n[8].i );
+ (*ctx->Exec.CopyTexSubImage2D)( n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].i, n[6].i, n[7].i, n[8].i );
break;
case OPCODE_COPY_TEX_SUB_IMAGE3D:
- gl_CopyTexSubImage3D( ctx, n[1].e, n[2].i, n[3].i, n[4].i,
- n[5].i, n[6].i, n[7].i, n[8].i, n[9].i);
+ (*ctx->Exec.CopyTexSubImage3D)( n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].i, n[6].i, n[7].i, n[8].i , n[9].i);
break;
case OPCODE_CULL_FACE:
- gl_CullFace( ctx, n[1].e );
+ (*ctx->Exec.CullFace)( n[1].e );
break;
case OPCODE_DEPTH_FUNC:
- gl_DepthFunc( ctx, n[1].e );
+ (*ctx->Exec.DepthFunc)( n[1].e );
break;
case OPCODE_DEPTH_MASK:
- gl_DepthMask( ctx, n[1].b );
+ (*ctx->Exec.DepthMask)( n[1].b );
break;
case OPCODE_DEPTH_RANGE:
- gl_DepthRange( ctx, (GLclampd) n[1].f, (GLclampd) n[2].f );
+ (*ctx->Exec.DepthRange)( (GLclampd) n[1].f, (GLclampd) n[2].f );
break;
case OPCODE_DISABLE:
- gl_Disable( ctx, n[1].e );
+ (*ctx->Exec.Disable)( n[1].e );
break;
case OPCODE_DRAW_BUFFER:
- gl_DrawBuffer( ctx, n[1].e );
+ (*ctx->Exec.DrawBuffer)( n[1].e );
break;
case OPCODE_DRAW_PIXELS:
- gl_DrawPixels( ctx, (struct gl_image *) n[1].data );
+ {
+ struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = _mesa_native_packing;
+ (*ctx->Exec.DrawPixels)( n[1].i, n[2].i, n[3].e, n[4].e,
+ n[5].data );
+ ctx->Unpack = save; /* restore */
+ }
break;
case OPCODE_ENABLE:
- gl_Enable( ctx, n[1].e );
+ (*ctx->Exec.Enable)( n[1].e );
break;
case OPCODE_EVALMESH1:
- gl_EvalMesh1( ctx, n[1].e, n[2].i, n[3].i );
+ (*ctx->Exec.EvalMesh1)( n[1].e, n[2].i, n[3].i );
break;
case OPCODE_EVALMESH2:
- gl_EvalMesh2( ctx, n[1].e, n[2].i, n[3].i, n[4].i, n[5].i );
+ (*ctx->Exec.EvalMesh2)( n[1].e, n[2].i, n[3].i, n[4].i, n[5].i );
break;
case OPCODE_FOG:
{
@@ -2699,23 +3430,26 @@ static void execute_list( GLcontext *ctx, GLuint list )
p[1] = n[3].f;
p[2] = n[4].f;
p[3] = n[5].f;
- gl_Fogfv( ctx, n[1].e, p );
+ (*ctx->Exec.Fogfv)( n[1].e, p );
}
break;
case OPCODE_FRONT_FACE:
- gl_FrontFace( ctx, n[1].e );
+ (*ctx->Exec.FrontFace)( n[1].e );
break;
case OPCODE_FRUSTUM:
- gl_Frustum( ctx, n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f );
+ (*ctx->Exec.Frustum)( n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f );
break;
case OPCODE_HINT:
- gl_Hint( ctx, n[1].e, n[2].e );
+ (*ctx->Exec.Hint)( n[1].e, n[2].e );
+ break;
+ case OPCODE_HINT_PGI:
+ (*ctx->Exec.HintPGI)( n[1].e, n[2].i );
break;
case OPCODE_INDEX_MASK:
- gl_IndexMask( ctx, n[1].ui );
+ (*ctx->Exec.IndexMask)( n[1].ui );
break;
case OPCODE_INIT_NAMES:
- gl_InitNames( ctx );
+ (*ctx->Exec.InitNames)();
break;
case OPCODE_LIGHT:
{
@@ -2724,7 +3458,7 @@ static void execute_list( GLcontext *ctx, GLuint list )
p[1] = n[4].f;
p[2] = n[5].f;
p[3] = n[6].f;
- gl_Lightfv( ctx, n[1].e, n[2].e, p, 4 );
+ (*ctx->Exec.Lightfv)( n[1].e, n[2].e, p );
}
break;
case OPCODE_LIGHT_MODEL:
@@ -2734,24 +3468,24 @@ static void execute_list( GLcontext *ctx, GLuint list )
p[1] = n[3].f;
p[2] = n[4].f;
p[3] = n[5].f;
- gl_LightModelfv( ctx, n[1].e, p );
+ (*ctx->Exec.LightModelfv)( n[1].e, p );
}
break;
case OPCODE_LINE_STIPPLE:
- gl_LineStipple( ctx, n[1].i, n[2].us );
+ (*ctx->Exec.LineStipple)( n[1].i, n[2].us );
break;
case OPCODE_LINE_WIDTH:
- gl_LineWidth( ctx, n[1].f );
+ (*ctx->Exec.LineWidth)( n[1].f );
break;
case OPCODE_LIST_BASE:
- gl_ListBase( ctx, n[1].ui );
+ (*ctx->Exec.ListBase)( n[1].ui );
break;
case OPCODE_LOAD_IDENTITY:
- gl_LoadIdentity( ctx );
+ (*ctx->Exec.LoadIdentity)();
break;
case OPCODE_LOAD_MATRIX:
if (sizeof(Node)==sizeof(GLfloat)) {
- gl_LoadMatrixf( ctx, &n[1].f );
+ (*ctx->Exec.LoadMatrixf)( &n[1].f );
}
else {
GLfloat m[16];
@@ -2759,40 +3493,54 @@ static void execute_list( GLcontext *ctx, GLuint list )
for (i=0;i<16;i++) {
m[i] = n[1+i].f;
}
- gl_LoadMatrixf( ctx, m );
+ (*ctx->Exec.LoadMatrixf)( m );
}
break;
case OPCODE_LOAD_NAME:
- gl_LoadName( ctx, n[1].ui );
+ (*ctx->Exec.LoadName)( n[1].ui );
break;
case OPCODE_LOGIC_OP:
- gl_LogicOp( ctx, n[1].e );
+ (*ctx->Exec.LogicOp)( n[1].e );
break;
case OPCODE_MAP1:
- gl_Map1f( ctx, n[1].e, n[2].f, n[3].f,
- n[4].i, n[5].i, (GLfloat *) n[6].data, GL_TRUE );
+ {
+ GLenum target = n[1].e;
+ GLint ustride = _mesa_evaluator_components(target);
+ GLint uorder = n[5].i;
+ GLfloat u1 = n[2].f;
+ GLfloat u2 = n[3].f;
+ (*ctx->Exec.Map1f)( target, u1, u2, ustride, uorder,
+ (GLfloat *) n[6].data );
+ }
break;
case OPCODE_MAP2:
- gl_Map2f( ctx, n[1].e,
- n[2].f, n[3].f, /* u1, u2 */
- n[6].i, n[8].i, /* ustride, uorder */
- n[4].f, n[5].f, /* v1, v2 */
- n[7].i, n[9].i, /* vstride, vorder */
- (GLfloat *) n[10].data,
- GL_TRUE);
+ {
+ GLenum target = n[1].e;
+ GLfloat u1 = n[2].f;
+ GLfloat u2 = n[3].f;
+ GLfloat v1 = n[4].f;
+ GLfloat v2 = n[5].f;
+ GLint ustride = n[6].i;
+ GLint vstride = n[7].i;
+ GLint uorder = n[8].i;
+ GLint vorder = n[9].i;
+ (*ctx->Exec.Map2f)( target, u1, u2, ustride, uorder,
+ v1, v2, vstride, vorder,
+ (GLfloat *) n[10].data );
+ }
break;
case OPCODE_MAPGRID1:
- gl_MapGrid1f( ctx, n[1].i, n[2].f, n[3].f );
+ (*ctx->Exec.MapGrid1f)( n[1].i, n[2].f, n[3].f );
break;
case OPCODE_MAPGRID2:
- gl_MapGrid2f( ctx, n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f);
+ (*ctx->Exec.MapGrid2f)( n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f);
break;
case OPCODE_MATRIX_MODE:
- gl_MatrixMode( ctx, n[1].e );
+ (*ctx->Exec.MatrixMode)( n[1].e );
break;
case OPCODE_MULT_MATRIX:
if (sizeof(Node)==sizeof(GLfloat)) {
- gl_MultMatrixf( ctx, &n[1].f );
+ (*ctx->Exec.MultMatrixf)( &n[1].f );
}
else {
GLfloat m[16];
@@ -2800,26 +3548,26 @@ static void execute_list( GLcontext *ctx, GLuint list )
for (i=0;i<16;i++) {
m[i] = n[1+i].f;
}
- gl_MultMatrixf( ctx, m );
+ (*ctx->Exec.MultMatrixf)( m );
}
break;
case OPCODE_ORTHO:
- gl_Ortho( ctx, n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f );
+ (*ctx->Exec.Ortho)( n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f );
break;
case OPCODE_PASSTHROUGH:
- gl_PassThrough( ctx, n[1].f );
+ (*ctx->Exec.PassThrough)( n[1].f );
break;
case OPCODE_PIXEL_MAP:
- gl_PixelMapfv( ctx, n[1].e, n[2].i, (GLfloat *) n[3].data );
+ (*ctx->Exec.PixelMapfv)( n[1].e, n[2].i, (GLfloat *) n[3].data );
break;
case OPCODE_PIXEL_TRANSFER:
- gl_PixelTransferf( ctx, n[1].e, n[2].f );
+ (*ctx->Exec.PixelTransferf)( n[1].e, n[2].f );
break;
case OPCODE_PIXEL_ZOOM:
- gl_PixelZoom( ctx, n[1].f, n[2].f );
+ (*ctx->Exec.PixelZoom)( n[1].f, n[2].f );
break;
case OPCODE_POINT_SIZE:
- gl_PointSize( ctx, n[1].f );
+ (*ctx->Exec.PointSize)( n[1].f );
break;
case OPCODE_POINT_PARAMETERS:
{
@@ -2827,65 +3575,65 @@ static void execute_list( GLcontext *ctx, GLuint list )
params[0] = n[2].f;
params[1] = n[3].f;
params[2] = n[4].f;
- gl_PointParameterfvEXT( ctx, n[1].e, params );
+ (*ctx->Exec.PointParameterfvEXT)( n[1].e, params );
}
break;
case OPCODE_POLYGON_MODE:
- gl_PolygonMode( ctx, n[1].e, n[2].e );
+ (*ctx->Exec.PolygonMode)( n[1].e, n[2].e );
break;
case OPCODE_POLYGON_STIPPLE:
- gl_PolygonStipple( ctx, (GLuint *) n[1].data );
+ (*ctx->Exec.PolygonStipple)( (GLubyte *) n[1].data );
break;
case OPCODE_POLYGON_OFFSET:
- gl_PolygonOffset( ctx, n[1].f, n[2].f );
+ (*ctx->Exec.PolygonOffset)( n[1].f, n[2].f );
break;
case OPCODE_POP_ATTRIB:
- gl_PopAttrib( ctx );
+ (*ctx->Exec.PopAttrib)();
break;
case OPCODE_POP_MATRIX:
- gl_PopMatrix( ctx );
+ (*ctx->Exec.PopMatrix)();
break;
case OPCODE_POP_NAME:
- gl_PopName( ctx );
+ (*ctx->Exec.PopName)();
break;
case OPCODE_PRIORITIZE_TEXTURE:
- gl_PrioritizeTextures( ctx, 1, &n[1].ui, &n[2].f );
+ (*ctx->Exec.PrioritizeTextures)( 1, &n[1].ui, &n[2].f );
break;
case OPCODE_PUSH_ATTRIB:
- gl_PushAttrib( ctx, n[1].bf );
+ (*ctx->Exec.PushAttrib)( n[1].bf );
break;
case OPCODE_PUSH_MATRIX:
- gl_PushMatrix( ctx );
+ (*ctx->Exec.PushMatrix)();
break;
case OPCODE_PUSH_NAME:
- gl_PushName( ctx, n[1].ui );
+ (*ctx->Exec.PushName)( n[1].ui );
break;
case OPCODE_RASTER_POS:
- gl_RasterPos4f( ctx, n[1].f, n[2].f, n[3].f, n[4].f );
+ (*ctx->Exec.RasterPos4f)( n[1].f, n[2].f, n[3].f, n[4].f );
break;
case OPCODE_READ_BUFFER:
- gl_ReadBuffer( ctx, n[1].e );
+ (*ctx->Exec.ReadBuffer)( n[1].e );
break;
case OPCODE_RECTF:
- gl_Rectf( ctx, n[1].f, n[2].f, n[3].f, n[4].f );
+ (*ctx->Exec.Rectf)( n[1].f, n[2].f, n[3].f, n[4].f );
break;
case OPCODE_SCALE:
- gl_Scalef( ctx, n[1].f, n[2].f, n[3].f );
+ (*ctx->Exec.Scalef)( n[1].f, n[2].f, n[3].f );
break;
case OPCODE_SCISSOR:
- gl_Scissor( ctx, n[1].i, n[2].i, n[3].i, n[4].i );
+ (*ctx->Exec.Scissor)( n[1].i, n[2].i, n[3].i, n[4].i );
break;
case OPCODE_SHADE_MODEL:
- gl_ShadeModel( ctx, n[1].e );
+ (*ctx->Exec.ShadeModel)( n[1].e );
break;
case OPCODE_STENCIL_FUNC:
- gl_StencilFunc( ctx, n[1].e, n[2].i, n[3].ui );
+ (*ctx->Exec.StencilFunc)( n[1].e, n[2].i, n[3].ui );
break;
case OPCODE_STENCIL_MASK:
- gl_StencilMask( ctx, n[1].ui );
+ (*ctx->Exec.StencilMask)( n[1].ui );
break;
case OPCODE_STENCIL_OP:
- gl_StencilOp( ctx, n[1].e, n[2].e, n[3].e );
+ (*ctx->Exec.StencilOp)( n[1].e, n[2].e, n[3].e );
break;
case OPCODE_TEXENV:
{
@@ -2894,7 +3642,7 @@ static void execute_list( GLcontext *ctx, GLuint list )
params[1] = n[4].f;
params[2] = n[5].f;
params[3] = n[6].f;
- gl_TexEnvfv( ctx, n[1].e, n[2].e, params );
+ (*ctx->Exec.TexEnvfv)( n[1].e, n[2].e, params );
}
break;
case OPCODE_TEXGEN:
@@ -2904,7 +3652,7 @@ static void execute_list( GLcontext *ctx, GLuint list )
params[1] = n[4].f;
params[2] = n[5].f;
params[3] = n[6].f;
- gl_TexGenfv( ctx, n[1].e, n[2].e, params );
+ (*ctx->Exec.TexGenfv)( n[1].e, n[2].e, params );
}
break;
case OPCODE_TEXPARAMETER:
@@ -2914,74 +3662,75 @@ static void execute_list( GLcontext *ctx, GLuint list )
params[1] = n[4].f;
params[2] = n[5].f;
params[3] = n[6].f;
- gl_TexParameterfv( ctx, n[1].e, n[2].e, params );
+ (*ctx->Exec.TexParameterfv)( n[1].e, n[2].e, params );
}
break;
case OPCODE_TEX_IMAGE1D:
{
struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = defaultPacking;
- gl_TexImage1D( ctx,
- n[1].e, /* target */
- n[2].i, /* level */
- n[3].i, /* components */
- n[4].i, /* width */
- n[5].e, /* border */
- n[6].e, /* format */
- n[7].e, /* type */
- n[8].data );
+ ctx->Unpack = _mesa_native_packing;
+ (*ctx->Exec.TexImage1D)(
+ n[1].e, /* target */
+ n[2].i, /* level */
+ n[3].i, /* components */
+ n[4].i, /* width */
+ n[5].e, /* border */
+ n[6].e, /* format */
+ n[7].e, /* type */
+ n[8].data );
ctx->Unpack = save; /* restore */
}
break;
case OPCODE_TEX_IMAGE2D:
{
struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = defaultPacking;
- gl_TexImage2D( ctx,
- n[1].e, /* target */
- n[2].i, /* level */
- n[3].i, /* components */
- n[4].i, /* width */
- n[5].i, /* height */
- n[6].e, /* border */
- n[7].e, /* format */
- n[8].e, /* type */
- n[9].data );
+ ctx->Unpack = _mesa_native_packing;
+ (*ctx->Exec.TexImage2D)(
+ n[1].e, /* target */
+ n[2].i, /* level */
+ n[3].i, /* components */
+ n[4].i, /* width */
+ n[5].i, /* height */
+ n[6].e, /* border */
+ n[7].e, /* format */
+ n[8].e, /* type */
+ n[9].data );
ctx->Unpack = save; /* restore */
}
break;
case OPCODE_TEX_IMAGE3D:
{
struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = defaultPacking;
- gl_TexImage3D( ctx,
- n[1].e, /* target */
- n[2].i, /* level */
- n[3].i, /* components */
- n[4].i, /* width */
- n[5].i, /* height */
- n[6].i, /* depth */
- n[7].e, /* border */
- n[8].e, /* format */
- n[9].e, /* type */
- n[10].data );
+ ctx->Unpack = _mesa_native_packing;
+ (*ctx->Exec.TexImage3D)(
+ n[1].e, /* target */
+ n[2].i, /* level */
+ n[3].i, /* components */
+ n[4].i, /* width */
+ n[5].i, /* height */
+ n[6].i, /* depth */
+ n[7].e, /* border */
+ n[8].e, /* format */
+ n[9].e, /* type */
+ n[10].data );
ctx->Unpack = save; /* restore */
}
break;
case OPCODE_TEX_SUB_IMAGE1D:
{
struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = defaultPacking;
- gl_TexSubImage1D( ctx, n[1].e, n[2].i, n[3].i, n[4].i, n[5].e,
- n[6].e, n[7].data );
+ ctx->Unpack = _mesa_native_packing;
+ (*ctx->Exec.TexSubImage1D)( n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].e,
+ n[6].e, n[7].data );
ctx->Unpack = save; /* restore */
}
break;
case OPCODE_TEX_SUB_IMAGE2D:
{
struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = defaultPacking;
- (*ctx->Exec.TexSubImage2D)( ctx, n[1].e, n[2].i, n[3].i,
+ ctx->Unpack = _mesa_native_packing;
+ (*ctx->Exec.TexSubImage2D)( n[1].e, n[2].i, n[3].i,
n[4].i, n[5].e,
n[6].i, n[7].e, n[8].e, n[9].data );
ctx->Unpack = save; /* restore */
@@ -2990,28 +3739,29 @@ static void execute_list( GLcontext *ctx, GLuint list )
case OPCODE_TEX_SUB_IMAGE3D:
{
struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = defaultPacking;
- gl_TexSubImage3D( ctx, n[1].e, n[2].i, n[3].i, n[4].i, n[5].i,
- n[6].i, n[7].i, n[8].i, n[9].e, n[10].e,
- n[11].data );
+ ctx->Unpack = _mesa_native_packing;
+ (*ctx->Exec.TexSubImage3D)( n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].i, n[6].i, n[7].i,
+ n[8].i, n[9].e, n[10].e,
+ n[11].data );
ctx->Unpack = save; /* restore */
}
break;
case OPCODE_TRANSLATE:
- gl_Translatef( ctx, n[1].f, n[2].f, n[3].f );
+ (*ctx->Exec.Translatef)( n[1].f, n[2].f, n[3].f );
break;
case OPCODE_VIEWPORT:
- gl_Viewport( ctx,
- n[1].i, n[2].i, (GLsizei) n[3].i, (GLsizei) n[4].i );
+ (*ctx->Exec.Viewport)(n[1].i, n[2].i,
+ (GLsizei) n[3].i, (GLsizei) n[4].i);
break;
case OPCODE_WINDOW_POS:
- gl_WindowPos4fMESA( ctx, n[1].f, n[2].f, n[3].f, n[4].f );
+ (*ctx->Exec.WindowPos4fMESA)( n[1].f, n[2].f, n[3].f, n[4].f );
break;
case OPCODE_ACTIVE_TEXTURE: /* GL_ARB_multitexture */
- gl_ActiveTexture( ctx, n[1].e );
+ (*ctx->Exec.ActiveTextureARB)( n[1].e );
break;
case OPCODE_CLIENT_ACTIVE_TEXTURE: /* GL_ARB_multitexture */
- gl_ClientActiveTexture( ctx, n[1].e );
+ (*ctx->Exec.ClientActiveTextureARB)( n[1].e );
break;
case OPCODE_CONTINUE:
n = (Node *) n[1].next;
@@ -3051,23 +3801,21 @@ static void execute_list( GLcontext *ctx, GLuint list )
/*
* Test if a display list number is valid.
*/
-GLboolean gl_IsList( GLcontext *ctx, GLuint list )
+GLboolean
+_mesa_IsList( GLuint list )
{
- if (list > 0 && HashLookup(ctx->Shared->DisplayList, list)) {
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
+ GET_CURRENT_CONTEXT(ctx);
+ return islist(ctx, list);
}
-
/*
* Delete a sequence of consecutive display lists.
*/
-void gl_DeleteLists( GLcontext *ctx, GLuint list, GLsizei range )
+void
+_mesa_DeleteLists( GLuint list, GLsizei range )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint i;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDeleteLists");
@@ -3086,8 +3834,10 @@ void gl_DeleteLists( GLcontext *ctx, GLuint list, GLsizei range )
* Return a display list number, n, such that lists n through n+range-1
* are free.
*/
-GLuint gl_GenLists( GLcontext *ctx, GLsizei range )
+GLuint
+_mesa_GenLists(GLsizei range )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint base;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glGenLists", 0);
@@ -3099,12 +3849,12 @@ GLuint gl_GenLists( GLcontext *ctx, GLsizei range )
return 0;
}
- base = HashFindFreeKeyBlock(ctx->Shared->DisplayList, range);
+ base = _mesa_HashFindFreeKeyBlock(ctx->Shared->DisplayList, range);
if (base) {
/* reserve the list IDs by with empty/dummy lists */
GLint i;
for (i=0; i<range; i++) {
- HashInsert(ctx->Shared->DisplayList, base+i, make_empty_list());
+ _mesa_HashInsert(ctx->Shared->DisplayList, base+i, make_empty_list());
}
}
return base;
@@ -3115,8 +3865,10 @@ GLuint gl_GenLists( GLcontext *ctx, GLsizei range )
/*
* Begin a new display list.
*/
-void gl_NewList( GLcontext *ctx, GLuint list, GLenum mode )
+void
+_mesa_NewList( GLuint list, GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
struct immediate *IM;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glNewList");
@@ -3152,7 +3904,9 @@ void gl_NewList( GLcontext *ctx, GLuint list, GLenum mode )
ctx->CompileFlag = GL_TRUE;
ctx->CompileCVAFlag = GL_FALSE;
ctx->ExecuteFlag = (mode == GL_COMPILE_AND_EXECUTE);
- ctx->API = ctx->Save; /* Switch the API function pointers */
+
+ ctx->CurrentDispatch = &ctx->Save;
+ _glapi_set_dispatch( ctx->CurrentDispatch );
}
@@ -3160,8 +3914,10 @@ void gl_NewList( GLcontext *ctx, GLuint list, GLenum mode )
/*
* End definition of current display list.
*/
-void gl_EndList( GLcontext *ctx )
+void
+_mesa_EndList( void )
{
+ GET_CURRENT_CONTEXT(ctx);
if (MESA_VERBOSE&VERBOSE_API)
fprintf(stderr, "glEndList\n");
@@ -3178,7 +3934,7 @@ void gl_EndList( GLcontext *ctx )
/* Destroy old list, if any */
gl_destroy_list(ctx, ctx->CurrentListNum);
/* Install the list */
- HashInsert(ctx->Shared->DisplayList, ctx->CurrentListNum, ctx->CurrentListPtr);
+ _mesa_HashInsert(ctx->Shared->DisplayList, ctx->CurrentListNum, ctx->CurrentListPtr);
if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
@@ -3202,13 +3958,16 @@ void gl_EndList( GLcontext *ctx )
*/
ctx->NewState = ~0;
- ctx->API = ctx->Exec; /* Switch the API function pointers */
+ ctx->CurrentDispatch = &ctx->Exec;
+ _glapi_set_dispatch( ctx->CurrentDispatch );
}
-void gl_CallList( GLcontext *ctx, GLuint list )
+void
+_mesa_CallList( GLuint list )
{
+ GET_CURRENT_CONTEXT(ctx);
/* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
/* execute the display list, and restore the CompileFlag. */
GLboolean save_compile_flag;
@@ -3226,8 +3985,10 @@ void gl_CallList( GLcontext *ctx, GLuint list )
ctx->CompileFlag = save_compile_flag;
/* also restore API function pointers to point to "save" versions */
- if (save_compile_flag)
- ctx->API = ctx->Save;
+ if (save_compile_flag) {
+ ctx->CurrentDispatch = &ctx->Save;
+ _glapi_set_dispatch( ctx->CurrentDispatch );
+ }
}
@@ -3235,9 +3996,10 @@ void gl_CallList( GLcontext *ctx, GLuint list )
/*
* Execute glCallLists: call multiple display lists.
*/
-void gl_CallLists( GLcontext *ctx,
- GLsizei n, GLenum type, const GLvoid *lists )
+void
+_mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint list;
GLint i;
GLboolean save_compile_flag;
@@ -3258,9 +4020,10 @@ void gl_CallLists( GLcontext *ctx,
ctx->CompileFlag = save_compile_flag;
/* also restore API function pointers to point to "save" versions */
- if (save_compile_flag)
- ctx->API = ctx->Save;
-
+ if (save_compile_flag) {
+ ctx->CurrentDispatch = &ctx->Save;
+ _glapi_set_dispatch( ctx->CurrentDispatch );
+ }
/* RESET_IMMEDIATE( ctx ); */
}
@@ -3270,8 +4033,10 @@ void gl_CallLists( GLcontext *ctx,
/*
* Set the offset added to list numbers in glCallLists.
*/
-void gl_ListBase( GLcontext *ctx, GLuint base )
+void
+_mesa_ListBase( GLuint base )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glListBase");
ctx->List.ListBase = base;
}
@@ -3279,23 +4044,21 @@ void gl_ListBase( GLcontext *ctx, GLuint base )
-
-
/*
* Assign all the pointers in 'table' to point to Mesa's display list
* building functions.
*/
-void gl_init_dlist_pointers( struct gl_api_table *table )
+void
+_mesa_init_dlist_table( struct _glapi_table *table )
{
+ _mesa_init_no_op_table(table);
+
+ /* GL 1.0 */
table->Accum = save_Accum;
table->AlphaFunc = save_AlphaFunc;
- table->AreTexturesResident = gl_AreTexturesResident;
- table->BindTexture = save_BindTexture;
+ table->Begin = save_Begin;
table->Bitmap = save_Bitmap;
- table->BlendColor = save_BlendColor;
- table->BlendEquation = save_BlendEquation;
table->BlendFunc = save_BlendFunc;
- table->BlendFuncSeparate = save_BlendFuncSeparate;
table->CallList = save_CallList;
table->CallLists = save_CallLists;
table->Clear = save_Clear;
@@ -3305,150 +4068,452 @@ void gl_init_dlist_pointers( struct gl_api_table *table )
table->ClearIndex = save_ClearIndex;
table->ClearStencil = save_ClearStencil;
table->ClipPlane = save_ClipPlane;
+ table->Color3b = _mesa_Color3b;
+ table->Color3bv = _mesa_Color3bv;
+ table->Color3d = _mesa_Color3d;
+ table->Color3dv = _mesa_Color3dv;
+ table->Color3f = _mesa_Color3f;
+ table->Color3fv = _mesa_Color3fv;
+ table->Color3i = _mesa_Color3i;
+ table->Color3iv = _mesa_Color3iv;
+ table->Color3s = _mesa_Color3s;
+ table->Color3sv = _mesa_Color3sv;
+ table->Color3ub = _mesa_Color3ub;
+ table->Color3ubv = _mesa_Color3ubv;
+ table->Color3ui = _mesa_Color3ui;
+ table->Color3uiv = _mesa_Color3uiv;
+ table->Color3us = _mesa_Color3us;
+ table->Color3usv = _mesa_Color3usv;
+ table->Color4b = _mesa_Color4b;
+ table->Color4bv = _mesa_Color4bv;
+ table->Color4d = _mesa_Color4d;
+ table->Color4dv = _mesa_Color4dv;
+ table->Color4f = _mesa_Color4f;
+ table->Color4fv = _mesa_Color4fv;
+ table->Color4i = _mesa_Color4i;
+ table->Color4iv = _mesa_Color4iv;
+ table->Color4s = _mesa_Color4s;
+ table->Color4sv = _mesa_Color4sv;
+ table->Color4ub = _mesa_Color4ub;
+ table->Color4ubv = _mesa_Color4ubv;
+ table->Color4ui = _mesa_Color4ui;
+ table->Color4uiv = _mesa_Color4uiv;
+ table->Color4us = _mesa_Color4us;
+ table->Color4usv = _mesa_Color4usv;
table->ColorMask = save_ColorMask;
table->ColorMaterial = save_ColorMaterial;
- table->ColorTable = save_ColorTable;
- table->ColorSubTable = save_ColorSubTable;
table->CopyPixels = save_CopyPixels;
- table->CopyTexImage1D = save_CopyTexImage1D;
- table->CopyTexImage2D = save_CopyTexImage2D;
- table->CopyTexSubImage1D = save_CopyTexSubImage1D;
- table->CopyTexSubImage2D = save_CopyTexSubImage2D;
- table->CopyTexSubImage3D = save_CopyTexSubImage3D;
table->CullFace = save_CullFace;
- table->DeleteLists = gl_DeleteLists; /* NOT SAVED */
- table->DeleteTextures = gl_DeleteTextures; /* NOT SAVED */
+ table->DeleteLists = _mesa_DeleteLists;
table->DepthFunc = save_DepthFunc;
table->DepthMask = save_DepthMask;
table->DepthRange = save_DepthRange;
table->Disable = save_Disable;
- table->DisableClientState = gl_DisableClientState; /* NOT SAVED */
table->DrawBuffer = save_DrawBuffer;
table->DrawPixels = save_DrawPixels;
+ table->EdgeFlag = _mesa_EdgeFlag;
+ table->EdgeFlagv = _mesa_EdgeFlagv;
table->Enable = save_Enable;
- table->Error = gl_save_error;
- table->EnableClientState = gl_EnableClientState; /* NOT SAVED */
- table->EndList = gl_EndList; /* NOT SAVED */
+ table->End = _mesa_End;
+ table->EndList = _mesa_EndList;
+ table->EvalCoord1d = _mesa_EvalCoord1d;
+ table->EvalCoord1dv = _mesa_EvalCoord1dv;
+ table->EvalCoord1f = _mesa_EvalCoord1f;
+ table->EvalCoord1fv = _mesa_EvalCoord1fv;
+ table->EvalCoord2d = _mesa_EvalCoord2d;
+ table->EvalCoord2dv = _mesa_EvalCoord2dv;
+ table->EvalCoord2f = _mesa_EvalCoord2f;
+ table->EvalCoord2fv = _mesa_EvalCoord2fv;
table->EvalMesh1 = save_EvalMesh1;
table->EvalMesh2 = save_EvalMesh2;
- table->FeedbackBuffer = gl_FeedbackBuffer; /* NOT SAVED */
- table->Finish = gl_Finish; /* NOT SAVED */
- table->Flush = gl_Flush; /* NOT SAVED */
+ table->EvalPoint1 = _mesa_EvalPoint1;
+ table->EvalPoint2 = _mesa_EvalPoint2;
+ table->FeedbackBuffer = _mesa_FeedbackBuffer;
+ table->Finish = _mesa_Finish;
+ table->Flush = _mesa_Flush;
+ table->Fogf = save_Fogf;
table->Fogfv = save_Fogfv;
+ table->Fogi = save_Fogi;
+ table->Fogiv = save_Fogiv;
table->FrontFace = save_FrontFace;
table->Frustum = save_Frustum;
- table->GenLists = gl_GenLists; /* NOT SAVED */
- table->GenTextures = gl_GenTextures; /* NOT SAVED */
-
- /* NONE OF THESE COMMANDS ARE COMPILED INTO DISPLAY LISTS */
- table->GetBooleanv = gl_GetBooleanv;
- table->GetClipPlane = gl_GetClipPlane;
- table->GetColorTable = gl_GetColorTable;
- table->GetColorTableParameteriv = gl_GetColorTableParameteriv;
- table->GetDoublev = gl_GetDoublev;
- table->GetError = gl_GetError;
- table->GetFloatv = gl_GetFloatv;
- table->GetIntegerv = gl_GetIntegerv;
- table->GetString = gl_GetString;
- table->GetLightfv = gl_GetLightfv;
- table->GetLightiv = gl_GetLightiv;
- table->GetMapdv = gl_GetMapdv;
- table->GetMapfv = gl_GetMapfv;
- table->GetMapiv = gl_GetMapiv;
- table->GetMaterialfv = gl_GetMaterialfv;
- table->GetMaterialiv = gl_GetMaterialiv;
- table->GetPixelMapfv = gl_GetPixelMapfv;
- table->GetPixelMapuiv = gl_GetPixelMapuiv;
- table->GetPixelMapusv = gl_GetPixelMapusv;
- table->GetPointerv = gl_GetPointerv;
- table->GetPolygonStipple = gl_GetPolygonStipple;
- table->GetTexEnvfv = gl_GetTexEnvfv;
- table->GetTexEnviv = gl_GetTexEnviv;
- table->GetTexGendv = gl_GetTexGendv;
- table->GetTexGenfv = gl_GetTexGenfv;
- table->GetTexGeniv = gl_GetTexGeniv;
- table->GetTexImage = gl_GetTexImage;
- table->GetTexLevelParameterfv = gl_GetTexLevelParameterfv;
- table->GetTexLevelParameteriv = gl_GetTexLevelParameteriv;
- table->GetTexParameterfv = gl_GetTexParameterfv;
- table->GetTexParameteriv = gl_GetTexParameteriv;
-
+ table->GenLists = _mesa_GenLists;
+ table->GetBooleanv = _mesa_GetBooleanv;
+ table->GetClipPlane = _mesa_GetClipPlane;
+ table->GetDoublev = _mesa_GetDoublev;
+ table->GetError = _mesa_GetError;
+ table->GetFloatv = _mesa_GetFloatv;
+ table->GetIntegerv = _mesa_GetIntegerv;
+ table->GetLightfv = _mesa_GetLightfv;
+ table->GetLightiv = _mesa_GetLightiv;
+ table->GetMapdv = _mesa_GetMapdv;
+ table->GetMapfv = _mesa_GetMapfv;
+ table->GetMapiv = _mesa_GetMapiv;
+ table->GetMaterialfv = _mesa_GetMaterialfv;
+ table->GetMaterialiv = _mesa_GetMaterialiv;
+ table->GetPixelMapfv = _mesa_GetPixelMapfv;
+ table->GetPixelMapuiv = _mesa_GetPixelMapuiv;
+ table->GetPixelMapusv = _mesa_GetPixelMapusv;
+ table->GetPolygonStipple = _mesa_GetPolygonStipple;
+ table->GetString = _mesa_GetString;
+ table->GetTexEnvfv = _mesa_GetTexEnvfv;
+ table->GetTexEnviv = _mesa_GetTexEnviv;
+ table->GetTexGendv = _mesa_GetTexGendv;
+ table->GetTexGenfv = _mesa_GetTexGenfv;
+ table->GetTexGeniv = _mesa_GetTexGeniv;
+ table->GetTexImage = _mesa_GetTexImage;
+ table->GetTexLevelParameterfv = _mesa_GetTexLevelParameterfv;
+ table->GetTexLevelParameteriv = _mesa_GetTexLevelParameteriv;
+ table->GetTexParameterfv = _mesa_GetTexParameterfv;
+ table->GetTexParameteriv = _mesa_GetTexParameteriv;
table->Hint = save_Hint;
table->IndexMask = save_IndexMask;
+ table->Indexd = _mesa_Indexd;
+ table->Indexdv = _mesa_Indexdv;
+ table->Indexf = _mesa_Indexf;
+ table->Indexfv = _mesa_Indexfv;
+ table->Indexi = _mesa_Indexi;
+ table->Indexiv = _mesa_Indexiv;
+ table->Indexs = _mesa_Indexs;
+ table->Indexsv = _mesa_Indexsv;
table->InitNames = save_InitNames;
- table->IsEnabled = gl_IsEnabled; /* NOT SAVED */
- table->IsTexture = gl_IsTexture; /* NOT SAVED */
- table->IsList = gl_IsList; /* NOT SAVED */
+ table->IsEnabled = _mesa_IsEnabled;
+ table->IsList = _mesa_IsList;
+ table->LightModelf = save_LightModelf;
table->LightModelfv = save_LightModelfv;
+ table->LightModeli = save_LightModeli;
+ table->LightModeliv = save_LightModeliv;
+ table->Lightf = save_Lightf;
table->Lightfv = save_Lightfv;
+ table->Lighti = save_Lighti;
+ table->Lightiv = save_Lightiv;
table->LineStipple = save_LineStipple;
table->LineWidth = save_LineWidth;
table->ListBase = save_ListBase;
table->LoadIdentity = save_LoadIdentity;
+ table->LoadMatrixd = save_LoadMatrixd;
table->LoadMatrixf = save_LoadMatrixf;
table->LoadName = save_LoadName;
table->LogicOp = save_LogicOp;
+ table->Map1d = save_Map1d;
table->Map1f = save_Map1f;
+ table->Map2d = save_Map2d;
table->Map2f = save_Map2f;
+ table->MapGrid1d = save_MapGrid1d;
table->MapGrid1f = save_MapGrid1f;
+ table->MapGrid2d = save_MapGrid2d;
table->MapGrid2f = save_MapGrid2f;
+ table->Materialf = _mesa_Materialf;
+ table->Materialfv = _mesa_Materialfv;
+ table->Materiali = _mesa_Materiali;
+ table->Materialiv = _mesa_Materialiv;
table->MatrixMode = save_MatrixMode;
+ table->MultMatrixd = save_MultMatrixd;
table->MultMatrixf = save_MultMatrixf;
table->NewList = save_NewList;
+ table->Normal3b = _mesa_Normal3b;
+ table->Normal3bv = _mesa_Normal3bv;
+ table->Normal3d = _mesa_Normal3d;
+ table->Normal3dv = _mesa_Normal3dv;
+ table->Normal3f = _mesa_Normal3f;
+ table->Normal3fv = _mesa_Normal3fv;
+ table->Normal3i = _mesa_Normal3i;
+ table->Normal3iv = _mesa_Normal3iv;
+ table->Normal3s = _mesa_Normal3s;
+ table->Normal3sv = _mesa_Normal3sv;
table->Ortho = save_Ortho;
- table->PointParameterfvEXT = save_PointParameterfvEXT;
table->PassThrough = save_PassThrough;
table->PixelMapfv = save_PixelMapfv;
- table->PixelStorei = gl_PixelStorei; /* NOT SAVED */
+ table->PixelMapuiv = save_PixelMapuiv;
+ table->PixelMapusv = save_PixelMapusv;
+ table->PixelStoref = _mesa_PixelStoref;
+ table->PixelStorei = _mesa_PixelStorei;
table->PixelTransferf = save_PixelTransferf;
+ table->PixelTransferi = save_PixelTransferi;
table->PixelZoom = save_PixelZoom;
table->PointSize = save_PointSize;
table->PolygonMode = save_PolygonMode;
table->PolygonOffset = save_PolygonOffset;
table->PolygonStipple = save_PolygonStipple;
table->PopAttrib = save_PopAttrib;
- table->PopClientAttrib = gl_PopClientAttrib; /* NOT SAVED */
table->PopMatrix = save_PopMatrix;
table->PopName = save_PopName;
- table->PrioritizeTextures = save_PrioritizeTextures;
table->PushAttrib = save_PushAttrib;
- table->PushClientAttrib = gl_PushClientAttrib; /* NOT SAVED */
table->PushMatrix = save_PushMatrix;
table->PushName = save_PushName;
+ table->RasterPos2d = save_RasterPos2d;
+ table->RasterPos2dv = save_RasterPos2dv;
+ table->RasterPos2f = save_RasterPos2f;
+ table->RasterPos2fv = save_RasterPos2fv;
+ table->RasterPos2i = save_RasterPos2i;
+ table->RasterPos2iv = save_RasterPos2iv;
+ table->RasterPos2s = save_RasterPos2s;
+ table->RasterPos2sv = save_RasterPos2sv;
+ table->RasterPos3d = save_RasterPos3d;
+ table->RasterPos3dv = save_RasterPos3dv;
+ table->RasterPos3f = save_RasterPos3f;
+ table->RasterPos3fv = save_RasterPos3fv;
+ table->RasterPos3i = save_RasterPos3i;
+ table->RasterPos3iv = save_RasterPos3iv;
+ table->RasterPos3s = save_RasterPos3s;
+ table->RasterPos3sv = save_RasterPos3sv;
+ table->RasterPos4d = save_RasterPos4d;
+ table->RasterPos4dv = save_RasterPos4dv;
table->RasterPos4f = save_RasterPos4f;
+ table->RasterPos4fv = save_RasterPos4fv;
+ table->RasterPos4i = save_RasterPos4i;
+ table->RasterPos4iv = save_RasterPos4iv;
+ table->RasterPos4s = save_RasterPos4s;
+ table->RasterPos4sv = save_RasterPos4sv;
table->ReadBuffer = save_ReadBuffer;
- table->ReadPixels = gl_ReadPixels; /* NOT SAVED */
+ table->ReadPixels = _mesa_ReadPixels;
+ table->Rectd = save_Rectd;
+ table->Rectdv = save_Rectdv;
table->Rectf = save_Rectf;
- table->RenderMode = gl_RenderMode; /* NOT SAVED */
+ table->Rectfv = save_Rectfv;
+ table->Recti = save_Recti;
+ table->Rectiv = save_Rectiv;
+ table->Rects = save_Rects;
+ table->Rectsv = save_Rectsv;
+ table->RenderMode = _mesa_RenderMode;
+ table->Rotated = save_Rotated;
table->Rotatef = save_Rotatef;
+ table->Scaled = save_Scaled;
table->Scalef = save_Scalef;
table->Scissor = save_Scissor;
- table->SelectBuffer = gl_SelectBuffer; /* NOT SAVED */
+ table->SelectBuffer = _mesa_SelectBuffer;
table->ShadeModel = save_ShadeModel;
table->StencilFunc = save_StencilFunc;
table->StencilMask = save_StencilMask;
table->StencilOp = save_StencilOp;
+ table->TexCoord1d = _mesa_TexCoord1d;
+ table->TexCoord1dv = _mesa_TexCoord1dv;
+ table->TexCoord1f = _mesa_TexCoord1f;
+ table->TexCoord1fv = _mesa_TexCoord1fv;
+ table->TexCoord1i = _mesa_TexCoord1i;
+ table->TexCoord1iv = _mesa_TexCoord1iv;
+ table->TexCoord1s = _mesa_TexCoord1s;
+ table->TexCoord1sv = _mesa_TexCoord1sv;
+ table->TexCoord2d = _mesa_TexCoord2d;
+ table->TexCoord2dv = _mesa_TexCoord2dv;
+ table->TexCoord2f = _mesa_TexCoord2f;
+ table->TexCoord2fv = _mesa_TexCoord2fv;
+ table->TexCoord2i = _mesa_TexCoord2i;
+ table->TexCoord2iv = _mesa_TexCoord2iv;
+ table->TexCoord2s = _mesa_TexCoord2s;
+ table->TexCoord2sv = _mesa_TexCoord2sv;
+ table->TexCoord3d = _mesa_TexCoord3d;
+ table->TexCoord3dv = _mesa_TexCoord3dv;
+ table->TexCoord3f = _mesa_TexCoord3f;
+ table->TexCoord3fv = _mesa_TexCoord3fv;
+ table->TexCoord3i = _mesa_TexCoord3i;
+ table->TexCoord3iv = _mesa_TexCoord3iv;
+ table->TexCoord3s = _mesa_TexCoord3s;
+ table->TexCoord3sv = _mesa_TexCoord3sv;
+ table->TexCoord4d = _mesa_TexCoord4d;
+ table->TexCoord4dv = _mesa_TexCoord4dv;
+ table->TexCoord4f = _mesa_TexCoord4f;
+ table->TexCoord4fv = _mesa_TexCoord4fv;
+ table->TexCoord4i = _mesa_TexCoord4i;
+ table->TexCoord4iv = _mesa_TexCoord4iv;
+ table->TexCoord4s = _mesa_TexCoord4s;
+ table->TexCoord4sv = _mesa_TexCoord4sv;
+ table->TexEnvf = save_TexEnvf;
table->TexEnvfv = save_TexEnvfv;
+ table->TexEnvi = save_TexEnvi;
+ table->TexEnviv = save_TexEnviv;
+ table->TexGend = save_TexGend;
+ table->TexGendv = save_TexGendv;
+ table->TexGenf = save_TexGenf;
table->TexGenfv = save_TexGenfv;
+ table->TexGeni = save_TexGeni;
+ table->TexGeniv = save_TexGeniv;
table->TexImage1D = save_TexImage1D;
table->TexImage2D = save_TexImage2D;
- table->TexImage3D = save_TexImage3D;
- table->TexSubImage1D = save_TexSubImage1D;
- table->TexSubImage2D = save_TexSubImage2D;
- table->TexSubImage3D = save_TexSubImage3D;
+ table->TexParameterf = save_TexParameterf;
table->TexParameterfv = save_TexParameterfv;
+ table->TexParameteri = save_TexParameteri;
+ table->TexParameteriv = save_TexParameteriv;
+ table->Translated = save_Translated;
table->Translatef = save_Translatef;
+ table->Vertex2d = _mesa_Vertex2d;
+ table->Vertex2dv = _mesa_Vertex2dv;
+ table->Vertex2f = _mesa_Vertex2f;
+ table->Vertex2fv = _mesa_Vertex2fv;
+ table->Vertex2i = _mesa_Vertex2i;
+ table->Vertex2iv = _mesa_Vertex2iv;
+ table->Vertex2s = _mesa_Vertex2s;
+ table->Vertex2sv = _mesa_Vertex2sv;
+ table->Vertex3d = _mesa_Vertex3d;
+ table->Vertex3dv = _mesa_Vertex3dv;
+ table->Vertex3f = _mesa_Vertex3f;
+ table->Vertex3fv = _mesa_Vertex3fv;
+ table->Vertex3i = _mesa_Vertex3i;
+ table->Vertex3iv = _mesa_Vertex3iv;
+ table->Vertex3s = _mesa_Vertex3s;
+ table->Vertex3sv = _mesa_Vertex3sv;
+ table->Vertex4d = _mesa_Vertex4d;
+ table->Vertex4dv = _mesa_Vertex4dv;
+ table->Vertex4f = _mesa_Vertex4f;
+ table->Vertex4fv = _mesa_Vertex4fv;
+ table->Vertex4i = _mesa_Vertex4i;
+ table->Vertex4iv = _mesa_Vertex4iv;
+ table->Vertex4s = _mesa_Vertex4s;
+ table->Vertex4sv = _mesa_Vertex4sv;
table->Viewport = save_Viewport;
- /* GL_MESA_window_pos extension */
- table->WindowPos4fMESA = save_WindowPos4fMESA;
+ /* GL 1.1 */
+ table->AreTexturesResident = _mesa_AreTexturesResident;
+ table->ArrayElement = _mesa_ArrayElement;
+ table->BindTexture = save_BindTexture;
+ table->ColorPointer = _mesa_ColorPointer;
+ table->CopyTexImage1D = save_CopyTexImage1D;
+ table->CopyTexImage2D = save_CopyTexImage2D;
+ table->CopyTexSubImage1D = save_CopyTexSubImage1D;
+ table->CopyTexSubImage2D = save_CopyTexSubImage2D;
+ table->DeleteTextures = _mesa_DeleteTextures;
+ table->DisableClientState = _mesa_DisableClientState;
+ table->DrawArrays = _mesa_DrawArrays;
+ table->DrawElements = _mesa_DrawElements;
+ table->EdgeFlagPointer = _mesa_EdgeFlagPointer;
+ table->EnableClientState = _mesa_EnableClientState;
+ table->GenTextures = _mesa_GenTextures;
+ table->GetPointerv = _mesa_GetPointerv;
+ table->IndexPointer = _mesa_IndexPointer;
+ table->Indexub = _mesa_Indexub;
+ table->Indexubv = _mesa_Indexubv;
+ table->InterleavedArrays = _mesa_InterleavedArrays;
+ table->IsTexture = _mesa_IsTexture;
+ table->NormalPointer = _mesa_NormalPointer;
+ table->PopClientAttrib = _mesa_PopClientAttrib;
+ table->PrioritizeTextures = save_PrioritizeTextures;
+ table->PushClientAttrib = _mesa_PushClientAttrib;
+ table->TexCoordPointer = _mesa_TexCoordPointer;
+ table->TexSubImage1D = save_TexSubImage1D;
+ table->TexSubImage2D = save_TexSubImage2D;
+ table->VertexPointer = _mesa_VertexPointer;
+
+ /* GL 1.2 */
+ table->CopyTexSubImage3D = save_CopyTexSubImage3D;
+ table->DrawRangeElements = _mesa_DrawRangeElements;
+ table->TexImage3D = save_TexImage3D;
+ table->TexSubImage3D = save_TexSubImage3D;
- /* GL_MESA_resize_buffers extension */
- table->ResizeBuffersMESA = gl_ResizeBuffersMESA;
+ /* GL_ARB_imaging */
+ /* NOT supported, just call stub functions */
+ table->BlendColor = _mesa_BlendColor;
+ table->BlendEquation = _mesa_BlendEquation;
+ table->ColorSubTable = _mesa_ColorSubTable;
+ table->ColorTable = _mesa_ColorTable;
+ table->ColorTableParameterfv = _mesa_ColorTableParameterfv;
+ table->ColorTableParameteriv = _mesa_ColorTableParameteriv;
+ table->ConvolutionFilter1D = _mesa_ConvolutionFilter1D;
+ table->ConvolutionFilter2D = _mesa_ConvolutionFilter2D;
+ table->ConvolutionParameterf = _mesa_ConvolutionParameterf;
+ table->ConvolutionParameterfv = _mesa_ConvolutionParameterfv;
+ table->ConvolutionParameteri = _mesa_ConvolutionParameteri;
+ table->ConvolutionParameteriv = _mesa_ConvolutionParameteriv;
+ table->CopyColorSubTable = _mesa_CopyColorSubTable;
+ table->CopyColorTable = _mesa_CopyColorTable;
+ table->CopyConvolutionFilter1D = _mesa_CopyConvolutionFilter1D;
+ table->CopyConvolutionFilter2D = _mesa_CopyConvolutionFilter2D;
+ table->GetColorTable = _mesa_GetColorTable;
+ table->GetColorTableParameterfv = _mesa_GetColorTableParameterfv;
+ table->GetColorTableParameteriv = _mesa_GetColorTableParameteriv;
+ table->GetConvolutionFilter = _mesa_GetConvolutionFilter;
+ table->GetConvolutionParameterfv = _mesa_GetConvolutionParameterfv;
+ table->GetConvolutionParameteriv = _mesa_GetConvolutionParameteriv;
+ table->GetHistogram = _mesa_GetHistogram;
+ table->GetHistogramParameterfv = _mesa_GetHistogramParameterfv;
+ table->GetHistogramParameteriv = _mesa_GetHistogramParameteriv;
+ table->GetMinmax = _mesa_GetMinmax;
+ table->GetMinmaxParameterfv = _mesa_GetMinmaxParameterfv;
+ table->GetMinmaxParameteriv = _mesa_GetMinmaxParameteriv;
+ table->GetSeparableFilter = _mesa_GetSeparableFilter;
+ table->Histogram = _mesa_Histogram;
+ table->Minmax = _mesa_Minmax;
+ table->ResetHistogram = _mesa_ResetHistogram;
+ table->ResetMinmax = _mesa_ResetMinmax;
+ table->SeparableFilter2D = _mesa_SeparableFilter2D;
+
+ /* GL_EXT_paletted_texture */
+ table->ColorTableEXT = save_ColorTableEXT;
+ table->ColorSubTableEXT = save_ColorSubTableEXT;
+ table->GetColorTableEXT = _mesa_GetColorTableEXT;
+ table->GetColorTableParameterfvEXT = _mesa_GetColorTableParameterfvEXT;
+ table->GetColorTableParameterivEXT = _mesa_GetColorTableParameterivEXT;
+
+ /* GL_EXT_compiled_vertex_array */
+ table->LockArraysEXT = _mesa_LockArraysEXT;
+ table->UnlockArraysEXT = _mesa_UnlockArraysEXT;
+
+ /* GL_EXT_point_parameters */
+ table->PointParameterfEXT = save_PointParameterfEXT;
+ table->PointParameterfvEXT = save_PointParameterfvEXT;
+
+ /* GL_PGI_misc_hints */
+ table->HintPGI = save_HintPGI;
+
+ /* GL_EXT_polygon_offset */
+ table->PolygonOffsetEXT = save_PolygonOffsetEXT;
+
+ /* GL_EXT_blend_minmax */
+ table->BlendEquationEXT = save_BlendEquation;
+
+ /* GL_EXT_blend_color */
+ table->BlendColorEXT = save_BlendColor;
/* GL_ARB_multitexture */
- table->ActiveTexture = save_ActiveTexture;
- table->ClientActiveTexture = save_ClientActiveTexture;
+ table->ActiveTextureARB = save_ActiveTextureARB;
+ table->ClientActiveTextureARB = save_ClientActiveTextureARB;
+ table->MultiTexCoord1dARB = _mesa_MultiTexCoord1dARB;
+ table->MultiTexCoord1dvARB = _mesa_MultiTexCoord1dvARB;
+ table->MultiTexCoord1fARB = _mesa_MultiTexCoord1fARB;
+ table->MultiTexCoord1fvARB = _mesa_MultiTexCoord1fvARB;
+ table->MultiTexCoord1iARB = _mesa_MultiTexCoord1iARB;
+ table->MultiTexCoord1ivARB = _mesa_MultiTexCoord1ivARB;
+ table->MultiTexCoord1sARB = _mesa_MultiTexCoord1sARB;
+ table->MultiTexCoord1svARB = _mesa_MultiTexCoord1svARB;
+ table->MultiTexCoord2dARB = _mesa_MultiTexCoord2dARB;
+ table->MultiTexCoord2dvARB = _mesa_MultiTexCoord2dvARB;
+ table->MultiTexCoord2fARB = _mesa_MultiTexCoord2fARB;
+ table->MultiTexCoord2fvARB = _mesa_MultiTexCoord2fvARB;
+ table->MultiTexCoord2iARB = _mesa_MultiTexCoord2iARB;
+ table->MultiTexCoord2ivARB = _mesa_MultiTexCoord2ivARB;
+ table->MultiTexCoord2sARB = _mesa_MultiTexCoord2sARB;
+ table->MultiTexCoord2svARB = _mesa_MultiTexCoord2svARB;
+ table->MultiTexCoord3dARB = _mesa_MultiTexCoord3dARB;
+ table->MultiTexCoord3dvARB = _mesa_MultiTexCoord3dvARB;
+ table->MultiTexCoord3fARB = _mesa_MultiTexCoord3fARB;
+ table->MultiTexCoord3fvARB = _mesa_MultiTexCoord3fvARB;
+ table->MultiTexCoord3iARB = _mesa_MultiTexCoord3iARB;
+ table->MultiTexCoord3ivARB = _mesa_MultiTexCoord3ivARB;
+ table->MultiTexCoord3sARB = _mesa_MultiTexCoord3sARB;
+ table->MultiTexCoord3svARB = _mesa_MultiTexCoord3svARB;
+ table->MultiTexCoord4dARB = _mesa_MultiTexCoord4dARB;
+ table->MultiTexCoord4dvARB = _mesa_MultiTexCoord4dvARB;
+ table->MultiTexCoord4fARB = _mesa_MultiTexCoord4fARB;
+ table->MultiTexCoord4fvARB = _mesa_MultiTexCoord4fvARB;
+ table->MultiTexCoord4iARB = _mesa_MultiTexCoord4iARB;
+ table->MultiTexCoord4ivARB = _mesa_MultiTexCoord4ivARB;
+ table->MultiTexCoord4sARB = _mesa_MultiTexCoord4sARB;
+ table->MultiTexCoord4svARB = _mesa_MultiTexCoord4svARB;
+
+ /* GL_INGR_blend_func_separate */
+ table->BlendFuncSeparateINGR = save_BlendFuncSeparateINGR;
+
+ /* GL_MESA_window_pos */
+ table->WindowPos4fMESA = save_WindowPos4fMESA;
+
+ /* GL_MESA_resize_buffers */
+ table->ResizeBuffersMESA = _mesa_ResizeBuffersMESA;
+
+ /* GL_ARB_transpose_matrix */
+ table->LoadTransposeMatrixdARB = save_LoadTransposeMatrixdARB;
+ table->LoadTransposeMatrixfARB = save_LoadTransposeMatrixfARB;
+ table->MultTransposeMatrixdARB = save_MultTransposeMatrixdARB;
+ table->MultTransposeMatrixfARB = save_MultTransposeMatrixfARB;
+
}
@@ -3477,7 +4542,7 @@ static void print_list( GLcontext *ctx, FILE *f, GLuint list )
return;
}
- n = (Node *) HashLookup(ctx->Shared->DisplayList, list);
+ n = (Node *) _mesa_HashLookup(ctx->Shared->DisplayList, list);
fprintf( f, "START-LIST %u, address %p\n", list, (void*)n );
@@ -3612,11 +4677,6 @@ static void print_list( GLcontext *ctx, FILE *f, GLuint list )
-
-
-
-
-
/*
* Clients may call this function to help debug display list problems.
* This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
@@ -3624,6 +4684,6 @@ static void print_list( GLcontext *ctx, FILE *f, GLuint list )
*/
void mesa_print_display_list( GLuint list )
{
- GET_CONTEXT;
- print_list( CC, stderr, list );
+ GET_CURRENT_CONTEXT(ctx);
+ print_list( ctx, stderr, list );
}
diff --git a/xc/extras/Mesa/src/dlist.h b/xc/extras/Mesa/src/dlist.h
index 6d7445285..282238bb4 100644
--- a/xc/extras/Mesa/src/dlist.h
+++ b/xc/extras/Mesa/src/dlist.h
@@ -1,4 +1,4 @@
-/* $Id: dlist.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: dlist.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -51,24 +51,23 @@ extern void gl_init_lists( void );
extern void gl_destroy_list( GLcontext *ctx, GLuint list );
-extern void gl_CallList( GLcontext *ctx, GLuint list );
+extern void _mesa_CallList( GLuint list );
-extern void gl_CallLists( GLcontext *ctx,
- GLsizei n, GLenum type, const GLvoid *lists );
+extern void _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists );
-extern void gl_DeleteLists( GLcontext *ctx, GLuint list, GLsizei range );
+extern void _mesa_DeleteLists( GLuint list, GLsizei range );
-extern void gl_EndList( GLcontext *ctx );
+extern void _mesa_EndList( void );
-extern GLuint gl_GenLists( GLcontext *ctx, GLsizei range );
+extern GLuint _mesa_GenLists( GLsizei range );
-extern GLboolean gl_IsList( GLcontext *ctx, GLuint list );
+extern GLboolean _mesa_IsList( GLuint list );
-extern void gl_ListBase( GLcontext *ctx, GLuint base );
+extern void _mesa_ListBase( GLuint base );
-extern void gl_NewList( GLcontext *ctx, GLuint list, GLenum mode );
+extern void _mesa_NewList( GLuint list, GLenum mode );
-extern void gl_init_dlist_pointers( struct gl_api_table *table );
+extern void _mesa_init_dlist_table( struct _glapi_table *table );
extern void gl_compile_cassette( GLcontext *ctx );
diff --git a/xc/extras/Mesa/src/dotprod_tmp.h b/xc/extras/Mesa/src/dotprod_tmp.h
index 581de51c7..28e4fb5fb 100644
--- a/xc/extras/Mesa/src/dotprod_tmp.h
+++ b/xc/extras/Mesa/src/dotprod_tmp.h
@@ -1,4 +1,4 @@
-/* $Id: dotprod_tmp.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: dotprod_tmp.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/drawpix.c b/xc/extras/Mesa/src/drawpix.c
index 7f76d1f17..c8a5853ec 100644
--- a/xc/extras/Mesa/src/drawpix.c
+++ b/xc/extras/Mesa/src/drawpix.c
@@ -1,8 +1,8 @@
-/* $Id: drawpix.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: drawpix.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,19 +25,10 @@
*/
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "drawpix.h"
#include "feedback.h"
@@ -53,23 +44,62 @@
-/* TODO: apply texture mapping to fragments */
+/*
+ * Given the dest position, size and skipPixels and skipRows values
+ * for a glDrawPixels command, perform clipping of the image bounds
+ * so the result lies withing the context's buffer bounds.
+ * Return: GL_TRUE if image is ready for drawing
+ * GL_FALSE if image was completely clipped away (draw nothing)
+ */
+GLboolean
+_mesa_clip_pixelrect(const GLcontext *ctx,
+ GLint *destX, GLint *destY,
+ GLsizei *width, GLsizei *height,
+ GLint *skipPixels, GLint *skipRows)
+{
+ const GLframebuffer *buffer = ctx->DrawBuffer;
+
+ /* left clipping */
+ if (*destX < buffer->Xmin) {
+ *skipPixels += (buffer->Xmin - *destX);
+ *width -= (buffer->Xmin - *destX);
+ *destX = buffer->Xmin;
+ }
+ /* right clipping */
+ if (*destX + *width > buffer->Xmax)
+ *width -= (*destX + *width - buffer->Xmax - 1);
+
+ if (*width <= 0)
+ return GL_FALSE;
+
+ /* bottom clipping */
+ if (*destY < buffer->Ymin) {
+ *skipRows += (buffer->Ymin - *destY);
+ *height -= (buffer->Ymin - *destY);
+ *destY = buffer->Ymin;
+ }
+ /* top clipping */
+ if (*destY + *height > buffer->Ymax)
+ *height -= (*destY + *height - buffer->Ymax - 1);
+
+ if (*height <= 0)
+ return GL_TRUE;
+
+ return GL_TRUE;
+}
+
/*
- * Try to do a fast glDrawPixels. Conditions include:
- * not using a display list
- * simple pixel unpacking
- * no raster ops
- * etc....
+ * Try to do a fast and simple RGB(a) glDrawPixels.
* Return: GL_TRUE if success, GL_FALSE if slow path must be used instead
*/
-GLboolean gl_direct_DrawPixels( GLcontext *ctx,
- const struct gl_pixelstore_attrib *unpack,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels )
+static GLboolean
+simple_DrawPixels( GLcontext *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height, GLenum format, GLenum type,
+ const GLvoid *pixels )
{
+ const struct gl_pixelstore_attrib *unpack = &ctx->Unpack;
GLubyte rgb[MAX_WIDTH][3];
GLubyte rgba[MAX_WIDTH][4];
@@ -87,12 +117,10 @@ GLboolean gl_direct_DrawPixels( GLcontext *ctx,
}
/* see if device driver can do the drawpix */
- if (ctx->Driver.DrawPixels) {
- GLint x = (GLint) (ctx->Current.RasterPos[0] + 0.5F);
- GLint y = (GLint) (ctx->Current.RasterPos[1] + 0.5F);
- if ((*ctx->Driver.DrawPixels)(ctx, x, y, width, height, format, type,
- unpack, pixels))
- return GL_TRUE;
+ if (ctx->Driver.DrawPixels
+ && (*ctx->Driver.DrawPixels)(ctx, x, y, width, height, format, type,
+ unpack, pixels)) {
+ return GL_TRUE;
}
if ((ctx->RasterMask&(~(SCISSOR_BIT|WINCLIP_BIT)))==0
@@ -106,8 +134,8 @@ GLboolean gl_direct_DrawPixels( GLcontext *ctx,
&& !unpack->SwapBytes
&& !unpack->LsbFirst) {
- GLint destX = (GLint) (ctx->Current.RasterPos[0] + 0.5F);
- GLint destY = (GLint) (ctx->Current.RasterPos[1] + 0.5F);
+ GLint destX = x;
+ GLint destY = y;
GLint drawWidth = width; /* actual width drawn */
GLint drawHeight = height; /* actual height drawn */
GLint skipPixels = unpack->SkipPixels;
@@ -127,26 +155,28 @@ GLboolean gl_direct_DrawPixels( GLcontext *ctx,
*/
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
/* horizontal clipping */
- if (destX < ctx->Buffer->Xmin) {
- skipPixels += (ctx->Buffer->Xmin - destX);
- drawWidth -= (ctx->Buffer->Xmin - destX);
- destX = ctx->Buffer->Xmin;
+ if (destX < ctx->DrawBuffer->Xmin) {
+ skipPixels += (ctx->DrawBuffer->Xmin - destX);
+ drawWidth -= (ctx->DrawBuffer->Xmin - destX);
+ destX = ctx->DrawBuffer->Xmin;
}
- if (destX + drawWidth > ctx->Buffer->Xmax)
- drawWidth -= (destX + drawWidth - ctx->Buffer->Xmax - 1);
+ if (destX + drawWidth > ctx->DrawBuffer->Xmax)
+ drawWidth -= (destX + drawWidth - ctx->DrawBuffer->Xmax - 1);
if (drawWidth <= 0)
return GL_TRUE;
/* vertical clipping */
- if (destY < ctx->Buffer->Ymin) {
- skipRows += (ctx->Buffer->Ymin - destY);
- drawHeight -= (ctx->Buffer->Ymin - destY);
- destY = ctx->Buffer->Ymin;
+ if (destY < ctx->DrawBuffer->Ymin) {
+ skipRows += (ctx->DrawBuffer->Ymin - destY);
+ drawHeight -= (ctx->DrawBuffer->Ymin - destY);
+ destY = ctx->DrawBuffer->Ymin;
}
- if (destY + drawHeight > ctx->Buffer->Ymax)
- drawHeight -= (destY + drawHeight - ctx->Buffer->Ymax - 1);
+ if (destY + drawHeight > ctx->DrawBuffer->Ymax)
+ drawHeight -= (destY + drawHeight - ctx->DrawBuffer->Ymax - 1);
if (drawHeight <= 0)
return GL_TRUE;
+
+ zoomY0 = 0; /* not used - silence compiler warning */
}
else {
/* setup array of fragment Z value to pass to zoom function */
@@ -364,10 +394,9 @@ GLboolean gl_direct_DrawPixels( GLcontext *ctx,
return GL_FALSE;
}
}
- else {
- /* can't do direct render, have to use slow path */
- return GL_FALSE;
- }
+
+ /* can't do a simple draw, have to use slow path */
+ return GL_FALSE;
}
@@ -375,99 +404,43 @@ GLboolean gl_direct_DrawPixels( GLcontext *ctx,
/*
* Do glDrawPixels of index pixels.
*/
-static void draw_index_pixels( GLcontext *ctx, GLint x, GLint y,
- const struct gl_image *image )
+static void
+draw_index_pixels( GLcontext *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum type, const GLvoid *pixels )
{
- GLint width, height, widthInBytes;
+ const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
const GLint desty = y;
- GLint i, j;
+ GLint row, drawWidth;
GLdepth zspan[MAX_WIDTH];
- const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
- assert(image);
- assert(image->Format == GL_COLOR_INDEX);
-
- width = image->Width;
- height = image->Height;
- if (image->Type == GL_BITMAP)
- widthInBytes = (width + 7) / 8;
- else
- widthInBytes = width;
+ drawWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width;
/* Fragment depth values */
if (ctx->Depth.Test || ctx->Fog.Enabled) {
GLdepth zval = (GLdepth) (ctx->Current.RasterPos[2] * DEPTH_SCALE);
- for (i=0;i<width;i++) {
+ GLint i;
+ for (i = 0; i < drawWidth; i++) {
zspan[i] = zval;
}
}
- /* process the image row by row */
- for (i=0;i<height;i++,y++) {
- GLuint ispan[MAX_WIDTH];
-
- /* convert to uints */
- switch (image->Type) {
- case GL_UNSIGNED_BYTE:
- {
- GLubyte *src = (GLubyte *) image->Data + i * width;
- for (j=0;j<width;j++) {
- ispan[j] = (GLuint) *src++;
- }
- }
- break;
- case GL_FLOAT:
- {
- GLfloat *src = (GLfloat *) image->Data + i * width;
- for (j=0;j<width;j++) {
- ispan[j] = (GLuint) (GLint) *src++;
- }
- }
- break;
- case GL_BITMAP:
- {
- GLubyte *src = (GLubyte *) image->Data + i * widthInBytes;
- for (j=0;j<width;j++) {
- ispan[j] = ( src[j >> 3] >> (7 - (j & 0x7)) ) & 1;
- }
- }
- break;
- default:
- gl_problem( ctx, "draw_index_pixels type" );
- return;
- }
-
- /* apply shift and offset */
- if (ctx->Pixel.IndexOffset || ctx->Pixel.IndexShift) {
- gl_shift_and_offset_ci( ctx, width, ispan );
- }
-
- if (ctx->Visual->RGBAflag) {
- /* Convert index to RGBA and write to frame buffer */
- GLubyte rgba[MAX_WIDTH][4];
- gl_map_ci_to_rgba( ctx, width, ispan, rgba );
- if (zoom) {
- gl_write_zoomed_rgba_span( ctx, width, x, y, zspan,
- (const GLubyte (*)[4])rgba, desty );
- }
- else {
- gl_write_rgba_span( ctx, width, x, y, zspan, rgba, GL_BITMAP );
- }
+ /*
+ * General solution
+ */
+ for (row = 0; row < height; row++, y++) {
+ GLuint indexes[MAX_WIDTH];
+ const GLvoid *source = gl_pixel_addr_in_image(&ctx->Unpack,
+ pixels, width, height, GL_COLOR_INDEX, type, 0, row, 0);
+ _mesa_unpack_index_span(ctx, drawWidth, GL_UNSIGNED_INT, indexes,
+ type, source, &ctx->Unpack, GL_TRUE);
+ if (zoom) {
+ gl_write_zoomed_index_span(ctx, drawWidth, x, y, zspan, indexes, desty);
}
else {
- /* optionally apply index map then write to frame buffer */
- if (ctx->Pixel.MapColorFlag) {
- gl_map_ci(ctx, width, ispan);
- }
- if (zoom) {
- gl_write_zoomed_index_span( ctx, width, x, y, zspan, ispan, desty );
- }
- else {
- gl_write_index_span( ctx, width, x, y, zspan, ispan, GL_BITMAP );
- }
+ gl_write_index_span(ctx, drawWidth, x, y, zspan, indexes, GL_BITMAP);
}
}
-
}
@@ -476,83 +449,44 @@ static void draw_index_pixels( GLcontext *ctx, GLint x, GLint y,
* Do glDrawPixels of stencil image. The image datatype may either
* be GLubyte or GLbitmap.
*/
-static void draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y,
- const struct gl_image *image )
+static void
+draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum type, const GLvoid *pixels )
{
- GLint widthInBytes, width, height;
- const GLint desty = y;
- GLint i;
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
-
- if (image->Type != GL_BYTE &&
- image->Type != GL_UNSIGNED_BYTE &&
- image->Type != GL_SHORT &&
- image->Type != GL_UNSIGNED_SHORT &&
- image->Type != GL_INT &&
- image->Type != GL_UNSIGNED_INT &&
- image->Type != GL_FLOAT &&
- image->Type != GL_BITMAP) {
- gl_error( ctx, GL_INVALID_OPERATION, "glDrawPixels(stencil type)");
+ const GLint desty = y;
+ GLint row, drawWidth;
+
+ if (type != GL_BYTE &&
+ type != GL_UNSIGNED_BYTE &&
+ type != GL_SHORT &&
+ type != GL_UNSIGNED_SHORT &&
+ type != GL_INT &&
+ type != GL_UNSIGNED_INT &&
+ type != GL_FLOAT &&
+ type != GL_BITMAP) {
+ gl_error( ctx, GL_INVALID_ENUM, "glDrawPixels(stencil type)");
return;
}
- assert(image);
- assert(image->Format == GL_STENCIL_INDEX);
- assert(image->Type == GL_UNSIGNED_BYTE || image->Type == GL_BITMAP);
-
- if (image->Type == GL_UNSIGNED_BYTE)
- widthInBytes = image->Width;
- else
- widthInBytes = (image->Width + 7) / 8;
- width = image->Width;
- height = image->Height;
-
- /* process the image row by row */
- for (i=0;i<height;i++,y++) {
- GLstencil *src = (GLstencil*)image->Data + i * widthInBytes;
- GLstencil *stencilValues;
- GLstencil stencilCopy[MAX_WIDTH];
-
- if (image->Type == GL_BITMAP) {
- /* convert bitmap data to GLubyte (0 or 1) data */
- GLint j;
- for (j = 0; j < width; j++) {
- stencilCopy[j] = ( src[j >> 3] >> (7 - (j & 0x7)) ) & 1;
- }
- src = stencilCopy;
- }
+ drawWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width;
- if (ctx->Pixel.IndexOffset || ctx->Pixel.IndexShift
- || ctx->Pixel.MapStencilFlag) {
+ for (row = 0; row < height; row++, y++) {
+ GLstencil values[MAX_WIDTH];
+ GLenum destType = (sizeof(GLstencil) == sizeof(GLubyte))
+ ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT;
+ const GLvoid *source = gl_pixel_addr_in_image(&ctx->Unpack,
+ pixels, width, height, GL_COLOR_INDEX, type, 0, row, 0);
+ _mesa_unpack_index_span(ctx, drawWidth, destType, values,
+ type, source, &ctx->Unpack, GL_TRUE);
- /* make copy of stencil values */
- if (src != stencilCopy)
- MEMCPY( stencilCopy, src, width * sizeof(GLstencil));
-
- /* apply shift and offset */
- if (ctx->Pixel.IndexOffset || ctx->Pixel.IndexShift) {
- gl_shift_and_offset_stencil( ctx, width, stencilCopy );
- }
-
- /* mapping */
- if (ctx->Pixel.MapStencilFlag) {
- gl_map_stencil( ctx, width, stencilCopy );
- }
-
- stencilValues = stencilCopy;
- }
- else {
- /* use stencil values in-place */
- stencilValues = src;
- }
-
- /* write stencil values to stencil buffer */
if (zoom) {
- gl_write_zoomed_stencil_span( ctx, (GLuint) width, x, y,
- stencilValues, desty );
+ gl_write_zoomed_stencil_span( ctx, (GLuint) drawWidth, x, y,
+ values, desty );
}
else {
- gl_write_stencil_span( ctx, (GLuint) width, x, y, stencilValues );
+ gl_write_stencil_span( ctx, (GLuint) drawWidth, x, y, values );
}
}
}
@@ -562,30 +496,37 @@ static void draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y,
/*
* Do a glDrawPixels of depth values.
*/
-static void draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
- const struct gl_image *image )
+static void
+draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum type, const GLvoid *pixels )
{
- GLint width, height;
+ const GLboolean bias_or_scale = ctx->Pixel.DepthBias!=0.0 || ctx->Pixel.DepthScale!=1.0;
+ const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
const GLint desty = y;
GLubyte rgba[MAX_WIDTH][4];
GLuint ispan[MAX_WIDTH];
- const GLboolean bias_or_scale = ctx->Pixel.DepthBias!=0.0 || ctx->Pixel.DepthScale!=1.0;
- const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
-
- assert(image);
- assert(image->Format == GL_DEPTH_COMPONENT);
-
- width = image->Width;
- height = image->Height;
+ GLint drawWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width;
+
+ if (type != GL_UNSIGNED_BYTE
+ && type != GL_UNSIGNED_BYTE
+ && type != GL_UNSIGNED_SHORT
+ && type != GL_UNSIGNED_SHORT
+ && type != GL_UNSIGNED_INT
+ && type != GL_UNSIGNED_INT
+ && type != GL_FLOAT) {
+ gl_error(ctx, GL_INVALID_ENUM, "glDrawPixels(type)");
+ return;
+ }
- /* Color or index */
+ /* Colors or indexes */
if (ctx->Visual->RGBAflag) {
GLint r = (GLint) (ctx->Current.RasterColor[0] * 255.0F);
GLint g = (GLint) (ctx->Current.RasterColor[1] * 255.0F);
GLint b = (GLint) (ctx->Current.RasterColor[2] * 255.0F);
GLint a = (GLint) (ctx->Current.RasterColor[3] * 255.0F);
GLint i;
- for (i=0; i<width; i++) {
+ for (i = 0; i < drawWidth; i++) {
rgba[i][RCOMP] = r;
rgba[i][GCOMP] = g;
rgba[i][BCOMP] = b;
@@ -594,34 +535,36 @@ static void draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
}
else {
GLint i;
- for (i=0;i<width;i++) {
+ for (i = 0; i < drawWidth; i++) {
ispan[i] = ctx->Current.RasterIndex;
}
}
- if (image->Type==GL_UNSIGNED_SHORT && sizeof(GLdepth)==sizeof(GLushort)
+ if (type==GL_UNSIGNED_SHORT && sizeof(GLdepth)==sizeof(GLushort)
&& !bias_or_scale && !zoom && ctx->Visual->RGBAflag) {
/* Special case: directly write 16-bit depth values */
- GLint j;
- for (j=0;j<height;j++,y++) {
- GLdepth *zptr = (GLdepth *) image->Data + j * width;
+ GLint row;
+ for (row = 0; row < height; row++, y++) {
+ const GLdepth *zptr = gl_pixel_addr_in_image(&ctx->Unpack,
+ pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0);
gl_write_rgba_span( ctx, width, x, y, zptr, rgba, GL_BITMAP );
}
}
- else if (image->Type==GL_UNSIGNED_INT && sizeof(GLdepth)==sizeof(GLuint)
+ else if (type==GL_UNSIGNED_INT && sizeof(GLdepth)==sizeof(GLuint)
&& !bias_or_scale && !zoom && ctx->Visual->RGBAflag) {
/* Special case: directly write 32-bit depth values */
- GLint i, j;
+ GLint i, row;
/* Compute shift value to scale 32-bit uints down to depth values. */
GLuint shift = 0;
GLuint max = MAX_DEPTH;
- while ((max&0x80000000)==0) {
+ while ((max & 0x80000000) == 0) {
max = max << 1;
shift++;
}
- for (j=0;j<height;j++,y++) {
+ for (row = 0; row < height; row++, y++) {
GLdepth zspan[MAX_WIDTH];
- GLuint *zptr = (GLuint *) image->Data + j * width;
+ const GLdepth *zptr = gl_pixel_addr_in_image(&ctx->Unpack,
+ pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0);
for (i=0;i<width;i++) {
zspan[i] = zptr[i] >> shift;
}
@@ -629,72 +572,30 @@ static void draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
}
}
else {
- /* General case (slower) */
- GLint i, j;
-
- /* process image row by row */
- for (i=0;i<height;i++,y++) {
- GLfloat depth[MAX_WIDTH];
+ /* General case */
+ GLint row;
+ for (row = 0; row < height; row++, y++) {
GLdepth zspan[MAX_WIDTH];
-
- switch (image->Type) {
- case GL_UNSIGNED_SHORT:
- {
- GLushort *src = (GLushort *) image->Data + i * width;
- for (j=0;j<width;j++) {
- depth[j] = USHORT_TO_FLOAT( *src++ );
- }
- }
- break;
- case GL_UNSIGNED_INT:
- {
- GLuint *src = (GLuint *) image->Data + i * width;
- for (j=0;j<width;j++) {
- depth[j] = UINT_TO_FLOAT( *src++ );
- }
- }
- break;
- case GL_FLOAT:
- {
- GLfloat *src = (GLfloat *) image->Data + i * width;
- for (j=0;j<width;j++) {
- depth[j] = *src++;
- }
- }
- break;
- default:
- gl_problem(ctx, "Bad type in draw_depth_pixels");
- return;
- }
-
- /* apply depth scale and bias */
- if (ctx->Pixel.DepthScale!=1.0 || ctx->Pixel.DepthBias!=0.0) {
- for (j=0;j<width;j++) {
- depth[j] = depth[j] * ctx->Pixel.DepthScale + ctx->Pixel.DepthBias;
- }
- }
-
- /* clamp depth values to [0,1] and convert from floats to integers */
- for (j=0;j<width;j++) {
- zspan[j] = (GLdepth) (CLAMP( depth[j], 0.0F, 1.0F ) * DEPTH_SCALE);
- }
-
+ const GLvoid *src = gl_pixel_addr_in_image(&ctx->Unpack,
+ pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0);
+ _mesa_unpack_depth_span( ctx, drawWidth, zspan, type, src,
+ &ctx->Unpack, GL_TRUE );
if (ctx->Visual->RGBAflag) {
if (zoom) {
- gl_write_zoomed_rgba_span( ctx, width, x, y, zspan,
- (const GLubyte (*)[4])rgba, desty );
+ gl_write_zoomed_rgba_span(ctx, width, x, y, zspan,
+ (const GLubyte (*)[4])rgba, desty);
}
else {
- gl_write_rgba_span( ctx, width, x, y, zspan, rgba, GL_BITMAP );
+ gl_write_rgba_span(ctx, width, x, y, zspan, rgba, GL_BITMAP);
}
}
else {
if (zoom) {
- gl_write_zoomed_index_span( ctx, width, x, y, zspan,
- ispan, GL_BITMAP );
+ gl_write_zoomed_index_span(ctx, width, x, y, zspan,
+ ispan, GL_BITMAP);
}
else {
- gl_write_index_span( ctx, width, x, y, zspan, ispan, GL_BITMAP );
+ gl_write_index_span(ctx, width, x, y, zspan, ispan, GL_BITMAP);
}
}
@@ -703,184 +604,71 @@ static void draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
}
-
-/* Simple unpacking parameters: */
-static struct gl_pixelstore_attrib NoUnpack = {
- 1, /* Alignment */
- 0, /* RowLength */
- 0, /* SkipPixels */
- 0, /* SkipRows */
- 0, /* ImageHeight */
- 0, /* SkipImages */
- GL_FALSE, /* SwapBytes */
- GL_FALSE /* LsbFirst */
-};
-
-
/*
* Do glDrawPixels of RGBA pixels.
*/
-static void draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
- const struct gl_image *image )
+static void
+draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type, const GLvoid *pixels )
{
- GLint width, height;
- GLint i, j;
+ const struct gl_pixelstore_attrib *unpack = &ctx->Unpack;
+ const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
const GLint desty = y;
GLdepth zspan[MAX_WIDTH];
GLboolean quickDraw;
- const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
-
- assert(image);
/* Try an optimized glDrawPixels first */
- if (gl_direct_DrawPixels(ctx, &NoUnpack, image->Width, image->Height,
- image->Format, image->Type, image->Data ))
+ if (simple_DrawPixels(ctx, x, y, width, height, format, type, pixels))
return;
- width = image->Width;
- height = image->Height;
-
/* Fragment depth values */
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * DEPTH_SCALE);
+ GLint i;
for (i=0;i<width;i++) {
zspan[i] = z;
}
}
- if (ctx->RasterMask==0 && !zoom && x>=0 && y>=0
- && x+width<=ctx->Buffer->Width && y+height<=ctx->Buffer->Height) {
+
+ if (ctx->RasterMask == 0 && !zoom
+ && x >= 0 && y >= 0
+ && x + width <= ctx->DrawBuffer->Width
+ && y + height <= ctx->DrawBuffer->Height) {
quickDraw = GL_TRUE;
}
else {
quickDraw = GL_FALSE;
}
+ /*
+ * General solution
+ */
{
- /* General solution */
- GLboolean r_flag, g_flag, b_flag, a_flag, l_flag;
- GLuint components;
GLubyte rgba[MAX_WIDTH][4];
- GLfloat rf[MAX_WIDTH];
- GLfloat gf[MAX_WIDTH];
- GLfloat bf[MAX_WIDTH];
- DEFARRAY(GLfloat,af,MAX_WIDTH);
- CHECKARRAY(af,return);
-
- r_flag = g_flag = b_flag = a_flag = l_flag = GL_FALSE;
- switch (image->Format) {
- case GL_RED:
- r_flag = GL_TRUE;
- components = 1;
- break;
- case GL_GREEN:
- g_flag = GL_TRUE;
- components = 1;
- break;
- case GL_BLUE:
- b_flag = GL_TRUE;
- components = 1;
- break;
- case GL_ALPHA:
- a_flag = GL_TRUE;
- components = 1;
- break;
- case GL_RGB:
- r_flag = g_flag = b_flag = GL_TRUE;
- components = 3;
- break;
- case GL_LUMINANCE:
- l_flag = GL_TRUE;
- components = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- l_flag = a_flag = GL_TRUE;
- components = 2;
- break;
- case GL_RGBA:
- r_flag = g_flag = b_flag = a_flag = GL_TRUE;
- components = 4;
- break;
- default:
- gl_problem(ctx, "Bad type in draw_rgba_pixels");
- goto cleanup;
- }
+ GLint row;
+ if (width > MAX_WIDTH)
+ width = MAX_WIDTH;
+ for (row = 0; row < height; row++, y++) {
+ const GLvoid *source = gl_pixel_addr_in_image(unpack,
+ pixels, width, height, format, type, 0, row, 0);
+ _mesa_unpack_ubyte_color_span(ctx, width, GL_RGBA, (void*) rgba,
+ format, type, source, unpack, GL_TRUE);
- /* process the image row by row */
- for (i=0;i<height;i++,y++) {
- /* convert to floats */
- switch (image->Type) {
- case GL_UNSIGNED_BYTE:
- {
- GLubyte *src = (GLubyte *) image->Data + i * width * components;
- for (j=0;j<width;j++) {
- if (l_flag) {
- rf[j] = gf[j] = bf[j] = UBYTE_TO_FLOAT(*src++);
- }
- else {
- rf[j] = r_flag ? UBYTE_TO_FLOAT(*src++) : 0.0;
- gf[j] = g_flag ? UBYTE_TO_FLOAT(*src++) : 0.0;
- bf[j] = b_flag ? UBYTE_TO_FLOAT(*src++) : 0.0;
- }
- af[j] = a_flag ? UBYTE_TO_FLOAT(*src++) : 1.0;
- }
- }
- break;
- case GL_FLOAT:
- {
- GLfloat *src = (GLfloat *) image->Data + i * width * components;
- for (j=0;j<width;j++) {
- if (l_flag) {
- rf[j] = gf[j] = bf[j] = *src++;
- }
- else {
- rf[j] = r_flag ? *src++ : 0.0;
- gf[j] = g_flag ? *src++ : 0.0;
- bf[j] = b_flag ? *src++ : 0.0;
- }
- af[j] = a_flag ? *src++ : 1.0;
- }
- }
- break;
- default:
- gl_problem( ctx, "draw_rgba_pixels type" );
- goto cleanup;
- }
-
- /* apply scale and bias */
- if (ctx->Pixel.ScaleOrBiasRGBA) {
- gl_scale_and_bias_color(ctx, width, rf, gf, bf, af);
- }
-
- /* apply pixel mappings */
- if (ctx->Pixel.MapColorFlag) {
- gl_map_color(ctx, width, rf, gf, bf, af);
- }
-
- /* convert to integers */
- for (j=0;j<width;j++) {
- rgba[j][RCOMP] = (GLint) (rf[j] * 255.0F);
- rgba[j][GCOMP] = (GLint) (gf[j] * 255.0F);
- rgba[j][BCOMP] = (GLint) (bf[j] * 255.0F);
- rgba[j][ACOMP] = (GLint) (af[j] * 255.0F);
- }
-
- /* write to frame buffer */
if (quickDraw) {
- (*ctx->Driver.WriteRGBASpan)( ctx, width, x, y,
- (const GLubyte (*)[4])rgba, NULL);
+ (*ctx->Driver.WriteRGBASpan)( ctx, width, x, y,
+ (CONST GLubyte (*)[]) rgba, NULL);
}
else if (zoom) {
gl_write_zoomed_rgba_span( ctx, width, x, y, zspan,
- (const GLubyte (*)[4])rgba, desty );
+ (CONST GLubyte (*)[]) rgba, desty );
}
else {
gl_write_rgba_span( ctx, (GLuint) width, x, y, zspan, rgba, GL_BITMAP);
}
}
-cleanup:
- UNDEFARRAY(af);
}
}
@@ -889,45 +677,50 @@ cleanup:
/*
* Execute glDrawPixels
*/
-void gl_DrawPixels( GLcontext* ctx, struct gl_image *image )
+void
+_mesa_DrawPixels( GLsizei width, GLsizei height,
+ GLenum format, GLenum type, const GLvoid *pixels )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDrawPixels");
-
- if (gl_image_error_test( ctx, image, "glDrawPixels" ))
- return;
-
if (ctx->RenderMode==GL_RENDER) {
GLint x, y;
- if (!ctx->Current.RasterPosValid) {
+ if (!pixels || !ctx->Current.RasterPosValid) {
return;
}
x = (GLint) (ctx->Current.RasterPos[0] + 0.5F);
y = (GLint) (ctx->Current.RasterPos[1] + 0.5F);
- switch (image->Format) {
- case GL_COLOR_INDEX:
- draw_index_pixels( ctx, x, y, image );
- break;
+ switch (format) {
case GL_STENCIL_INDEX:
- draw_stencil_pixels( ctx, x, y, image );
+ draw_stencil_pixels( ctx, x, y, width, height, type, pixels );
break;
case GL_DEPTH_COMPONENT:
- draw_depth_pixels( ctx, x, y, image );
+ draw_depth_pixels( ctx, x, y, width, height, type, pixels );
+ break;
+ case GL_COLOR_INDEX:
+ if (ctx->Visual->RGBAflag)
+ draw_index_pixels(ctx, x, y, width, height, type, pixels);
+ else
+ draw_rgba_pixels(ctx, x,y, width, height, format, type, pixels);
break;
case GL_RED:
case GL_GREEN:
case GL_BLUE:
case GL_ALPHA:
- case GL_RGB:
case GL_LUMINANCE:
case GL_LUMINANCE_ALPHA:
+ case GL_RGB:
+ case GL_BGR:
case GL_RGBA:
- draw_rgba_pixels( ctx, x, y, image );
+ case GL_BGRA:
+ case GL_ABGR_EXT:
+ draw_rgba_pixels(ctx, x, y, width, height, format, type, pixels);
break;
default:
- gl_error( ctx, GL_INVALID_ENUM, "glDrawPixels" );
+ gl_error( ctx, GL_INVALID_ENUM, "glDrawPixels(format)" );
return;
}
}
diff --git a/xc/extras/Mesa/src/drawpix.h b/xc/extras/Mesa/src/drawpix.h
index 4d4c74c83..2d2fc2190 100644
--- a/xc/extras/Mesa/src/drawpix.h
+++ b/xc/extras/Mesa/src/drawpix.h
@@ -1,8 +1,8 @@
-/* $Id: drawpix.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: drawpix.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef DRAWPIXELS_H
#define DRAWPIXELS_H
@@ -36,19 +33,15 @@
extern GLboolean
-gl_direct_DrawPixels( GLcontext *ctx,
- const struct gl_pixelstore_attrib *unpack,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type, const GLvoid *pixels );
-
-
-#if 000
-extern void gl_DrawPixels( GLcontext *ctx, GLsizei width, GLsizei height,
- GLenum format, GLenum type, const GLvoid *pixels );
-#endif
+_mesa_clip_pixelrect(const GLcontext *ctx,
+ GLint *destX, GLint *destY,
+ GLsizei *width, GLsizei *height,
+ GLint *skipPixels, GLint *skipRows);
-extern void gl_DrawPixels( GLcontext *ctx, struct gl_image *image );
+extern void
+_mesa_DrawPixels( GLsizei width, GLsizei height,
+ GLenum format, GLenum type, const GLvoid *pixels );
#endif
diff --git a/xc/extras/Mesa/src/enable.c b/xc/extras/Mesa/src/enable.c
index 84065cb5c..e8067b15b 100644
--- a/xc/extras/Mesa/src/enable.c
+++ b/xc/extras/Mesa/src/enable.c
@@ -1,8 +1,8 @@
-/* $Id: enable.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: enable.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,17 +25,10 @@
*/
-/* $XFree86: xc/lib/GL/mesa/src/enable.c,v 1.3 1999/04/04 00:20:23 dawes Exp $ */
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <stdio.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "enable.h"
#include "light.h"
@@ -54,7 +47,7 @@
/*
* Perform glEnable and glDisable calls.
*/
-void gl_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
+void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
{
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "gl_enable/disable" );
@@ -123,8 +116,8 @@ void gl_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
if (ctx->Light.ColorMaterialEnabled!=state) {
ctx->Light.ColorMaterialEnabled = state;
ctx->NewState |= NEW_LIGHTING;
- if (state)
- gl_update_color_material( ctx, ctx->Current.ByteColor );
+ if (state)
+ gl_update_color_material( ctx, ctx->Current.ByteColor );
}
break;
case GL_CULL_FACE:
@@ -478,22 +471,28 @@ void gl_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
-void gl_Enable( GLcontext* ctx, GLenum cap )
+void
+_mesa_Enable( GLenum cap )
{
- gl_set_enable( ctx, cap, GL_TRUE );
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_set_enable( ctx, cap, GL_TRUE );
}
-void gl_Disable( GLcontext* ctx, GLenum cap )
+void
+_mesa_Disable( GLenum cap )
{
- gl_set_enable( ctx, cap, GL_FALSE );
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_set_enable( ctx, cap, GL_FALSE );
}
-GLboolean gl_IsEnabled( GLcontext* ctx, GLenum cap )
+GLboolean
+_mesa_IsEnabled( GLenum cap )
{
+ GET_CURRENT_CONTEXT(ctx);
switch (cap) {
case GL_ALPHA_TEST:
return ctx->Color.AlphaEnabled;
@@ -656,7 +655,8 @@ GLboolean gl_IsEnabled( GLcontext* ctx, GLenum cap )
-static void gl_client_state( GLcontext *ctx, GLenum cap, GLboolean state )
+static void
+client_state( GLcontext *ctx, GLenum cap, GLboolean state )
{
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx,
(state
@@ -691,15 +691,19 @@ static void gl_client_state( GLcontext *ctx, GLenum cap, GLboolean state )
-void gl_EnableClientState( GLcontext *ctx, GLenum cap )
+void
+_mesa_EnableClientState( GLenum cap )
{
- gl_client_state( ctx, cap, GL_TRUE );
+ GET_CURRENT_CONTEXT(ctx);
+ client_state( ctx, cap, GL_TRUE );
}
-void gl_DisableClientState( GLcontext *ctx, GLenum cap )
+void
+_mesa_DisableClientState( GLenum cap )
{
- gl_client_state( ctx, cap, GL_FALSE );
+ GET_CURRENT_CONTEXT(ctx);
+ client_state( ctx, cap, GL_FALSE );
}
diff --git a/xc/extras/Mesa/src/enable.h b/xc/extras/Mesa/src/enable.h
index cd3875436..d52684708 100644
--- a/xc/extras/Mesa/src/enable.h
+++ b/xc/extras/Mesa/src/enable.h
@@ -1,8 +1,8 @@
-/* $Id: enable.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: enable.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef ENABLE_H
#define ENABLE_H
@@ -35,17 +32,23 @@
#include "types.h"
-extern void gl_set_enable( GLcontext* ctx, GLenum cap, GLboolean state );
+extern void
+_mesa_set_enable( GLcontext* ctx, GLenum cap, GLboolean state );
-extern void gl_Disable( GLcontext* ctx, GLenum cap );
+extern void
+_mesa_Disable( GLenum cap );
-extern void gl_Enable( GLcontext* ctx, GLenum cap );
+extern void
+_mesa_Enable( GLenum cap );
-extern GLboolean gl_IsEnabled( GLcontext* ctx, GLenum cap );
+extern GLboolean
+_mesa_IsEnabled( GLenum cap );
-extern void gl_EnableClientState( GLcontext *ctx, GLenum cap );
+extern void
+_mesa_EnableClientState( GLenum cap );
-extern void gl_DisableClientState( GLcontext *ctx, GLenum cap );
+extern void
+_mesa_DisableClientState( GLenum cap );
#endif
diff --git a/xc/extras/Mesa/src/enums.c b/xc/extras/Mesa/src/enums.c
index 7a3466ec3..1979abd3f 100644
--- a/xc/extras/Mesa/src/enums.c
+++ b/xc/extras/Mesa/src/enums.c
@@ -1,8 +1,8 @@
-/* $Id: enums.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: enums.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -24,16 +24,14 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifndef XFree86Server
-#include <stdlib.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
-#include "GL/gl.h"
+#ifdef PC_HEADER
+#include "all.h"
+#else
+#include "glheader.h"
#include "enums.h"
-#include "macros.h"
+#include "mem.h"
+#endif
typedef struct {
diff --git a/xc/extras/Mesa/src/enums.h b/xc/extras/Mesa/src/enums.h
index 41017d7be..87d5dd77c 100644
--- a/xc/extras/Mesa/src/enums.h
+++ b/xc/extras/Mesa/src/enums.h
@@ -1,4 +1,4 @@
-/* $Id: enums.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: enums.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/eval.c b/xc/extras/Mesa/src/eval.c
index b4a83045b..0e7f32f72 100644
--- a/xc/extras/Mesa/src/eval.c
+++ b/xc/extras/Mesa/src/eval.c
@@ -1,10 +1,10 @@
-/* $Id: eval.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: eval.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -41,16 +41,11 @@
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "eval.h"
#include "macros.h"
+#include "mem.h"
#include "mmath.h"
#include "types.h"
#include "vbcull.h"
@@ -528,9 +523,9 @@ de_casteljau_surf(GLfloat *cn, GLfloat *out, GLfloat *du, GLfloat *dv,
/*
* Return the number of components per control point for any type of
* evaluator. Return 0 if bad target.
+ * See table 5.1 in the OpenGL 1.2 spec.
*/
-
-static GLint components( GLenum target )
+GLuint _mesa_evaluator_components( GLenum target )
{
switch (target) {
case GL_MAP1_VERTEX_3: return 3;
@@ -568,12 +563,11 @@ static GLint components( GLenum target )
* Return: pointer to buffer of contiguous control points or NULL if out
* of memory.
*/
-GLfloat *gl_copy_map_points1f( GLenum target,
- GLint ustride, GLint uorder,
+GLfloat *gl_copy_map_points1f( GLenum target, GLint ustride, GLint uorder,
const GLfloat *points )
{
GLfloat *buffer, *p;
- GLint i, k, size = components(target);
+ GLint i, k, size = _mesa_evaluator_components(target);
if (!points || size==0) {
return NULL;
@@ -594,12 +588,11 @@ GLfloat *gl_copy_map_points1f( GLenum target,
/*
* Same as above but convert doubles to floats.
*/
-GLfloat *gl_copy_map_points1d( GLenum target,
- GLint ustride, GLint uorder,
- const GLdouble *points )
+GLfloat *gl_copy_map_points1d( GLenum target, GLint ustride, GLint uorder,
+ const GLdouble *points )
{
GLfloat *buffer, *p;
- GLint i, k, size = components(target);
+ GLint i, k, size = _mesa_evaluator_components(target);
if (!points || size==0) {
return NULL;
@@ -628,15 +621,15 @@ GLfloat *gl_copy_map_points1d( GLenum target,
* of memory.
*/
GLfloat *gl_copy_map_points2f( GLenum target,
- GLint ustride, GLint uorder,
- GLint vstride, GLint vorder,
- const GLfloat *points )
+ GLint ustride, GLint uorder,
+ GLint vstride, GLint vorder,
+ const GLfloat *points )
{
GLfloat *buffer, *p;
GLint i, j, k, size, dsize, hsize;
GLint uinc;
- size = components(target);
+ size = _mesa_evaluator_components(target);
if (!points || size==0) {
return NULL;
@@ -679,7 +672,7 @@ GLfloat *gl_copy_map_points2d(GLenum target,
GLint i, j, k, size, hsize, dsize;
GLint uinc;
- size = components(target);
+ size = _mesa_evaluator_components(target);
if (!points || size==0) {
return NULL;
@@ -709,6 +702,7 @@ GLfloat *gl_copy_map_points2d(GLenum target,
}
+#if 00
/*
* This function is called by the display list deallocator function to
* specify that a given set of control points are no longer needed.
@@ -804,6 +798,7 @@ void gl_free_control_points( GLcontext* ctx, GLenum target, GLfloat *data )
}
}
+#endif
@@ -813,154 +808,130 @@ void gl_free_control_points( GLcontext* ctx, GLenum target, GLfloat *data )
/*
- * Note that the array of control points must be 'unpacked' at this time.
- * Input: retain - if TRUE, this control point data is also in a display
- * list and can't be freed until the list is freed.
+ * This does the work of glMap1[fd].
*/
-void gl_Map1f( GLcontext* ctx, GLenum target,
- GLfloat u1, GLfloat u2, GLint stride,
- GLint order, const GLfloat *points, GLboolean retain )
+static void
+map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
+ GLint uorder, const GLvoid *points, GLenum type )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint k;
-
- if (!points) {
- gl_error( ctx, GL_OUT_OF_MEMORY, "glMap1f" );
- return;
- }
-
- /* may be a new stride after copying control points */
- stride = components( target );
+ GLfloat *pnts;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMap1");
- if (u1==u2) {
+ assert(type == GL_FLOAT || type == GL_DOUBLE);
+
+ if (u1 == u2) {
gl_error( ctx, GL_INVALID_VALUE, "glMap1(u1,u2)" );
return;
}
-
- if (order<1 || order>MAX_EVAL_ORDER) {
+ if (uorder < 1 || uorder > MAX_EVAL_ORDER) {
gl_error( ctx, GL_INVALID_VALUE, "glMap1(order)" );
return;
}
+ if (!points) {
+ gl_error( ctx, GL_INVALID_VALUE, "glMap1(points)" );
+ return;
+ }
- k = components( target );
- if (k==0) {
+ k = _mesa_evaluator_components( target );
+ if (k == 0) {
gl_error( ctx, GL_INVALID_ENUM, "glMap1(target)" );
}
- if (stride < k) {
+ if (ustride < k) {
gl_error( ctx, GL_INVALID_VALUE, "glMap1(stride)" );
return;
}
+ /* make copy of the control points */
+ if (type == GL_FLOAT)
+ pnts = gl_copy_map_points1f(target, ustride, uorder, (GLfloat*) points);
+ else
+ pnts = gl_copy_map_points1d(target, ustride, uorder, (GLdouble*) points);
+
switch (target) {
case GL_MAP1_VERTEX_3:
- ctx->EvalMap.Map1Vertex3.Order = order;
+ ctx->EvalMap.Map1Vertex3.Order = uorder;
ctx->EvalMap.Map1Vertex3.u1 = u1;
ctx->EvalMap.Map1Vertex3.u2 = u2;
ctx->EvalMap.Map1Vertex3.du = 1.0 / (u2 - u1);
- if (ctx->EvalMap.Map1Vertex3.Points
- && !ctx->EvalMap.Map1Vertex3.Retain) {
+ if (ctx->EvalMap.Map1Vertex3.Points)
FREE( ctx->EvalMap.Map1Vertex3.Points );
- }
- ctx->EvalMap.Map1Vertex3.Points = (GLfloat *) points;
- ctx->EvalMap.Map1Vertex3.Retain = retain;
+ ctx->EvalMap.Map1Vertex3.Points = pnts;
break;
case GL_MAP1_VERTEX_4:
- ctx->EvalMap.Map1Vertex4.Order = order;
+ ctx->EvalMap.Map1Vertex4.Order = uorder;
ctx->EvalMap.Map1Vertex4.u1 = u1;
ctx->EvalMap.Map1Vertex4.u2 = u2;
ctx->EvalMap.Map1Vertex4.du = 1.0 / (u2 - u1);
- if (ctx->EvalMap.Map1Vertex4.Points
- && !ctx->EvalMap.Map1Vertex4.Retain) {
+ if (ctx->EvalMap.Map1Vertex4.Points)
FREE( ctx->EvalMap.Map1Vertex4.Points );
- }
- ctx->EvalMap.Map1Vertex4.Points = (GLfloat *) points;
- ctx->EvalMap.Map1Vertex4.Retain = retain;
+ ctx->EvalMap.Map1Vertex4.Points = pnts;
break;
case GL_MAP1_INDEX:
- ctx->EvalMap.Map1Index.Order = order;
+ ctx->EvalMap.Map1Index.Order = uorder;
ctx->EvalMap.Map1Index.u1 = u1;
ctx->EvalMap.Map1Index.u2 = u2;
ctx->EvalMap.Map1Index.du = 1.0 / (u2 - u1);
- if (ctx->EvalMap.Map1Index.Points
- && !ctx->EvalMap.Map1Index.Retain) {
+ if (ctx->EvalMap.Map1Index.Points)
FREE( ctx->EvalMap.Map1Index.Points );
- }
- ctx->EvalMap.Map1Index.Points = (GLfloat *) points;
- ctx->EvalMap.Map1Index.Retain = retain;
+ ctx->EvalMap.Map1Index.Points = pnts;
break;
case GL_MAP1_COLOR_4:
- ctx->EvalMap.Map1Color4.Order = order;
+ ctx->EvalMap.Map1Color4.Order = uorder;
ctx->EvalMap.Map1Color4.u1 = u1;
ctx->EvalMap.Map1Color4.u2 = u2;
ctx->EvalMap.Map1Color4.du = 1.0 / (u2 - u1);
- if (ctx->EvalMap.Map1Color4.Points
- && !ctx->EvalMap.Map1Color4.Retain) {
+ if (ctx->EvalMap.Map1Color4.Points)
FREE( ctx->EvalMap.Map1Color4.Points );
- }
- ctx->EvalMap.Map1Color4.Points = (GLfloat *) points;
- ctx->EvalMap.Map1Color4.Retain = retain;
+ ctx->EvalMap.Map1Color4.Points = pnts;
break;
case GL_MAP1_NORMAL:
- ctx->EvalMap.Map1Normal.Order = order;
+ ctx->EvalMap.Map1Normal.Order = uorder;
ctx->EvalMap.Map1Normal.u1 = u1;
ctx->EvalMap.Map1Normal.u2 = u2;
ctx->EvalMap.Map1Normal.du = 1.0 / (u2 - u1);
- if (ctx->EvalMap.Map1Normal.Points
- && !ctx->EvalMap.Map1Normal.Retain) {
+ if (ctx->EvalMap.Map1Normal.Points)
FREE( ctx->EvalMap.Map1Normal.Points );
- }
- ctx->EvalMap.Map1Normal.Points = (GLfloat *) points;
- ctx->EvalMap.Map1Normal.Retain = retain;
+ ctx->EvalMap.Map1Normal.Points = pnts;
break;
case GL_MAP1_TEXTURE_COORD_1:
- ctx->EvalMap.Map1Texture1.Order = order;
+ ctx->EvalMap.Map1Texture1.Order = uorder;
ctx->EvalMap.Map1Texture1.u1 = u1;
ctx->EvalMap.Map1Texture1.u2 = u2;
ctx->EvalMap.Map1Texture1.du = 1.0 / (u2 - u1);
- if (ctx->EvalMap.Map1Texture1.Points
- && !ctx->EvalMap.Map1Texture1.Retain) {
+ if (ctx->EvalMap.Map1Texture1.Points)
FREE( ctx->EvalMap.Map1Texture1.Points );
- }
- ctx->EvalMap.Map1Texture1.Points = (GLfloat *) points;
- ctx->EvalMap.Map1Texture1.Retain = retain;
+ ctx->EvalMap.Map1Texture1.Points = pnts;
break;
case GL_MAP1_TEXTURE_COORD_2:
- ctx->EvalMap.Map1Texture2.Order = order;
+ ctx->EvalMap.Map1Texture2.Order = uorder;
ctx->EvalMap.Map1Texture2.u1 = u1;
ctx->EvalMap.Map1Texture2.u2 = u2;
ctx->EvalMap.Map1Texture2.du = 1.0 / (u2 - u1);
- if (ctx->EvalMap.Map1Texture2.Points
- && !ctx->EvalMap.Map1Texture2.Retain) {
+ if (ctx->EvalMap.Map1Texture2.Points)
FREE( ctx->EvalMap.Map1Texture2.Points );
- }
- ctx->EvalMap.Map1Texture2.Points = (GLfloat *) points;
- ctx->EvalMap.Map1Texture2.Retain = retain;
+ ctx->EvalMap.Map1Texture2.Points = pnts;
break;
case GL_MAP1_TEXTURE_COORD_3:
- ctx->EvalMap.Map1Texture3.Order = order;
+ ctx->EvalMap.Map1Texture3.Order = uorder;
ctx->EvalMap.Map1Texture3.u1 = u1;
ctx->EvalMap.Map1Texture3.u2 = u2;
ctx->EvalMap.Map1Texture3.du = 1.0 / (u2 - u1);
- if (ctx->EvalMap.Map1Texture3.Points
- && !ctx->EvalMap.Map1Texture3.Retain) {
+ if (ctx->EvalMap.Map1Texture3.Points)
FREE( ctx->EvalMap.Map1Texture3.Points );
- }
- ctx->EvalMap.Map1Texture3.Points = (GLfloat *) points;
- ctx->EvalMap.Map1Texture3.Retain = retain;
+ ctx->EvalMap.Map1Texture3.Points = pnts;
break;
case GL_MAP1_TEXTURE_COORD_4:
- ctx->EvalMap.Map1Texture4.Order = order;
+ ctx->EvalMap.Map1Texture4.Order = uorder;
ctx->EvalMap.Map1Texture4.u1 = u1;
ctx->EvalMap.Map1Texture4.u2 = u2;
ctx->EvalMap.Map1Texture4.du = 1.0 / (u2 - u1);
- if (ctx->EvalMap.Map1Texture4.Points
- && !ctx->EvalMap.Map1Texture4.Retain) {
+ if (ctx->EvalMap.Map1Texture4.Points)
FREE( ctx->EvalMap.Map1Texture4.Points );
- }
- ctx->EvalMap.Map1Texture4.Points = (GLfloat *) points;
- ctx->EvalMap.Map1Texture4.Retain = retain;
+ ctx->EvalMap.Map1Texture4.Points = pnts;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glMap1(target)" );
@@ -969,18 +940,30 @@ void gl_Map1f( GLcontext* ctx, GLenum target,
+void
+_mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride,
+ GLint order, const GLfloat *points )
+{
+ map1(target, u1, u2, stride, order, points, GL_FLOAT);
+}
-/*
- * Note that the array of control points must be 'unpacked' at this time.
- * Input: retain - if TRUE, this control point data is also in a display
- * list and can't be freed until the list is freed.
- */
-void gl_Map2f( GLcontext* ctx, GLenum target,
- GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
- GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
- const GLfloat *points, GLboolean retain )
+
+void
+_mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride,
+ GLint order, const GLdouble *points )
{
+ map1(target, u1, u2, stride, order, points, GL_DOUBLE);
+}
+
+
+static void
+map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
+ GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
+ const GLvoid *points, GLenum type )
+{
+ GET_CURRENT_CONTEXT(ctx);
GLint k;
+ GLfloat *pnts;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMap2");
@@ -1004,7 +987,7 @@ void gl_Map2f( GLcontext* ctx, GLenum target,
return;
}
- k = components( target );
+ k = _mesa_evaluator_components( target );
if (k==0) {
gl_error( ctx, GL_INVALID_ENUM, "glMap2(target)" );
}
@@ -1018,6 +1001,14 @@ void gl_Map2f( GLcontext* ctx, GLenum target,
return;
}
+ /* make copy of the control points */
+ if (type == GL_FLOAT)
+ pnts = gl_copy_map_points2f(target, ustride, uorder,
+ vstride, vorder, (GLfloat*) points);
+ else
+ pnts = gl_copy_map_points2d(target, ustride, uorder,
+ vstride, vorder, (GLdouble*) points);
+
switch (target) {
case GL_MAP2_VERTEX_3:
ctx->EvalMap.Map2Vertex3.Uorder = uorder;
@@ -1028,12 +1019,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target,
ctx->EvalMap.Map2Vertex3.v1 = v1;
ctx->EvalMap.Map2Vertex3.v2 = v2;
ctx->EvalMap.Map2Vertex3.dv = 1.0 / (v2 - v1);
- if (ctx->EvalMap.Map2Vertex3.Points
- && !ctx->EvalMap.Map2Vertex3.Retain) {
+ if (ctx->EvalMap.Map2Vertex3.Points)
FREE( ctx->EvalMap.Map2Vertex3.Points );
- }
- ctx->EvalMap.Map2Vertex3.Retain = retain;
- ctx->EvalMap.Map2Vertex3.Points = (GLfloat *) points;
+ ctx->EvalMap.Map2Vertex3.Points = pnts;
break;
case GL_MAP2_VERTEX_4:
ctx->EvalMap.Map2Vertex4.Uorder = uorder;
@@ -1044,12 +1032,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target,
ctx->EvalMap.Map2Vertex4.v1 = v1;
ctx->EvalMap.Map2Vertex4.v2 = v2;
ctx->EvalMap.Map2Vertex4.dv = 1.0 / (v2 - v1);
- if (ctx->EvalMap.Map2Vertex4.Points
- && !ctx->EvalMap.Map2Vertex4.Retain) {
+ if (ctx->EvalMap.Map2Vertex4.Points)
FREE( ctx->EvalMap.Map2Vertex4.Points );
- }
- ctx->EvalMap.Map2Vertex4.Points = (GLfloat *) points;
- ctx->EvalMap.Map2Vertex4.Retain = retain;
+ ctx->EvalMap.Map2Vertex4.Points = pnts;
break;
case GL_MAP2_INDEX:
ctx->EvalMap.Map2Index.Uorder = uorder;
@@ -1060,12 +1045,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target,
ctx->EvalMap.Map2Index.v1 = v1;
ctx->EvalMap.Map2Index.v2 = v2;
ctx->EvalMap.Map2Index.dv = 1.0 / (v2 - v1);
- if (ctx->EvalMap.Map2Index.Points
- && !ctx->EvalMap.Map2Index.Retain) {
+ if (ctx->EvalMap.Map2Index.Points)
FREE( ctx->EvalMap.Map2Index.Points );
- }
- ctx->EvalMap.Map2Index.Retain = retain;
- ctx->EvalMap.Map2Index.Points = (GLfloat *) points;
+ ctx->EvalMap.Map2Index.Points = pnts;
break;
case GL_MAP2_COLOR_4:
ctx->EvalMap.Map2Color4.Uorder = uorder;
@@ -1076,12 +1058,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target,
ctx->EvalMap.Map2Color4.v1 = v1;
ctx->EvalMap.Map2Color4.v2 = v2;
ctx->EvalMap.Map2Color4.dv = 1.0 / (v2 - v1);
- if (ctx->EvalMap.Map2Color4.Points
- && !ctx->EvalMap.Map2Color4.Retain) {
+ if (ctx->EvalMap.Map2Color4.Points)
FREE( ctx->EvalMap.Map2Color4.Points );
- }
- ctx->EvalMap.Map2Color4.Retain = retain;
- ctx->EvalMap.Map2Color4.Points = (GLfloat *) points;
+ ctx->EvalMap.Map2Color4.Points = pnts;
break;
case GL_MAP2_NORMAL:
ctx->EvalMap.Map2Normal.Uorder = uorder;
@@ -1092,12 +1071,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target,
ctx->EvalMap.Map2Normal.v1 = v1;
ctx->EvalMap.Map2Normal.v2 = v2;
ctx->EvalMap.Map2Normal.dv = 1.0 / (v2 - v1);
- if (ctx->EvalMap.Map2Normal.Points
- && !ctx->EvalMap.Map2Normal.Retain) {
+ if (ctx->EvalMap.Map2Normal.Points)
FREE( ctx->EvalMap.Map2Normal.Points );
- }
- ctx->EvalMap.Map2Normal.Retain = retain;
- ctx->EvalMap.Map2Normal.Points = (GLfloat *) points;
+ ctx->EvalMap.Map2Normal.Points = pnts;
break;
case GL_MAP2_TEXTURE_COORD_1:
ctx->EvalMap.Map2Texture1.Uorder = uorder;
@@ -1108,12 +1084,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target,
ctx->EvalMap.Map2Texture1.v1 = v1;
ctx->EvalMap.Map2Texture1.v2 = v2;
ctx->EvalMap.Map2Texture1.dv = 1.0 / (v2 - v1);
- if (ctx->EvalMap.Map2Texture1.Points
- && !ctx->EvalMap.Map2Texture1.Retain) {
+ if (ctx->EvalMap.Map2Texture1.Points)
FREE( ctx->EvalMap.Map2Texture1.Points );
- }
- ctx->EvalMap.Map2Texture1.Retain = retain;
- ctx->EvalMap.Map2Texture1.Points = (GLfloat *) points;
+ ctx->EvalMap.Map2Texture1.Points = pnts;
break;
case GL_MAP2_TEXTURE_COORD_2:
ctx->EvalMap.Map2Texture2.Uorder = uorder;
@@ -1124,12 +1097,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target,
ctx->EvalMap.Map2Texture2.v1 = v1;
ctx->EvalMap.Map2Texture2.v2 = v2;
ctx->EvalMap.Map2Texture2.dv = 1.0 / (v2 - v1);
- if (ctx->EvalMap.Map2Texture2.Points
- && !ctx->EvalMap.Map2Texture2.Retain) {
+ if (ctx->EvalMap.Map2Texture2.Points)
FREE( ctx->EvalMap.Map2Texture2.Points );
- }
- ctx->EvalMap.Map2Texture2.Retain = retain;
- ctx->EvalMap.Map2Texture2.Points = (GLfloat *) points;
+ ctx->EvalMap.Map2Texture2.Points = pnts;
break;
case GL_MAP2_TEXTURE_COORD_3:
ctx->EvalMap.Map2Texture3.Uorder = uorder;
@@ -1140,12 +1110,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target,
ctx->EvalMap.Map2Texture3.v1 = v1;
ctx->EvalMap.Map2Texture3.v2 = v2;
ctx->EvalMap.Map2Texture3.dv = 1.0 / (v2 - v1);
- if (ctx->EvalMap.Map2Texture3.Points
- && !ctx->EvalMap.Map2Texture3.Retain) {
+ if (ctx->EvalMap.Map2Texture3.Points)
FREE( ctx->EvalMap.Map2Texture3.Points );
- }
- ctx->EvalMap.Map2Texture3.Retain = retain;
- ctx->EvalMap.Map2Texture3.Points = (GLfloat *) points;
+ ctx->EvalMap.Map2Texture3.Points = pnts;
break;
case GL_MAP2_TEXTURE_COORD_4:
ctx->EvalMap.Map2Texture4.Uorder = uorder;
@@ -1156,12 +1123,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target,
ctx->EvalMap.Map2Texture4.v1 = v1;
ctx->EvalMap.Map2Texture4.v2 = v2;
ctx->EvalMap.Map2Texture4.dv = 1.0 / (v2 - v1);
- if (ctx->EvalMap.Map2Texture4.Points
- && !ctx->EvalMap.Map2Texture4.Retain) {
+ if (ctx->EvalMap.Map2Texture4.Points)
FREE( ctx->EvalMap.Map2Texture4.Points );
- }
- ctx->EvalMap.Map2Texture4.Retain = retain;
- ctx->EvalMap.Map2Texture4.Points = (GLfloat *) points;
+ ctx->EvalMap.Map2Texture4.Points = pnts;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glMap2(target)" );
@@ -1169,11 +1133,33 @@ void gl_Map2f( GLcontext* ctx, GLenum target,
}
-
+void
+_mesa_Map2f( GLenum target,
+ GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
+ GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
+ const GLfloat *points)
+{
+ map2(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder,
+ points, GL_FLOAT);
+}
-void gl_GetMapdv( GLcontext* ctx, GLenum target, GLenum query, GLdouble *v )
+void
+_mesa_Map2d( GLenum target,
+ GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
+ GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
+ const GLdouble *points )
{
+ map2(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder,
+ points, GL_DOUBLE);
+}
+
+
+
+void
+_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v )
+{
+ GET_CURRENT_CONTEXT(ctx);
GLint i, n;
GLfloat *data;
@@ -1443,8 +1429,10 @@ void gl_GetMapdv( GLcontext* ctx, GLenum target, GLenum query, GLdouble *v )
}
-void gl_GetMapfv( GLcontext* ctx, GLenum target, GLenum query, GLfloat *v )
+void
+_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint i, n;
GLfloat *data;
@@ -1714,8 +1702,10 @@ void gl_GetMapfv( GLcontext* ctx, GLenum target, GLenum query, GLfloat *v )
}
-void gl_GetMapiv( GLcontext* ctx, GLenum target, GLenum query, GLint *v )
+void
+_mesa_GetMapiv( GLenum target, GLenum query, GLint *v )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint i, n;
GLfloat *data;
@@ -2613,8 +2603,10 @@ void gl_eval_vb( struct vertex_buffer *VB )
}
-void gl_MapGrid1f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2 )
+void
+_mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMapGrid1f");
if (un<1) {
@@ -2628,9 +2620,18 @@ void gl_MapGrid1f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2 )
}
-void gl_MapGrid2f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2,
- GLint vn, GLfloat v1, GLfloat v2 )
+void
+_mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 )
+{
+ _mesa_MapGrid1f( un, u1, u2 );
+}
+
+
+void
+_mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2,
+ GLint vn, GLfloat v1, GLfloat v2 )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMapGrid2f");
if (un<1) {
gl_error( ctx, GL_INVALID_VALUE, "glMapGrid2f(un)" );
@@ -2651,9 +2652,187 @@ void gl_MapGrid2f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2,
}
+void
+_mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2,
+ GLint vn, GLdouble v1, GLdouble v2 )
+{
+ _mesa_MapGrid2f( un, u1, u2, vn, v1, v2 );
+}
+
+
+
+
+/* KW: If are compiling, we don't know whether eval will produce a
+ * vertex when it is run in the future. If this is pure immediate
+ * mode, eval is a noop if neither vertex map is enabled.
+ *
+ * Thus we need to have a check in the display list code or
+ * elsewhere for eval(1,2) vertices in the case where
+ * map(1,2)_vertex is disabled, and to purge those vertices from
+ * the vb. This is currently done
+ * via modifications to the cull_vb and render_vb operations, and
+ * by using the existing cullmask mechanism for all other operations.
+ */
+
+
+/* KW: Because the eval values don't become 'current', fixup will flow
+ * through these vertices, and then evaluation will write on top
+ * of the fixup results.
+ *
+ * This is a little inefficient, but at least it is correct. This
+ * could be short-circuited in the case where all vertices are
+ * eval-vertices, or more generally by a cullmask in fixup.
+ *
+ * Note: using Obj to hold eval coord data. This data is actually
+ * transformed if eval is disabled. But disabling eval & sending
+ * eval coords is stupid, right?
+ */
+
+
+#define EVALCOORD1(IM, x) \
+{ \
+ GLuint count = IM->Count++; \
+ IM->Flag[count] |= VERT_EVAL_C1; \
+ ASSIGN_4V(IM->Obj[count], x, 0, 0, 1); \
+ if (count == VB_MAX-1) \
+ IM->maybe_transform_vb( IM ); \
+}
+
+#define EVALCOORD2(IM, x, y) \
+{ \
+ GLuint count = IM->Count++; \
+ IM->Flag[count] |= VERT_EVAL_C2; \
+ ASSIGN_4V(IM->Obj[count], x, y, 0, 1); \
+ if (count == VB_MAX-1) \
+ IM->maybe_transform_vb( IM ); \
+}
+
+#define EVALPOINT1(IM, x) \
+{ \
+ GLuint count = IM->Count++; \
+ IM->Flag[count] |= VERT_EVAL_P1; \
+ ASSIGN_4V(IM->Obj[count], x, 0, 0, 1); \
+ if (count == VB_MAX-1) \
+ IM->maybe_transform_vb( IM ); \
+}
+
+#define EVALPOINT2(IM, x, y) \
+{ \
+ GLuint count = IM->Count++; \
+ IM->Flag[count] |= VERT_EVAL_P2; \
+ ASSIGN_4V(IM->Obj[count], x, y, 0, 1); \
+ if (count == VB_MAX-1) \
+ IM->maybe_transform_vb( IM ); \
+}
+
+
+/* Lame internal function:
+ */
+static void
+eval_coord1f( GLcontext *CC, GLfloat u )
+{
+ struct immediate *i = CC->input;
+ EVALCOORD1( i, u );
+}
+
+
+void
+_mesa_EvalCoord1d( GLdouble u )
+{
+ GET_IMMEDIATE;
+ EVALCOORD1( IM, (GLfloat) u );
+}
+
+
+void
+_mesa_EvalCoord1f( GLfloat u )
+{
+ GET_IMMEDIATE;
+ EVALCOORD1( IM, u );
+}
+
+
+void
+_mesa_EvalCoord1dv( const GLdouble *u )
+{
+ GET_IMMEDIATE;
+ EVALCOORD1( IM, (GLfloat) *u );
+}
+
+
+void
+_mesa_EvalCoord1fv( const GLfloat *u )
+{
+ GET_IMMEDIATE;
+ EVALCOORD1( IM, (GLfloat) *u );
+}
+
-void gl_EvalMesh1( GLcontext* ctx, GLenum mode, GLint i1, GLint i2 )
+void
+_mesa_EvalCoord2d( GLdouble u, GLdouble v )
{
+ GET_IMMEDIATE;
+ EVALCOORD2( IM, (GLfloat) u, (GLfloat) v );
+}
+
+
+void
+_mesa_EvalCoord2f( GLfloat u, GLfloat v )
+{
+ GET_IMMEDIATE;
+ EVALCOORD2( IM, u, v );
+}
+
+
+/* Lame internal function:
+ */
+static void
+eval_coord2f( GLcontext *CC, GLfloat u, GLfloat v )
+{
+ struct immediate *i = CC->input;
+ EVALCOORD2( i, u, v );
+}
+
+
+void
+_mesa_EvalCoord2dv( const GLdouble *u )
+{
+ GET_IMMEDIATE;
+ EVALCOORD2( IM, (GLfloat) u[0], (GLfloat) u[1] );
+}
+
+
+void
+_mesa_EvalCoord2fv( const GLfloat *u )
+{
+ GET_IMMEDIATE;
+ EVALCOORD2( IM, u[0], u[1] );
+}
+
+
+void
+_mesa_EvalPoint1( GLint i )
+{
+ GET_IMMEDIATE;
+ EVALPOINT1( IM, i );
+}
+
+
+void
+_mesa_EvalPoint2( GLint i, GLint j )
+{
+ GET_IMMEDIATE;
+ EVALPOINT2( IM, i, j );
+}
+
+
+
+
+
+void
+_mesa_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
+{
+ GET_CURRENT_CONTEXT(ctx);
GLint i;
GLfloat u, du;
GLenum prim;
@@ -2686,18 +2865,17 @@ void gl_EvalMesh1( GLcontext* ctx, GLenum mode, GLint i1, GLint i2 )
gl_Begin( ctx, prim );
for (i=i1;i<=i2;i++,u+=du) {
- gl_EvalCoord1f( ctx, u );
+ eval_coord1f( ctx, u );
}
gl_End(ctx);
}
-void gl_EvalMesh2( GLcontext* ctx,
- GLenum mode,
- GLint i1, GLint i2,
- GLint j1, GLint j2 )
+void
+_mesa_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint i, j;
GLfloat u, du, v, dv, v1, u1;
@@ -2720,7 +2898,7 @@ void gl_EvalMesh2( GLcontext* ctx,
gl_Begin( ctx, GL_POINTS );
for (v=v1,j=j1;j<=j2;j++,v+=dv) {
for (u=u1,i=i1;i<=i2;i++,u+=du) {
- gl_EvalCoord2f( ctx, u, v );
+ eval_coord2f( ctx, u, v );
}
}
gl_End(ctx);
@@ -2729,14 +2907,14 @@ void gl_EvalMesh2( GLcontext* ctx,
for (v=v1,j=j1;j<=j2;j++,v+=dv) {
gl_Begin( ctx, GL_LINE_STRIP );
for (u=u1,i=i1;i<=i2;i++,u+=du) {
- gl_EvalCoord2f( ctx, u, v );
+ eval_coord2f( ctx, u, v );
}
gl_End(ctx);
}
for (u=u1,i=i1;i<=i2;i++,u+=du) {
gl_Begin( ctx, GL_LINE_STRIP );
for (v=v1,j=j1;j<=j2;j++,v+=dv) {
- gl_EvalCoord2f( ctx, u, v );
+ eval_coord2f( ctx, u, v );
}
gl_End(ctx);
}
@@ -2747,8 +2925,8 @@ void gl_EvalMesh2( GLcontext* ctx,
/* can't be guaranteed to be coplanar! */
gl_Begin( ctx, GL_TRIANGLE_STRIP );
for (u=u1,i=i1;i<=i2;i++,u+=du) {
- gl_EvalCoord2f( ctx, u, v );
- gl_EvalCoord2f( ctx, u, v+dv );
+ eval_coord2f( ctx, u, v );
+ eval_coord2f( ctx, u, v+dv );
}
gl_End(ctx);
}
@@ -2758,3 +2936,6 @@ void gl_EvalMesh2( GLcontext* ctx,
return;
}
}
+
+
+
diff --git a/xc/extras/Mesa/src/eval.h b/xc/extras/Mesa/src/eval.h
index d7b0e6c3a..e745f1098 100644
--- a/xc/extras/Mesa/src/eval.h
+++ b/xc/extras/Mesa/src/eval.h
@@ -1,8 +1,8 @@
-/* $Id: eval.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: eval.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -35,6 +35,9 @@
extern void gl_init_eval( void );
+extern GLuint _mesa_evaluator_components( GLenum target );
+
+
extern void gl_free_control_points( GLcontext *ctx,
GLenum target, GLfloat *data );
@@ -58,38 +61,86 @@ extern GLfloat *gl_copy_map_points2d(GLenum target,
const GLdouble *points );
-extern void gl_Map1f( GLcontext* ctx,
- GLenum target, GLfloat u1, GLfloat u2, GLint stride,
- GLint order, const GLfloat *points, GLboolean retain );
+extern void gl_eval_vb( struct vertex_buffer *VB );
-extern void gl_Map2f( GLcontext* ctx, GLenum target,
- GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
- GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
- const GLfloat *points, GLboolean retain );
+extern void
+_mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride,
+ GLint order, const GLfloat *points );
+extern void
+_mesa_Map2f( GLenum target,
+ GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
+ GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
+ const GLfloat *points );
-extern void gl_MapGrid1f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2 );
+extern void
+_mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride,
+ GLint order, const GLdouble *points );
-extern void gl_MapGrid2f( GLcontext* ctx,
- GLint un, GLfloat u1, GLfloat u2,
- GLint vn, GLfloat v1, GLfloat v2 );
+extern void
+_mesa_Map2d( GLenum target,
+ GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
+ GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
+ const GLdouble *points );
-extern void gl_GetMapdv( GLcontext* ctx,
- GLenum target, GLenum query, GLdouble *v );
+extern void
+_mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 );
-extern void gl_GetMapfv( GLcontext* ctx,
- GLenum target, GLenum query, GLfloat *v );
+extern void
+_mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 );
-extern void gl_GetMapiv( GLcontext* ctx,
- GLenum target, GLenum query, GLint *v );
+extern void
+_mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2,
+ GLint vn, GLfloat v1, GLfloat v2 );
-extern void gl_EvalMesh1( GLcontext* ctx, GLenum mode, GLint i1, GLint i2 );
+extern void
+_mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2,
+ GLint vn, GLdouble v1, GLdouble v2 );
-extern void gl_EvalMesh2( GLcontext* ctx, GLenum mode,
- GLint i1, GLint i2, GLint j1, GLint j2 );
+extern void
+_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v );
-extern void gl_eval_vb( struct vertex_buffer *VB );
+extern void
+_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v );
+
+extern void
+_mesa_GetMapiv( GLenum target, GLenum query, GLint *v );
+
+extern void
+_mesa_EvalMesh1( GLenum mode, GLint i1, GLint i2 );
+
+extern void
+_mesa_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
+
+extern void
+_mesa_EvalCoord1d( GLdouble u );
+
+extern void
+_mesa_EvalCoord1f( GLfloat u );
+
+extern void
+_mesa_EvalCoord1dv( const GLdouble *u );
+
+extern void
+_mesa_EvalCoord1fv( const GLfloat *u );
+
+extern void
+_mesa_EvalCoord2d( GLdouble u, GLdouble v );
+
+extern void
+_mesa_EvalCoord2f( GLfloat u, GLfloat v );
+
+extern void
+_mesa_EvalCoord2dv( const GLdouble *u );
+
+extern void
+_mesa_EvalCoord2fv( const GLfloat *u );
+
+extern void
+_mesa_EvalPoint1( GLint i );
+extern void
+_mesa_EvalPoint2( GLint i, GLint j );
#endif
diff --git a/xc/extras/Mesa/src/extensions.c b/xc/extras/Mesa/src/extensions.c
index 812b0b225..13f252755 100644
--- a/xc/extras/Mesa/src/extensions.c
+++ b/xc/extras/Mesa/src/extensions.c
@@ -1,8 +1,8 @@
-/* $Id: extensions.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: extensions.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,15 +25,16 @@
*/
-#ifndef XFree86Server
-#include <stdlib.h>
+#ifdef PC_HEADER
+#include "all.h"
#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "extensions.h"
+#include "mem.h"
#include "simple_list.h"
#include "types.h"
+#endif
#define MAX_EXT_NAMELEN 80
@@ -61,7 +62,7 @@ static struct { int enabled; const char *name; } default_extensions[] = {
{ DEFAULT_ON, "GL_EXT_texture3D" },
{ ALWAYS_ENABLED, "GL_MESA_window_pos" },
{ ALWAYS_ENABLED, "GL_MESA_resize_buffers" },
- { DEFAULT_ON, "GL_EXT_shared_texture_palette" },
+ { ALWAYS_ENABLED, "GL_EXT_shared_texture_palette" },
{ ALWAYS_ENABLED, "GL_EXT_rescale_normal" },
{ ALWAYS_ENABLED, "GL_EXT_abgr" },
{ ALWAYS_ENABLED, "GL_SGIS_texture_edge_clamp" },
@@ -71,13 +72,10 @@ static struct { int enabled; const char *name; } default_extensions[] = {
{ ALWAYS_ENABLED, "GL_NV_texgen_reflection" },
{ DEFAULT_ON, "GL_PGI_misc_hints" },
{ DEFAULT_ON, "GL_EXT_compiled_vertex_array" },
- { DEFAULT_ON, "GL_EXT_clip_volume_hint" },
-
- /* These obviously won't make it before 3.3:
- */
{ DEFAULT_OFF, "GL_EXT_vertex_array_set" },
- { DEFAULT_OFF, "GL_EXT_texture_env" },
- { DEFAULT_OFF, "GL_EXT_fog_coord" },
+ { DEFAULT_ON, "GL_EXT_clip_volume_hint" },
+ { DEFAULT_ON, "GL_EXT_texture_env_add" },
+ { ALWAYS_ENABLED, "GL_ARB_tranpose_matrix" },
};
@@ -222,538 +220,3 @@ const char *gl_extensions_get_string( GLcontext *ctx )
return ctx->Extensions.ext_string;
}
-
-
-
-/*
- * Return the address of an extension function.
- * This is meant to be called by glXGetProcAddress(), wglGetProcAddress(),
- * or similar function.
- * NOTE: this function could be optimized to binary search a sorted
- * list of function names.
- */
-void (*gl_get_proc_address( const GLubyte *procName ))()
-{
- typedef void (*gl_function)();
- struct proc {
- const char *name;
- gl_function address;
- };
- static struct proc procTable[] = {
- /* OpenGL 1.0 functions */
- { "glAccum", (gl_function) glAccum },
- { "glAlphaFunc", (gl_function) glAlphaFunc },
- { "glBegin", (gl_function) glBegin },
- { "glBitmap", (gl_function) glBitmap },
- { "glAccum", (gl_function) glAccum },
- { "glAlphaFunc", (gl_function) glAlphaFunc },
- { "glBegin", (gl_function) glBegin },
- { "glBitmap", (gl_function) glBitmap },
- { "glBlendFunc", (gl_function) glBlendFunc },
- { "glCallList", (gl_function) glCallList },
- { "glCallLists", (gl_function) glCallLists },
- { "glClear", (gl_function) glClear },
- { "glClearAccum", (gl_function) glClearAccum },
- { "glClearColor", (gl_function) glClearColor },
- { "glClearDepth", (gl_function) glClearDepth },
- { "glClearIndex", (gl_function) glClearIndex },
- { "glClearStencil", (gl_function) glClearStencil },
- { "glClipPlane", (gl_function) glClipPlane },
- { "glColor3b", (gl_function) glColor3b },
- { "glColor3bv", (gl_function) glColor3bv },
- { "glColor3d", (gl_function) glColor3d },
- { "glColor3dv", (gl_function) glColor3dv },
- { "glColor3f", (gl_function) glColor3f },
- { "glColor3fv", (gl_function) glColor3fv },
- { "glColor3i", (gl_function) glColor3i },
- { "glColor3iv", (gl_function) glColor3iv },
- { "glColor3s", (gl_function) glColor3s },
- { "glColor3sv", (gl_function) glColor3sv },
- { "glColor3ub", (gl_function) glColor3ub },
- { "glColor3ubv", (gl_function) glColor3ubv },
- { "glColor3ui", (gl_function) glColor3ui },
- { "glColor3uiv", (gl_function) glColor3uiv },
- { "glColor3us", (gl_function) glColor3us },
- { "glColor3usv", (gl_function) glColor3usv },
- { "glColor4b", (gl_function) glColor4b },
- { "glColor4bv", (gl_function) glColor4bv },
- { "glColor4d", (gl_function) glColor4d },
- { "glColor4dv", (gl_function) glColor4dv },
- { "glColor4f", (gl_function) glColor4f },
- { "glColor4fv", (gl_function) glColor4fv },
- { "glColor4i", (gl_function) glColor4i },
- { "glColor4iv", (gl_function) glColor4iv },
- { "glColor4s", (gl_function) glColor4s },
- { "glColor4sv", (gl_function) glColor4sv },
- { "glColor4ub", (gl_function) glColor4ub },
- { "glColor4ubv", (gl_function) glColor4ubv },
- { "glColor4ui", (gl_function) glColor4ui },
- { "glColor4uiv", (gl_function) glColor4uiv },
- { "glColor4us", (gl_function) glColor4us },
- { "glColor4usv", (gl_function) glColor4usv },
- { "glColorMask", (gl_function) glColorMask },
- { "glColorMaterial", (gl_function) glColorMaterial },
- { "glCopyPixels", (gl_function) glCopyPixels },
- { "glCullFace", (gl_function) glCullFace },
- { "glDeleteLists", (gl_function) glDeleteLists },
- { "glDepthFunc", (gl_function) glDepthFunc },
- { "glDepthMask", (gl_function) glDepthMask },
- { "glDepthRange", (gl_function) glDepthRange },
- { "glDisable", (gl_function) glDisable },
- { "glDrawBuffer", (gl_function) glDrawBuffer },
- { "glDrawPixels", (gl_function) glDrawPixels },
- { "glEdgeFlag", (gl_function) glEdgeFlag },
- { "glEdgeFlagv", (gl_function) glEdgeFlagv },
- { "glEnable", (gl_function) glEnable },
- { "glEnd", (gl_function) glEnd },
- { "glEndList", (gl_function) glEndList },
- { "glEvalCoord1d", (gl_function) glEvalCoord1d },
- { "glEvalCoord1dv", (gl_function) glEvalCoord1dv },
- { "glEvalCoord1f", (gl_function) glEvalCoord1f },
- { "glEvalCoord1fv", (gl_function) glEvalCoord1fv },
- { "glEvalCoord2d", (gl_function) glEvalCoord2d },
- { "glEvalCoord2dv", (gl_function) glEvalCoord2dv },
- { "glEvalCoord2f", (gl_function) glEvalCoord2f },
- { "glEvalCoord2fv", (gl_function) glEvalCoord2fv },
- { "glEvalMesh1", (gl_function) glEvalMesh1 },
- { "glEvalMesh2", (gl_function) glEvalMesh2 },
- { "glEvalPoint1", (gl_function) glEvalPoint1 },
- { "glEvalPoint2", (gl_function) glEvalPoint2 },
- { "glFeedbackBuffer", (gl_function) glFeedbackBuffer },
- { "glFinish", (gl_function) glFinish },
- { "glFlush", (gl_function) glFlush },
- { "glFogf", (gl_function) glFogf },
- { "glFogfv", (gl_function) glFogfv },
- { "glFogi", (gl_function) glFogi },
- { "glFogiv", (gl_function) glFogiv },
- { "glFrontFace", (gl_function) glFrontFace },
- { "glFrustum", (gl_function) glFrustum },
- { "glGenLists", (gl_function) glGenLists },
- { "glGetBooleanv", (gl_function) glGetBooleanv },
- { "glGetClipPlane", (gl_function) glGetClipPlane },
- { "glGetDoublev", (gl_function) glGetDoublev },
- { "glGetError", (gl_function) glGetError },
- { "glGetFloatv", (gl_function) glGetFloatv },
- { "glGetIntegerv", (gl_function) glGetIntegerv },
- { "glGetLightfv", (gl_function) glGetLightfv },
- { "glGetLightiv", (gl_function) glGetLightiv },
- { "glGetMapdv", (gl_function) glGetMapdv },
- { "glGetMapfv", (gl_function) glGetMapfv },
- { "glGetMapiv", (gl_function) glGetMapiv },
- { "glGetMaterialfv", (gl_function) glGetMaterialfv },
- { "glGetMaterialiv", (gl_function) glGetMaterialiv },
- { "glGetPixelMapfv", (gl_function) glGetPixelMapfv },
- { "glGetPixelMapuiv", (gl_function) glGetPixelMapuiv },
- { "glGetPixelMapusv", (gl_function) glGetPixelMapusv },
- { "glGetPolygonStipple", (gl_function) glGetPolygonStipple },
- { "glGetString", (gl_function) glGetString },
- { "glGetTexEnvfv", (gl_function) glGetTexEnvfv },
- { "glGetTexEnviv", (gl_function) glGetTexEnviv },
- { "glGetTexGendv", (gl_function) glGetTexGendv },
- { "glGetTexGenfv", (gl_function) glGetTexGenfv },
- { "glGetTexGeniv", (gl_function) glGetTexGeniv },
- { "glGetTexImage", (gl_function) glGetTexImage },
- { "glGetTexLevelParameterfv", (gl_function) glGetTexLevelParameterfv },
- { "glGetTexLevelParameteriv", (gl_function) glGetTexLevelParameteriv },
- { "glGetTexParameterfv", (gl_function) glGetTexParameterfv },
- { "glGetTexParameteriv", (gl_function) glGetTexParameteriv },
- { "glHint", (gl_function) glHint },
- { "glIndexMask", (gl_function) glIndexMask },
- { "glIndexd", (gl_function) glIndexd },
- { "glIndexdv", (gl_function) glIndexdv },
- { "glIndexf", (gl_function) glIndexf },
- { "glIndexfv", (gl_function) glIndexfv },
- { "glIndexi", (gl_function) glIndexi },
- { "glIndexiv", (gl_function) glIndexiv },
- { "glIndexs", (gl_function) glIndexs },
- { "glIndexsv", (gl_function) glIndexsv },
- { "glInitNames", (gl_function) glInitNames },
- { "glIsEnabled", (gl_function) glIsEnabled },
- { "glIsList", (gl_function) glIsList },
- { "glLightModelf", (gl_function) glLightModelf },
- { "glLightModelfv", (gl_function) glLightModelfv },
- { "glLightModeli", (gl_function) glLightModeli },
- { "glLightModeliv", (gl_function) glLightModeliv },
- { "glLightf", (gl_function) glLightf },
- { "glLightfv", (gl_function) glLightfv },
- { "glLighti", (gl_function) glLighti },
- { "glLightiv", (gl_function) glLightiv },
- { "glLineStipple", (gl_function) glLineStipple },
- { "glLineWidth", (gl_function) glLineWidth },
- { "glListBase", (gl_function) glListBase },
- { "glLoadIdentity", (gl_function) glLoadIdentity },
- { "glLoadMatrixd", (gl_function) glLoadMatrixd },
- { "glLoadMatrixf", (gl_function) glLoadMatrixf },
- { "glLoadName", (gl_function) glLoadName },
- { "glLogicOp", (gl_function) glLogicOp },
- { "glMap1d", (gl_function) glMap1d },
- { "glMap1f", (gl_function) glMap1f },
- { "glMap2d", (gl_function) glMap2d },
- { "glMap2f", (gl_function) glMap2f },
- { "glMapGrid1d", (gl_function) glMapGrid1d },
- { "glMapGrid1f", (gl_function) glMapGrid1f },
- { "glMapGrid2d", (gl_function) glMapGrid2d },
- { "glMapGrid2f", (gl_function) glMapGrid2f },
- { "glMaterialf", (gl_function) glMaterialf },
- { "glMaterialfv", (gl_function) glMaterialfv },
- { "glMateriali", (gl_function) glMateriali },
- { "glMaterialiv", (gl_function) glMaterialiv },
- { "glMatrixMode", (gl_function) glMatrixMode },
- { "glMultMatrixd", (gl_function) glMultMatrixd },
- { "glMultMatrixf", (gl_function) glMultMatrixf },
- { "glNewList", (gl_function) glNewList },
- { "glNormal3b", (gl_function) glNormal3b },
- { "glNormal3bv", (gl_function) glNormal3bv },
- { "glNormal3d", (gl_function) glNormal3d },
- { "glNormal3dv", (gl_function) glNormal3dv },
- { "glNormal3f", (gl_function) glNormal3f },
- { "glNormal3fv", (gl_function) glNormal3fv },
- { "glNormal3i", (gl_function) glNormal3i },
- { "glNormal3iv", (gl_function) glNormal3iv },
- { "glNormal3s", (gl_function) glNormal3s },
- { "glNormal3sv", (gl_function) glNormal3sv },
- { "glOrtho", (gl_function) glOrtho },
- { "glPassThrough", (gl_function) glPassThrough },
- { "glPixelMapfv", (gl_function) glPixelMapfv },
- { "glPixelMapuiv", (gl_function) glPixelMapuiv },
- { "glPixelMapusv", (gl_function) glPixelMapusv },
- { "glPixelStoref", (gl_function) glPixelStoref },
- { "glPixelStorei", (gl_function) glPixelStorei },
- { "glPixelTransferf", (gl_function) glPixelTransferf },
- { "glPixelTransferi", (gl_function) glPixelTransferi },
- { "glPixelZoom", (gl_function) glPixelZoom },
- { "glPointSize", (gl_function) glPointSize },
- { "glPolygonMode", (gl_function) glPolygonMode },
- { "glPolygonOffset", (gl_function) glPolygonOffset },
- { "glPolygonStipple", (gl_function) glPolygonStipple },
- { "glPopAttrib", (gl_function) glPopAttrib },
- { "glPopMatrix", (gl_function) glPopMatrix },
- { "glPopName", (gl_function) glPopName },
- { "glPushAttrib", (gl_function) glPushAttrib },
- { "glPushMatrix", (gl_function) glPushMatrix },
- { "glPushName", (gl_function) glPushName },
- { "glRasterPos2d", (gl_function) glRasterPos2d },
- { "glRasterPos2dv", (gl_function) glRasterPos2dv },
- { "glRasterPos2f", (gl_function) glRasterPos2f },
- { "glRasterPos2fv", (gl_function) glRasterPos2fv },
- { "glRasterPos2i", (gl_function) glRasterPos2i },
- { "glRasterPos2iv", (gl_function) glRasterPos2iv },
- { "glRasterPos2s", (gl_function) glRasterPos2s },
- { "glRasterPos2sv", (gl_function) glRasterPos2sv },
- { "glRasterPos3d", (gl_function) glRasterPos3d },
- { "glRasterPos3dv", (gl_function) glRasterPos3dv },
- { "glRasterPos3f", (gl_function) glRasterPos3f },
- { "glRasterPos3fv", (gl_function) glRasterPos3fv },
- { "glRasterPos3i", (gl_function) glRasterPos3i },
- { "glRasterPos3iv", (gl_function) glRasterPos3iv },
- { "glRasterPos3s", (gl_function) glRasterPos3s },
- { "glRasterPos3sv", (gl_function) glRasterPos3sv },
- { "glRasterPos4d", (gl_function) glRasterPos4d },
- { "glRasterPos4dv", (gl_function) glRasterPos4dv },
- { "glRasterPos4f", (gl_function) glRasterPos4f },
- { "glRasterPos4fv", (gl_function) glRasterPos4fv },
- { "glRasterPos4i", (gl_function) glRasterPos4i },
- { "glRasterPos4iv", (gl_function) glRasterPos4iv },
- { "glRasterPos4s", (gl_function) glRasterPos4s },
- { "glRasterPos4sv", (gl_function) glRasterPos4sv },
- { "glReadBuffer", (gl_function) glReadBuffer },
- { "glReadPixels", (gl_function) glReadPixels },
- { "glRectd", (gl_function) glRectd },
- { "glRectdv", (gl_function) glRectdv },
- { "glRectf", (gl_function) glRectf },
- { "glRectfv", (gl_function) glRectfv },
- { "glRecti", (gl_function) glRecti },
- { "glRectiv", (gl_function) glRectiv },
- { "glRects", (gl_function) glRects },
- { "glRectsv", (gl_function) glRectsv },
- { "glRenderMode", (gl_function) glRenderMode },
- { "glRotated", (gl_function) glRotated },
- { "glRotatef", (gl_function) glRotatef },
- { "glScaled", (gl_function) glScaled },
- { "glScalef", (gl_function) glScalef },
- { "glScissor", (gl_function) glScissor },
- { "glSelectBuffer", (gl_function) glSelectBuffer },
- { "glShadeModel", (gl_function) glShadeModel },
- { "glStencilFunc", (gl_function) glStencilFunc },
- { "glStencilMask", (gl_function) glStencilMask },
- { "glStencilOp", (gl_function) glStencilOp },
- { "glTexCoord1d", (gl_function) glTexCoord1d },
- { "glTexCoord1dv", (gl_function) glTexCoord1dv },
- { "glTexCoord1f", (gl_function) glTexCoord1f },
- { "glTexCoord1fv", (gl_function) glTexCoord1fv },
- { "glTexCoord1i", (gl_function) glTexCoord1i },
- { "glTexCoord1iv", (gl_function) glTexCoord1iv },
- { "glTexCoord1s", (gl_function) glTexCoord1s },
- { "glTexCoord1sv", (gl_function) glTexCoord1sv },
- { "glTexCoord2d", (gl_function) glTexCoord2d },
- { "glTexCoord2dv", (gl_function) glTexCoord2dv },
- { "glTexCoord2f", (gl_function) glTexCoord2f },
- { "glTexCoord2fv", (gl_function) glTexCoord2fv },
- { "glTexCoord2i", (gl_function) glTexCoord2i },
- { "glTexCoord2iv", (gl_function) glTexCoord2iv },
- { "glTexCoord2s", (gl_function) glTexCoord2s },
- { "glTexCoord2sv", (gl_function) glTexCoord2sv },
- { "glTexCoord3d", (gl_function) glTexCoord3d },
- { "glTexCoord3dv", (gl_function) glTexCoord3dv },
- { "glTexCoord3f", (gl_function) glTexCoord3f },
- { "glTexCoord3fv", (gl_function) glTexCoord3fv },
- { "glTexCoord3i", (gl_function) glTexCoord3i },
- { "glTexCoord3iv", (gl_function) glTexCoord3iv },
- { "glTexCoord3s", (gl_function) glTexCoord3s },
- { "glTexCoord3sv", (gl_function) glTexCoord3sv },
- { "glTexCoord4d", (gl_function) glTexCoord4d },
- { "glTexCoord4dv", (gl_function) glTexCoord4dv },
- { "glTexCoord4f", (gl_function) glTexCoord4f },
- { "glTexCoord4fv", (gl_function) glTexCoord4fv },
- { "glTexCoord4i", (gl_function) glTexCoord4i },
- { "glTexCoord4iv", (gl_function) glTexCoord4iv },
- { "glTexCoord4s", (gl_function) glTexCoord4s },
- { "glTexCoord4sv", (gl_function) glTexCoord4sv },
- { "glTexEnvf", (gl_function) glTexEnvf },
- { "glTexEnvfv", (gl_function) glTexEnvfv },
- { "glTexEnvi", (gl_function) glTexEnvi },
- { "glTexEnviv", (gl_function) glTexEnviv },
- { "glTexGend", (gl_function) glTexGend },
- { "glTexGendv", (gl_function) glTexGendv },
- { "glTexGenf", (gl_function) glTexGenf },
- { "glTexGenfv", (gl_function) glTexGenfv },
- { "glTexGeni", (gl_function) glTexGeni },
- { "glTexGeniv", (gl_function) glTexGeniv },
- { "glTexImage1D", (gl_function) glTexImage1D },
- { "glTexImage2D", (gl_function) glTexImage2D },
- { "glTexParameterf", (gl_function) glTexParameterf },
- { "glTexParameterfv", (gl_function) glTexParameterfv },
- { "glTexParameteri", (gl_function) glTexParameteri },
- { "glTexParameteriv", (gl_function) glTexParameteriv },
- { "glTranslated", (gl_function) glTranslated },
- { "glTranslatef", (gl_function) glTranslatef },
- { "glVertex2d", (gl_function) glVertex2d },
- { "glVertex2dv", (gl_function) glVertex2dv },
- { "glVertex2f", (gl_function) glVertex2f },
- { "glVertex2fv", (gl_function) glVertex2fv },
- { "glVertex2i", (gl_function) glVertex2i },
- { "glVertex2iv", (gl_function) glVertex2iv },
- { "glVertex2s", (gl_function) glVertex2s },
- { "glVertex2sv", (gl_function) glVertex2sv },
- { "glVertex3d", (gl_function) glVertex3d },
- { "glVertex3dv", (gl_function) glVertex3dv },
- { "glVertex3f", (gl_function) glVertex3f },
- { "glVertex3fv", (gl_function) glVertex3fv },
- { "glVertex3i", (gl_function) glVertex3i },
- { "glVertex3iv", (gl_function) glVertex3iv },
- { "glVertex3s", (gl_function) glVertex3s },
- { "glVertex3sv", (gl_function) glVertex3sv },
- { "glVertex4d", (gl_function) glVertex4d },
- { "glVertex4dv", (gl_function) glVertex4dv },
- { "glVertex4f", (gl_function) glVertex4f },
- { "glVertex4fv", (gl_function) glVertex4fv },
- { "glVertex4i", (gl_function) glVertex4i },
- { "glVertex4iv", (gl_function) glVertex4iv },
- { "glVertex4s", (gl_function) glVertex4s },
- { "glVertex4sv", (gl_function) glVertex4sv },
- { "glViewport", (gl_function) glViewport },
-
- /* OpenGL 1.1 functions */
- { "glAreTexturesResident", (gl_function) glAreTexturesResident },
- { "glArrayElement", (gl_function) glArrayElement },
- { "glBindTexture", (gl_function) glBindTexture },
- { "glColorPointer", (gl_function) glColorPointer },
- { "glCopyTexImage1D", (gl_function) glCopyTexImage1D },
- { "glCopyTexImage2D", (gl_function) glCopyTexImage2D },
- { "glCopyTexSubImage1D", (gl_function) glCopyTexSubImage1D },
- { "glCopyTexSubImage2D", (gl_function) glCopyTexSubImage2D },
- { "glDeleteTextures", (gl_function) glDeleteTextures },
- { "glDisableClientState", (gl_function) glDisableClientState },
- { "glDrawArrays", (gl_function) glDrawArrays },
- { "glDrawElements", (gl_function) glDrawElements },
- { "glEdgeFlagPointer", (gl_function) glEdgeFlagPointer },
- { "glEnableClientState", (gl_function) glEnableClientState },
- { "glGenTextures", (gl_function) glGenTextures },
- { "glGetPointerv", (gl_function) glGetPointerv },
- { "glIndexPointer", (gl_function) glIndexPointer },
- { "glIndexub", (gl_function) glIndexub },
- { "glIndexubv", (gl_function) glIndexubv },
- { "glInterleavedArrays", (gl_function) glInterleavedArrays },
- { "glIsTexture", (gl_function) glIsTexture },
- { "glNormalPointer", (gl_function) glNormalPointer },
- { "glPopClientAttrib", (gl_function) glPopClientAttrib },
- { "glPrioritizeTextures", (gl_function) glPrioritizeTextures },
- { "glPushClientAttrib", (gl_function) glPushClientAttrib },
- { "glTexCoordPointer", (gl_function) glTexCoordPointer },
- { "glTexSubImage1D", (gl_function) glTexSubImage1D },
- { "glTexSubImage2D", (gl_function) glTexSubImage2D },
- { "glVertexPointer", (gl_function) glVertexPointer },
-
- /* OpenGL 1.2 functions */
- { "glCopyTexSubImage3D", (gl_function) glCopyTexSubImage3D },
- { "glDrawRangeElements", (gl_function) glDrawRangeElements },
- { "glTexImage3D", (gl_function) glTexImage3D },
- { "glTexSubImage3D", (gl_function) glTexSubImage3D },
-
- /* ARB_imaging functions */
- { "glBlendColor", (gl_function) glBlendColor },
- { "glBlendEquation", (gl_function) glBlendEquation },
- { "glColorSubTable", (gl_function) glColorSubTable },
- { "glColorTable", (gl_function) glColorTable },
- { "glColorTableParameterfv", (gl_function) glColorTableParameterfv },
- { "glColorTableParameteriv", (gl_function) glColorTableParameteriv },
- { "glConvolutionFilter1D", (gl_function) glConvolutionFilter1D },
- { "glConvolutionFilter2D", (gl_function) glConvolutionFilter2D },
- { "glConvolutionParameterf", (gl_function) glConvolutionParameterf },
- { "glConvolutionParameterfv", (gl_function) glConvolutionParameterfv },
- { "glConvolutionParameteri", (gl_function) glConvolutionParameteri },
- { "glConvolutionParameteriv", (gl_function) glConvolutionParameteriv },
- { "glCopyColorSubTable", (gl_function) glCopyColorSubTable },
- { "glCopyColorTable", (gl_function) glCopyColorTable },
- { "glCopyConvolutionFilter1D", (gl_function) glCopyConvolutionFilter1D },
- { "glCopyConvolutionFilter2D", (gl_function) glCopyConvolutionFilter2D },
- { "glGetColorTable", (gl_function) glGetColorTable },
- { "glGetColorTableParameterfv", (gl_function) glGetColorTableParameterfv },
- { "glGetColorTableParameteriv", (gl_function) glGetColorTableParameteriv },
- { "glGetConvolutionFilter", (gl_function) glGetConvolutionFilter },
- { "glGetConvolutionParameterfv", (gl_function) glGetConvolutionParameterfv },
- { "glGetConvolutionParameteriv", (gl_function) glGetConvolutionParameteriv },
- { "glGetHistogram", (gl_function) glGetHistogram },
- { "glGetHistogramParameterfv", (gl_function) glGetHistogramParameterfv },
- { "glGetHistogramParameteriv", (gl_function) glGetHistogramParameteriv },
- { "glGetMinmax", (gl_function) glGetMinmax },
- { "glGetMinmaxParameterfv", (gl_function) glGetMinmaxParameterfv },
- { "glGetMinmaxParameteriv", (gl_function) glGetMinmaxParameteriv },
- { "glGetSeparableFilter", (gl_function) glGetSeparableFilter },
- { "glHistogram", (gl_function) glHistogram },
- { "glMinmax", (gl_function) glMinmax },
- { "glResetHistogram", (gl_function) glResetHistogram },
- { "glResetMinmax", (gl_function) glResetMinmax },
- { "glSeparableFilter2D", (gl_function) glSeparableFilter2D },
-
- /* GL_EXT_paletted_texture */
- { "glColorTableEXT", (gl_function) glColorTableEXT },
- { "glColorSubTableEXT", (gl_function) glColorSubTableEXT },
- { "glGetColorTableEXT", (gl_function) glGetColorTableEXT },
- { "glGetColorTableParameterfvEXT", (gl_function) glGetColorTableParameterfvEXT },
- { "glGetColorTableParameterivEXT", (gl_function) glGetColorTableParameterivEXT },
-
- /* GL_EXT_compiled_vertex_array */
- { "glLockArraysEXT", (gl_function) glLockArraysEXT },
- { "glUnlockArraysEXT", (gl_function) glUnlockArraysEXT },
-
- /* GL_EXT_point_parameters */
- { "glPointParameterfEXT", (gl_function) glPointParameterfEXT },
- { "glPointParameterfvEXT", (gl_function) glPointParameterfvEXT },
-
- /* GL_EXT_polygon_offset */
- { "glPolygonOffsetEXT", (gl_function) glPolygonOffsetEXT },
-
- /* GL_EXT_blend_minmax */
- { "glBlendEquationEXT", (gl_function) glBlendEquationEXT },
-
- /* GL_EXT_blend_color */
- { "glBlendColorEXT", (gl_function) glBlendColorEXT },
-
- /* GL_EXT_vertex_arrays */
- { "glVertexPointerEXT", (gl_function) glVertexPointerEXT },
- { "glNormalPointerEXT", (gl_function) glNormalPointerEXT },
- { "glColorPointerEXT", (gl_function) glColorPointerEXT },
- { "glIndexPointerEXT", (gl_function) glIndexPointerEXT },
- { "glTexCoordPointerEXT", (gl_function) glTexCoordPointerEXT },
- { "glEdgeFlagPointerEXT", (gl_function) glEdgeFlagPointerEXT },
- { "glGetPointervEXT", (gl_function) glGetPointervEXT },
- { "glArrayElementEXT", (gl_function) glArrayElementEXT },
- { "glDrawArraysEXT", (gl_function) glDrawArraysEXT },
-
- /* GL_EXT_texture_object */
- { "glGenTexturesEXT", (gl_function) glGenTexturesEXT },
- { "glDeleteTexturesEXT", (gl_function) glDeleteTexturesEXT },
- { "glBindTextureEXT", (gl_function) glBindTextureEXT },
- { "glPrioritizeTexturesEXT", (gl_function) glPrioritizeTexturesEXT },
- { "glAreTexturesResidentEXT", (gl_function) glAreTexturesResidentEXT },
- { "glIsTextureEXT", (gl_function) glIsTextureEXT },
-
- /* GL_EXT_texture3D */
- { "glTexImage3DEXT", (gl_function) glTexImage3DEXT },
- { "glTexSubImage3DEXT", (gl_function) glTexSubImage3DEXT },
- { "glCopyTexSubImage3DEXT", (gl_function) glCopyTexSubImage3DEXT },
-
- /* GL_ARB_multitexture */
- { "glActiveTextureARB", (gl_function) glActiveTextureARB },
- { "glClientActiveTextureARB", (gl_function) glClientActiveTextureARB },
- { "glMultiTexCoord1dARB", (gl_function) glMultiTexCoord1dARB },
- { "glMultiTexCoord1dvARB", (gl_function) glMultiTexCoord1dvARB },
- { "glMultiTexCoord1fARB", (gl_function) glMultiTexCoord1fARB },
- { "glMultiTexCoord1fvARB", (gl_function) glMultiTexCoord1fvARB },
- { "glMultiTexCoord1iARB", (gl_function) glMultiTexCoord1iARB },
- { "glMultiTexCoord1ivARB", (gl_function) glMultiTexCoord1ivARB },
- { "glMultiTexCoord1sARB", (gl_function) glMultiTexCoord1sARB },
- { "glMultiTexCoord1svARB", (gl_function) glMultiTexCoord1svARB },
- { "glMultiTexCoord2dARB", (gl_function) glMultiTexCoord2dARB },
- { "glMultiTexCoord2dvARB", (gl_function) glMultiTexCoord2dvARB },
- { "glMultiTexCoord2fARB", (gl_function) glMultiTexCoord2fARB },
- { "glMultiTexCoord2fvARB", (gl_function) glMultiTexCoord2fvARB },
- { "glMultiTexCoord2iARB", (gl_function) glMultiTexCoord2iARB },
- { "glMultiTexCoord2ivARB", (gl_function) glMultiTexCoord2ivARB },
- { "glMultiTexCoord2sARB", (gl_function) glMultiTexCoord2sARB },
- { "glMultiTexCoord2svARB", (gl_function) glMultiTexCoord2svARB },
- { "glMultiTexCoord3dARB", (gl_function) glMultiTexCoord3dARB },
- { "glMultiTexCoord3dvARB", (gl_function) glMultiTexCoord3dvARB },
- { "glMultiTexCoord3fARB", (gl_function) glMultiTexCoord3fARB },
- { "glMultiTexCoord3fvARB", (gl_function) glMultiTexCoord3fvARB },
- { "glMultiTexCoord3iARB", (gl_function) glMultiTexCoord3iARB },
- { "glMultiTexCoord3ivARB", (gl_function) glMultiTexCoord3ivARB },
- { "glMultiTexCoord3sARB", (gl_function) glMultiTexCoord3sARB },
- { "glMultiTexCoord3svARB", (gl_function) glMultiTexCoord3svARB },
- { "glMultiTexCoord4dARB", (gl_function) glMultiTexCoord4dARB },
- { "glMultiTexCoord4dvARB", (gl_function) glMultiTexCoord4dvARB },
- { "glMultiTexCoord4fARB", (gl_function) glMultiTexCoord4fARB },
- { "glMultiTexCoord4fvARB", (gl_function) glMultiTexCoord4fvARB },
- { "glMultiTexCoord4iARB", (gl_function) glMultiTexCoord4iARB },
- { "glMultiTexCoord4ivARB", (gl_function) glMultiTexCoord4ivARB },
- { "glMultiTexCoord4sARB", (gl_function) glMultiTexCoord4sARB },
- { "glMultiTexCoord4svARB", (gl_function) glMultiTexCoord4svARB },
-
- /* GL_INGR_blend_func_separate */
- { "glBlendFuncSeparateINGR", (gl_function) glBlendFuncSeparateINGR },
-
- /* GL_MESA_window_pos */
- { "glWindowPos2iMESA", (gl_function) glWindowPos2iMESA },
- { "glWindowPos2sMESA", (gl_function) glWindowPos2sMESA },
- { "glWindowPos2fMESA", (gl_function) glWindowPos2fMESA },
- { "glWindowPos2dMESA", (gl_function) glWindowPos2dMESA },
- { "glWindowPos2ivMESA", (gl_function) glWindowPos2ivMESA },
- { "glWindowPos2svMESA", (gl_function) glWindowPos2svMESA },
- { "glWindowPos2fvMESA", (gl_function) glWindowPos2fvMESA },
- { "glWindowPos2dvMESA", (gl_function) glWindowPos2dvMESA },
- { "glWindowPos3iMESA", (gl_function) glWindowPos3iMESA },
- { "glWindowPos3sMESA", (gl_function) glWindowPos3sMESA },
- { "glWindowPos3fMESA", (gl_function) glWindowPos3fMESA },
- { "glWindowPos3dMESA", (gl_function) glWindowPos3dMESA },
- { "glWindowPos3ivMESA", (gl_function) glWindowPos3ivMESA },
- { "glWindowPos3svMESA", (gl_function) glWindowPos3svMESA },
- { "glWindowPos3fvMESA", (gl_function) glWindowPos3fvMESA },
- { "glWindowPos3dvMESA", (gl_function) glWindowPos3dvMESA },
- { "glWindowPos4iMESA", (gl_function) glWindowPos4iMESA },
- { "glWindowPos4sMESA", (gl_function) glWindowPos4sMESA },
- { "glWindowPos4fMESA", (gl_function) glWindowPos4fMESA },
- { "glWindowPos4dMESA", (gl_function) glWindowPos4dMESA },
- { "glWindowPos4ivMESA", (gl_function) glWindowPos4ivMESA },
- { "glWindowPos4svMESA", (gl_function) glWindowPos4svMESA },
- { "glWindowPos4fvMESA", (gl_function) glWindowPos4fvMESA },
- { "glWindowPos4dvMESA", (gl_function) glWindowPos4dvMESA },
-
- /* GL_MESA_resize_buffers */
- { "glResizeBuffersMESA", (gl_function) glResizeBuffersMESA },
-
- /* GL_EXT_compiled_vertex_array */
- { "glLockArraysEXT", (gl_function) glLockArraysEXT },
- { "glUnlockArraysEXT", (gl_function) glUnlockArraysEXT },
-
- { NULL, NULL } /* end of list token */
- };
- GLuint i;
-
- for (i = 0; procTable[i].address; i++) {
- if (strcmp((const char *) procName, procTable[i].name) == 0)
- return procTable[i].address;
- }
-
- return NULL;
-}
diff --git a/xc/extras/Mesa/src/extensions.h b/xc/extras/Mesa/src/extensions.h
index cea505c1a..763b74157 100644
--- a/xc/extras/Mesa/src/extensions.h
+++ b/xc/extras/Mesa/src/extensions.h
@@ -1,8 +1,8 @@
-/* $Id: extensions.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: extensions.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -39,15 +39,14 @@
*/
extern int gl_extensions_add( struct gl_context *ctx, int state,
const char *name, void (*notify)( void ) );
-extern GLboolean gl_extension_is_enabled( GLcontext *ctx, const char *name);
+
extern int gl_extensions_enable( struct gl_context *ctx, const char *name );
extern int gl_extensions_disable( struct gl_context *ctx, const char *name );
+extern GLboolean gl_extension_is_enabled( GLcontext *ctx, const char *name);
extern void gl_extensions_dtr( struct gl_context *ctx );
extern void gl_extensions_ctr( struct gl_context *ctx );
extern const char *gl_extensions_get_string( struct gl_context *ctx );
-extern void (*gl_get_proc_address( const GLubyte *procName ))();
-
#endif
diff --git a/xc/extras/Mesa/src/feedback.c b/xc/extras/Mesa/src/feedback.c
index ff39a4be0..b9a2b8e98 100644
--- a/xc/extras/Mesa/src/feedback.c
+++ b/xc/extras/Mesa/src/feedback.c
@@ -1,10 +1,10 @@
-/* $Id: feedback.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: feedback.c,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,18 +25,10 @@
*/
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "enums.h"
#include "feedback.h"
@@ -57,8 +49,9 @@
void
-gl_FeedbackBuffer( GLcontext *ctx, GLsizei size, GLenum type, GLfloat *buffer )
+_mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "glFeedbackBuffer" );
if (ctx->RenderMode==GL_FEEDBACK) {
@@ -114,8 +107,10 @@ gl_FeedbackBuffer( GLcontext *ctx, GLsizei size, GLenum type, GLfloat *buffer )
-void gl_PassThrough( GLcontext *ctx, GLfloat token )
+void
+_mesa_PassThrough( GLfloat token )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPassThrough");
if (ctx->RenderMode==GL_FEEDBACK) {
@@ -162,39 +157,46 @@ void gl_feedback_vertex( GLcontext *ctx,
-static void gl_do_feedback_vertex( GLcontext *ctx, GLuint v, GLuint pv )
+static void feedback_vertex( GLcontext *ctx, GLuint v, GLuint pv )
{
GLfloat win[4];
GLfloat color[4];
GLfloat tc[4];
GLuint texUnit = ctx->Texture.CurrentTransformUnit;
- struct vertex_buffer *VB = ctx->VB;
+ const struct vertex_buffer *VB = ctx->VB;
+ GLuint index;
win[0] = VB->Win.data[v][0];
win[1] = VB->Win.data[v][1];
win[2] = VB->Win.data[v][2] / DEPTH_SCALE;
win[3] = 1.0 / VB->Win.data[v][3];
- if (ctx->Light.ShadeModel==GL_SMOOTH) pv = v;
+ if (ctx->Light.ShadeModel == GL_SMOOTH)
+ pv = v;
UBYTE_RGBA_TO_FLOAT_RGBA( color, VB->ColorPtr->data[pv] );
if (VB->TexCoordPtr[texUnit]->size == 4 &&
- VB->TexCoordPtr[texUnit]->data[v][3]!=0.0)
- {
+ VB->TexCoordPtr[texUnit]->data[v][3] != 0.0) {
GLfloat invq = 1.0F / VB->TexCoordPtr[texUnit]->data[v][3];
tc[0] = VB->TexCoordPtr[texUnit]->data[v][0] * invq;
tc[1] = VB->TexCoordPtr[texUnit]->data[v][1] * invq;
tc[2] = VB->TexCoordPtr[texUnit]->data[v][2] * invq;
tc[3] = VB->TexCoordPtr[texUnit]->data[v][3];
- } else {
+ }
+ else {
ASSIGN_4V(tc, 0,0,0,1);
COPY_SZ_4V(tc,
VB->TexCoordPtr[texUnit]->size,
VB->TexCoordPtr[texUnit]->data[v]);
}
- gl_feedback_vertex( ctx, win, color, VB->IndexPtr->data[v], tc );
+ if (VB->IndexPtr)
+ index = VB->IndexPtr->data[v];
+ else
+ index = 0;
+
+ gl_feedback_vertex( ctx, win, color, index, tc );
}
@@ -209,9 +211,9 @@ void gl_feedback_triangle( GLcontext *ctx,
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_POLYGON_TOKEN );
FEEDBACK_TOKEN( ctx, (GLfloat) 3 ); /* three vertices */
- gl_do_feedback_vertex( ctx, v0, pv );
- gl_do_feedback_vertex( ctx, v1, pv );
- gl_do_feedback_vertex( ctx, v2, pv );
+ feedback_vertex( ctx, v0, pv );
+ feedback_vertex( ctx, v1, pv );
+ feedback_vertex( ctx, v2, pv );
}
}
@@ -225,8 +227,8 @@ void gl_feedback_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv )
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) token );
- gl_do_feedback_vertex( ctx, v1, pv );
- gl_do_feedback_vertex( ctx, v2, pv );
+ feedback_vertex( ctx, v1, pv );
+ feedback_vertex( ctx, v2, pv );
ctx->StippleCounter++;
}
@@ -234,14 +236,15 @@ void gl_feedback_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv )
void gl_feedback_points( GLcontext *ctx, GLuint first, GLuint last )
{
- struct vertex_buffer *VB = ctx->VB;
+ const struct vertex_buffer *VB = ctx->VB;
GLuint i;
- for (i=first;i<=last;i++)
+ for (i=first;i<=last;i++) {
if (VB->ClipMask[i]==0) {
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_POINT_TOKEN );
- gl_do_feedback_vertex( ctx, i, i );
+ feedback_vertex( ctx, i, i );
}
+ }
}
@@ -256,8 +259,10 @@ void gl_feedback_points( GLcontext *ctx, GLuint first, GLuint last )
/*
* NOTE: this function can't be put in a display list.
*/
-void gl_SelectBuffer( GLcontext *ctx, GLsizei size, GLuint *buffer )
+void
+_mesa_SelectBuffer( GLsizei size, GLuint *buffer )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glSelectBuffer");
if (ctx->RenderMode==GL_SELECT) {
gl_error( ctx, GL_INVALID_OPERATION, "glSelectBuffer" );
@@ -297,9 +302,9 @@ void gl_select_triangle( GLcontext *ctx,
struct vertex_buffer *VB = ctx->VB;
if (gl_cull_triangle( ctx, v0, v1, v2, 0 )) {
- gl_update_hitflag( ctx, VB->Win.data[v0][3] / DEPTH_SCALE );
- gl_update_hitflag( ctx, VB->Win.data[v1][3] / DEPTH_SCALE );
- gl_update_hitflag( ctx, VB->Win.data[v2][3] / DEPTH_SCALE );
+ gl_update_hitflag( ctx, VB->Win.data[v0][2] / DEPTH_SCALE );
+ gl_update_hitflag( ctx, VB->Win.data[v1][2] / DEPTH_SCALE );
+ gl_update_hitflag( ctx, VB->Win.data[v2][2] / DEPTH_SCALE );
}
}
@@ -309,18 +314,21 @@ void gl_select_line( GLcontext *ctx,
{
struct vertex_buffer *VB = ctx->VB;
- gl_update_hitflag( ctx, VB->Win.data[v0][3] / DEPTH_SCALE );
- gl_update_hitflag( ctx, VB->Win.data[v1][3] / DEPTH_SCALE );
+ gl_update_hitflag( ctx, VB->Win.data[v0][2] / DEPTH_SCALE );
+ gl_update_hitflag( ctx, VB->Win.data[v1][2] / DEPTH_SCALE );
}
+
void gl_select_points( GLcontext *ctx, GLuint first, GLuint last )
{
struct vertex_buffer *VB = ctx->VB;
GLuint i;
- for (i=first;i<=last;i++)
- if (VB->ClipMask[i]==0)
- gl_update_hitflag( ctx, VB->Win.data[i][3] / DEPTH_SCALE);
+ for (i=first;i<=last;i++) {
+ if (VB->ClipMask[i]==0) {
+ gl_update_hitflag( ctx, VB->Win.data[i][2] / DEPTH_SCALE);
+ }
+ }
}
@@ -339,7 +347,7 @@ static void write_hit_record( GLcontext *ctx )
WRITE_RECORD( ctx, ctx->Select.NameStackDepth );
WRITE_RECORD( ctx, zmin );
WRITE_RECORD( ctx, zmax );
- for (i=0;i<ctx->Select.NameStackDepth;i++) {
+ for (i = 0; i < ctx->Select.NameStackDepth; i++) {
WRITE_RECORD( ctx, ctx->Select.NameStack[i] );
}
@@ -351,11 +359,13 @@ static void write_hit_record( GLcontext *ctx )
-void gl_InitNames( GLcontext *ctx )
+void
+_mesa_InitNames( void )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glInitNames");
/* Record the hit before the HitFlag is wiped out again. */
- if (ctx->RenderMode==GL_SELECT) {
+ if (ctx->RenderMode == GL_SELECT) {
if (ctx->Select.HitFlag) {
write_hit_record( ctx );
}
@@ -368,20 +378,22 @@ void gl_InitNames( GLcontext *ctx )
-void gl_LoadName( GLcontext *ctx, GLuint name )
+void
+_mesa_LoadName( GLuint name )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLoadName");
- if (ctx->RenderMode!=GL_SELECT) {
+ if (ctx->RenderMode != GL_SELECT) {
return;
}
- if (ctx->Select.NameStackDepth==0) {
+ if (ctx->Select.NameStackDepth == 0) {
gl_error( ctx, GL_INVALID_OPERATION, "glLoadName" );
return;
}
if (ctx->Select.HitFlag) {
write_hit_record( ctx );
}
- if (ctx->Select.NameStackDepth<MAX_NAME_STACK_DEPTH) {
+ if (ctx->Select.NameStackDepth < MAX_NAME_STACK_DEPTH) {
ctx->Select.NameStack[ctx->Select.NameStackDepth-1] = name;
}
else {
@@ -390,16 +402,18 @@ void gl_LoadName( GLcontext *ctx, GLuint name )
}
-void gl_PushName( GLcontext *ctx, GLuint name )
+void
+_mesa_PushName( GLuint name )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPushName");
- if (ctx->RenderMode!=GL_SELECT) {
+ if (ctx->RenderMode != GL_SELECT) {
return;
}
if (ctx->Select.HitFlag) {
write_hit_record( ctx );
}
- if (ctx->Select.NameStackDepth<MAX_NAME_STACK_DEPTH) {
+ if (ctx->Select.NameStackDepth < MAX_NAME_STACK_DEPTH) {
ctx->Select.NameStack[ctx->Select.NameStackDepth++] = name;
}
else {
@@ -409,16 +423,18 @@ void gl_PushName( GLcontext *ctx, GLuint name )
-void gl_PopName( GLcontext *ctx )
+void
+_mesa_PopName( void )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPopName");
- if (ctx->RenderMode!=GL_SELECT) {
+ if (ctx->RenderMode != GL_SELECT) {
return;
}
if (ctx->Select.HitFlag) {
write_hit_record( ctx );
}
- if (ctx->Select.NameStackDepth>0) {
+ if (ctx->Select.NameStackDepth > 0) {
ctx->Select.NameStackDepth--;
}
else {
@@ -437,8 +453,10 @@ void gl_PopName( GLcontext *ctx )
/*
* NOTE: this function can't be put in a display list.
*/
-GLint gl_RenderMode( GLcontext *ctx, GLenum mode )
+GLint
+_mesa_RenderMode( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint result;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glRenderMode", 0);
@@ -507,7 +525,6 @@ GLint gl_RenderMode( GLcontext *ctx, GLenum mode )
return 0;
}
-
ctx->RenderMode = mode;
ctx->NewState |= NEW_ALL;
diff --git a/xc/extras/Mesa/src/feedback.h b/xc/extras/Mesa/src/feedback.h
index 70929dc9f..e7a09f84a 100644
--- a/xc/extras/Mesa/src/feedback.h
+++ b/xc/extras/Mesa/src/feedback.h
@@ -1,8 +1,8 @@
-/* $Id: feedback.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: feedback.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef FEEDBACK_H
#define FEEDBACK_H
@@ -52,22 +49,30 @@ extern void gl_feedback_vertex( GLcontext *ctx,
extern void gl_update_hitflag( GLcontext *ctx, GLfloat z );
-extern void gl_PassThrough( GLcontext *ctx, GLfloat token );
+extern void
+_mesa_PassThrough( GLfloat token );
+
+extern void
+_mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer );
-extern void gl_FeedbackBuffer( GLcontext *ctx, GLsizei size,
- GLenum type, GLfloat *buffer );
+extern void
+_mesa_SelectBuffer( GLsizei size, GLuint *buffer );
-extern void gl_SelectBuffer( GLcontext *ctx, GLsizei size, GLuint *buffer );
+extern void
+_mesa_InitNames( void );
-extern void gl_InitNames( GLcontext *ctx );
+extern void
+_mesa_LoadName( GLuint name );
-extern void gl_LoadName( GLcontext *ctx, GLuint name );
+extern void
+_mesa_PushName( GLuint name );
-extern void gl_PushName( GLcontext *ctx, GLuint name );
+extern void
+_mesa_PopName( void );
-extern void gl_PopName( GLcontext *ctx );
+extern GLint
+_mesa_RenderMode( GLenum mode );
-extern GLint gl_RenderMode( GLcontext *ctx, GLenum mode );
extern void gl_feedback_points( GLcontext *ctx, GLuint first, GLuint last );
extern void gl_feedback_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv );
diff --git a/xc/extras/Mesa/src/fixed.h b/xc/extras/Mesa/src/fixed.h
index d23183c2a..33a33d4c0 100644
--- a/xc/extras/Mesa/src/fixed.h
+++ b/xc/extras/Mesa/src/fixed.h
@@ -1,4 +1,4 @@
-/* $Id: fixed.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: fixed.h,v 1.4 2000/01/30 00:27:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/fog.c b/xc/extras/Mesa/src/fog.c
index 85cdb8134..6223a564a 100644
--- a/xc/extras/Mesa/src/fog.c
+++ b/xc/extras/Mesa/src/fog.c
@@ -1,8 +1,8 @@
-/* $Id: fog.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: fog.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,29 +25,64 @@
*/
-/* $XFree86: xc/lib/GL/mesa/src/fog.c,v 1.4 1999/04/04 00:20:24 dawes Exp $ */
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <math.h>
-#include <stdlib.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "fog.h"
#include "macros.h"
#include "mmath.h"
#include "types.h"
-#include "xform.h"
#endif
-void gl_Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
+void
+_mesa_Fogf(GLenum pname, GLfloat param)
+{
+ _mesa_Fogfv(pname, &param);
+}
+
+
+void
+_mesa_Fogi(GLenum pname, GLint param )
+{
+ GLfloat fparam = (GLfloat) param;
+ _mesa_Fogfv(pname, &fparam);
+}
+
+
+void
+_mesa_Fogiv(GLenum pname, const GLint *params )
+{
+ GLfloat p[4];
+ switch (pname) {
+ case GL_FOG_MODE:
+ case GL_FOG_DENSITY:
+ case GL_FOG_START:
+ case GL_FOG_END:
+ case GL_FOG_INDEX:
+ p[0] = (GLfloat) *params;
+ break;
+ case GL_FOG_COLOR:
+ p[0] = INT_TO_FLOAT( params[0] );
+ p[1] = INT_TO_FLOAT( params[1] );
+ p[2] = INT_TO_FLOAT( params[2] );
+ p[3] = INT_TO_FLOAT( params[3] );
+ break;
+ default:
+ /* Error will be caught later in gl_Fogfv */
+ ;
+ }
+ _mesa_Fogfv(pname, p);
+}
+
+
+void
+_mesa_Fogfv( GLenum pname, const GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLenum m;
switch (pname) {
@@ -71,9 +106,23 @@ void gl_Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
}
break;
case GL_FOG_START:
+#if 0
+ /* Prior to OpenGL 1.1, this was an error */
+ if (*params<0.0F) {
+ gl_error( ctx, GL_INVALID_VALUE, "glFog(GL_FOG_START)" );
+ return;
+ }
+#endif
ctx->Fog.Start = *params;
break;
case GL_FOG_END:
+#if 0
+ /* Prior to OpenGL 1.1, this was an error */
+ if (*params<0.0F) {
+ gl_error( ctx, GL_INVALID_VALUE, "glFog(GL_FOG_END)" );
+ return;
+ }
+#endif
ctx->Fog.End = *params;
break;
case GL_FOG_INDEX:
@@ -101,13 +150,9 @@ void gl_Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
typedef void (*fog_func)( struct vertex_buffer *VB, GLuint side,
GLubyte flag );
-typedef void (*fog_coord_func)( struct vertex_buffer *VB,
- const GLvector4f *from,
- GLubyte flag );
static fog_func fog_ci_tab[2];
static fog_func fog_rgba_tab[2];
-static fog_coord_func make_fog_coord_tab[2];
/*
* Compute the fogged color for an array of vertices.
@@ -161,70 +206,6 @@ void gl_fog_vertices( struct vertex_buffer *VB )
}
}
-
-static void check_fog_coords( GLcontext *ctx, struct gl_pipeline_stage *d )
-{
- d->type = 0;
-
- if (ctx->FogMode==FOG_FRAGMENT)
- {
- d->type = PIPE_IMMEDIATE|PIPE_PRECALC;
- d->inputs = VERT_OBJ_ANY;
- d->outputs = VERT_FOG_COORD;
- }
-}
-
-void gl_make_fog_coords( struct vertex_buffer *VB )
-{
- GLcontext *ctx = VB->ctx;
-
- /* If full eye coords weren't required, just calculate the eye Z
- * values.
- */
- if (!ctx->NeedEyeCoords) {
- GLfloat *m = ctx->ModelView.m;
- GLfloat plane[4];
-
- plane[0] = m[2];
- plane[1] = m[6];
- plane[2] = m[10];
- plane[3] = m[14];
-
- gl_dotprod_tab[0][VB->ObjPtr->size](&VB->Eye,
- 2, /* fill z coordinates */
- VB->ObjPtr,
- plane,
- 0 );
-
- make_fog_coord_tab[0]( VB, &VB->Eye, 0 );
- }
- else
- {
- make_fog_coord_tab[0]( VB, VB->EyePtr, 0 );
- }
-}
-
-
-/* Drivers that want fog coordinates in VB->Spec[0] alpha, can substitute this
- * stage for the default PIPE_OP_FOG pipeline stage.
- */
-struct gl_pipeline_stage gl_fog_coord_stage = {
- "build fog coordinates",
- PIPE_OP_FOG,
- PIPE_PRECALC|PIPE_IMMEDIATE,
- 0,
- NEW_FOG,
- NEW_LIGHTING|NEW_RASTER_OPS|NEW_FOG|NEW_MODELVIEW,
- 0, 0,
- 0, 0, 0,
- check_fog_coords,
- gl_make_fog_coords
-};
-
-
-
-
-
/*
* Apply fog to an array of RGBA pixels.
* Input: n - number of pixels
diff --git a/xc/extras/Mesa/src/fog.h b/xc/extras/Mesa/src/fog.h
index 24dbf57c0..c187a1821 100644
--- a/xc/extras/Mesa/src/fog.h
+++ b/xc/extras/Mesa/src/fog.h
@@ -1,8 +1,8 @@
-/* $Id: fog.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: fog.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,7 +25,6 @@
*/
-
#ifndef FOG_H
#define FOG_H
@@ -33,7 +32,21 @@
#include "types.h"
-extern void gl_Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *params );
+extern void
+_mesa_Fogf(GLenum pname, GLfloat param);
+
+
+extern void
+_mesa_Fogi(GLenum pname, GLint param );
+
+
+extern void
+_mesa_Fogfv(GLenum pname, const GLfloat *params );
+
+
+extern void
+_mesa_Fogiv(GLenum pname, const GLint *params );
+
extern void gl_fog_vertices( struct vertex_buffer *VB );
@@ -45,11 +58,7 @@ extern void gl_fog_rgba_pixels( const GLcontext *ctx,
extern void gl_fog_ci_pixels( const GLcontext *ctx,
GLuint n, const GLdepth z[], GLuint indx[] );
-extern void gl_make_fog_coords( struct vertex_buffer *VB );
-
-extern struct gl_pipeline_stage gl_fog_coord_stage;
extern void gl_init_fog( void );
-
#endif
diff --git a/xc/extras/Mesa/src/fog_tmp.h b/xc/extras/Mesa/src/fog_tmp.h
index 9fbb0e106..033f61a17 100644
--- a/xc/extras/Mesa/src/fog_tmp.h
+++ b/xc/extras/Mesa/src/fog_tmp.h
@@ -1,4 +1,4 @@
-/* $Id: fog_tmp.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: fog_tmp.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,178 +24,6 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* For 3.2: Add a helper function for drivers to do fog coordinate
- * calculation. Not called from standard pipelines.
- */
-static void TAG(make_fog_coord)( struct vertex_buffer *VB,
- const GLvector4f *eye,
- GLubyte flag)
-{
- const GLcontext *ctx = VB->ctx;
- GLfloat end = ctx->Fog.End;
- GLubyte *cullmask = VB->CullMask + VB->Start;
- GLfloat *v = eye->start;
- GLuint stride = eye->stride;
- GLuint n = VB->Count - VB->Start;
- GLubyte (*out)[4];
- GLfloat d;
- GLuint i;
-
- (void) cullmask;
- (void) flag;
-
- /* Use specular alpha (front side) as fog coordinate.
- */
- out = VB->Spec[0] + VB->Start;
-
- if (VB->EyePtr->size > 2) {
- switch (ctx->Fog.Mode) {
- case GL_LINEAR:
- d = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
- for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride)) {
- CULLCHECK {
- GLfloat f = (end - ABSF(v[2])) * d;
- FLOAT_COLOR_TO_UBYTE_COLOR(out[i][3], f);
- }
- }
- break;
- case GL_EXP:
- d = -ctx->Fog.Density;
- for ( i = 0 ; i < n ; i++, STRIDE_F(v,stride)) {
- CULLCHECK {
- GLfloat f = exp( d*ABSF(v[2]) ); /* already clamped */
- FLOAT_COLOR_TO_UBYTE_COLOR(out[i][3], f);
- }
- }
- break;
- case GL_EXP2:
- d = -(ctx->Fog.Density*ctx->Fog.Density);
- for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride)) {
- CULLCHECK {
- GLfloat z = v[2];
- GLfloat f = exp( d*z*z ); /* already clamped */
- FLOAT_COLOR_TO_UBYTE_COLOR(out[i][3], f);
- }
- }
- break;
- default:
- gl_problem(ctx, "Bad fog mode in make_fog_coord");
- return;
- }
- }
- else
- {
- GLubyte r = 0;
-
- if (ctx->Fog.Mode == GL_LINEAR) {
- GLfloat f = ctx->Fog.End * (ctx->Fog.End - ctx->Fog.Start);
- CLAMP_FLOAT_COLOR( f );
- f = 1.0 - f;
- FLOAT_COLOR_TO_UBYTE_COLOR(r, f);
- }
-
- for (i = 0 ; i < n ; i++)
- out[i][3] = r;
- }
-}
-
-
-
-
-
-#if 0
-/* For 3.3: use fog coordinates as intermediate step in all fog
- * calculations.
- */
-
-static void TAG(fog_rgba_vertices)( struct vertex_buffer *VB,
- GLuint side,
- GLubyte flag)
-{
- const GLcontext *ctx = VB->ctx;
- const GLubyte rFog = ctx->Fog.ByteColor[0];
- const GLubyte gFog = ctx->Fog.ByteColor[1];
- const GLubyte bFog = ctx->Fog.ByteColor[2];
- GLfloat end = ctx->Fog.End;
- GLubyte *cullmask = VB->CullMask + VB->Start;
- GLubyte (*fcoord)[4] = VB->SpecPtr[0]->start;
- GLuint stride = VB->SpecPtr[0]->stride;
- GLuint n = VB->Count - VB->Start;
- GLubyte *in;
- GLuint in_stride;
- GLubyte (*out)[4];
- GLfloat d,t;
- GLuint i;
-
- (void) cullmask;
- (void) flag;
-
- /* Get correct source and destination for fogged colors.
- */
- in_stride = VB->Color[side]->stride;
- in = VB->Color[side]->start;
- VB->Color[side] = VB->FoggedColor[side];
- VB->ColorPtr = VB->Color[0];
- out = (GLubyte (*)[4])VB->Color[side]->start;
-
- FLOAT_COLOR_TO_UBYTE_COLOR( rFog, ctx->Fog.Color[0] );
-
- for ( i = 0 ; i < n ; i++, STRIDE_F(spec, sp_stride), in += in_stride) {
- CULLCHECK {
- GLint fc = (GLint) spec[3], ifc = 255 - fc;
-
- out[i][0] = (fc * in[0] + ifc * rFog) >> 8;
- out[i][1] = (fc * in[1] + ifc * gFog) >> 8;
- out[i][2] = (fc * in[2] + ifc * bFog) >> 8;
- }
- }
-}
-
-
-
-static void TAG(fog_ci_vertices)( struct vertex_buffer *VB,
- GLuint side,
- GLubyte flag )
-{
- GLcontext *ctx = VB->ctx;
-
- GLubyte *cullmask = VB->CullMask + VB->Start;
-
- GLfloat *v = VB->EyePtr->start;
- GLuint stride = VB->EyePtr->stride;
- GLuint vertex_size = VB->EyePtr->size;
- GLuint n = VB->EyePtr->count;
-
- GLuint *in;
- GLuint in_stride;
- GLuint *out;
- GLuint i;
-
- (void) flag;
- (void) cullmask;
-
-
- in = VB->Index[side]->start;
- in_stride = VB->Index[side]->stride;
- VB->IndexPtr = VB->FoggedIndex[side];
- out = VB->IndexPtr->start;
-
-
- /* NOTE: the extensive use of casts generates better/faster code for MIPS */
- for ( i = 0; i < n ; i++, STRIDE_F(v,stride), STRIDE_UI(in,in_stride))
- CULLCHECK {
- GLfloat f = (fogend - ABSF(v[2])) * d;
- f = CLAMP( f, 0.0, 1.0 );
- *out = (GLint) ((GLfloat)(GLint) *in + (1.0F-f) * fogindex);
- }
-}
-
-#endif
-
-
-
-
-
static void TAG(fog_rgba_vertices)( struct vertex_buffer *VB,
@@ -427,7 +255,6 @@ static void TAG(init_fog_tab)(void)
{
fog_ci_tab[IDX] = TAG(fog_ci_vertices);
fog_rgba_tab[IDX] = TAG(fog_rgba_vertices);
- make_fog_coord_tab[IDX] = TAG(make_fog_coord);
}
#undef TAG
diff --git a/xc/extras/Mesa/src/general_clip.h b/xc/extras/Mesa/src/general_clip.h
index 995842608..7ca7513a0 100644
--- a/xc/extras/Mesa/src/general_clip.h
+++ b/xc/extras/Mesa/src/general_clip.h
@@ -1,4 +1,4 @@
-/* $Id: general_clip.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: general_clip.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/get.c b/xc/extras/Mesa/src/get.c
index 60eb01ac0..8222366ad 100644
--- a/xc/extras/Mesa/src/get.c
+++ b/xc/extras/Mesa/src/get.c
@@ -1,10 +1,10 @@
-/* $Id: get.c,v 1.4 1999/12/18 16:51:05 daryll Exp $ */
+/* $Id: get.c,v 1.5 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,24 +25,17 @@
*/
-/* $XFree86: xc/lib/GL/mesa/src/get.c,v 1.3 1999/04/04 00:20:25 dawes Exp $ */
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "enable.h"
#include "enums.h"
#include "extensions.h"
#include "get.h"
#include "macros.h"
+#include "matrix.h"
#include "mmath.h"
#include "types.h"
#include "vb.h"
@@ -66,8 +59,10 @@
-void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params )
+void
+_mesa_GetBooleanv( GLenum pname, GLboolean *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint i;
GLuint texUnit = ctx->Texture.CurrentUnit;
GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;
@@ -393,6 +388,7 @@ void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params )
*params = FLOAT_TO_BOOL(LINE_WIDTH_GRANULARITY);
break;
case GL_LINE_WIDTH_RANGE:
+ case GL_ALIASED_LINE_WIDTH_RANGE:
params[0] = FLOAT_TO_BOOL(MIN_LINE_WIDTH);
params[1] = FLOAT_TO_BOOL(MAX_LINE_WIDTH);
break;
@@ -620,6 +616,7 @@ void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params )
*params = FLOAT_TO_BOOL(POINT_SIZE_GRANULARITY );
break;
case GL_POINT_SIZE_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
params[0] = FLOAT_TO_BOOL(MIN_POINT_SIZE );
params[1] = FLOAT_TO_BOOL(MAX_POINT_SIZE );
break;
@@ -748,13 +745,13 @@ void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params )
*params = INT_TO_BOOL(0); /* TODO */
break;
case GL_TEXTURE_1D:
- *params = gl_IsEnabled( ctx, GL_TEXTURE_1D );
+ *params = _mesa_IsEnabled(GL_TEXTURE_1D );
break;
case GL_TEXTURE_2D:
- *params = gl_IsEnabled( ctx, GL_TEXTURE_2D );
+ *params = _mesa_IsEnabled(GL_TEXTURE_2D );
break;
case GL_TEXTURE_3D:
- *params = gl_IsEnabled( ctx, GL_TEXTURE_3D );
+ *params = _mesa_IsEnabled(GL_TEXTURE_3D );
break;
case GL_TEXTURE_BINDING_1D:
*params = INT_TO_BOOL(textureUnit->CurrentD[1]->Name);
@@ -969,6 +966,42 @@ void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params )
case GL_NATIVE_GRAPHICS_HANDLE_PGI:
*params = 0;
break;
+
+ /* GL_ARB_transpose_matrix */
+ case GL_TRANSPOSE_COLOR_MATRIX_ARB:
+ /* don't have a color matrix */
+ break;
+ case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ gl_matrix_transposef(tm, ctx->ModelView.m);
+ for (i=0;i<16;i++) {
+ params[i] = FLOAT_TO_BOOL(tm[i]);
+ }
+ }
+ break;
+ case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ gl_matrix_transposef(tm, ctx->ProjectionMatrix.m);
+ for (i=0;i<16;i++) {
+ params[i] = FLOAT_TO_BOOL(tm[i]);
+ }
+ }
+ break;
+ case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ gl_matrix_transposef(tm, ctx->TextureMatrix[texTransformUnit].m);
+ for (i=0;i<16;i++) {
+ params[i] = FLOAT_TO_BOOL(tm[i]);
+ }
+ }
+ break;
+
default:
printf("invalid enum: %x\n", pname);
gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
@@ -978,8 +1011,10 @@ void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params )
-void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params )
+void
+_mesa_GetDoublev( GLenum pname, GLdouble *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint i;
GLuint texUnit = ctx->Texture.CurrentUnit;
GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;
@@ -1305,6 +1340,7 @@ void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params )
*params = (GLdouble) LINE_WIDTH_GRANULARITY;
break;
case GL_LINE_WIDTH_RANGE:
+ case GL_ALIASED_LINE_WIDTH_RANGE:
params[0] = (GLdouble) MIN_LINE_WIDTH;
params[1] = (GLdouble) MAX_LINE_WIDTH;
break;
@@ -1532,6 +1568,7 @@ void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params )
*params = (GLdouble) POINT_SIZE_GRANULARITY;
break;
case GL_POINT_SIZE_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
params[0] = (GLdouble) MIN_POINT_SIZE;
params[1] = (GLdouble) MAX_POINT_SIZE;
break;
@@ -1660,13 +1697,13 @@ void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params )
*params = 0.0; /* TODO */
break;
case GL_TEXTURE_1D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_1D) ? 1.0 : 0.0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1.0 : 0.0;
break;
case GL_TEXTURE_2D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_2D) ? 1.0 : 0.0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1.0 : 0.0;
break;
case GL_TEXTURE_3D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_3D) ? 1.0 : 0.0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1.0 : 0.0;
break;
case GL_TEXTURE_BINDING_1D:
*params = (GLdouble) textureUnit->CurrentD[1]->Name;
@@ -1882,7 +1919,40 @@ void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params )
*params = 0;
break;
-
+ /* GL_ARB_transpose_matrix */
+ case GL_TRANSPOSE_COLOR_MATRIX_ARB:
+ /* don't have a color matrix */
+ break;
+ case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ gl_matrix_transposef(tm, ctx->ModelView.m);
+ for (i=0;i<16;i++) {
+ params[i] = (GLdouble) tm[i];
+ }
+ }
+ break;
+ case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ gl_matrix_transposef(tm, ctx->ProjectionMatrix.m);
+ for (i=0;i<16;i++) {
+ params[i] = (GLdouble) tm[i];
+ }
+ }
+ break;
+ case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ gl_matrix_transposef(tm, ctx->TextureMatrix[texTransformUnit].m);
+ for (i=0;i<16;i++) {
+ params[i] = (GLdouble) tm[i];
+ }
+ }
+ break;
default:
printf("invalid enum: %x\n", pname);
@@ -1893,8 +1963,10 @@ void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params )
-void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params )
+void
+_mesa_GetFloatv( GLenum pname, GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint i;
GLuint texUnit = ctx->Texture.CurrentUnit;
GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;
@@ -2217,6 +2289,7 @@ void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params )
*params = (GLfloat) LINE_WIDTH_GRANULARITY;
break;
case GL_LINE_WIDTH_RANGE:
+ case GL_ALIASED_LINE_WIDTH_RANGE:
params[0] = (GLfloat) MIN_LINE_WIDTH;
params[1] = (GLfloat) MAX_LINE_WIDTH;
break;
@@ -2444,6 +2517,7 @@ void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params )
*params = (GLfloat) POINT_SIZE_GRANULARITY;
break;
case GL_POINT_SIZE_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
params[0] = (GLfloat) MIN_POINT_SIZE;
params[1] = (GLfloat) MAX_POINT_SIZE;
break;
@@ -2572,13 +2646,13 @@ void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params )
*params = 0.0F; /* TODO */
break;
case GL_TEXTURE_1D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_1D) ? 1.0 : 0.0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1.0 : 0.0;
break;
case GL_TEXTURE_2D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_2D) ? 1.0 : 0.0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1.0 : 0.0;
break;
case GL_TEXTURE_3D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_3D) ? 1.0 : 0.0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1.0 : 0.0;
break;
case GL_TEXTURE_BINDING_1D:
*params = (GLfloat) textureUnit->CurrentD[1]->Name;
@@ -2793,6 +2867,20 @@ void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params )
*params = 0;
break;
+ /* GL_ARB_transpose_matrix */
+ case GL_TRANSPOSE_COLOR_MATRIX_ARB:
+ /* don't have a color matrix */
+ break;
+ case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
+ gl_matrix_transposef(params, ctx->ModelView.m);
+ break;
+ case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
+ gl_matrix_transposef(params, ctx->ProjectionMatrix.m);
+ break;
+ case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
+ gl_matrix_transposef(params, ctx->TextureMatrix[texTransformUnit].m);
+ break;
+
default:
printf("invalid enum: %x\n", pname);
gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
@@ -2802,8 +2890,10 @@ void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params )
-void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params )
+void
+_mesa_GetIntegerv( GLenum pname, GLint *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint i;
GLuint texUnit = ctx->Texture.CurrentUnit;
GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;
@@ -3130,6 +3220,7 @@ void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params )
*params = (GLint) LINE_WIDTH_GRANULARITY;
break;
case GL_LINE_WIDTH_RANGE:
+ case GL_ALIASED_LINE_WIDTH_RANGE:
params[0] = (GLint) MIN_LINE_WIDTH;
params[1] = (GLint) MAX_LINE_WIDTH;
break;
@@ -3357,6 +3448,7 @@ void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params )
*params = (GLint) POINT_SIZE_GRANULARITY;
break;
case GL_POINT_SIZE_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
params[0] = (GLint) MIN_POINT_SIZE;
params[1] = (GLint) MAX_POINT_SIZE;
break;
@@ -3485,13 +3577,13 @@ void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params )
*params = 0; /* TODO */
break;
case GL_TEXTURE_1D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_1D) ? 1 : 0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1 : 0;
break;
case GL_TEXTURE_2D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_2D) ? 1 : 0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1 : 0;
break;
case GL_TEXTURE_3D:
- *params = gl_IsEnabled(ctx, GL_TEXTURE_3D) ? 1 : 0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1 : 0;
break;
case GL_TEXTURE_BINDING_1D:
*params = textureUnit->CurrentD[1]->Name;
@@ -3717,6 +3809,41 @@ void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params )
*params = ctx->Array.LockCount;
break;
+ /* GL_ARB_transpose_matrix */
+ case GL_TRANSPOSE_COLOR_MATRIX_ARB:
+ /* don't have a color matrix */
+ break;
+ case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ gl_matrix_transposef(tm, ctx->ModelView.m);
+ for (i=0;i<16;i++) {
+ params[i] = (GLint) tm[i];
+ }
+ }
+ break;
+ case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ gl_matrix_transposef(tm, ctx->ProjectionMatrix.m);
+ for (i=0;i<16;i++) {
+ params[i] = (GLint) tm[i];
+ }
+ }
+ break;
+ case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ gl_matrix_transposef(tm, ctx->TextureMatrix[texTransformUnit].m);
+ for (i=0;i<16;i++) {
+ params[i] = (GLint) tm[i];
+ }
+ }
+ break;
+
default:
printf("invalid enum: %x\n", pname);
gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
@@ -3725,8 +3852,10 @@ void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params )
-void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params )
+void
+_mesa_GetPointerv( GLenum pname, GLvoid **params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint texUnit = ctx->Texture.CurrentUnit;
/*GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;*/
@@ -3766,11 +3895,13 @@ void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params )
-const GLubyte *gl_GetString( GLcontext *ctx, GLenum name )
+const GLubyte *
+_mesa_GetString( GLenum name )
{
+ GET_CURRENT_CONTEXT(ctx);
static char result[1000];
static char *vendor = "Brian Paul";
- static char *version = "1.2 Mesa 3.1";
+ static char *version = "1.2 Mesa 3.3 beta";
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glGetString", 0);
@@ -3811,3 +3942,24 @@ const GLubyte *gl_GetString( GLcontext *ctx, GLenum name )
return NULL;
}
}
+
+
+/*
+ * Execute a glGetError command
+ */
+GLenum
+_mesa_GetError( void )
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ GLenum e = ctx->ErrorValue;
+
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL( ctx, "glGetError", (GLenum) 0);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ fprintf(stderr, "glGetError <-- %s\n", gl_lookup_enum_by_nr(e));
+
+ ctx->ErrorValue = (GLenum) GL_NO_ERROR;
+ return e;
+}
+
diff --git a/xc/extras/Mesa/src/get.h b/xc/extras/Mesa/src/get.h
index 7738a2183..199914cf4 100644
--- a/xc/extras/Mesa/src/get.h
+++ b/xc/extras/Mesa/src/get.h
@@ -1,8 +1,8 @@
-/* $Id: get.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: get.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef GET_H
#define GET_H
@@ -35,17 +32,27 @@
#include "types.h"
-extern void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params );
+extern void
+_mesa_GetBooleanv( GLenum pname, GLboolean *params );
+
+extern void
+_mesa_GetDoublev( GLenum pname, GLdouble *params );
+
+extern void
+_mesa_GetFloatv( GLenum pname, GLfloat *params );
-extern void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params );
+extern void
+_mesa_GetIntegerv( GLenum pname, GLint *params );
-extern void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params );
+extern void
+_mesa_GetPointerv( GLenum pname, GLvoid **params );
-extern void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params );
+extern const GLubyte *
+_mesa_GetString( GLenum name );
-extern void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params );
+extern GLenum
+_mesa_GetError( void );
-extern const GLubyte *gl_GetString( GLcontext *ctx, GLenum name );
#endif
diff --git a/xc/extras/Mesa/src/glapi.c b/xc/extras/Mesa/src/glapi.c
new file mode 100644
index 000000000..0fa74e01e
--- /dev/null
+++ b/xc/extras/Mesa/src/glapi.c
@@ -0,0 +1,1369 @@
+/* $Id: glapi.c,v 1.2 2000/01/30 00:27:02 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999-2000 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+/*
+ * This file manages the OpenGL API dispatch layer.
+ * The dispatch table (struct _glapi_table) is basically just a list
+ * of function pointers.
+ * There are functions to set/get the current dispatch table for the
+ * current thread and to manage registration/dispatch of dynamically
+ * added extension functions.
+ *
+ * It's intended that this file and the other glapi*.[ch] files are
+ * flexible enough to be reused in several places: XFree86, DRI-
+ * based libGL.so, and perhaps the SGI SI.
+ *
+ * There are no dependencies on Mesa in this code.
+ */
+
+
+
+#include <assert.h>
+#include <stdlib.h> /* to get NULL */
+#include <string.h>
+#include "glapi.h"
+#include "glapinoop.h"
+#include "glapioffsets.h"
+#include "glapitable.h"
+#if defined(THREADS)
+#include "glthread.h"
+#endif
+
+
+/* This is used when thread safety is disabled */
+struct _glapi_table *_glapi_Dispatch = &__glapi_noop_table;
+
+/* Used when thread safety disabled */
+void *_glapi_Context = NULL;
+
+
+#if defined(THREADS)
+
+/* Flag to indicate whether thread-safe dispatch is enabled */
+static GLboolean ThreadSafe = GL_FALSE;
+
+static _glthread_TSD DispatchTSD;
+
+static void dispatch_thread_init()
+{
+ _glthread_InitTSD(&DispatchTSD);
+}
+
+
+static _glthread_TSD ContextTSD;
+
+static void context_thread_init()
+{
+ _glthread_InitTSD(&ContextTSD);
+}
+
+#endif
+
+
+
+static GLuint MaxDispatchOffset = sizeof(struct _glapi_table) / sizeof(void *) - 1;
+static GLboolean GetSizeCalled = GL_FALSE;
+
+
+
+/*
+ * We should call this periodically from a function such as glXMakeCurrent
+ * in order to test if multiple threads are being used. When we detect
+ * that situation we should then call _glapi_enable_thread_safety()
+ */
+void
+_glapi_check_multithread(void)
+{
+#if defined(THREADS)
+ if (!ThreadSafe) {
+ static unsigned long knownID;
+ static GLboolean firstCall = GL_TRUE;
+ if (firstCall) {
+ knownID = _glthread_GetID();
+ firstCall = GL_FALSE;
+ }
+ else if (knownID != _glthread_GetID()) {
+ ThreadSafe = GL_TRUE;
+ }
+ }
+ if (ThreadSafe) {
+ /* make sure that this thread's dispatch pointer isn't null */
+ if (!_glapi_get_dispatch()) {
+ _glapi_set_dispatch(NULL);
+ }
+ }
+#endif
+}
+
+
+
+/*
+ * Set the current context pointer for this thread.
+ * The context pointer is an opaque type which should be cast to
+ * void from the real context pointer type.
+ */
+void
+_glapi_set_context(void *context)
+{
+#if defined(THREADS)
+ _glthread_SetTSD(&ContextTSD, context, context_thread_init);
+ if (ThreadSafe)
+ _glapi_Context = NULL;
+ else
+ _glapi_Context = context;
+#else
+ _glapi_Context = context;
+#endif
+}
+
+
+
+/*
+ * Get the current context pointer for this thread.
+ * The context pointer is an opaque type which should be cast from
+ * void to the real context pointer type.
+ */
+void *
+_glapi_get_context(void)
+{
+#if defined(THREADS)
+ if (ThreadSafe) {
+ return _glthread_GetTSD(&ContextTSD);
+ }
+ else {
+ return _glapi_Context;
+ }
+#else
+ return _glapi_Context;
+#endif
+}
+
+
+
+/*
+ * Set the global or per-thread dispatch table pointer.
+ */
+void
+_glapi_set_dispatch(struct _glapi_table *dispatch)
+{
+ if (!dispatch) {
+ /* use the no-op functions */
+ dispatch = &__glapi_noop_table;
+ }
+#ifdef DEBUG
+ else {
+ _glapi_check_table(dispatch);
+ }
+#endif
+
+#if defined(THREADS)
+ _glthread_SetTSD(&DispatchTSD, (void*) dispatch, dispatch_thread_init);
+ if (ThreadSafe)
+ _glapi_Dispatch = NULL;
+ else
+ _glapi_Dispatch = dispatch;
+#else
+ _glapi_Dispatch = dispatch;
+#endif
+}
+
+
+
+/*
+ * Return pointer to current dispatch table for calling thread.
+ */
+struct _glapi_table *
+_glapi_get_dispatch(void)
+{
+#if defined(THREADS)
+ if (ThreadSafe) {
+ return (struct _glapi_table *) _glthread_GetTSD(&DispatchTSD);
+ }
+ else {
+ assert(_glapi_Dispatch);
+ return _glapi_Dispatch;
+ }
+#else
+ return _glapi_Dispatch;
+#endif
+}
+
+
+
+/*
+ * Return size of dispatch table struct as number of functions (or
+ * slots).
+ */
+GLuint
+_glapi_get_dispatch_table_size(void)
+{
+ /* return sizeof(struct _glapi_table) / sizeof(void *);*/
+ GetSizeCalled = GL_TRUE;
+ return MaxDispatchOffset + 1;
+}
+
+
+
+/*
+ * Get API dispatcher version string.
+ */
+const char *
+_glapi_get_version(void)
+{
+ return "20000128"; /* YYYYMMDD */
+}
+
+
+struct name_address_pair {
+ const char *Name;
+ GLvoid *Address;
+};
+
+static struct name_address_pair static_functions[1000];
+
+
+
+/*
+ * Return dispatch table offset of the named static (built-in) function.
+ * Return -1 if function not found.
+ */
+static GLint
+get_static_proc_offset(const char *funcName)
+{
+ GLuint i;
+ for (i = 0; static_functions[i].Name; i++) {
+ if (strcmp(static_functions[i].Name, funcName) == 0) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+
+/*
+ * Return dispatch function address the named static (built-in) function.
+ * Return NULL if function not found.
+ */
+static GLvoid *
+get_static_proc_address(const char *funcName)
+{
+ GLuint i = get_static_proc_offset(funcName);
+ if (i >= 0)
+ return static_functions[i].Address;
+ else
+ return NULL;
+}
+
+
+
+/**********************************************************************
+ * Extension function management.
+ */
+
+
+struct _glapi_ext_entrypoint {
+ const char *Name; /* the extension function's name */
+ GLuint Offset; /* relative to start of dispatch table */
+ GLvoid *Address; /* address of dispatch function */
+};
+
+static struct _glapi_ext_entrypoint ExtEntryTable[_GLAPI_EXTRA_SLOTS];
+static GLuint NumExtEntryPoints = 0;
+
+
+
+/*
+ * Generate a dispatch function (entrypoint) which jumps through
+ * the given slot number (offset) in the current dispatch table.
+ */
+static void *
+generate_entrypoint(GLuint offset)
+{
+ /* XXX need to generate some assembly code here */
+
+ return NULL;
+}
+
+
+
+/*
+ * Add a new extension function entrypoint.
+ * Return: GL_TRUE = success or GL_FALSE = failure
+ */
+GLboolean
+_glapi_add_entrypoint(const char *funcName, GLuint offset)
+{
+ GLint index;
+
+ /* Make sure we don't try to add a new entrypoint after someone
+ * has already called _glapi_get_dispatch_table_size()! If that's
+ * happened the caller's information will now be out of date.
+ */
+ assert(!GetSizeCalled);
+
+ /* first check if the named function is already statically present */
+ index = get_static_proc_offset(funcName);
+
+ if (index >= 0) {
+ assert(index == offset);
+ return GL_TRUE;
+ }
+ /* else if (offset < _glapi_get_dispatch_table_size()) { */
+ else {
+ /* be sure index and name match known data */
+ GLuint i;
+ for (i = 0; i < NumExtEntryPoints; i++) {
+ if (strcmp(ExtEntryTable[i].Name, funcName) == 0) {
+ /* function already registered with api */
+ if (ExtEntryTable[i].Offset == offset) {
+ return GL_TRUE; /* offsets match */
+ }
+ else {
+ return GL_FALSE; /* bad offset! */
+ }
+ }
+ }
+ assert(NumExtEntryPoints < _GLAPI_EXTRA_SLOTS);
+ ExtEntryTable[NumExtEntryPoints].Name = strdup(funcName);
+ ExtEntryTable[NumExtEntryPoints].Offset = offset;
+ ExtEntryTable[NumExtEntryPoints].Address = generate_entrypoint(offset);
+ NumExtEntryPoints++;
+
+ if (offset > MaxDispatchOffset)
+ MaxDispatchOffset = offset;
+
+ return GL_TRUE;
+ }
+/*
+ else {
+ return GL_FALSE;
+ }
+*/
+}
+
+
+
+/*
+ * Return offset of entrypoint for named function within dispatch table.
+ */
+GLint
+_glapi_get_proc_offset(const char *funcName)
+{
+ /* search extension functions first */
+ GLint i;
+ for (i = 0; i < NumExtEntryPoints; i++) {
+ if (strcmp(ExtEntryTable[i].Name, funcName) == 0) {
+ return ExtEntryTable[i].Offset;
+ }
+ }
+
+ /* search static functions */
+ return get_static_proc_offset(funcName);
+}
+
+
+
+/*
+ * Return entrypoint for named function.
+ */
+const GLvoid *
+_glapi_get_proc_address(const char *funcName)
+{
+ /* search extension functions first */
+ GLint i;
+ for (i = 0; i < NumExtEntryPoints; i++) {
+ if (strcmp(ExtEntryTable[i].Name, funcName) == 0) {
+ return ExtEntryTable[i].Address;
+ }
+ }
+
+ /* search static functions */
+ return get_static_proc_address(funcName);
+}
+
+
+
+
+/*
+ * Return the name of the function at the given dispatch offset.
+ * This is only intended for debugging.
+ */
+const char *
+_glapi_get_proc_name(GLuint offset)
+{
+ GLuint n = sizeof(static_functions) / sizeof(struct name_address_pair);
+ if (offset < n) {
+ return static_functions[offset].Name;
+ }
+ else {
+ /* search added extension functions */
+ GLuint i;
+ for (i = 0; i < NumExtEntryPoints; i++) {
+ if (ExtEntryTable[i].Offset == offset) {
+ return ExtEntryTable[i].Name;
+ }
+ }
+ return NULL;
+ }
+}
+
+
+
+/*
+ * Make sure there are no NULL pointers in the given dispatch table.
+ * Intented for debugging purposes.
+ */
+void
+_glapi_check_table(const struct _glapi_table *table)
+{
+ const GLuint entries = _glapi_get_dispatch_table_size();
+ const void **tab = (const void **) table;
+ GLuint i;
+ for (i = 1; i < entries; i++) {
+ assert(tab[i]);
+ }
+
+#ifdef DEBUG
+ /* Do some spot checks to be sure that the dispatch table
+ * slots are assigned correctly.
+ */
+ {
+ GLuint BeginOffset = _glapi_get_proc_offset("glBegin");
+ char *BeginFunc = (char*) &table->Begin;
+ GLuint offset = (BeginFunc - (char *) table) / sizeof(void *);
+ assert(BeginOffset == _gloffset_Begin);
+ assert(BeginOffset == offset);
+ }
+ {
+ GLuint viewportOffset = _glapi_get_proc_offset("glViewport");
+ char *viewportFunc = (char*) &table->Viewport;
+ GLuint offset = (viewportFunc - (char *) table) / sizeof(void *);
+ assert(viewportOffset == _gloffset_Viewport);
+ assert(viewportOffset == offset);
+ }
+ {
+ GLuint VertexPointerOffset = _glapi_get_proc_offset("glVertexPointer");
+ char *VertexPointerFunc = (char*) &table->VertexPointer;
+ GLuint offset = (VertexPointerFunc - (char *) table) / sizeof(void *);
+ assert(VertexPointerOffset == _gloffset_VertexPointer);
+ assert(VertexPointerOffset == offset);
+ }
+ {
+ GLuint ResetMinMaxOffset = _glapi_get_proc_offset("glResetMinmax");
+ char *ResetMinMaxFunc = (char*) &table->ResetMinmax;
+ GLuint offset = (ResetMinMaxFunc - (char *) table) / sizeof(void *);
+ assert(ResetMinMaxOffset == _gloffset_ResetMinmax);
+ assert(ResetMinMaxOffset == offset);
+ }
+ {
+ GLuint blendColorOffset = _glapi_get_proc_offset("glBlendColorEXT");
+ char *blendColorFunc = (char*) &table->BlendColorEXT;
+ GLuint offset = (blendColorFunc - (char *) table) / sizeof(void *);
+ assert(blendColorOffset == _gloffset_BlendColorEXT);
+ assert(blendColorOffset == offset);
+ }
+ {
+ GLuint istextureOffset = _glapi_get_proc_offset("glIsTextureEXT");
+ char *istextureFunc = (char*) &table->IsTextureEXT;
+ GLuint offset = (istextureFunc - (char *) table) / sizeof(void *);
+ assert(istextureOffset == _gloffset_IsTextureEXT);
+ assert(istextureOffset == offset);
+ }
+#endif
+}
+
+
+/*
+ * For each entry in static_functions[] which use this function
+ * we should implement a dispatch function in glapitemp.h and
+ * in glapinoop.c
+ */
+static int NotImplemented(void)
+{
+ return 0;
+}
+
+
+
+static struct name_address_pair static_functions[] = {
+ { "NotImplemented", (GLvoid *) NotImplemented },
+
+ /* GL 1.1 */
+ { "glAccum", (GLvoid *) glAccum },
+ { "glAlphaFunc", (GLvoid *) glAlphaFunc },
+ { "glBegin", (GLvoid *) glBegin },
+ { "glBitmap", (GLvoid *) glBitmap },
+ { "glBlendFunc", (GLvoid *) glBlendFunc },
+ { "glCallList", (GLvoid *) glCallList },
+ { "glCallLists", (GLvoid *) glCallLists },
+ { "glClear", (GLvoid *) glClear },
+ { "glClearAccum", (GLvoid *) glClearAccum },
+ { "glClearColor", (GLvoid *) glClearColor },
+ { "glClearDepth", (GLvoid *) glClearDepth },
+ { "glClearIndex", (GLvoid *) glClearIndex },
+ { "glClearStencil", (GLvoid *) glClearStencil },
+ { "glClipPlane", (GLvoid *) glClipPlane },
+ { "glColor3b", (GLvoid *) glColor3b },
+ { "glColor3bv", (GLvoid *) glColor3bv },
+ { "glColor3d", (GLvoid *) glColor3d },
+ { "glColor3dv", (GLvoid *) glColor3dv },
+ { "glColor3f", (GLvoid *) glColor3f },
+ { "glColor3fv", (GLvoid *) glColor3fv },
+ { "glColor3i", (GLvoid *) glColor3i },
+ { "glColor3iv", (GLvoid *) glColor3iv },
+ { "glColor3s", (GLvoid *) glColor3s },
+ { "glColor3sv", (GLvoid *) glColor3sv },
+ { "glColor3ub", (GLvoid *) glColor3ub },
+ { "glColor3ubv", (GLvoid *) glColor3ubv },
+ { "glColor3ui", (GLvoid *) glColor3ui },
+ { "glColor3uiv", (GLvoid *) glColor3uiv },
+ { "glColor3us", (GLvoid *) glColor3us },
+ { "glColor3usv", (GLvoid *) glColor3usv },
+ { "glColor4b", (GLvoid *) glColor4b },
+ { "glColor4bv", (GLvoid *) glColor4bv },
+ { "glColor4d", (GLvoid *) glColor4d },
+ { "glColor4dv", (GLvoid *) glColor4dv },
+ { "glColor4f", (GLvoid *) glColor4f },
+ { "glColor4fv", (GLvoid *) glColor4fv },
+ { "glColor4i", (GLvoid *) glColor4i },
+ { "glColor4iv", (GLvoid *) glColor4iv },
+ { "glColor4s", (GLvoid *) glColor4s },
+ { "glColor4sv", (GLvoid *) glColor4sv },
+ { "glColor4ub", (GLvoid *) glColor4ub },
+ { "glColor4ubv", (GLvoid *) glColor4ubv },
+ { "glColor4ui", (GLvoid *) glColor4ui },
+ { "glColor4uiv", (GLvoid *) glColor4uiv },
+ { "glColor4us", (GLvoid *) glColor4us },
+ { "glColor4usv", (GLvoid *) glColor4usv },
+ { "glColorMask", (GLvoid *) glColorMask },
+ { "glColorMaterial", (GLvoid *) glColorMaterial },
+ { "glCopyPixels", (GLvoid *) glCopyPixels },
+ { "glCullFace", (GLvoid *) glCullFace },
+ { "glDeleteLists", (GLvoid *) glDeleteLists },
+ { "glDepthFunc", (GLvoid *) glDepthFunc },
+ { "glDepthMask", (GLvoid *) glDepthMask },
+ { "glDepthRange", (GLvoid *) glDepthRange },
+ { "glDisable", (GLvoid *) glDisable },
+ { "glDrawBuffer", (GLvoid *) glDrawBuffer },
+ { "glDrawPixels", (GLvoid *) glDrawPixels },
+ { "glEdgeFlag", (GLvoid *) glEdgeFlag },
+ { "glEdgeFlagv", (GLvoid *) glEdgeFlagv },
+ { "glEnable", (GLvoid *) glEnable },
+ { "glEnd", (GLvoid *) glEnd },
+ { "glEndList", (GLvoid *) glEndList },
+ { "glEvalCoord1d", (GLvoid *) glEvalCoord1d },
+ { "glEvalCoord1dv", (GLvoid *) glEvalCoord1dv },
+ { "glEvalCoord1f", (GLvoid *) glEvalCoord1f },
+ { "glEvalCoord1fv", (GLvoid *) glEvalCoord1fv },
+ { "glEvalCoord2d", (GLvoid *) glEvalCoord2d },
+ { "glEvalCoord2dv", (GLvoid *) glEvalCoord2dv },
+ { "glEvalCoord2f", (GLvoid *) glEvalCoord2f },
+ { "glEvalCoord2fv", (GLvoid *) glEvalCoord2fv },
+ { "glEvalMesh1", (GLvoid *) glEvalMesh1 },
+ { "glEvalMesh2", (GLvoid *) glEvalMesh2 },
+ { "glEvalPoint1", (GLvoid *) glEvalPoint1 },
+ { "glEvalPoint2", (GLvoid *) glEvalPoint2 },
+ { "glFeedbackBuffer", (GLvoid *) glFeedbackBuffer },
+ { "glFinish", (GLvoid *) glFinish },
+ { "glFlush", (GLvoid *) glFlush },
+ { "glFogf", (GLvoid *) glFogf },
+ { "glFogfv", (GLvoid *) glFogfv },
+ { "glFogi", (GLvoid *) glFogi },
+ { "glFogiv", (GLvoid *) glFogiv },
+ { "glFrontFace", (GLvoid *) glFrontFace },
+ { "glFrustum", (GLvoid *) glFrustum },
+ { "glGenLists", (GLvoid *) glGenLists },
+ { "glGetBooleanv", (GLvoid *) glGetBooleanv },
+ { "glGetClipPlane", (GLvoid *) glGetClipPlane },
+ { "glGetDoublev", (GLvoid *) glGetDoublev },
+ { "glGetError", (GLvoid *) glGetError },
+ { "glGetFloatv", (GLvoid *) glGetFloatv },
+ { "glGetIntegerv", (GLvoid *) glGetIntegerv },
+ { "glGetLightfv", (GLvoid *) glGetLightfv },
+ { "glGetLightiv", (GLvoid *) glGetLightiv },
+ { "glGetMapdv", (GLvoid *) glGetMapdv },
+ { "glGetMapfv", (GLvoid *) glGetMapfv },
+ { "glGetMapiv", (GLvoid *) glGetMapiv },
+ { "glGetMaterialfv", (GLvoid *) glGetMaterialfv },
+ { "glGetMaterialiv", (GLvoid *) glGetMaterialiv },
+ { "glGetPixelMapfv", (GLvoid *) glGetPixelMapfv },
+ { "glGetPixelMapuiv", (GLvoid *) glGetPixelMapuiv },
+ { "glGetPixelMapusv", (GLvoid *) glGetPixelMapusv },
+ { "glGetPolygonStipple", (GLvoid *) glGetPolygonStipple },
+ { "glGetString", (GLvoid *) glGetString },
+ { "glGetTexEnvfv", (GLvoid *) glGetTexEnvfv },
+ { "glGetTexEnviv", (GLvoid *) glGetTexEnviv },
+ { "glGetTexGendv", (GLvoid *) glGetTexGendv },
+ { "glGetTexGenfv", (GLvoid *) glGetTexGenfv },
+ { "glGetTexGeniv", (GLvoid *) glGetTexGeniv },
+ { "glGetTexImage", (GLvoid *) glGetTexImage },
+ { "glGetTexLevelParameterfv", (GLvoid *) glGetTexLevelParameterfv },
+ { "glGetTexLevelParameteriv", (GLvoid *) glGetTexLevelParameteriv },
+ { "glGetTexParameterfv", (GLvoid *) glGetTexParameterfv },
+ { "glGetTexParameteriv", (GLvoid *) glGetTexParameteriv },
+ { "glHint", (GLvoid *) glHint },
+ { "glIndexMask", (GLvoid *) glIndexMask },
+ { "glIndexd", (GLvoid *) glIndexd },
+ { "glIndexdv", (GLvoid *) glIndexdv },
+ { "glIndexf", (GLvoid *) glIndexf },
+ { "glIndexfv", (GLvoid *) glIndexfv },
+ { "glIndexi", (GLvoid *) glIndexi },
+ { "glIndexiv", (GLvoid *) glIndexiv },
+ { "glIndexs", (GLvoid *) glIndexs },
+ { "glIndexsv", (GLvoid *) glIndexsv },
+ { "glInitNames", (GLvoid *) glInitNames },
+ { "glIsEnabled", (GLvoid *) glIsEnabled },
+ { "glIsList", (GLvoid *) glIsList },
+ { "glLightModelf", (GLvoid *) glLightModelf },
+ { "glLightModelfv", (GLvoid *) glLightModelfv },
+ { "glLightModeli", (GLvoid *) glLightModeli },
+ { "glLightModeliv", (GLvoid *) glLightModeliv },
+ { "glLightf", (GLvoid *) glLightf },
+ { "glLightfv", (GLvoid *) glLightfv },
+ { "glLighti", (GLvoid *) glLighti },
+ { "glLightiv", (GLvoid *) glLightiv },
+ { "glLineStipple", (GLvoid *) glLineStipple },
+ { "glLineWidth", (GLvoid *) glLineWidth },
+ { "glListBase", (GLvoid *) glListBase },
+ { "glLoadIdentity", (GLvoid *) glLoadIdentity },
+ { "glLoadMatrixd", (GLvoid *) glLoadMatrixd },
+ { "glLoadMatrixf", (GLvoid *) glLoadMatrixf },
+ { "glLoadName", (GLvoid *) glLoadName },
+ { "glLogicOp", (GLvoid *) glLogicOp },
+ { "glMap1d", (GLvoid *) glMap1d },
+ { "glMap1f", (GLvoid *) glMap1f },
+ { "glMap2d", (GLvoid *) glMap2d },
+ { "glMap2f", (GLvoid *) glMap2f },
+ { "glMapGrid1d", (GLvoid *) glMapGrid1d },
+ { "glMapGrid1f", (GLvoid *) glMapGrid1f },
+ { "glMapGrid2d", (GLvoid *) glMapGrid2d },
+ { "glMapGrid2f", (GLvoid *) glMapGrid2f },
+ { "glMaterialf", (GLvoid *) glMaterialf },
+ { "glMaterialfv", (GLvoid *) glMaterialfv },
+ { "glMateriali", (GLvoid *) glMateriali },
+ { "glMaterialiv", (GLvoid *) glMaterialiv },
+ { "glMatrixMode", (GLvoid *) glMatrixMode },
+ { "glMultMatrixd", (GLvoid *) glMultMatrixd },
+ { "glMultMatrixf", (GLvoid *) glMultMatrixf },
+ { "glNewList", (GLvoid *) glNewList },
+ { "glNormal3b", (GLvoid *) glNormal3b },
+ { "glNormal3bv", (GLvoid *) glNormal3bv },
+ { "glNormal3d", (GLvoid *) glNormal3d },
+ { "glNormal3dv", (GLvoid *) glNormal3dv },
+ { "glNormal3f", (GLvoid *) glNormal3f },
+ { "glNormal3fv", (GLvoid *) glNormal3fv },
+ { "glNormal3i", (GLvoid *) glNormal3i },
+ { "glNormal3iv", (GLvoid *) glNormal3iv },
+ { "glNormal3s", (GLvoid *) glNormal3s },
+ { "glNormal3sv", (GLvoid *) glNormal3sv },
+ { "glOrtho", (GLvoid *) glOrtho },
+ { "glPassThrough", (GLvoid *) glPassThrough },
+ { "glPixelMapfv", (GLvoid *) glPixelMapfv },
+ { "glPixelMapuiv", (GLvoid *) glPixelMapuiv },
+ { "glPixelMapusv", (GLvoid *) glPixelMapusv },
+ { "glPixelStoref", (GLvoid *) glPixelStoref },
+ { "glPixelStorei", (GLvoid *) glPixelStorei },
+ { "glPixelTransferf", (GLvoid *) glPixelTransferf },
+ { "glPixelTransferi", (GLvoid *) glPixelTransferi },
+ { "glPixelZoom", (GLvoid *) glPixelZoom },
+ { "glPointSize", (GLvoid *) glPointSize },
+ { "glPolygonMode", (GLvoid *) glPolygonMode },
+ { "glPolygonOffset", (GLvoid *) glPolygonOffset },
+ { "glPolygonStipple", (GLvoid *) glPolygonStipple },
+ { "glPopAttrib", (GLvoid *) glPopAttrib },
+ { "glPopMatrix", (GLvoid *) glPopMatrix },
+ { "glPopName", (GLvoid *) glPopName },
+ { "glPushAttrib", (GLvoid *) glPushAttrib },
+ { "glPushMatrix", (GLvoid *) glPushMatrix },
+ { "glPushName", (GLvoid *) glPushName },
+ { "glRasterPos2d", (GLvoid *) glRasterPos2d },
+ { "glRasterPos2dv", (GLvoid *) glRasterPos2dv },
+ { "glRasterPos2f", (GLvoid *) glRasterPos2f },
+ { "glRasterPos2fv", (GLvoid *) glRasterPos2fv },
+ { "glRasterPos2i", (GLvoid *) glRasterPos2i },
+ { "glRasterPos2iv", (GLvoid *) glRasterPos2iv },
+ { "glRasterPos2s", (GLvoid *) glRasterPos2s },
+ { "glRasterPos2sv", (GLvoid *) glRasterPos2sv },
+ { "glRasterPos3d", (GLvoid *) glRasterPos3d },
+ { "glRasterPos3dv", (GLvoid *) glRasterPos3dv },
+ { "glRasterPos3f", (GLvoid *) glRasterPos3f },
+ { "glRasterPos3fv", (GLvoid *) glRasterPos3fv },
+ { "glRasterPos3i", (GLvoid *) glRasterPos3i },
+ { "glRasterPos3iv", (GLvoid *) glRasterPos3iv },
+ { "glRasterPos3s", (GLvoid *) glRasterPos3s },
+ { "glRasterPos3sv", (GLvoid *) glRasterPos3sv },
+ { "glRasterPos4d", (GLvoid *) glRasterPos4d },
+ { "glRasterPos4dv", (GLvoid *) glRasterPos4dv },
+ { "glRasterPos4f", (GLvoid *) glRasterPos4f },
+ { "glRasterPos4fv", (GLvoid *) glRasterPos4fv },
+ { "glRasterPos4i", (GLvoid *) glRasterPos4i },
+ { "glRasterPos4iv", (GLvoid *) glRasterPos4iv },
+ { "glRasterPos4s", (GLvoid *) glRasterPos4s },
+ { "glRasterPos4sv", (GLvoid *) glRasterPos4sv },
+ { "glReadBuffer", (GLvoid *) glReadBuffer },
+ { "glReadPixels", (GLvoid *) glReadPixels },
+ { "glRectd", (GLvoid *) glRectd },
+ { "glRectdv", (GLvoid *) glRectdv },
+ { "glRectf", (GLvoid *) glRectf },
+ { "glRectfv", (GLvoid *) glRectfv },
+ { "glRecti", (GLvoid *) glRecti },
+ { "glRectiv", (GLvoid *) glRectiv },
+ { "glRects", (GLvoid *) glRects },
+ { "glRectsv", (GLvoid *) glRectsv },
+ { "glRenderMode", (GLvoid *) glRenderMode },
+ { "glRotated", (GLvoid *) glRotated },
+ { "glRotatef", (GLvoid *) glRotatef },
+ { "glScaled", (GLvoid *) glScaled },
+ { "glScalef", (GLvoid *) glScalef },
+ { "glScissor", (GLvoid *) glScissor },
+ { "glSelectBuffer", (GLvoid *) glSelectBuffer },
+ { "glShadeModel", (GLvoid *) glShadeModel },
+ { "glStencilFunc", (GLvoid *) glStencilFunc },
+ { "glStencilMask", (GLvoid *) glStencilMask },
+ { "glStencilOp", (GLvoid *) glStencilOp },
+ { "glTexCoord1d", (GLvoid *) glTexCoord1d },
+ { "glTexCoord1dv", (GLvoid *) glTexCoord1dv },
+ { "glTexCoord1f", (GLvoid *) glTexCoord1f },
+ { "glTexCoord1fv", (GLvoid *) glTexCoord1fv },
+ { "glTexCoord1i", (GLvoid *) glTexCoord1i },
+ { "glTexCoord1iv", (GLvoid *) glTexCoord1iv },
+ { "glTexCoord1s", (GLvoid *) glTexCoord1s },
+ { "glTexCoord1sv", (GLvoid *) glTexCoord1sv },
+ { "glTexCoord2d", (GLvoid *) glTexCoord2d },
+ { "glTexCoord2dv", (GLvoid *) glTexCoord2dv },
+ { "glTexCoord2f", (GLvoid *) glTexCoord2f },
+ { "glTexCoord2fv", (GLvoid *) glTexCoord2fv },
+ { "glTexCoord2i", (GLvoid *) glTexCoord2i },
+ { "glTexCoord2iv", (GLvoid *) glTexCoord2iv },
+ { "glTexCoord2s", (GLvoid *) glTexCoord2s },
+ { "glTexCoord2sv", (GLvoid *) glTexCoord2sv },
+ { "glTexCoord3d", (GLvoid *) glTexCoord3d },
+ { "glTexCoord3dv", (GLvoid *) glTexCoord3dv },
+ { "glTexCoord3f", (GLvoid *) glTexCoord3f },
+ { "glTexCoord3fv", (GLvoid *) glTexCoord3fv },
+ { "glTexCoord3i", (GLvoid *) glTexCoord3i },
+ { "glTexCoord3iv", (GLvoid *) glTexCoord3iv },
+ { "glTexCoord3s", (GLvoid *) glTexCoord3s },
+ { "glTexCoord3sv", (GLvoid *) glTexCoord3sv },
+ { "glTexCoord4d", (GLvoid *) glTexCoord4d },
+ { "glTexCoord4dv", (GLvoid *) glTexCoord4dv },
+ { "glTexCoord4f", (GLvoid *) glTexCoord4f },
+ { "glTexCoord4fv", (GLvoid *) glTexCoord4fv },
+ { "glTexCoord4i", (GLvoid *) glTexCoord4i },
+ { "glTexCoord4iv", (GLvoid *) glTexCoord4iv },
+ { "glTexCoord4s", (GLvoid *) glTexCoord4s },
+ { "glTexCoord4sv", (GLvoid *) glTexCoord4sv },
+ { "glTexEnvf", (GLvoid *) glTexEnvf },
+ { "glTexEnvfv", (GLvoid *) glTexEnvfv },
+ { "glTexEnvi", (GLvoid *) glTexEnvi },
+ { "glTexEnviv", (GLvoid *) glTexEnviv },
+ { "glTexGend", (GLvoid *) glTexGend },
+ { "glTexGendv", (GLvoid *) glTexGendv },
+ { "glTexGenf", (GLvoid *) glTexGenf },
+ { "glTexGenfv", (GLvoid *) glTexGenfv },
+ { "glTexGeni", (GLvoid *) glTexGeni },
+ { "glTexGeniv", (GLvoid *) glTexGeniv },
+ { "glTexImage1D", (GLvoid *) glTexImage1D },
+ { "glTexImage2D", (GLvoid *) glTexImage2D },
+ { "glTexParameterf", (GLvoid *) glTexParameterf },
+ { "glTexParameterfv", (GLvoid *) glTexParameterfv },
+ { "glTexParameteri", (GLvoid *) glTexParameteri },
+ { "glTexParameteriv", (GLvoid *) glTexParameteriv },
+ { "glTranslated", (GLvoid *) glTranslated },
+ { "glTranslatef", (GLvoid *) glTranslatef },
+ { "glVertex2d", (GLvoid *) glVertex2d },
+ { "glVertex2dv", (GLvoid *) glVertex2dv },
+ { "glVertex2f", (GLvoid *) glVertex2f },
+ { "glVertex2fv", (GLvoid *) glVertex2fv },
+ { "glVertex2i", (GLvoid *) glVertex2i },
+ { "glVertex2iv", (GLvoid *) glVertex2iv },
+ { "glVertex2s", (GLvoid *) glVertex2s },
+ { "glVertex2sv", (GLvoid *) glVertex2sv },
+ { "glVertex3d", (GLvoid *) glVertex3d },
+ { "glVertex3dv", (GLvoid *) glVertex3dv },
+ { "glVertex3f", (GLvoid *) glVertex3f },
+ { "glVertex3fv", (GLvoid *) glVertex3fv },
+ { "glVertex3i", (GLvoid *) glVertex3i },
+ { "glVertex3iv", (GLvoid *) glVertex3iv },
+ { "glVertex3s", (GLvoid *) glVertex3s },
+ { "glVertex3sv", (GLvoid *) glVertex3sv },
+ { "glVertex4d", (GLvoid *) glVertex4d },
+ { "glVertex4dv", (GLvoid *) glVertex4dv },
+ { "glVertex4f", (GLvoid *) glVertex4f },
+ { "glVertex4fv", (GLvoid *) glVertex4fv },
+ { "glVertex4i", (GLvoid *) glVertex4i },
+ { "glVertex4iv", (GLvoid *) glVertex4iv },
+ { "glVertex4s", (GLvoid *) glVertex4s },
+ { "glVertex4sv", (GLvoid *) glVertex4sv },
+ { "glViewport", (GLvoid *) glViewport },
+
+ /* GL 1.1 */
+#ifdef GL_VERSION_1_1
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glAreTexturesResident", (GLvoid *) NAME(glAreTexturesResident) },
+ { "glArrayElement", (GLvoid *) NAME(glArrayElement) },
+ { "glBindTexture", (GLvoid *) NAME(glBindTexture) },
+ { "glColorPointer", (GLvoid *) NAME(glColorPointer) },
+ { "glCopyTexImage1D", (GLvoid *) NAME(glCopyTexImage1D) },
+ { "glCopyTexImage2D", (GLvoid *) NAME(glCopyTexImage2D) },
+ { "glCopyTexSubImage1D", (GLvoid *) NAME(glCopyTexSubImage1D) },
+ { "glCopyTexSubImage2D", (GLvoid *) NAME(glCopyTexSubImage2D) },
+ { "glDeleteTextures", (GLvoid *) NAME(glDeleteTextures) },
+ { "glDisableClientState", (GLvoid *) NAME(glDisableClientState) },
+ { "glDrawArrays", (GLvoid *) NAME(glDrawArrays) },
+ { "glDrawElements", (GLvoid *) NAME(glDrawElements) },
+ { "glEdgeFlagPointer", (GLvoid *) NAME(glEdgeFlagPointer) },
+ { "glEnableClientState", (GLvoid *) NAME(glEnableClientState) },
+ { "glGenTextures", (GLvoid *) NAME(glGenTextures) },
+ { "glGetPointerv", (GLvoid *) NAME(glGetPointerv) },
+ { "glIndexPointer", (GLvoid *) NAME(glIndexPointer) },
+ { "glIndexub", (GLvoid *) NAME(glIndexub) },
+ { "glIndexubv", (GLvoid *) NAME(glIndexubv) },
+ { "glInterleavedArrays", (GLvoid *) NAME(glInterleavedArrays) },
+ { "glIsTexture", (GLvoid *) NAME(glIsTexture) },
+ { "glNormalPointer", (GLvoid *) NAME(glNormalPointer) },
+ { "glPopClientAttrib", (GLvoid *) NAME(glPopClientAttrib) },
+ { "glPrioritizeTextures", (GLvoid *) NAME(glPrioritizeTextures) },
+ { "glPushClientAttrib", (GLvoid *) NAME(glPushClientAttrib) },
+ { "glTexCoordPointer", (GLvoid *) NAME(glTexCoordPointer) },
+ { "glTexSubImage1D", (GLvoid *) NAME(glTexSubImage1D) },
+ { "glTexSubImage2D", (GLvoid *) NAME(glTexSubImage2D) },
+ { "glVertexPointer", (GLvoid *) NAME(glVertexPointer) },
+#undef NAME
+
+ /* GL 1.2 */
+#ifdef GL_VERSION_1_2
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glCopyTexSubImage3D", (GLvoid *) NAME(glCopyTexSubImage3D) },
+ { "glDrawRangeElements", (GLvoid *) NAME(glDrawRangeElements) },
+ { "glTexImage3D", (GLvoid *) NAME(glTexImage3D) },
+ { "glTexSubImage3D", (GLvoid *) NAME(glTexSubImage3D) },
+#undef NAME
+
+ /* GL_ARB_imaging */
+#ifdef GL_ARB_imaging
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glBlendColor", (GLvoid *) NAME(glBlendColor) },
+ { "glBlendEquation", (GLvoid *) NAME(glBlendEquation) },
+ { "glColorSubTable", (GLvoid *) NAME(glColorSubTable) },
+ { "glColorTable", (GLvoid *) NAME(glColorTable) },
+ { "glColorTableParameterfv", (GLvoid *) NAME(glColorTableParameterfv) },
+ { "glColorTableParameteriv", (GLvoid *) NAME(glColorTableParameteriv) },
+ { "glConvolutionFilter1D", (GLvoid *) NAME(glConvolutionFilter1D) },
+ { "glConvolutionFilter2D", (GLvoid *) NAME(glConvolutionFilter2D) },
+ { "glConvolutionParameterf", (GLvoid *) NAME(glConvolutionParameterf) },
+ { "glConvolutionParameterfv", (GLvoid *) NAME(glConvolutionParameterfv) },
+ { "glConvolutionParameteri", (GLvoid *) NAME(glConvolutionParameteri) },
+ { "glConvolutionParameteriv", (GLvoid *) NAME(glConvolutionParameteriv) },
+ { "glCopyColorSubTable", (GLvoid *) NAME(glCopyColorSubTable) },
+ { "glCopyColorTable", (GLvoid *) NAME(glCopyColorTable) },
+ { "glCopyConvolutionFilter1D", (GLvoid *) NAME(glCopyConvolutionFilter1D) },
+ { "glCopyConvolutionFilter2D", (GLvoid *) NAME(glCopyConvolutionFilter2D) },
+ { "glGetColorTable", (GLvoid *) NAME(glGetColorTable) },
+ { "glGetColorTableParameterfv", (GLvoid *) NAME(glGetColorTableParameterfv) },
+ { "glGetColorTableParameteriv", (GLvoid *) NAME(glGetColorTableParameteriv) },
+ { "glGetConvolutionFilter", (GLvoid *) NAME(glGetConvolutionFilter) },
+ { "glGetConvolutionParameterfv", (GLvoid *) NAME(glGetConvolutionParameterfv) },
+ { "glGetConvolutionParameteriv", (GLvoid *) NAME(glGetConvolutionParameteriv) },
+ { "glGetHistogram", (GLvoid *) NAME(glGetHistogram) },
+ { "glGetHistogramParameterfv", (GLvoid *) NAME(glGetHistogramParameterfv) },
+ { "glGetHistogramParameteriv", (GLvoid *) NAME(glGetHistogramParameteriv) },
+ { "glGetMinmax", (GLvoid *) NAME(glGetMinmax) },
+ { "glGetMinmaxParameterfv", (GLvoid *) NAME(glGetMinmaxParameterfv) },
+ { "glGetMinmaxParameteriv", (GLvoid *) NAME(glGetMinmaxParameteriv) },
+ { "glGetSeparableFilter", (GLvoid *) NAME(glGetSeparableFilter) },
+ { "glHistogram", (GLvoid *) NAME(glHistogram) },
+ { "glMinmax", (GLvoid *) NAME(glMinmax) },
+ { "glResetHistogram", (GLvoid *) NAME(glResetHistogram) },
+ { "glResetMinmax", (GLvoid *) NAME(glResetMinmax) },
+ { "glSeparableFilter2D", (GLvoid *) NAME(glSeparableFilter2D) },
+#undef NAME
+
+ /* GL_ARB_multitexture */
+#ifdef GL_ARB_multitexture
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glActiveTextureARB", (GLvoid *) NAME(glActiveTextureARB) },
+ { "glClientActiveTextureARB", (GLvoid *) NAME(glClientActiveTextureARB) },
+ { "glMultiTexCoord1dARB", (GLvoid *) NAME(glMultiTexCoord1dARB) },
+ { "glMultiTexCoord1dvARB", (GLvoid *) NAME(glMultiTexCoord1dvARB) },
+ { "glMultiTexCoord1fARB", (GLvoid *) NAME(glMultiTexCoord1fARB) },
+ { "glMultiTexCoord1fvARB", (GLvoid *) NAME(glMultiTexCoord1fvARB) },
+ { "glMultiTexCoord1iARB", (GLvoid *) NAME(glMultiTexCoord1iARB) },
+ { "glMultiTexCoord1ivARB", (GLvoid *) NAME(glMultiTexCoord1ivARB) },
+ { "glMultiTexCoord1sARB", (GLvoid *) NAME(glMultiTexCoord1sARB) },
+ { "glMultiTexCoord1svARB", (GLvoid *) NAME(glMultiTexCoord1svARB) },
+ { "glMultiTexCoord2dARB", (GLvoid *) NAME(glMultiTexCoord2dARB) },
+ { "glMultiTexCoord2dvARB", (GLvoid *) NAME(glMultiTexCoord2dvARB) },
+ { "glMultiTexCoord2fARB", (GLvoid *) NAME(glMultiTexCoord2fARB) },
+ { "glMultiTexCoord2fvARB", (GLvoid *) NAME(glMultiTexCoord2fvARB) },
+ { "glMultiTexCoord2iARB", (GLvoid *) NAME(glMultiTexCoord2iARB) },
+ { "glMultiTexCoord2ivARB", (GLvoid *) NAME(glMultiTexCoord2ivARB) },
+ { "glMultiTexCoord2sARB", (GLvoid *) NAME(glMultiTexCoord2sARB) },
+ { "glMultiTexCoord2svARB", (GLvoid *) NAME(glMultiTexCoord2svARB) },
+ { "glMultiTexCoord3dARB", (GLvoid *) NAME(glMultiTexCoord3dARB) },
+ { "glMultiTexCoord3dvARB", (GLvoid *) NAME(glMultiTexCoord3dvARB) },
+ { "glMultiTexCoord3fARB", (GLvoid *) NAME(glMultiTexCoord3fARB) },
+ { "glMultiTexCoord3fvARB", (GLvoid *) NAME(glMultiTexCoord3fvARB) },
+ { "glMultiTexCoord3iARB", (GLvoid *) NAME(glMultiTexCoord3iARB) },
+ { "glMultiTexCoord3ivARB", (GLvoid *) NAME(glMultiTexCoord3ivARB) },
+ { "glMultiTexCoord3sARB", (GLvoid *) NAME(glMultiTexCoord3sARB) },
+ { "glMultiTexCoord3svARB", (GLvoid *) NAME(glMultiTexCoord3svARB) },
+ { "glMultiTexCoord4dARB", (GLvoid *) NAME(glMultiTexCoord4dARB) },
+ { "glMultiTexCoord4dvARB", (GLvoid *) NAME(glMultiTexCoord4dvARB) },
+ { "glMultiTexCoord4fARB", (GLvoid *) NAME(glMultiTexCoord4fARB) },
+ { "glMultiTexCoord4fvARB", (GLvoid *) NAME(glMultiTexCoord4fvARB) },
+ { "glMultiTexCoord4iARB", (GLvoid *) NAME(glMultiTexCoord4iARB) },
+ { "glMultiTexCoord4ivARB", (GLvoid *) NAME(glMultiTexCoord4ivARB) },
+ { "glMultiTexCoord4sARB", (GLvoid *) NAME(glMultiTexCoord4sARB) },
+ { "glMultiTexCoord4svARB", (GLvoid *) NAME(glMultiTexCoord4svARB) },
+#undef NAME
+
+ /* 2. GL_EXT_blend_color */
+#ifdef GL_EXT_blend_color
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glBlendColorEXT", (GLvoid *) NAME(glBlendColorEXT) },
+#undef NAME
+
+ /* 3. GL_EXT_polygon_offset */
+#ifdef GL_EXT_polygon_offset
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glPolygonOffsetEXT", (GLvoid *) NAME(glPolygonOffsetEXT) },
+#undef NAME
+
+ /* 6. GL_EXT_texture3D */
+#ifdef GL_EXT_texture3D
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glCopyTexSubImage3DEXT", (GLvoid *) NAME(glCopyTexSubImage3DEXT) },
+ { "glTexImage3DEXT", (GLvoid *) NAME(glTexImage3DEXT) },
+ { "glTexSubImage3DEXT", (GLvoid *) NAME(glTexSubImage3DEXT) },
+#undef NAME
+
+ /* 7. GL_SGI_texture_filter4 */
+#ifdef GL_SGI_texture_filter4
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glGetTexFilterFuncSGIS", (GLvoid *) NAME(glGetTexFilterFuncSGIS) },
+ { "glTexFilterFuncSGIS", (GLvoid *) NAME(glTexFilterFuncSGIS) },
+#undef NAME
+
+ /* 9. GL_EXT_subtexture */
+#ifdef GL_EXT_subtexture
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glTexSubImage1DEXT", (GLvoid *) NAME(glTexSubImage1DEXT) },
+ { "glTexSubImage2DEXT", (GLvoid *) NAME(glTexSubImage2DEXT) },
+#undef NAME
+
+ /* 10. GL_EXT_copy_texture */
+#ifdef GL_EXT_copy_texture
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glCopyTexImage1DEXT", (GLvoid *) NAME(glCopyTexImage1DEXT) },
+ { "glCopyTexImage2DEXT", (GLvoid *) NAME(glCopyTexImage2DEXT) },
+ { "glCopyTexSubImage1DEXT", (GLvoid *) NAME(glCopyTexSubImage1DEXT) },
+ { "glCopyTexSubImage2DEXT", (GLvoid *) NAME(glCopyTexSubImage2DEXT) },
+#undef NAME
+
+ /* 11. GL_EXT_histogram */
+#ifdef GL_EXT_histogram
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glGetHistogramEXT", (GLvoid *) NAME(glGetHistogramEXT) },
+ { "glGetHistogramParameterfvEXT", (GLvoid *) NAME(glGetHistogramParameterfvEXT) },
+ { "glGetHistogramParameterivEXT", (GLvoid *) NAME(glGetHistogramParameterivEXT) },
+ { "glGetMinmaxEXT", (GLvoid *) NAME(glGetMinmaxEXT) },
+ { "glGetMinmaxParameterfvEXT", (GLvoid *) NAME(glGetMinmaxParameterfvEXT) },
+ { "glGetMinmaxParameterivEXT", (GLvoid *) NAME(glGetMinmaxParameterivEXT) },
+ { "glHistogramEXT", (GLvoid *) NAME(glHistogramEXT) },
+ { "glMinmaxEXT", (GLvoid *) NAME(glMinmaxEXT) },
+ { "glResetHistogramEXT", (GLvoid *) NAME(glResetHistogramEXT) },
+ { "glResetMinmaxEXT", (GLvoid *) NAME(glResetMinmaxEXT) },
+#undef NAME
+
+ /* 12. GL_EXT_convolution */
+#ifdef GL_EXT_convolution
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glConvolutionFilter1DEXT", (GLvoid *) NAME(glConvolutionFilter1DEXT) },
+ { "glConvolutionFilter2DEXT", (GLvoid *) NAME(glConvolutionFilter2DEXT) },
+ { "glConvolutionParameterfEXT", (GLvoid *) NAME(glConvolutionParameterfEXT) },
+ { "glConvolutionParameterfvEXT", (GLvoid *) NAME(glConvolutionParameterfvEXT) },
+ { "glConvolutionParameteriEXT", (GLvoid *) NAME(glConvolutionParameteriEXT) },
+ { "glConvolutionParameterivEXT", (GLvoid *) NAME(glConvolutionParameterivEXT) },
+ { "glCopyConvolutionFilter1DEXT", (GLvoid *) NAME(glCopyConvolutionFilter1DEXT) },
+ { "glCopyConvolutionFilter2DEXT", (GLvoid *) NAME(glCopyConvolutionFilter2DEXT) },
+ { "glGetConvolutionFilterEXT", (GLvoid *) NAME(glGetConvolutionFilterEXT) },
+ { "glGetConvolutionParameterivEXT", (GLvoid *) NAME(glGetConvolutionParameterivEXT) },
+ { "glGetConvolutionParameterfvEXT", (GLvoid *) NAME(glGetConvolutionParameterfvEXT) },
+ { "glGetSeparableFilterEXT", (GLvoid *) NAME(glGetSeparableFilterEXT) },
+ { "glSeparableFilter2DEXT", (GLvoid *) NAME(glSeparableFilter2DEXT) },
+#undef NAME
+
+ /* 14. GL_SGI_color_table */
+#ifdef GL_SGI_color_table
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glColorTableSGI", (GLvoid *) NAME(glColorTableSGI) },
+ { "glColorTableParameterfvSGI", (GLvoid *) NAME(glColorTableParameterfvSGI) },
+ { "glColorTableParameterivSGI", (GLvoid *) NAME(glColorTableParameterivSGI) },
+ { "glCopyColorTableSGI", (GLvoid *) NAME(glCopyColorTableSGI) },
+ { "glGetColorTableSGI", (GLvoid *) NAME(glGetColorTableSGI) },
+ { "glGetColorTableParameterfvSGI", (GLvoid *) NAME(glGetColorTableParameterfvSGI) },
+ { "glGetColorTableParameterivSGI", (GLvoid *) NAME(glGetColorTableParameterivSGI) },
+#undef NAME
+
+ /* 15. GL_SGIS_pixel_texture */
+#ifdef GL_SGIS_pixel_texture
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glPixelTexGenParameterfSGIS", (GLvoid *) NAME(glPixelTexGenParameterfSGIS) },
+ { "glPixelTexGenParameteriSGIS", (GLvoid *) NAME(glPixelTexGenParameteriSGIS) },
+ { "glGetPixelTexGenParameterfvSGIS", (GLvoid *) NAME(glGetPixelTexGenParameterfvSGIS) },
+ { "glGetPixelTexGenParameterivSGIS", (GLvoid *) NAME(glGetPixelTexGenParameterivSGIS) },
+#undef NAME
+
+ /* 16. GL_SGIS_texture4D */
+#ifdef GL_SGIS_texture4D
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glTexImage4DSGIS", (GLvoid *) NAME(glTexImage4DSGIS) },
+ { "glTexSubImage4DSGIS", (GLvoid *) NAME(glTexSubImage4DSGIS) },
+#undef NAME
+
+ /* 20. GL_EXT_texture_object */
+#ifdef GL_EXT_texture_object
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glAreTexturesResidentEXT", (GLvoid *) NAME(glAreTexturesResidentEXT) },
+ { "glBindTextureEXT", (GLvoid *) NAME(glBindTextureEXT) },
+ { "glDeleteTexturesEXT", (GLvoid *) NAME(glDeleteTexturesEXT) },
+ { "glGenTexturesEXT", (GLvoid *) NAME(glGenTexturesEXT) },
+ { "glIsTextureEXT", (GLvoid *) NAME(glIsTextureEXT) },
+ { "glPrioritizeTexturesEXT", (GLvoid *) NAME(glPrioritizeTexturesEXT) },
+#undef NAME
+
+ /* 21. GL_SGIS_detail_texture */
+#ifdef GL_SGIS_detail_texture
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glDetailTexFuncSGIS", (GLvoid *) NAME(glDetailTexFuncSGIS) },
+ { "glGetDetailTexFuncSGIS", (GLvoid *) NAME(glGetDetailTexFuncSGIS) },
+#undef NAME
+
+ /* 22. GL_SGIS_sharpen_texture */
+#ifdef GL_SGIS_sharpen_texture
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glGetSharpenTexFuncSGIS", (GLvoid *) NAME(glGetSharpenTexFuncSGIS) },
+ { "glSharpenTexFuncSGIS", (GLvoid *) NAME(glSharpenTexFuncSGIS) },
+#undef NAME
+
+ /* 25. GL_SGIS_multisample */
+#ifdef GL_SGIS_multisample
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glSampleMaskSGIS", (GLvoid *) NAME(glSampleMaskSGIS) },
+ { "glSamplePatternSGIS", (GLvoid *) NAME(glSamplePatternSGIS) },
+#undef NAME
+
+ /* 30. GL_EXT_vertex_array */
+#ifdef GL_EXT_vertex_array
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glArrayElementEXT", (GLvoid *) NAME(glArrayElementEXT) },
+ { "glColorPointerEXT", (GLvoid *) NAME(glColorPointerEXT) },
+ { "glDrawArraysEXT", (GLvoid *) NAME(glDrawArraysEXT) },
+ { "glEdgeFlagPointerEXT", (GLvoid *) NAME(glEdgeFlagPointerEXT) },
+ { "glGetPointervEXT", (GLvoid *) NAME(glGetPointervEXT) },
+ { "glIndexPointerEXT", (GLvoid *) NAME(glIndexPointerEXT) },
+ { "glNormalPointerEXT", (GLvoid *) NAME(glNormalPointerEXT) },
+ { "glTexCoordPointerEXT", (GLvoid *) NAME(glTexCoordPointerEXT) },
+ { "glVertexPointerEXT", (GLvoid *) NAME(glVertexPointerEXT) },
+#undef NAME
+
+ /* 37. GL_EXT_blend_minmax */
+#ifdef GL_EXT_blend_minmax
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glBlendEquationEXT", (GLvoid *) NAME(glBlendEquationEXT) },
+#undef NAME
+
+ /* 52. GL_SGIX_sprite */
+#ifdef GL_SGIX_sprite
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glSpriteParameterfSGIX", (GLvoid *) NAME(glSpriteParameterfSGIX) },
+ { "glSpriteParameterfvSGIX", (GLvoid *) NAME(glSpriteParameterfvSGIX) },
+ { "glSpriteParameteriSGIX", (GLvoid *) NAME(glSpriteParameteriSGIX) },
+ { "glSpriteParameterivSGIX", (GLvoid *) NAME(glSpriteParameterivSGIX) },
+#undef NAME
+
+ /* 54. GL_EXT_point_parameters */
+#ifdef GL_EXT_point_parameters
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glPointParameterfEXT", (GLvoid *) NAME(glPointParameterfEXT) },
+ { "glPointParameterfvEXT", (GLvoid *) NAME(glPointParameterfvEXT) },
+#undef NAME
+
+ /* 55. GL_SGIX_instruments */
+#ifdef GL_SGIX_instruments
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glInstrumentsBufferSGIX", (GLvoid *) NAME(glInstrumentsBufferSGIX) },
+ { "glStartInstrumentsSGIX", (GLvoid *) NAME(glStartInstrumentsSGIX) },
+ { "glStopInstrumentsSGIX", (GLvoid *) NAME(glStopInstrumentsSGIX) },
+ { "glReadInstrumentsSGIX", (GLvoid *) NAME(glReadInstrumentsSGIX) },
+ { "glPollInstrumentsSGIX", (GLvoid *) NAME(glPollInstrumentsSGIX) },
+ { "glGetInstrumentsSGIX", (GLvoid *) NAME(glGetInstrumentsSGIX) },
+#undef NAME
+
+ /* 57. GL_SGIX_framezoom */
+#ifdef GL_SGIX_framezoom
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glFrameZoomSGIX", (GLvoid *) NAME(glFrameZoomSGIX) },
+#undef NAME
+
+ /* 60. GL_SGIX_reference_plane */
+#ifdef GL_SGIX_reference_plane
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glReferencePlaneSGIX", (GLvoid *) NAME(glReferencePlaneSGIX) },
+#undef NAME
+
+ /* 61. GL_SGIX_flush_raster */
+#ifdef GL_SGIX_flush_raster
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glFlushRasterSGIX", (GLvoid *) NAME(glFlushRasterSGIX) },
+#undef NAME
+
+ /* 66. GL_HP_image_transform */
+#ifdef GL_HP_image_transform
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glGetImageTransformParameterfvHP", (GLvoid *) NAME(glGetImageTransformParameterfvHP) },
+ { "glGetImageTransformParameterivHP", (GLvoid *) NAME(glGetImageTransformParameterivHP) },
+ { "glImageTransformParameterfHP", (GLvoid *) NAME(glImageTransformParameterfHP) },
+ { "glImageTransformParameterfvHP", (GLvoid *) NAME(glImageTransformParameterfvHP) },
+ { "glImageTransformParameteriHP", (GLvoid *) NAME(glImageTransformParameteriHP) },
+ { "glImageTransformParameterivHP", (GLvoid *) NAME(glImageTransformParameterivHP) },
+#undef NAME
+
+ /* 74. GL_EXT_color_subtable */
+#ifdef GL_EXT_color_subtable
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glColorSubTableEXT", (GLvoid *) NAME(glColorSubTableEXT) },
+ { "glCopyColorSubTableEXT", (GLvoid *) NAME(glCopyColorSubTableEXT) },
+#undef NAME
+
+ /* 77. GL_PGI_misc_hints */
+#ifdef GL_PGI_misc_hints
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glHintPGI", (GLvoid *) NAME(glHintPGI) },
+#undef NAME
+
+ /* 78. GL_EXT_paletted_texture */
+#ifdef GL_EXT_paletted_texture
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glColorTableEXT", (GLvoid *) NAME(glColorTableEXT) },
+ { "glGetColorTableEXT", (GLvoid *) NAME(glGetColorTableEXT) },
+ { "glGetColorTableParameterfvEXT", (GLvoid *) NAME(glGetColorTableParameterfvEXT) },
+ { "glGetColorTableParameterivEXT", (GLvoid *) NAME(glGetColorTableParameterivEXT) },
+#undef NAME
+
+ /* 80. GL_SGIX_list_priority */
+#ifdef GL_SGIX_list_priority
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glGetListParameterfvSGIX", (GLvoid *) NAME(glGetListParameterfvSGIX) },
+ { "glGetListParameterivSGIX", (GLvoid *) NAME(glGetListParameterivSGIX) },
+ { "glListParameterfSGIX", (GLvoid *) NAME(glListParameterfSGIX) },
+ { "glListParameterfvSGIX", (GLvoid *) NAME(glListParameterfvSGIX) },
+ { "glListParameteriSGIX", (GLvoid *) NAME(glListParameteriSGIX) },
+ { "glListParameterivSGIX", (GLvoid *) NAME(glListParameterivSGIX) },
+#undef NAME
+
+ /* 94. GL_EXT_index_material */
+#ifdef GL_EXT_index_material
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glIndexMaterialEXT", (GLvoid *) NAME(glIndexMaterialEXT) },
+#undef NAME
+
+ /* 95. GL_EXT_index_func */
+#ifdef GL_EXT_index_func
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glIndexFuncEXT", (GLvoid *) NAME(glIndexFuncEXT) },
+#undef NAME
+
+ /* 97. GL_EXT_compiled_vertex_array */
+#ifdef GL_EXT_compiled_vertex_array
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glLockArraysEXT", (GLvoid *) NAME(glLockArraysEXT) },
+ { "glUnlockArraysEXT", (GLvoid *) NAME(glUnlockArraysEXT) },
+#undef NAME
+
+ /* 98. GL_EXT_cull_vertex */
+#ifdef GL_EXT_cull_vertex
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glCullParameterfvEXT", (GLvoid *) NAME(glCullParameterfvEXT) },
+ { "glCullParameterdvEXT", (GLvoid *) NAME(glCullParameterdvEXT) },
+#undef NAME
+
+ /* 173. GL_EXT/INGR_blend_func_separate */
+#ifdef GL_INGR_blend_func_separate
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glBlendFuncSeparateINGR", (GLvoid *) NAME(glBlendFuncSeparateINGR) },
+#undef NAME
+
+ /* GL_MESA_window_pos */
+#ifdef MESA_window_pos
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glWindowPos4fMESA", (GLvoid *) NAME(glWindowPos4fMESA) },
+#undef NAME
+
+ /* GL_MESA_resize_buffers */
+#ifdef MESA_resize_buffers
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glResizeBuffersMESA", (GLvoid *) NAME(glResizeBuffersMESA) },
+#undef NAME
+
+ /* GL_ARB_transpose_matrix */
+#ifdef GL_ARB_transpose_matrix
+#define NAME(X) X
+#else
+#define NAME(X) NotImplemented
+#endif
+ { "glLoadTransposeMatrixdARB", (GLvoid *) NAME(glLoadTransposeMatrixdARB) },
+ { "glLoadTransposeMatrixfARB", (GLvoid *) NAME(glLoadTransposeMatrixfARB) },
+ { "glMultTransposeMatrixdARB", (GLvoid *) NAME(glMultTransposeMatrixdARB) },
+ { "glMultTransposeMatrixfARB", (GLvoid *) NAME(glMultTransposeMatrixfARB) },
+#undef NAME
+
+ /*
+ * XXX many more extenstion functions to add.
+ */
+
+ { NULL, NULL } /* end of list marker */
+};
+
diff --git a/xc/extras/Mesa/src/glapi.h b/xc/extras/Mesa/src/glapi.h
new file mode 100644
index 000000000..0a4f8dcc9
--- /dev/null
+++ b/xc/extras/Mesa/src/glapi.h
@@ -0,0 +1,90 @@
+/* $Id: glapi.h,v 1.2 2000/01/30 00:27:02 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999-2000 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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 _GLAPI_H
+#define _GLAPI_H
+
+
+#include "GL/gl.h"
+
+struct _glapi_table;
+
+
+extern void *_glapi_Context;
+
+extern struct _glapi_table *_glapi_Dispatch;
+
+
+extern void
+_glapi_check_multithread(void);
+
+
+extern void
+_glapi_set_context(void *context);
+
+
+extern void *
+_glapi_get_context(void);
+
+
+extern void
+_glapi_set_dispatch(struct _glapi_table *dispatch);
+
+
+extern struct _glapi_table *
+_glapi_get_dispatch(void);
+
+
+extern GLuint
+_glapi_get_dispatch_table_size(void);
+
+
+extern const char *
+_glapi_get_version(void);
+
+
+extern void
+_glapi_check_table(const struct _glapi_table *table);
+
+
+extern GLboolean
+_glapi_add_entrypoint(const char *funcName, GLuint offset);
+
+
+extern GLint
+_glapi_get_proc_offset(const char *funcName);
+
+
+extern const GLvoid *
+_glapi_get_proc_address(const char *funcName);
+
+
+extern const char *
+_glapi_get_proc_name(GLuint offset);
+
+
+#endif
diff --git a/xc/extras/Mesa/src/glapinoop.c b/xc/extras/Mesa/src/glapinoop.c
new file mode 100644
index 000000000..f8be80cbc
--- /dev/null
+++ b/xc/extras/Mesa/src/glapinoop.c
@@ -0,0 +1,4869 @@
+/* $Id: glapinoop.c,v 1.2 2000/01/30 00:27:02 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999-2000 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+/*
+ * This is part of the reusable GL dispather, see glapi.c for details.
+ */
+
+
+#include <stdio.h>
+#include "glapi.h"
+#include "glapinoop.h"
+#include "glapitable.h"
+
+
+static GLboolean WarnFlag = GL_FALSE;
+
+
+void
+_glapi_noop_enable_warnings(GLboolean enable)
+{
+ WarnFlag = enable;
+}
+
+
+static void
+warning(const char *funcName)
+{
+ if (WarnFlag) {
+ fprintf(stderr, "GL User Error: calling %s without a current context\n",
+ funcName);
+ }
+}
+
+
+
+static void NoOpAccum(GLenum op, GLfloat value)
+{
+ (void) op;
+ (void) value;
+ warning("glAccum");
+}
+
+static void NoOpAlphaFunc(GLenum func, GLclampf ref)
+{
+ (void) func;
+ (void) ref;
+ warning("glAlphaFunc");
+}
+
+static void NoOpBegin(GLenum mode)
+{
+ (void) mode;
+ warning("glBegin");
+}
+
+static void NoOpBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap)
+{
+ (void) width;
+ (void) height;
+ (void) xorig;
+ (void) yorig;
+ (void) xmove;
+ (void) ymove;
+ (void) bitmap;
+ warning("glBitmap");
+}
+
+static void NoOpBlendFunc(GLenum sfactor, GLenum dfactor)
+{
+ (void) sfactor;
+ (void) dfactor;
+ warning("glBlendFunc");
+}
+
+static void NoOpCallList(GLuint list)
+{
+ (void) list;
+ warning("glCallList");
+}
+
+static void NoOpCallLists(GLsizei n, GLenum type, const GLvoid *lists)
+{
+ (void) n;
+ (void) type;
+ (void) lists;
+ warning("glCallLists");
+}
+
+static void NoOpClear(GLbitfield mask)
+{
+ (void) mask;
+ warning("glClear");
+}
+
+static void NoOpClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ (void) alpha;
+ warning("glClearAccum");
+}
+
+static void NoOpClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ (void) alpha;
+ warning("glClearColor");
+}
+
+static void NoOpClearDepth(GLclampd depth)
+{
+ (void) depth;
+ warning("gl");
+}
+
+static void NoOpClearIndex(GLfloat c)
+{
+ (void) c;
+ warning("glClearIndex");
+}
+
+static void NoOpClearStencil(GLint s)
+{
+ (void) s;
+ warning("glStencil");
+}
+
+static void NoOpClipPlane(GLenum plane, const GLdouble *equation)
+{
+ (void) plane;
+ (void) equation;
+ warning("glClipPlane");
+}
+
+static void NoOpColor3b(GLbyte red, GLbyte green, GLbyte blue)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ warning("glColor3b");
+}
+
+static void NoOpColor3d(GLdouble red, GLdouble green, GLdouble blue)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ warning("glColor3d");
+}
+
+static void NoOpColor3f(GLfloat red, GLfloat green, GLfloat blue)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ warning("glColor3f");
+}
+
+static void NoOpColor3i(GLint red, GLint green, GLint blue)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ warning("glColor3i");
+}
+
+static void NoOpColor3s(GLshort red, GLshort green, GLshort blue)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ warning("glColor3s");
+}
+
+static void NoOpColor3ub(GLubyte red, GLubyte green, GLubyte blue)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ warning("glColor3ub");
+}
+
+static void NoOpColor3ui(GLuint red, GLuint green, GLuint blue)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ warning("glColor3ui");
+}
+
+static void NoOpColor3us(GLushort red, GLushort green, GLushort blue)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ warning("glColor3us");
+}
+
+static void NoOpColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ (void) alpha;
+ warning("glColor4b");
+}
+
+static void NoOpColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ (void) alpha;
+ warning("glColor4d");
+}
+
+static void NoOpColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ (void) alpha;
+ warning("glColor4f");
+}
+
+static void NoOpColor4i(GLint red, GLint green, GLint blue, GLint alpha)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ (void) alpha;
+ warning("glColor4i");
+}
+
+static void NoOpColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ (void) alpha;
+ warning("glColor4s");
+}
+
+static void NoOpColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ (void) alpha;
+ warning("glColor4ub");
+}
+
+static void NoOpColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ (void) alpha;
+ warning("glColor4ui");
+}
+
+static void NoOpColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ (void) alpha;
+ warning("glColor4us");
+}
+
+static void NoOpColor3bv(const GLbyte *v)
+{
+ (void) v;
+ warning("glColor3bv");
+}
+
+static void NoOpColor3dv(const GLdouble *v)
+{
+ (void) v;
+ warning("glColor3dv");
+}
+
+static void NoOpColor3fv(const GLfloat *v)
+{
+ (void) v;
+ warning("glColor3fv");
+}
+
+static void NoOpColor3iv(const GLint *v)
+{
+ (void) v;
+ warning("glColor3iv");
+}
+
+static void NoOpColor3sv(const GLshort *v)
+{
+ (void) v;
+ warning("glColor3sv");
+}
+
+static void NoOpColor3ubv(const GLubyte *v)
+{
+ (void) v;
+ warning("glColor3ubv");
+}
+
+static void NoOpColor3uiv(const GLuint *v)
+{
+ (void) v;
+ warning("glColor3uiv");
+}
+
+static void NoOpColor3usv(const GLushort *v)
+{
+ (void) v;
+ warning("glColor3usv");
+}
+
+static void NoOpColor4bv(const GLbyte *v)
+{
+ (void) v;
+ warning("glColor4bv");
+}
+
+static void NoOpColor4dv(const GLdouble *v)
+{
+ (void) v;
+ warning("glColor4dv");
+}
+
+static void NoOpColor4fv(const GLfloat *v)
+{
+ (void) v;
+ warning("glColor4fv");
+}
+
+static void NoOpColor4iv(const GLint *v)
+{
+ (void) v;
+ warning("glColor4iv");
+}
+
+static void NoOpColor4sv(const GLshort *v)
+{
+ (void) v;
+ warning("glColor4sv");
+}
+
+static void NoOpColor4ubv(const GLubyte *v)
+{
+ (void) v;
+ warning("glColor4ubv");
+}
+
+static void NoOpColor4uiv(const GLuint *v)
+{
+ (void) v;
+ warning("glColor4uiv");
+}
+
+static void NoOpColor4usv(const GLushort *v)
+{
+ (void) v;
+ warning("glColor4usv");
+}
+
+static void NoOpColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+{
+ (void) red;
+ (void) green;
+ (void) blue;
+ (void) alpha;
+ warning("glColorMask");
+}
+
+static void NoOpColorMaterial(GLenum face, GLenum mode)
+{
+ (void) face;
+ (void) mode;
+ warning("glColorMaterial");
+}
+
+static void NoOpCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
+{
+ (void) x;
+ (void) y;
+ (void) width;
+ (void) height;
+ (void) type;
+ warning("glCopyPixels");
+}
+
+static void NoOpCullFace(GLenum mode)
+{
+ (void) mode;
+ warning("glCullFace");
+}
+
+static void NoOpDepthFunc(GLenum func)
+{
+ (void) func;
+ warning("glDepthFunc");
+}
+
+static void NoOpDepthMask(GLboolean flag)
+{
+ (void) flag;
+ warning("glDepthMask");
+}
+
+static void NoOpDepthRange(GLclampd nearVal, GLclampd farVal)
+{
+ (void) nearVal;
+ (void) farVal;
+ warning("glDepthRange");
+}
+
+static void NoOpDeleteLists(GLuint list, GLsizei range)
+{
+ (void) list;
+ (void) range;
+ warning("glDeleteLists");
+}
+
+static void NoOpDisable(GLenum cap)
+{
+ (void) cap;
+ warning("glDisable");
+}
+
+static void NoOpDisableClientState(GLenum cap)
+{
+ (void) cap;
+ warning("glDisableClientState");
+}
+
+static void NoOpDrawBuffer(GLenum mode)
+{
+ (void) mode;
+ warning("glDrawBuffer");
+}
+
+static void NoOpDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ (void) width;
+ (void) height;
+ (void) format;
+ (void) type;
+ (void) pixels;
+ warning("glDrawPixels");
+}
+
+static void NoOpEnable(GLenum mode)
+{
+ (void) mode;
+ warning("glEnable");
+}
+
+static void NoOpEnd(void)
+{
+ warning("glEnd");
+}
+
+static void NoOpEndList(void)
+{
+ warning("glEndList");
+}
+
+static void NoOpEvalCoord1d(GLdouble u)
+{
+ (void) u;
+ warning("glEvalCoord1d");
+}
+
+static void NoOpEvalCoord1f(GLfloat u)
+{
+ (void) u;
+ warning("glEvalCoord1f");
+}
+
+static void NoOpEvalCoord1dv(const GLdouble *u)
+{
+ (void) u;
+ warning("glEvalCoord1dv");
+}
+
+static void NoOpEvalCoord1fv(const GLfloat *u)
+{
+ (void) u;
+ warning("glEvalCoord1fv");
+}
+
+static void NoOpEvalCoord2d(GLdouble u, GLdouble v)
+{
+ (void) u;
+ (void) v;
+ warning("glEvalCoord2d");
+}
+
+static void NoOpEvalCoord2f(GLfloat u, GLfloat v)
+{
+ (void) u;
+ (void) v;
+ warning("glEvalCoord2f");
+}
+
+static void NoOpEvalCoord2dv(const GLdouble *u)
+{
+ (void) u;
+ warning("glEvalCoord2dv");
+}
+
+static void NoOpEvalCoord2fv(const GLfloat *u)
+{
+ (void) u;
+ warning("glEvalCoord2fv");
+}
+
+static void NoOpEvalPoint1(GLint i)
+{
+ (void) i;
+ warning("glEvalPoint1");
+}
+
+static void NoOpEvalPoint2(GLint i, GLint j)
+{
+ (void) i;
+ (void) j;
+ warning("glEvalPoint2");
+}
+
+static void NoOpEvalMesh1(GLenum mode, GLint i1, GLint i2)
+{
+ (void) mode;
+ (void) i1;
+ (void) i2;
+ warning("glEvalMesh1");
+}
+
+static void NoOpEdgeFlag(GLboolean flag)
+{
+ (void) flag;
+ warning("glEdgeFlag");
+}
+
+static void NoOpEdgeFlagv(const GLboolean *flag)
+{
+ (void) flag;
+ warning("glEdgeFlagv");
+}
+
+static void NoOpEdgeFlagPointer(GLsizei stride, const GLvoid *ptr)
+{
+ (void) stride;
+ (void) ptr;
+ warning("glEdgeFlagPointer");
+}
+
+static void NoOpEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
+{
+ (void) mode;
+ (void) i1;
+ (void) i2;
+ (void) j1;
+ (void) j2;
+ warning("glEvalMesh2");
+}
+
+static void NoOpFeedbackBuffer(GLsizei size, GLenum type, GLfloat *buffer)
+{
+ (void) size;
+ (void) type;
+ (void) buffer;
+ warning("glFeedbackBuffer");
+}
+
+static void NoOpFinish(void)
+{
+ warning("glFinish");
+}
+
+static void NoOpFlush(void)
+{
+ warning("glFlush");
+}
+
+static void NoOpFogf(GLenum pname, GLfloat param)
+{
+ (void) pname;
+ (void) param;
+ warning("glFogf");
+}
+
+static void NoOpFogi(GLenum pname, GLint param)
+{
+ (void) pname;
+ (void) param;
+ warning("glFogi");
+}
+
+static void NoOpFogfv(GLenum pname, const GLfloat *params)
+{
+ (void) pname;
+ (void) params;
+ warning("glFogfv");
+}
+
+static void NoOpFogiv(GLenum pname, const GLint *params)
+{
+ (void) pname;
+ (void) params;
+ warning("glFogiv");
+}
+
+static void NoOpFrontFace(GLenum mode)
+{
+ (void) mode;
+ warning("glFrontFace");
+}
+
+static void NoOpFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
+{
+ (void) left;
+ (void) right;
+ (void) bottom;
+ (void) top;
+ (void) nearval;
+ (void) farval;
+ warning("glFrustum");
+}
+
+static GLuint NoOpGenLists(GLsizei range)
+{
+ (void) range;
+ warning("glGenLists");
+ return 0;
+}
+
+static void NoOpGetBooleanv(GLenum pname, GLboolean *params)
+{
+ (void) pname;
+ (void) params;
+ warning("glGetBooleanv");
+}
+
+static void NoOpGetClipPlane(GLenum plane, GLdouble *equation)
+{
+ (void) plane;
+ (void) equation;
+ warning("glGetClipPlane");
+}
+
+static void NoOpGetDoublev(GLenum pname, GLdouble *params)
+{
+ (void) pname;
+ (void) params;
+ warning("glGetDoublev");
+}
+
+static GLenum NoOpGetError(void)
+{
+ warning("glGetError");
+ return (GLenum) 0;
+}
+
+static void NoOpGetFloatv(GLenum pname, GLfloat *params)
+{
+ (void) pname;
+ (void) params;
+ warning("glGetFloatv");
+}
+
+static void NoOpGetIntegerv(GLenum pname, GLint *params)
+{
+ (void) pname;
+ (void) params;
+ warning("glGetIntegerv");
+}
+
+static void NoOpGetLightfv(GLenum light, GLenum pname, GLfloat *params)
+{
+ (void) light;
+ (void) pname;
+ (void) params;
+ warning("glGetLightfv");
+}
+
+static void NoOpGetLightiv(GLenum light, GLenum pname, GLint *params)
+{
+ (void) light;
+ (void) pname;
+ (void) params;
+ warning("glGetLightiv");
+}
+
+static void NoOpGetMapdv(GLenum target, GLenum query, GLdouble *v)
+{
+ (void) target;
+ (void) query;
+ (void) v;
+ warning("glGetMapdv");
+}
+
+static void NoOpGetMapfv(GLenum target, GLenum query, GLfloat *v)
+{
+ (void) target;
+ (void) query;
+ (void) v;
+ warning("glGetMapfv");
+}
+
+static void NoOpGetMapiv(GLenum target, GLenum query, GLint *v)
+{
+ (void) target;
+ (void) query;
+ (void) v;
+ warning("glGetMapiv");
+}
+
+static void NoOpGetMaterialfv(GLenum face, GLenum pname, GLfloat *params)
+{
+ (void) face;
+ (void) pname;
+ (void) params;
+ warning("glGetMaterialfv");
+}
+
+static void NoOpGetMaterialiv(GLenum face, GLenum pname, GLint *params)
+{
+ (void) face;
+ (void) pname;
+ (void) params;
+ warning("glGetMaterialiv");
+}
+
+static void NoOpGetPixelMapfv(GLenum map, GLfloat *values)
+{
+ (void) map;
+ (void) values;
+ warning("glGetPixelMapfv");
+}
+
+static void NoOpGetPixelMapuiv(GLenum map, GLuint *values)
+{
+ (void) map;
+ (void) values;
+ warning("glGetPixelMapuiv");
+}
+
+static void NoOpGetPixelMapusv(GLenum map, GLushort *values)
+{
+ (void) map;
+ (void) values;
+ warning("glGetPixelMapusv");
+}
+
+static void NoOpGetPolygonStipple(GLubyte *mask)
+{
+ (void) mask;
+ warning("glGetPolygonStipple");
+}
+
+static const GLubyte * NoOpGetString(GLenum name)
+{
+ (void) name;
+ warning("glGetString");
+ return NULL;
+}
+
+static void NoOpGetTexEnvfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetTexEnvfv");
+}
+
+static void NoOpGetTexEnviv(GLenum target, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetTexEnviv");
+}
+
+static void NoOpGetTexGeniv(GLenum coord, GLenum pname, GLint *params)
+{
+ (void) coord;
+ (void) pname;
+ (void) params;
+ warning("glGetTexGeniv");
+}
+
+static void NoOpGetTexGendv(GLenum coord, GLenum pname, GLdouble *params)
+{
+ (void) coord;
+ (void) pname;
+ (void) params;
+ warning("glGetTexGendv");
+}
+
+static void NoOpGetTexGenfv(GLenum coord, GLenum pname, GLfloat *params)
+{
+ (void) coord;
+ (void) pname;
+ (void) params;
+ warning("glGetTexGenfv");
+}
+
+static void NoOpGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels)
+{
+ (void) target;
+ (void) level;
+ (void) format;
+ (void) type;
+ (void) pixels;
+ warning("glGetTexImage");
+}
+
+static void NoOpGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) level;
+ (void) pname;
+ (void) params;
+ warning("glGetTexLevelParameterfv");
+}
+
+static void NoOpGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) level;
+ (void) pname;
+ (void) params;
+ warning("glGetTexLevelParameteriv");
+}
+
+static void NoOpGetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetTexParameterfv");
+}
+
+static void NoOpGetTexParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetTexParameteriv");
+}
+
+static void NoOpHint(GLenum target, GLenum mode)
+{
+ (void) target;
+ (void) mode;
+ warning("glHint");
+}
+
+static void NoOpIndexd(GLdouble c)
+{
+ (void) c;
+ warning("glIndexd");
+}
+
+static void NoOpIndexdv(const GLdouble *c)
+{
+ (void) c;
+ warning("glIndexdv");
+}
+
+static void NoOpIndexf(GLfloat c)
+{
+ (void) c;
+ warning("glIndexf");
+}
+
+static void NoOpIndexfv(const GLfloat *c)
+{
+ (void) c;
+ warning("glIndexfv");
+}
+
+static void NoOpIndexi(GLint c)
+{
+ (void) c;
+ warning("glIndexi");
+}
+
+static void NoOpIndexiv(const GLint *c)
+{
+ (void) c;
+ warning("glIndexiv");
+}
+
+static void NoOpIndexs(GLshort c)
+{
+ (void) c;
+ warning("glIndexs");
+}
+
+static void NoOpIndexsv(const GLshort *c)
+{
+ (void) c;
+ warning("glIndexsv");
+}
+
+static void NoOpIndexMask(GLuint mask)
+{
+ (void) mask;
+ warning("glIndexMask");
+}
+
+static void NoOpInitNames(void)
+{
+ warning("glInitNames");
+}
+
+static GLboolean NoOpIsList(GLuint list)
+{
+ (void) list;
+ warning("glIsList");
+ return GL_FALSE;
+}
+
+static void NoOpLightf(GLenum light, GLenum pname, GLfloat param)
+{
+ (void) light;
+ (void) pname;
+ (void) param;
+ warning("glLightf");
+}
+
+static void NoOpLighti(GLenum light, GLenum pname, GLint param)
+{
+ (void) light;
+ (void) pname;
+ (void) param;
+ warning("glLighti");
+}
+
+static void NoOpLightfv(GLenum light, GLenum pname, const GLfloat *params)
+{
+ (void) light;
+ (void) pname;
+ (void) params;
+ warning("glLightfv");
+}
+
+static void NoOpLightiv(GLenum light, GLenum pname, const GLint *params)
+{
+ (void) light;
+ (void) pname;
+ (void) params;
+ warning("glLightiv");
+}
+
+static void NoOpLightModelf(GLenum pname, GLfloat param)
+{
+ (void) pname;
+ (void) param;
+ warning("glLightModelf");
+}
+
+static void NoOpLightModeli(GLenum pname, GLint param)
+{
+ (void) pname;
+ (void) param;
+ warning("glLightModeli");
+}
+
+static void NoOpLightModelfv(GLenum pname, const GLfloat *params)
+{
+ (void) pname;
+ (void) params;
+ warning("glLightModelfv");
+}
+
+static void NoOpLightModeliv(GLenum pname, const GLint *params)
+{
+ (void) pname;
+ (void) params;
+ warning("glLightModeliv");
+}
+
+static void NoOpLineWidth(GLfloat width)
+{
+ (void) width;
+ warning("glLineWidth");
+}
+
+static void NoOpLineStipple(GLint factor, GLushort pattern)
+{
+ (void) factor;
+ (void) pattern;
+ warning("glLineStipple");
+}
+
+static void NoOpListBase(GLuint base)
+{
+ (void) base;
+ warning("glListBase");
+}
+
+static void NoOpLoadIdentity(void)
+{
+ warning("glLoadIdentity");
+}
+
+static void NoOpLoadMatrixd(const GLdouble *m)
+{
+ (void) m;
+ warning("glLoadMatrixd");
+}
+
+static void NoOpLoadMatrixf(const GLfloat *m)
+{
+ (void) m;
+ warning("glLoadMatrixf");
+}
+
+static void NoOpLoadName(GLuint name)
+{
+ (void) name;
+ warning("glLoadName");
+}
+
+static void NoOpLogicOp(GLenum opcode)
+{
+ (void) opcode;
+ warning("glLogicOp");
+}
+
+static void NoOpMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points)
+{
+ (void) target;
+ (void) u1;
+ (void) u2;
+ (void) stride;
+ (void) order;
+ (void) points;
+ warning("glMap1d");
+}
+
+static void NoOpMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points)
+{
+ (void) target;
+ (void) u1;
+ (void) u2;
+ (void) stride;
+ (void) order;
+ (void) points;
+ warning("glMap1f");
+}
+
+static void NoOpMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points)
+{
+ (void) target;
+ (void) u1;
+ (void) u2;
+ (void) ustride;
+ (void) uorder;
+ (void) v1;
+ (void) v2;
+ (void) vstride;
+ (void) vorder;
+ (void) points;
+ warning("glMap2d");
+}
+
+static void NoOpMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points)
+{
+ (void) target;
+ (void) u1;
+ (void) u2;
+ (void) ustride;
+ (void) uorder;
+ (void) v1;
+ (void) v2;
+ (void) vstride;
+ (void) vorder;
+ (void) points;
+ warning("glMap2f");
+}
+
+static void NoOpMapGrid1d(GLint un, GLdouble u1, GLdouble u2)
+{
+ (void) un;
+ (void) u1;
+ (void) u2;
+ warning("glMapGrid1d");
+}
+
+static void NoOpMapGrid1f(GLint un, GLfloat u1, GLfloat u2)
+{
+ (void) un;
+ (void) u1;
+ (void) u2;
+ warning("glMapGrid1f");
+}
+
+static void NoOpMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
+{
+ (void) un;
+ (void) u1;
+ (void) u2;
+ (void) vn;
+ (void) v1;
+ (void) v2;
+ warning("glMapGrid2d");
+}
+
+static void NoOpMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
+{
+ (void) un;
+ (void) u1;
+ (void) u2;
+ (void) vn;
+ (void) v1;
+ (void) v2;
+ warning("glMapGrid2f");
+}
+
+static void NoOpMaterialf(GLenum face, GLenum pname, GLfloat param)
+{
+ (void) face;
+ (void) pname;
+ (void) param;
+ warning("glMaterialf");
+}
+
+static void NoOpMateriali(GLenum face, GLenum pname, GLint param)
+{
+ (void) face;
+ (void) pname;
+ (void) param;
+ warning("glMateriali");
+}
+
+static void NoOpMaterialfv(GLenum face, GLenum pname, const GLfloat *params)
+{
+ (void) face;
+ (void) pname;
+ (void) params;
+ warning("glMaterialfv");
+}
+
+static void NoOpMaterialiv(GLenum face, GLenum pname, const GLint *params)
+{
+ (void) face;
+ (void) pname;
+ (void) params;
+ warning("glMaterialiv");
+}
+
+static void NoOpMatrixMode(GLenum mode)
+{
+ (void) mode;
+ warning("glMatrixMode");
+}
+
+static void NoOpMultMatrixd(const GLdouble *m)
+{
+ (void) m;
+ warning("glMultMatrixd");
+}
+
+static void NoOpMultMatrixf(const GLfloat *m)
+{
+ (void) m;
+ warning("glMultMatrixf");
+}
+
+static void NoOpNewList(GLuint list, GLenum mode)
+{
+ (void) list;
+ (void) mode;
+ warning("glNewList");
+}
+
+static void NoOpNormal3b(GLbyte nx, GLbyte ny, GLbyte nz)
+{
+ (void) nx;
+ (void) ny;
+ (void) nz;
+ warning("glNormal3b");
+}
+
+static void NoOpNormal3bv(const GLbyte *v)
+{
+ (void) v;
+ warning("glNormal3bv");
+}
+
+static void NoOpNormal3d(GLdouble nx, GLdouble ny, GLdouble nz)
+{
+ (void) nx;
+ (void) ny;
+ (void) nz;
+ warning("glNormal3d");
+}
+
+static void NoOpNormal3dv(const GLdouble *v)
+{
+ (void) v;
+ warning("glNormal3dv");
+}
+
+static void NoOpNormal3f(GLfloat nx, GLfloat ny, GLfloat nz)
+{
+ (void) nx;
+ (void) ny;
+ (void) nz;
+ warning("glNormal3f");
+}
+
+static void NoOpNormal3fv(const GLfloat *v)
+{
+ (void) v;
+ warning("glNormal3fv");
+}
+
+static void NoOpNormal3i(GLint nx, GLint ny, GLint nz)
+{
+ (void) nx;
+ (void) ny;
+ (void) nz;
+ warning("glNormal3i");
+}
+
+static void NoOpNormal3iv(const GLint *v)
+{
+ (void) v;
+ warning("glNormal3iv");
+}
+
+static void NoOpNormal3s(GLshort nx, GLshort ny, GLshort nz)
+{
+ (void) nx;
+ (void) ny;
+ (void) nz;
+ warning("glNormal3s");
+}
+
+static void NoOpNormal3sv(const GLshort *v)
+{
+ (void) v;
+ warning("glNormal3sv");
+}
+
+static void NoOpOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
+{
+ (void) left;
+ (void) right;
+ (void) bottom;
+ (void) top;
+ (void) nearval;
+ (void) farval;
+ warning("glOrtho");
+}
+
+static void NoOpPassThrough(GLfloat token)
+{
+ (void) token;
+ warning("glPassThrough");
+}
+
+static void NoOpPixelMapfv(GLenum map, GLint mapsize, const GLfloat *values)
+{
+ (void) map;
+ (void) mapsize;
+ (void) values;
+ warning("glPixelMapfv");
+}
+
+static void NoOpPixelMapuiv(GLenum map, GLint mapsize, const GLuint *values)
+{
+ (void) map;
+ (void) mapsize;
+ (void) values;
+ warning("glPixelMapuiv");
+}
+
+static void NoOpPixelMapusv(GLenum map, GLint mapsize, const GLushort *values)
+{
+ (void) map;
+ (void) mapsize;
+ (void) values;
+ warning("glPixelMapusv");
+}
+
+static void NoOpPixelStoref(GLenum pname, GLfloat param)
+{
+ (void) pname;
+ (void) param;
+ warning("glPixelStoref");
+}
+
+static void NoOpPixelStorei(GLenum pname, GLint param)
+{
+ (void) pname;
+ (void) param;
+ warning("glPixelStorei");
+}
+
+static void NoOpPixelTransferf(GLenum pname, GLfloat param)
+{
+ (void) pname;
+ (void) param;
+ warning("glPixelTransferf");
+}
+
+static void NoOpPixelTransferi(GLenum pname, GLint param)
+{
+ (void) pname;
+ (void) param;
+ warning("glPixelTransferi");
+}
+
+static void NoOpPixelZoom(GLfloat xfactor, GLfloat yfactor)
+{
+ (void) xfactor;
+ (void) yfactor;
+ warning("glPixelZoom");
+}
+
+static void NoOpPointSize(GLfloat size)
+{
+ (void) size;
+ warning("glPointSize");
+}
+
+static void NoOpPolygonMode(GLenum face, GLenum mode)
+{
+ (void) face;
+ (void) mode;
+ warning("glPolygonMode");
+}
+
+static void NoOpPolygonStipple(const GLubyte *pattern)
+{
+ (void) pattern;
+ warning("glPolygonStipple");
+}
+
+static void NoOpPopAttrib(void)
+{
+ warning("glPopAttrib");
+}
+
+static void NoOpPopMatrix(void)
+{
+ warning("glPopMatrix");
+}
+
+static void NoOpPopName(void)
+{
+ warning("glPopName");
+}
+
+static void NoOpPushMatrix(void)
+{
+ warning("glPushMatrix");
+}
+
+static void NoOpRasterPos2d(GLdouble x, GLdouble y)
+{
+ (void) x;
+ (void) y;
+ warning("glRasterPos2d");
+}
+
+static void NoOpRasterPos2f(GLfloat x, GLfloat y)
+{
+ (void) x;
+ (void) y;
+ warning("glRasterPos2f");
+}
+
+static void NoOpRasterPos2i(GLint x, GLint y)
+{
+ (void) x;
+ (void) y;
+ warning("glRasterPos2i");
+}
+
+static void NoOpRasterPos2s(GLshort x, GLshort y)
+{
+ (void) x;
+ (void) y;
+ warning("glRasterPos2s");
+}
+
+static void NoOpRasterPos3d(GLdouble x, GLdouble y, GLdouble z)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ warning("glRasterPos3d");
+}
+
+static void NoOpRasterPos3f(GLfloat x, GLfloat y, GLfloat z)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ warning("glRasterPos3f");
+}
+
+static void NoOpRasterPos3i(GLint x, GLint y, GLint z)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ warning("glRasterPos3i");
+}
+
+static void NoOpRasterPos3s(GLshort x, GLshort y, GLshort z)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ warning("glRasterPos3s");
+}
+
+static void NoOpRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ (void) w;
+ warning("glRasterPos4d");
+}
+
+static void NoOpRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ (void) w;
+ warning("glRasterPos4f");
+}
+
+static void NoOpRasterPos4i(GLint x, GLint y, GLint z, GLint w)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ (void) w;
+ warning("glRasterPos4i");
+}
+
+static void NoOpRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ (void) w;
+ warning("glRasterPos4s");
+}
+
+static void NoOpRasterPos2dv(const GLdouble *v)
+{
+ (void) v;
+ warning("glRasterPos2dv");
+}
+
+static void NoOpRasterPos2fv(const GLfloat *v)
+{
+ (void) v;
+ warning("glRasterPos2fv");
+}
+
+static void NoOpRasterPos2iv(const GLint *v)
+{
+ (void) v;
+ warning("glRasterPos2iv");
+}
+
+static void NoOpRasterPos2sv(const GLshort *v)
+{
+ (void) v;
+ warning("glRasterPos2sv");
+}
+
+static void NoOpRasterPos3dv(const GLdouble *v)
+{
+ (void) v;
+ warning("glRasterPos3dv");
+}
+
+static void NoOpRasterPos3fv(const GLfloat *v)
+{
+ (void) v;
+ warning("glRasterPos3fv");
+}
+
+static void NoOpRasterPos3iv(const GLint *v)
+{
+ (void) v;
+ warning("glRasterPos3iv");
+}
+
+static void NoOpRasterPos3sv(const GLshort *v)
+{
+ (void) v;
+ warning("glRasterPos3sv");
+}
+
+static void NoOpRasterPos4dv(const GLdouble *v)
+{
+ (void) v;
+ warning("glRasterPos4dv");
+}
+
+static void NoOpRasterPos4fv(const GLfloat *v)
+{
+ (void) v;
+ warning("glRasterPos4fv");
+}
+
+static void NoOpRasterPos4iv(const GLint *v)
+{
+ (void) v;
+ warning("glRasterPos4iv");
+}
+
+static void NoOpRasterPos4sv(const GLshort *v)
+{
+ (void) v;
+ warning("glRasterPos4sv");
+}
+
+static void NoOpReadBuffer(GLenum mode)
+{
+ (void) mode;
+ warning("glReadBuffer");
+}
+
+static void NoOpReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
+{
+ (void) x;
+ (void) y;
+ (void) width;
+ (void) height;
+ (void) format;
+ (void) type;
+ (void) pixels;
+ warning("glReadPixels");
+}
+
+static void NoOpRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
+{
+ (void) x1;
+ (void) y1;
+ (void) x2;
+ (void) y2;
+ warning("glRectd");
+}
+
+static void NoOpRectdv(const GLdouble *v1, const GLdouble *v2)
+{
+ (void) v1;
+ (void) v2;
+ warning("glRectdv");
+}
+
+static void NoOpRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
+{
+ (void) x1;
+ (void) y1;
+ (void) x2;
+ (void) y2;
+ warning("glRectf");
+}
+
+static void NoOpRectfv(const GLfloat *v1, const GLfloat *v2)
+{
+ (void) v1;
+ (void) v2;
+ warning("glRectfv");
+}
+
+static void NoOpRecti(GLint x1, GLint y1, GLint x2, GLint y2)
+{
+ (void) x1;
+ (void) y1;
+ (void) x2;
+ (void) y2;
+ warning("glRecti");
+}
+
+static void NoOpRectiv(const GLint *v1, const GLint *v2)
+{
+ (void) v1;
+ (void) v2;
+ warning("glRectiv");
+}
+
+static void NoOpRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
+{
+ (void) x1;
+ (void) y1;
+ (void) x2;
+ (void) y2;
+ warning("glRects");
+}
+
+static void NoOpRectsv(const GLshort *v1, const GLshort *v2)
+{
+ (void) v1;
+ (void) v2;
+ warning("glRectsv");
+}
+
+static void NoOpScissor(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ (void) x;
+ (void) y;
+ (void) width;
+ (void) height;
+ warning("glScissor");
+}
+
+static GLboolean NoOpIsEnabled(GLenum cap)
+{
+ (void) cap;
+ warning("glIsEnabled");
+ return GL_FALSE;
+}
+
+static void NoOpPushAttrib(GLbitfield mask)
+{
+ (void) mask;
+ warning("glPushAttrib");
+}
+
+static void NoOpPushName(GLuint name)
+{
+ (void) name;
+ warning("glPushName");
+}
+
+static GLint NoOpRenderMode(GLenum mode)
+{
+ (void) mode;
+ warning("glRenderMode");
+ return 0;
+}
+
+static void NoOpRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
+{
+ (void) angle;
+ (void) x;
+ (void) y;
+ (void) z;
+ warning("glRotated");
+}
+
+static void NoOpRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
+{
+ (void) angle;
+ (void) x;
+ (void) y;
+ (void) z;
+ warning("glRotatef");
+}
+
+static void NoOpSelectBuffer(GLsizei size, GLuint *buffer)
+{
+ (void) size;
+ (void) buffer;
+ warning("glSelectBuffer");
+}
+
+static void NoOpScaled(GLdouble x, GLdouble y, GLdouble z)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ warning("glScaled");
+}
+
+static void NoOpScalef(GLfloat x, GLfloat y, GLfloat z)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ warning("glScalef");
+}
+
+static void NoOpShadeModel(GLenum mode)
+{
+ (void) mode;
+ warning("glShadeModel");
+}
+
+static void NoOpStencilFunc(GLenum func, GLint ref, GLuint mask)
+{
+ (void) func;
+ (void) ref;
+ (void) mask;
+ warning("glStencilFunc");
+}
+
+static void NoOpStencilMask(GLuint mask)
+{
+ (void) mask;
+ warning("glStencilMask");
+}
+
+static void NoOpStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
+{
+ (void) fail;
+ (void) zfail;
+ (void) zpass;
+ warning("glStencilOp");
+}
+
+static void NoOpTexCoord1d(GLdouble s)
+{
+ (void) s;
+ warning("glTexCoord1d");
+}
+
+static void NoOpTexCoord1dv(const GLdouble *v)
+{
+ (void) v;
+ warning("glTexCoord1dv");
+}
+
+static void NoOpTexCoord1f(GLfloat s)
+{
+ (void) s;
+ warning("glTexCoord1f");
+}
+
+static void NoOpTexCoord1fv(const GLfloat *v)
+{
+ (void) v;
+ warning("glTexCoord1fv");
+}
+
+static void NoOpTexCoord1i(GLint s)
+{
+ (void) s;
+ warning("glTexCoord1i");
+}
+
+static void NoOpTexCoord1iv(const GLint *v)
+{
+ (void) v;
+ warning("glTexCoord1iv");
+}
+
+static void NoOpTexCoord1s(GLshort s)
+{
+ (void) s;
+ warning("glTexCoord1s");
+}
+
+static void NoOpTexCoord1sv(const GLshort *v)
+{
+ (void) v;
+ warning("glTexCoord1sv");
+}
+
+static void NoOpTexCoord2d(GLdouble s, GLdouble t)
+{
+ (void) s;
+ (void) t;
+ warning("glTexCoord2d");
+}
+
+static void NoOpTexCoord2dv(const GLdouble *v)
+{
+ (void) v;
+ warning("glTexCoord2dv");
+}
+
+static void NoOpTexCoord2f(GLfloat s, GLfloat t)
+{
+ (void) s;
+ (void) t;
+ warning("glTexCoord2f");
+}
+
+static void NoOpTexCoord2fv(const GLfloat *v)
+{
+ (void) v;
+ warning("glTexCoord2fv");
+}
+
+static void NoOpTexCoord2s(GLshort s, GLshort t)
+{
+ (void) s;
+ (void) t;
+ warning("glTexCoord2s");
+}
+
+static void NoOpTexCoord2sv(const GLshort *v)
+{
+ (void) v;
+ warning("glTexCoord2sv");
+}
+
+static void NoOpTexCoord2i(GLint s, GLint t)
+{
+ (void) s;
+ (void) t;
+ warning("glTexCoord2i");
+}
+
+static void NoOpTexCoord2iv(const GLint *v)
+{
+ (void) v;
+ warning("glTexCoord2iv");
+}
+
+static void NoOpTexCoord3d(GLdouble s, GLdouble t, GLdouble r)
+{
+ (void) s;
+ (void) t;
+ (void) r;
+ warning("glTexCoord3d");
+}
+
+static void NoOpTexCoord3dv(const GLdouble *v)
+{
+ (void) v;
+ warning("glTexCoord3dv");
+}
+
+static void NoOpTexCoord3f(GLfloat s, GLfloat t, GLfloat r)
+{
+ (void) s;
+ (void) t;
+ (void) r;
+ warning("glTexCoord3f");
+}
+
+static void NoOpTexCoord3fv(const GLfloat *v)
+{
+ (void) v;
+ warning("glTexCoord3fv");
+}
+
+static void NoOpTexCoord3i(GLint s, GLint t, GLint r)
+{
+ (void) s;
+ (void) t;
+ (void) r;
+ warning("glTexCoord3i");
+}
+
+static void NoOpTexCoord3iv(const GLint *v)
+{
+ (void) v;
+ warning("glTexCoord3iv");
+}
+
+static void NoOpTexCoord3s(GLshort s, GLshort t, GLshort r)
+{
+ (void) s;
+ (void) t;
+ (void) r;
+ warning("glTexCoord3s");
+}
+
+static void NoOpTexCoord3sv(const GLshort *v)
+{
+ (void) v;
+ warning("glTexCoord3sv");
+}
+
+static void NoOpTexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+ (void) s;
+ (void) t;
+ (void) r;
+ warning("glTexCoord4d");
+}
+
+static void NoOpTexCoord4dv(const GLdouble *v)
+{
+ (void) v;
+ warning("glTexCoord4dv");
+}
+
+static void NoOpTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+ (void) s;
+ (void) t;
+ (void) r;
+ (void) q;
+ warning("glTexCoord4f");
+}
+
+static void NoOpTexCoord4fv(const GLfloat *v)
+{
+ (void) v;
+ warning("glTexCoord4fv");
+}
+
+static void NoOpTexCoord4i(GLint s, GLint t, GLint r, GLint q)
+{
+ (void) s;
+ (void) t;
+ (void) r;
+ (void) q;
+ warning("glTexCoord4i");
+}
+
+static void NoOpTexCoord4iv(const GLint *v)
+{
+ (void) v;
+ warning("glTexCoord4iv");
+}
+
+static void NoOpTexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q)
+{
+ (void) s;
+ (void) t;
+ (void) r;
+ (void) q;
+ warning("glTexCoord4s");
+}
+
+static void NoOpTexCoord4sv(const GLshort *v)
+{
+ (void) v;
+ warning("glTexCoord4sv");
+}
+
+static void NoOpTexGend(GLenum coord, GLenum pname, GLdouble param)
+{
+ (void) coord;
+ (void) pname;
+ (void) param;
+ warning("glTexGend");
+}
+
+static void NoOpTexGenf(GLenum coord, GLenum pname, GLfloat param)
+{
+ (void) coord;
+ (void) pname;
+ (void) param;
+ warning("glTexGenf");
+}
+
+static void NoOpTexGeni(GLenum coord, GLenum pname, GLint param)
+{
+ (void) coord;
+ (void) pname;
+ (void) param;
+ warning("glTexGeni");
+}
+
+static void NoOpTexGendv(GLenum coord, GLenum pname, const GLdouble *params)
+{
+ (void) coord;
+ (void) pname;
+ (void) params;
+ warning("glTexGendv");
+}
+
+static void NoOpTexGeniv(GLenum coord, GLenum pname, const GLint *params)
+{
+ (void) coord;
+ (void) pname;
+ (void) params;
+ warning("glTexGeniv");
+}
+
+static void NoOpTexGenfv(GLenum coord, GLenum pname, const GLfloat *params)
+{
+ (void) coord;
+ (void) pname;
+ (void) params;
+ warning("glTexGenfv");
+}
+
+static void NoOpTexEnvf(GLenum target, GLenum pname, GLfloat param)
+{
+ (void) target;
+ (void) pname;
+ (void) param;
+ warning("glTexEnvf");
+}
+
+static void NoOpTexEnvi(GLenum target, GLenum pname, GLint param)
+{
+ (void) target;
+ (void) pname;
+ (void) param;
+ warning("glTexEnvi");
+}
+
+static void NoOpTexEnvfv(GLenum target, GLenum pname, const GLfloat *param)
+{
+ (void) target;
+ (void) pname;
+ (void) param;
+ warning("glTexEnvfv");
+}
+
+static void NoOpTexEnviv(GLenum target, GLenum pname, const GLint *param)
+{
+ (void) target;
+ (void) pname;
+ (void) param;
+ warning("glTexEnviv");
+}
+
+static void NoOpTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ (void) target;
+ (void) level;
+ (void) internalformat;
+ (void) width;
+ (void) border;
+ (void) format;
+ (void) type;
+ (void) pixels;
+ warning("glTexImage1D");
+}
+
+static void NoOpTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ (void) target;
+ (void) level;
+ (void) internalformat;
+ (void) width;
+ (void) height;
+ (void) border;
+ (void) format;
+ (void) type;
+ (void) pixels;
+ warning("glTexImage2D");
+}
+
+static void NoOpTexParameterf(GLenum target, GLenum pname, GLfloat param)
+{
+ (void) target;
+ (void) pname;
+ (void) param;
+ warning("glTexParameterf");
+}
+
+static void NoOpTexParameteri(GLenum target, GLenum pname, GLint param)
+{
+ (void) target;
+ (void) pname;
+ (void) param;
+ warning("glTexParameteri");
+}
+
+static void NoOpTexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glTexParameterfv");
+}
+
+static void NoOpTexParameteriv(GLenum target, GLenum pname, const GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glTexParameteriv");
+}
+
+static void NoOpTranslated(GLdouble x, GLdouble y, GLdouble z)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ warning("glTranslated");
+}
+
+static void NoOpTranslatef(GLfloat x, GLfloat y, GLfloat z)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ warning("glTranslatef");
+}
+
+static void NoOpVertex2d(GLdouble x, GLdouble y)
+{
+ (void) x;
+ (void) y;
+ warning("glVertex2d");
+}
+
+static void NoOpVertex2dv(const GLdouble *v)
+{
+ (void) v;
+ warning("glVertex2dv");
+}
+
+static void NoOpVertex2f(GLfloat x, GLfloat y)
+{
+ (void) x;
+ (void) y;
+ warning("glVertex2f");
+}
+
+static void NoOpVertex2fv(const GLfloat *v)
+{
+ (void) v;
+ warning("glVertex2fv");
+}
+
+static void NoOpVertex2i(GLint x, GLint y)
+{
+ (void) x;
+ (void) y;
+ warning("glVertex2i");
+}
+
+static void NoOpVertex2iv(const GLint *v)
+{
+ (void) v;
+ warning("glVertex2iv");
+}
+
+static void NoOpVertex2s(GLshort x, GLshort y)
+{
+ (void) x;
+ (void) y;
+ warning("glVertex2s");
+}
+
+static void NoOpVertex2sv(const GLshort *v)
+{
+ (void) v;
+ warning("glVertex2sv");
+}
+
+static void NoOpVertex3d(GLdouble x, GLdouble y, GLdouble z)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ warning("glVertex3d");
+}
+
+static void NoOpVertex3dv(const GLdouble *v)
+{
+ (void) v;
+ warning("glVertex3dv");
+}
+
+static void NoOpVertex3f(GLfloat x, GLfloat y, GLfloat z)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ warning("glVertex3f");
+}
+
+static void NoOpVertex3fv(const GLfloat *v)
+{
+ (void) v;
+ warning("glVertex3fv");
+}
+
+static void NoOpVertex3i(GLint x, GLint y, GLint z)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ warning("glVertex3i");
+}
+
+static void NoOpVertex3iv(const GLint *v)
+{
+ (void) v;
+ warning("glVertex3iv");
+}
+
+static void NoOpVertex3s(GLshort x, GLshort y, GLshort z)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ warning("glVertex3s");
+}
+
+static void NoOpVertex3sv(const GLshort *v)
+{
+ (void) v;
+ warning("glVertex3sv");
+}
+
+static void NoOpVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ (void) w;
+ warning("glVertex4d");
+}
+
+static void NoOpVertex4dv(const GLdouble *v)
+{
+ (void) v;
+ warning("glVertex4dv");
+}
+
+static void NoOpVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ (void) w;
+ warning("glVertex4f");
+}
+
+static void NoOpVertex4fv(const GLfloat *v)
+{
+ (void) v;
+ warning("glVertex4fv");
+}
+
+static void NoOpVertex4i(GLint x, GLint y, GLint z, GLint w)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ (void) w;
+ warning("glVertex4i");
+}
+
+static void NoOpVertex4iv(const GLint *v)
+{
+ (void) v;
+ warning("glVertex4iv");
+}
+
+static void NoOpVertex4s(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ (void) w;
+ warning("glVertex4s");
+}
+
+static void NoOpVertex4sv(const GLshort *v)
+{
+ (void) v;
+ warning("glVertex4sv");
+}
+
+static void NoOpViewport(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ (void) x;
+ (void) y;
+ (void) width;
+ (void) height;
+ warning("glViewport");
+}
+
+
+/* GL 1.1 */
+
+static GLboolean NoOpAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences)
+{
+ (void) n;
+ (void) textures;
+ (void) residences;
+ warning("glAreTexturesResident");
+ return GL_FALSE;
+}
+
+static void NoOpArrayElement(GLint i)
+{
+ (void) i;
+ warning("glArrayElement");
+}
+
+static void NoOpBindTexture(GLenum target, GLuint texture)
+{
+ (void) target;
+ (void) texture;
+ warning("glBindTexture");
+}
+
+static void NoOpColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+ (void) size;
+ (void) type;
+ (void) stride;
+ (void) ptr;
+ warning("glColorPointer");
+}
+
+static void NoOpCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
+{
+ (void) target;
+ (void) level;
+ (void) internalformat;
+ (void) x;
+ (void) y;
+ (void) width;
+ (void) border;
+ warning("glCopyTexImage1D");
+}
+
+static void NoOpCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+ (void) target;
+ (void) level;
+ (void) internalformat;
+ (void) x;
+ (void) y;
+ (void) width;
+ (void) height;
+ (void) border;
+ warning("glCopyTexImage2D");
+}
+
+static void NoOpCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
+{
+ (void) target;
+ (void) level;
+ (void) xoffset;
+ (void) x;
+ (void) y;
+ (void) width;
+ warning("glCopyTexSubImage1D");
+}
+
+static void NoOpCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ (void) target;
+ (void) level;
+ (void) xoffset;
+ (void) yoffset;
+ (void) x;
+ (void) y;
+ (void) width;
+ (void) height;
+ warning("glCopyTexSubImage2D");
+}
+
+static void NoOpDeleteTextures(GLsizei n, const GLuint *textures)
+{
+ (void) n;
+ (void) textures;
+ warning("glDeleteTextures");
+}
+
+static void NoOpDrawArrays(GLenum mode, GLint first, GLsizei count)
+{
+ (void) mode;
+ (void) first;
+ (void) count;
+ warning("glDrawArrays");
+}
+
+static void NoOpDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
+{
+ (void) mode;
+ (void) type;
+ (void) indices;
+ warning("glDrawElements");
+}
+
+static void NoOpEnableClientState(GLenum cap)
+{
+ (void) cap;
+ warning("glEnableClientState");
+}
+
+static void NoOpGenTextures(GLsizei n, GLuint *textures)
+{
+ (void) n;
+ (void) textures;
+ warning("glGenTextures");
+}
+
+static void NoOpGetPointerv(GLenum pname, GLvoid **params)
+{
+ (void) pname;
+ (void) params;
+ warning("glGetPointerv");
+}
+
+static void NoOpIndexub(GLubyte c)
+{
+ (void) c;
+ warning("glIndexub");
+}
+
+static void NoOpIndexubv(const GLubyte *c)
+{
+ (void) c;
+ warning("glIndexubv");
+}
+
+static void NoOpIndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+ (void) type;
+ (void) stride;
+ (void) ptr;
+ warning("glIndexPointer");
+}
+
+static void NoOpInterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer)
+{
+ (void) format;
+ (void) stride;
+ (void) pointer;
+ warning("glInterleavedArrays");
+}
+
+static GLboolean NoOpIsTexture(GLuint texture)
+{
+ (void) texture;
+ warning("glIsTexture");
+ return GL_FALSE;
+}
+
+static void NoOpNormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+ (void) type;
+ (void) stride;
+ (void) ptr;
+ warning("glNormalPointer");
+}
+
+static void NoOpPolygonOffset(GLfloat factor, GLfloat units)
+{
+ (void) factor;
+ (void) units;
+ warning("glPolygonOffset");
+}
+
+static void NoOpPopClientAttrib(void)
+{
+ warning("glPopClientAttrib");
+}
+
+static void NoOpPrioritizeTextures(GLsizei n, const GLuint *textures, const GLclampf *priorities)
+{
+ (void) n;
+ (void) textures;
+ (void) priorities;
+ warning("glPrioritizeTextures");
+}
+
+static void NoOpPushClientAttrib(GLbitfield mask)
+{
+ (void) mask;
+ warning("glPushClientAttrib");
+}
+
+static void NoOpTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+ (void) size;
+ (void) type;
+ (void) stride;
+ (void) ptr;
+ warning("glTexCoordPointer");
+}
+
+static void NoOpTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ (void) target;
+ (void) level;
+ (void) xoffset;
+ (void) width;
+ (void) format;
+ (void) type;
+ (void) pixels;
+ warning("glTexSubImage1D");
+}
+
+static void NoOpTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ (void) target;
+ (void) level;
+ (void) xoffset;
+ (void) yoffset;
+ (void) width;
+ (void) height;
+ (void) format;
+ (void) type;
+ (void) pixels;
+ warning("glTexSubImage2D");
+}
+
+static void NoOpVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+ (void) size;
+ (void) type;
+ (void) stride;
+ (void) ptr;
+ warning("glVertexPointer");
+}
+
+
+
+/* GL 1.2 */
+
+static void NoOpCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ (void) target;
+ (void) level;
+ (void) xoffset;
+ (void) yoffset;
+ (void) zoffset;
+ (void) x;
+ (void) y;
+ (void) width;
+ (void) height;
+ warning("glCopyTexSubImage3D");
+}
+
+static void NoOpDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)
+{
+ (void) mode;
+ (void) start;
+ (void) end;
+ (void) count;
+ (void) type;
+ (void) indices;
+ warning("glDrawRangeElements");
+}
+
+static void NoOpTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ (void) target;
+ (void) level;
+ (void) internalformat;
+ (void) width;
+ (void) height;
+ (void) depth;
+ (void) border;
+ (void) format;
+ (void) type;
+ (void) pixels;
+ warning("glTexImage3D");
+}
+
+static void NoOpTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ (void) target;
+ (void) level;
+ (void) xoffset;
+ (void) yoffset;
+ (void) zoffset;
+ (void) width;
+ (void) height;
+ (void) depth;
+ (void) depth;
+ (void) format;
+ (void) type;
+ (void) pixels;
+ warning("glTexSubImage3D");
+}
+
+
+
+/* GL_ARB_imaging */
+
+static void NoOpBlendColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a)
+{
+ (void) r;
+ (void) g;
+ (void) b;
+ (void) a;
+ warning("glBlendColor");
+}
+
+static void NoOpBlendEquation(GLenum eq)
+{
+ (void) eq;
+ warning("glBlendEquation");
+}
+
+static void NoOpColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data)
+{
+ (void) target;
+ (void) start;
+ (void) count;
+ (void) format;
+ (void) type;
+ (void) data;
+ warning("glColorSubTable");
+}
+
+static void NoOpColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
+{
+ (void) target;
+ (void) internalformat;
+ (void) width;
+ (void) format;
+ (void) type;
+ (void) table;
+ warning("glColorTable");
+}
+
+static void NoOpColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glColorTableParameterfv");
+}
+
+static void NoOpColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glColorTableParameteriv");
+}
+
+static void NoOpConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image)
+{
+ (void) target;
+ (void) internalformat;
+ (void) width;
+ (void) format;
+ (void) type;
+ (void) image;
+ warning("glConvolutionFilter1D");
+}
+
+static void NoOpConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)
+{
+ (void) target;
+ (void) internalformat;
+ (void) width;
+ (void) height;
+ (void) format;
+ (void) type;
+ (void) image;
+ warning("glConvolutionFilter2D");
+}
+
+static void NoOpConvolutionParameterf(GLenum target, GLenum pname, GLfloat params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glConvolutionParameterf");
+}
+
+static void NoOpConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glConvolutionParameterfv");
+}
+
+static void NoOpConvolutionParameteri(GLenum target, GLenum pname, GLint params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glConvolutionParameteri");
+}
+
+static void NoOpConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glConvolutionParameteriv");
+}
+
+static void NoOpCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
+{
+ (void) target;
+ (void) start;
+ (void) x;
+ (void) y;
+ (void) width;
+ warning("glCopyColorSubTable");
+}
+
+static void NoOpCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ (void) target;
+ (void) internalformat;
+ (void) x;
+ (void) y;
+ (void) width;
+ warning("glCopyColorTable");
+}
+
+static void NoOpCopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ (void) target;
+ (void) internalformat;
+ (void) x;
+ (void) y;
+ (void) width;
+ warning("glCopyConvolutionFilter1D");
+}
+
+static void NoOpCopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ (void) target;
+ (void) internalformat;
+ (void) x;
+ (void) y;
+ (void) width;
+ (void) height;
+ warning("glCopyConvolutionFilter2D");
+}
+
+static void NoOpGetColorTable(GLenum target, GLenum format, GLenum type, GLvoid *table)
+{
+ (void) target;
+ (void) format;
+ (void) type;
+ (void) table;
+ warning("glGetColorTable");
+}
+
+static void NoOpGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetColorTableParameterfv");
+}
+
+static void NoOpGetColorTableParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetColorTableParameteriv");
+}
+
+static void NoOpGetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image)
+{
+ (void) target;
+ (void) format;
+ (void) type;
+ (void) image;
+ warning("glGetConvolutionFilter");
+}
+
+static void NoOpGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetConvolutionParameterfv");
+}
+
+static void NoOpGetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetConvolutionParameteriv");
+}
+
+static void NoOpGetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values)
+{
+ (void) target;
+ (void) reset;
+ (void) format;
+ (void) types;
+ (void) values;
+ warning("glGetMinmax");
+}
+
+static void NoOpGetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
+{
+ (void) target;
+ (void) reset;
+ (void) format;
+ (void) type;
+ (void) values;
+ warning("glGetHistogram");
+}
+
+static void NoOpGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetHistogramParameterfv");
+}
+
+static void NoOpGetHistogramParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetHistogramParameteriv");
+}
+
+static void NoOpGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetMinmaxParameterfv");
+}
+
+static void NoOpGetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetMinmaxParameteriv");
+}
+
+static void NoOpGetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)
+{
+ (void) target;
+ (void) format;
+ (void) type;
+ (void) row;
+ (void) column;
+ (void) span;
+ warning("glGetSeperableFilter");
+}
+
+static void NoOpHistogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
+{
+ (void) target;
+ (void) width;
+ (void) internalformat;
+ (void) sink;
+ warning("glHistogram");
+}
+
+static void NoOpMinmax(GLenum target, GLenum internalformat, GLboolean sink)
+{
+ (void) target;
+ (void) internalformat;
+ (void) sink;
+ warning("glMinmax");
+}
+
+static void NoOpResetHistogram(GLenum target)
+{
+ (void) target;
+ warning("glResetHistogram");
+}
+
+static void NoOpResetMinmax(GLenum target)
+{
+ (void) target;
+ warning("glResetMinmax");
+}
+
+static void NoOpSeparableFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)
+{
+ (void) target;
+ (void) internalformat;
+ (void) width;
+ (void) height;
+ (void) format;
+ (void) type;
+ (void) row;
+ (void) column;
+ warning("glSeparableFilter2D");
+}
+
+
+
+
+/* GL_ARB_multitexture */
+
+static void NoOpActiveTextureARB(GLenum texture)
+{
+ (void) texture;
+ warning("glActiveTextureARB");
+}
+
+static void NoOpClientActiveTextureARB(GLenum texture)
+{
+ (void) texture;
+ warning("glClientActiveTextureARB");
+}
+
+static void NoOpMultiTexCoord1dARB(GLenum target, GLdouble s)
+{
+ (void) target;
+ (void) s;
+ warning("glMultiTexCoord1dARB");
+}
+
+static void NoOpMultiTexCoord1dvARB(GLenum target, const GLdouble *v)
+{
+ (void) target;
+ (void) v;
+ warning("glMultiTexCoord1dvARB");
+}
+
+static void NoOpMultiTexCoord1fARB(GLenum target, GLfloat s)
+{
+ (void) target;
+ (void) s;
+ warning("glMultiTexCoord1fARB");
+}
+
+static void NoOpMultiTexCoord1fvARB(GLenum target, const GLfloat *v)
+{
+ (void) target;
+ (void) v;
+ warning("glMultiTexCoord1fvARB");
+}
+
+static void NoOpMultiTexCoord1iARB(GLenum target, GLint s)
+{
+ (void) target;
+ (void) s;
+ warning("glMultiTexCoord1iARB");
+}
+
+static void NoOpMultiTexCoord1ivARB(GLenum target, const GLint *v)
+{
+ (void) target;
+ (void) v;
+ warning("glMultiTexCoord1ivARB");
+}
+
+static void NoOpMultiTexCoord1sARB(GLenum target, GLshort s)
+{
+ (void) target;
+ (void) s;
+ warning("glMultiTexCoord1sARB");
+}
+
+static void NoOpMultiTexCoord1svARB(GLenum target, const GLshort *v)
+{
+ (void) target;
+ (void) v;
+ warning("glMultiTexCoord1svARB");
+}
+
+static void NoOpMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t)
+{
+ (void) target;
+ (void) s;
+ (void) t;
+ warning("glMultiTexCoord2dARB");
+}
+
+static void NoOpMultiTexCoord2dvARB(GLenum target, const GLdouble *v)
+{
+ (void) target;
+ (void) v;
+ warning("glMultiTexCoord2dvARB");
+}
+
+static void NoOpMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t)
+{
+ (void) target;
+ (void) s;
+ (void) t;
+ warning("glMultiTexCoord2fARB");
+}
+
+static void NoOpMultiTexCoord2fvARB(GLenum target, const GLfloat *v)
+{
+ (void) target;
+ (void) v;
+ warning("glMultiTexCoord2fvARB");
+}
+
+static void NoOpMultiTexCoord2iARB(GLenum target, GLint s, GLint t)
+{
+ (void) target;
+ (void) s;
+ (void) t;
+ warning("glMultiTexCoord2iARB");
+}
+
+static void NoOpMultiTexCoord2ivARB(GLenum target, const GLint *v)
+{
+ (void) target;
+ (void) v;
+ warning("glMultiTexCoord2ivARB");
+}
+
+static void NoOpMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t)
+{
+ (void) target;
+ (void) s;
+ (void) t;
+ warning("glMultiTexCoord2sARB");
+}
+
+static void NoOpMultiTexCoord2svARB(GLenum target, const GLshort *v)
+{
+ (void) target;
+ (void) v;
+ warning("glMultiTexCoord2svARB");
+}
+
+static void NoOpMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r)
+{
+ (void) target;
+ (void) s;
+ (void) t;
+ (void) r;
+ warning("glMultiTexCoord3dARB");
+}
+
+static void NoOpMultiTexCoord3dvARB(GLenum target, const GLdouble *v)
+{
+ (void) target;
+ (void) v;
+ warning("glMultiTexCoord3dvARB");
+}
+
+static void NoOpMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r)
+{
+ (void) target;
+ (void) s;
+ (void) t;
+ (void) r;
+ warning("glMultiTexCoord3fARB");
+}
+
+static void NoOpMultiTexCoord3fvARB(GLenum target, const GLfloat *v)
+{
+ (void) target;
+ (void) v;
+ warning("glMultiTexCoord3fvARB");
+}
+
+static void NoOpMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r)
+{
+ (void) target;
+ (void) s;
+ (void) t;
+ (void) r;
+ warning("glMultiTexCoord3iARB");
+}
+
+static void NoOpMultiTexCoord3ivARB(GLenum target, const GLint *v)
+{
+ (void) target;
+ (void) v;
+ warning("glMultiTexCoord3ivARB");
+}
+
+static void NoOpMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r)
+{
+ (void) target;
+ (void) s;
+ (void) t;
+ (void) r;
+ warning("glMultiTexCoord3sARB");
+}
+
+static void NoOpMultiTexCoord3svARB(GLenum target, const GLshort *v)
+{
+ (void) target;
+ (void) v;
+ warning("glMultiTexCoord3svARB");
+}
+
+static void NoOpMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+ (void) target;
+ (void) s;
+ (void) t;
+ (void) r;
+ (void) q;
+ warning("glMultiTexCoord4dARB");
+}
+
+static void NoOpMultiTexCoord4dvARB(GLenum target, const GLdouble *v)
+{
+ (void) target;
+ (void) v;
+ warning("glMultiTexCoord4dvARB");
+}
+
+static void NoOpMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+ (void) target;
+ (void) s;
+ (void) t;
+ (void) r;
+ (void) q;
+ warning("glMultiTexCoord4fARB");
+}
+
+static void NoOpMultiTexCoord4fvARB(GLenum target, const GLfloat *v)
+{
+ (void) target;
+ (void) v;
+ warning("glMultiTexCoord4fvARB");
+}
+
+static void NoOpMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q)
+{
+ (void) target;
+ (void) s;
+ (void) t;
+ (void) r;
+ (void) q;
+ warning("glMultiTexCoord4iARB");
+}
+
+static void NoOpMultiTexCoord4ivARB(GLenum target, const GLint *v)
+{
+ (void) target;
+ (void) v;
+ warning("glMultiTexCoord4ivARB");
+}
+
+static void NoOpMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
+{
+ (void) target;
+ (void) s;
+ (void) t;
+ (void) r;
+ (void) q;
+ warning("glMultiTexCoord4sARB");
+}
+
+static void NoOpMultiTexCoord4svARB(GLenum target, const GLshort *v)
+{
+ (void) v;
+ warning("glMultiTexCoord4svARB");
+}
+
+
+
+
+/***
+ *** Extension functions
+ ***/
+
+
+/* 2. GL_EXT_blend_color */
+static void NoOpBlendColorEXT(GLclampf r, GLclampf g, GLclampf b, GLclampf a)
+{
+ (void) r;
+ (void) g;
+ (void) b;
+ (void) a;
+ warning("glBlendColor");
+}
+
+
+/* 3. GL_EXT_polygon_offset */
+static void NoOpPolygonOffsetEXT(GLfloat factor, GLfloat bias)
+{
+ (void) factor;
+ (void) bias;
+ warning("glPolygonOffsetEXT");
+}
+
+
+
+/* 6. GL_EXT_texture3D */
+
+static void NoOpTexImage3DEXT(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ (void) target;
+ (void) level;
+ (void) internalformat;
+ (void) width;
+ (void) height;
+ (void) depth;
+ (void) border;
+ (void) format;
+ (void) type;
+ (void) pixels;
+ warning("glTexImage3DEXT");
+}
+
+static void NoOpTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ (void) target;
+ (void) level;
+ (void) xoffset;
+ (void) yoffset;
+ (void) zoffset;
+ (void) width;
+ (void) height;
+ (void) depth;
+ (void) depth;
+ (void) format;
+ (void) type;
+ (void) pixels;
+ warning("glTexSubImage3DEXT");
+}
+
+static void NoOpCopyTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ (void) target;
+ (void) level;
+ (void) xoffset;
+ (void) yoffset;
+ (void) zoffset;
+ (void) x;
+ (void) y;
+ (void) width;
+ (void) height;
+ warning("glCopyTexSubImage3DEXT");
+}
+
+
+
+/* 7. GL_SGI_texture_filter4 */
+
+static void NoOpGetTexFilterFuncSGIS(GLenum target, GLenum filter, GLsizei n, const GLfloat *weights)
+{
+ (void) target;
+ (void) filter;
+ (void) n;
+ (void) weights;
+ warning("glGetTexFilterFuncSGIS");
+}
+
+static void NoOpTexFilterFuncSGIS(GLenum target, GLenum filter, GLfloat *weights)
+{
+ (void) target;
+ (void) filter;
+ (void) weights;
+ warning("glTexFilterFuncSGIS");
+}
+
+
+
+/* 9. GL_EXT_subtexture */
+
+static void NoOpCopyTexSubImage1DEXT(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
+{
+ (void) target;
+ (void) level;
+ (void) xoffset;
+ (void) x;
+ (void) y;
+ (void) width;
+ warning("glCopyTexSubImage1DEXT");
+}
+
+static void NoOpTexSubImage1DEXT(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ (void) target;
+ (void) level;
+ (void) xoffset;
+ (void) width;
+ (void) format;
+ (void) type;
+ (void) pixels;
+ warning("glTexSubImage2DEXT");
+}
+static void NoOpTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ (void) target;
+ (void) level;
+ (void) xoffset;
+ (void) yoffset;
+ (void) width;
+ (void) height;
+ (void) format;
+ (void) type;
+ (void) pixels;
+ warning("glTexSubImage2DEXT");
+}
+
+
+/* 10. GL_EXT_copy_texture */
+
+static void NoOpCopyTexImage1DEXT(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
+{
+ (void) target;
+ (void) level;
+ (void) internalformat;
+ (void) x;
+ (void) y;
+ (void) width;
+ (void) border;
+ warning("glCopyTexImage1DEXT");
+}
+
+static void NoOpCopyTexImage2DEXT(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+ (void) target;
+ (void) level;
+ (void) internalformat;
+ (void) x;
+ (void) y;
+ (void) width;
+ (void) height;
+ (void) border;
+ warning("glCopyTexImage2DEXT");
+}
+
+
+static void NoOpCopyTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ (void) target;
+ (void) level;
+ (void) xoffset;
+ (void) yoffset;
+ (void) x;
+ (void) y;
+ (void) width;
+ (void) height;
+ warning("glCopyTexSubImage2DEXT");
+}
+
+
+
+/* 11. GL_EXT_histogram */
+static void NoOpGetHistogramEXT(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
+{
+ (void) target;
+ (void) reset;
+ (void) format;
+ (void) type;
+ (void) values;
+ warning("glGetHistogramEXT");
+}
+
+static void NoOpGetHistogramParameterfvEXT(GLenum target, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetHistogramParameterfvEXT");
+}
+
+static void NoOpGetHistogramParameterivEXT(GLenum target, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetHistogramParameterivEXT");
+}
+
+static void NoOpGetMinmaxEXT(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values)
+{
+ (void) target;
+ (void) reset;
+ (void) format;
+ (void) types;
+ (void) values;
+ warning("glGetMinmaxEXT");
+}
+
+static void NoOpGetMinmaxParameterfvEXT(GLenum target, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetMinmaxParameterfvEXT");
+}
+
+static void NoOpGetMinmaxParameterivEXT(GLenum target, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetMinmaxParameterivEXT");
+}
+
+static void NoOpHistogramEXT(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
+{
+ (void) target;
+ (void) width;
+ (void) internalformat;
+ (void) sink;
+ warning("glHistogramEXT");
+}
+
+static void NoOpMinmaxEXT(GLenum target, GLenum internalformat, GLboolean sink)
+{
+ (void) target;
+ (void) internalformat;
+ (void) sink;
+ warning("glMinmaxEXT");
+}
+
+static void NoOpResetHistogramEXT(GLenum target)
+{
+ (void) target;
+ warning("glResetHistogramEXT");
+}
+
+static void NoOpResetMinmaxEXT(GLenum target)
+{
+ (void) target;
+ warning("glResetMinmaxEXT");
+}
+
+
+
+/* 12. GL_EXT_convolution */
+
+static void NoOpConvolutionFilter1DEXT(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image)
+{
+ (void) target;
+ (void) internalformat;
+ (void) width;
+ (void) format;
+ (void) type;
+ (void) image;
+ warning("glConvolutionFilter1DEXT");
+}
+
+static void NoOpConvolutionFilter2DEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)
+{
+ (void) target;
+ (void) internalformat;
+ (void) width;
+ (void) height;
+ (void) format;
+ (void) type;
+ (void) image;
+ warning("glConvolutionFilter2DEXT");
+}
+
+static void NoOpConvolutionParameterfEXT(GLenum target, GLenum pname, GLfloat params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glConvolutionParameterfEXT");
+}
+
+static void NoOpConvolutionParameterfvEXT(GLenum target, GLenum pname, const GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glConvolutionParameterfvEXT");
+}
+
+static void NoOpConvolutionParameteriEXT(GLenum target, GLenum pname, GLint params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glConvolutionParameteriEXT");
+}
+
+static void NoOpConvolutionParameterivEXT(GLenum target, GLenum pname, const GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glConvolutionParameterivEXT");
+}
+
+static void NoOpCopyConvolutionFilter1DEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ (void) target;
+ (void) internalformat;
+ (void) x;
+ (void) y;
+ (void) width;
+ warning("glCopyConvolutionFilter1DEXT");
+}
+
+static void NoOpCopyConvolutionFilter2DEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ (void) target;
+ (void) internalformat;
+ (void) x;
+ (void) y;
+ (void) width;
+ (void) height;
+ warning("glCopyConvolutionFilter2DEXT");
+}
+
+static void NoOpGetConvolutionFilterEXT(GLenum target, GLenum format, GLenum type, GLvoid *image)
+{
+ (void) target;
+ (void) format;
+ (void) type;
+ (void) image;
+ warning("glGetConvolutionFilterEXT");
+}
+
+static void NoOpGetConvolutionParameterfvEXT(GLenum target, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetConvolutionParameterfvEXT");
+}
+
+static void NoOpGetConvolutionParameterivEXT(GLenum target, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetConvolutionParameterivEXT");
+}
+
+static void NoOpGetSeparableFilterEXT(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)
+{
+ (void) target;
+ (void) format;
+ (void) type;
+ (void) row;
+ (void) column;
+ (void) span;
+ warning("glGetSeperableFilterEXT");
+}
+
+static void NoOpSeparableFilter2DEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)
+{
+ (void) target;
+ (void) internalformat;
+ (void) width;
+ (void) height;
+ (void) format;
+ (void) type;
+ (void) row;
+ (void) column;
+ warning("glSeparableFilter2DEXT");
+}
+
+
+/* 14. GL_SGI_color_table */
+
+static void NoOpColorTableSGI(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
+{
+ (void) target;
+ (void) internalformat;
+ (void) width;
+ (void) format;
+ (void) type;
+ (void) table;
+ warning("glColorTableSGI");
+}
+
+static void NoOpColorTableParameterfvSGI(GLenum target, GLenum pname, const GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glColorTableParameterfvSGI");
+}
+
+static void NoOpColorTableParameterivSGI(GLenum target, GLenum pname, const GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glColorTableParameterivSGI");
+}
+
+static void NoOpCopyColorTableSGI(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ (void) target;
+ (void) internalformat;
+ (void) x;
+ (void) y;
+ (void) width;
+ warning("glCopyColorTableSGI");
+}
+
+static void NoOpGetColorTableSGI(GLenum target, GLenum format, GLenum type, GLvoid *table)
+{
+ (void) target;
+ (void) format;
+ (void) type;
+ (void) table;
+ warning("glGetColorTableSGI");
+}
+
+static void NoOpGetColorTableParameterfvSGI(GLenum target, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetColorTableParameterfvSGI");
+}
+
+static void NoOpGetColorTableParameterivSGI(GLenum target, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetColorTableParameterivSGI");
+}
+
+
+/* 15. GL_SGIS_pixel_texture */
+static void NoOpPixelTexGenParameterfSGIS(GLenum pname, GLfloat value)
+{
+ (void) pname;
+ (void) value;
+ warning("glPixelTexGenParameterfSGIS");
+}
+
+static void NoOpGetPixelTexGenParameterfvSGIS(GLenum pname, GLfloat *value)
+{
+ (void) pname;
+ (void) value;
+ warning("glGetPixelTexGenParameterfvSGIS");
+}
+
+static void NoOpPixelTexGenParameteriSGIS(GLenum pname, GLint value)
+{
+ (void) pname;
+ (void) value;
+ warning("glPixelTexGenParameteriSGIS");
+}
+
+static void NoOpGetPixelTexGenParameterivSGIS(GLenum pname, GLint *value)
+{
+ (void) pname;
+ (void) value;
+ warning("glGetPixelTexGenParameterivSGIS");
+}
+
+
+
+/* 16. GL_SGIS_texture4D */
+
+static void NoOpTexImage4DSGIS(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels)
+{
+ (void) target;
+ (void) level;
+ (void) internalformat;
+ (void) width;
+ (void) height;
+ (void) depth;
+ (void) extent;
+ (void) border;
+ (void) format;
+ (void) type;
+ (void) pixels;
+ warning("glTexImage4DSGIS");
+}
+
+static void NoOpTexSubImage4DSGIS(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels)
+{
+ (void) target;
+ (void) level;
+ (void) xoffset;
+ (void) yoffset;
+ (void) zoffset;
+ (void) woffset;
+ (void) width;
+ (void) height;
+ (void) depth;
+ (void) extent;
+ (void) format;
+ (void) type;
+ (void) pixels;
+ warning("glTexSubImage4DSGIS");
+}
+
+
+/* 20. GL_EXT_texture_object */
+
+static GLboolean NoOpAreTexturesResidentEXT(GLsizei n, const GLuint *textures, GLboolean *residences)
+{
+ (void) n;
+ (void) textures;
+ (void) residences;
+ warning("glAreTexturesResidentEXT");
+ return GL_FALSE;
+}
+
+static void NoOpBindTextureEXT(GLenum target, GLuint texture)
+{
+ (void) target;
+ (void) texture;
+ warning("glBindTextureEXT");
+}
+
+static void NoOpDeleteTexturesEXT(GLsizei n, const GLuint *textures)
+{
+ (void) n;
+ (void) textures;
+ warning("glDeleteTexturesEXT");
+}
+
+static void NoOpGenTexturesEXT(GLsizei n, GLuint *textures)
+{
+ (void) n;
+ (void) textures;
+ warning("glGenTexturesEXT");
+}
+
+static GLboolean NoOpIsTextureEXT(GLuint texture)
+{
+ (void) texture;
+ warning("glIsTextureEXT");
+ return GL_FALSE;
+}
+
+static void NoOpPrioritizeTexturesEXT(GLsizei n, const GLuint *textures, const GLclampf *priorities)
+{
+ (void) n;
+ (void) textures;
+ (void) priorities;
+ warning("glPrioritizeTexturesEXT");
+}
+
+
+
+/* 21. GL_SGIS_detail_texture */
+
+static void NoOpDetailTexFuncSGIS(GLenum target, GLsizei n, const GLfloat *value)
+{
+ (void) target;
+ (void) n;
+ (void) value;
+ warning("glDetailTexFuncSGIS");
+}
+
+static void NoOpGetDetailTexFuncSGIS(GLenum target, GLfloat *value)
+{
+ (void) target;
+ (void) value;
+ warning("glGetDetailTexFuncSGIS");
+}
+
+
+
+/* 22. GL_SGIS_sharpen_texture */
+
+static void NoOpGetSharpenTexFuncSGIS(GLenum target, GLfloat *value)
+{
+ (void) target;
+ (void) value;
+ warning("glGetSharpenTexFuncSGIS");
+}
+
+static void NoOpSharpenTexFuncSGIS(GLenum target, GLsizei n, const GLfloat *value)
+{
+ (void) target;
+ (void) n;
+ (void) value;
+ warning("glSharpenTexFuncSGIS");
+}
+
+
+
+/* 25. GL_SGIS_multisample */
+
+static void NoOpSampleMaskSGIS(GLclampf range, GLboolean invert)
+{
+ (void) range;
+ (void) invert;
+ warning("glSampleMaskSGIS");
+}
+
+static void NoOpSamplePatternSGIS(GLenum pattern)
+{
+ (void) pattern;
+ warning("glSamplePatternSGIS");
+}
+
+
+
+/* 30. GL_EXT_vertex_array */
+
+static void NoOpArrayElementEXT(GLint i)
+{
+ (void) i;
+ warning("glArrayElementEXT");
+}
+
+static void NoOpColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer)
+{
+ (void) size;
+ (void) type;
+ (void) stride;
+ (void) count;
+ (void) pointer;
+ warning("glColorPointerEXT");
+}
+
+static void NoOpDrawArraysEXT(GLenum mode, GLint first, GLsizei count)
+{
+ (void) mode;
+ (void) first;
+ (void) count;
+ warning("glDrawArraysEXT");
+}
+
+static void NoOpEdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *pointer)
+{
+ (void) stride;
+ (void) count;
+ (void) pointer;
+ warning("glEdgeFlagPointerEXT");
+}
+
+static void NoOpGetPointervEXT(GLenum pname, void **params)
+{
+ (void) pname;
+ (void) params;
+ warning("glGetPointervEXT");
+}
+
+static void NoOpIndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, const void *pointer)
+{
+ (void) type;
+ (void) stride;
+ (void) count;
+ (void) pointer;
+ warning("glIndexPointerEXT");
+}
+
+static void NoOpNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const void *pointer)
+{
+ (void) type;
+ (void) stride;
+ (void) count;
+ (void) pointer;
+ warning("glNormalPointerEXT");
+}
+
+static void NoOpTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer)
+{
+ (void) size;
+ (void) type;
+ (void) stride;
+ (void) count;
+ (void) pointer;
+ warning("glTexCoordPointerEXT");
+}
+
+static void NoOpVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer)
+{
+ (void) size;
+ (void) type;
+ (void) stride;
+ (void) count;
+ (void) pointer;
+ warning("glVertexPointerEXT");
+}
+
+
+/* 52. GL_SGIX_sprite */
+static void NoOpSpriteParameterfSGIX(GLenum target, GLfloat value)
+{
+ warning("glSpriteParameterfSGIX");
+}
+
+static void NoOpSpriteParameterfvSGIX(GLenum target, const GLfloat *value)
+{
+ warning("glSpriteParameterfvSGIX");
+}
+
+static void NoOpSpriteParameteriSGIX(GLenum target, GLint value)
+{
+ warning("glSpriteParameteriSGIX");
+}
+
+static void NoOpSpriteParameterivSGIX(GLenum target, const GLint *value)
+{
+ warning("glSpriteParameterivSGIX");
+}
+
+
+
+/* 54. GL_EXT_point_parameters */
+
+static void NoOpPointParameterfEXT(GLenum target, GLfloat param)
+{
+ (void) target;
+ (void) param;
+ warning("glPointParameterfEXT");
+}
+
+static void NoOpPointParameterfvEXT(GLenum target, const GLfloat *param)
+{
+ (void) target;
+ (void) param;
+ warning("glPointParameterfvEXT");
+}
+
+
+
+/* 55. GL_SGIX_instruments */
+
+static GLint NoOpGetInstrumentsSGIX(void)
+{
+ warning("glGetInstrumentsSGIX");
+ return 0;
+}
+
+static void NoOpInstrumentsBufferSGIX(GLsizei n, GLint *values)
+{
+ (void) n;
+ (void) values;
+ warning("glInstrumentsBufferSGIX");
+}
+
+static GLint NoOpPollInstrumentsSGIX(GLint *values)
+{
+ (void) values;
+ warning("glPollInstrumentsSGIX");
+ return 0;
+}
+
+static void NoOpReadInstrumentsSGIX(GLint value)
+{
+ (void) value;
+ warning("glReadInstrumentsSGIX");
+}
+
+static void NoOpStartInstrumentsSGIX(void)
+{
+ warning("glStartInstrumentsSGIX");
+}
+
+static void NoOpStopInstrumentsSGIX(GLint value)
+{
+ (void) value;
+ warning("glStopInstrumentsSGIX");
+}
+
+
+
+/* 57. GL_SGIX_framezoom */
+static void NoOpFrameZoomSGIX(GLint factor)
+{
+ (void) factor;
+ warning("glFrameZoomSGIX");
+}
+
+
+
+/* 60. GL_SGIX_reference_plane */
+static void NoOpReferencePlaneSGIX(const GLdouble *equation)
+{
+ (void) equation;
+ warning("glReferencePlaneSGIX");
+}
+
+
+
+/* 61. GL_SGIX_flush_raster */
+static void NoOpFlushRasterSGIX(void)
+{
+ warning("glFlushRasterSGIX");
+}
+
+
+/* 66. GL_HP_image_transform */
+static void NoOpGetImageTransformParameterfvHP(GLenum target, GLenum pname, GLfloat *param)
+{
+ warning("glGetImageTransformParameterfvHP");
+}
+
+static void NoOpGetImageTransformParameterivHP(GLenum target, GLenum pname, GLint *param)
+{
+ warning("glGetImageTransformParameterivHP");
+}
+
+static void NoOpImageTransformParameterfHP(GLenum target, GLenum pname, GLfloat param)
+{
+ warning("glImageTransformParameterfHP");
+}
+
+static void NoOpImageTransformParameterfvHP(GLenum target, GLenum pname, const GLfloat *params)
+{
+ warning("glImageTransformParameterfvHP");
+}
+
+static void NoOpImageTransformParameteriHP(GLenum target, GLenum pname, GLint param)
+{
+ warning("glImageTransformParameteriHP");
+}
+
+static void NoOpImageTransformParameterivHP(GLenum target, GLenum pname, const GLint *params)
+{
+ warning("glImageTransformParameterivHP");
+}
+
+
+
+/* 74. GL_EXT_color_subtable */
+
+static void NoOpColorSubTableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data)
+{
+ (void) target;
+ (void) start;
+ (void) count;
+ (void) format;
+ (void) type;
+ (void) data;
+ warning("glColorSubTableEXT");
+}
+
+static void NoOpCopyColorSubTableEXT(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
+{
+ (void) target;
+ (void) start;
+ (void) x;
+ (void) y;
+ (void) width;
+ warning("glCopyColorSubTableEXT");
+}
+
+
+
+/* 77. GL_PGI_misc_hints */
+static void NoOpHintPGI(GLenum target, GLint mode)
+{
+ (void) target;
+ (void) mode;
+ warning("glHintPGI");
+}
+
+
+
+/* 78. GL_EXT_paletted_texture */
+
+static void NoOpColorTableEXT(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
+{
+ (void) target;
+ (void) internalformat;
+ (void) width;
+ (void) format;
+ (void) type;
+ (void) table;
+ warning("glColorTableEXT");
+}
+
+static void NoOpGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid *table)
+{
+ (void) target;
+ (void) format;
+ (void) type;
+ (void) table;
+ warning("glGetColorTableEXT");
+}
+
+static void NoOpGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetColorTableParameterfvEXT");
+}
+
+static void NoOpGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ warning("glGetColorTableParameterivEXT");
+}
+
+
+
+
+/* 80. GL_SGIX_list_priority */
+static void NoOpGetListParameterfvSGIX(GLuint list, GLenum pname, GLfloat *param)
+{
+ warning("glGetListParameterfvSGIX");
+}
+
+static void NoOpGetListParameterivSGIX(GLuint list, GLenum pname, GLint *param)
+{
+ warning("glGetListParameterivSGIX");
+}
+
+static void NoOpListParameterfSGIX(GLuint list, GLenum pname, GLfloat param)
+{
+ warning("glListParameterfSGIX");
+}
+
+static void NoOpListParameterfvSGIX(GLuint list, GLenum pname, const GLfloat *params)
+{
+ warning("glListParameterfvSGIX");
+}
+
+static void NoOpListParameteriSGIX(GLuint list, GLenum pname, GLint param)
+{
+ warning("glListParameteriSGIX");
+}
+
+static void NoOpListParameterivSGIX(GLuint list, GLenum pname, const GLint *params)
+{
+ warning("glListParameterivSGIX");
+}
+
+
+/* 94. GL_EXT_index_material */
+static void NoOpIndexMaterialEXT(GLenum face, GLenum mode)
+{
+ (void) face;
+ (void) mode;
+ warning("glIndexMaterialEXT");
+}
+
+
+/* 95. GL_EXT_index_func */
+static void NoOpIndexFuncEXT(GLenum pname, GLfloat value)
+{
+ (void) pname;
+ (void) value;
+ warning("glIndexFuncEXT");
+}
+
+
+/* 97. GL_EXT_compiled_vertex_array */
+
+static void NoOpLockArraysEXT(GLint first, GLsizei count)
+{
+ (void) first;
+ (void) count;
+ warning("glLockArraysEXT");
+}
+
+static void NoOpUnlockArraysEXT(void)
+{
+ warning("glUnlockArraysEXT");
+}
+
+
+
+/* 98. GL_EXT_cull_vertex */
+
+static void NoOpCullParameterfvEXT(GLenum pname, const GLfloat *values)
+{
+ (void) pname;
+ (void) values;
+ warning("glCullParameterfvEXT");
+}
+
+static void NoOpCullParameterdvEXT(GLenum pname, const GLdouble *values)
+{
+ (void) pname;
+ (void) values;
+ warning("glCullParameterdvEXT");
+}
+
+
+
+/* 37. GL_EXT_blend_minmax */
+
+static void NoOpBlendEquationEXT(GLenum mode)
+{
+ (void) mode;
+ warning("glBlendEuqationEXT");
+}
+
+
+
+/* GL_EXT/INGR_blend_func_separate */
+static void NoOpBlendFuncSeparateINGR(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+{
+ (void) sfactorRGB;
+ (void) dfactorRGB;
+ (void) sfactorAlpha;
+ (void) dfactorAlpha;
+ warning("glBlendFuncSeparateINGR");
+}
+
+
+
+/* GL_MESA_window_pos */
+static void NoOpWindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ (void) x;
+ (void) y;
+ (void) z;
+ (void) w;
+ warning("glWindowPos[234][ifdv][v]MESA");
+}
+
+
+
+/* GL_MESA_resize_buffers */
+static void NoOpResizeBuffersMESA(void)
+{
+ warning("glResizeBuffersMESA");
+}
+
+
+
+/* GL_ARB_transpose_matrix */
+
+static void NoOpLoadTransposeMatrixdARB(const GLdouble mat[16])
+{
+ (void) mat;
+ warning("glLoadTransposeMatrixdARB");
+}
+
+static void NoOpLoadTransposeMatrixfARB(const GLfloat mat[16])
+{
+ (void) mat;
+ warning("glLoadTransposeMatrixfARB");
+}
+
+static void NoOpMultTransposeMatrixdARB(const GLdouble mat[16])
+{
+ (void) mat;
+ warning("glMultTransposeMatrixdARB");
+}
+
+static void NoOpMultTransposeMatrixfARB(const GLfloat mat[16])
+{
+ (void) mat;
+ warning("glMultTransposeMatrixfARB");
+}
+
+
+
+static void Dummy(void)
+{
+}
+
+
+struct _glapi_table __glapi_noop_table = {
+ Dummy,
+ NoOpAccum,
+ NoOpAlphaFunc,
+ NoOpBegin,
+ NoOpBitmap,
+ NoOpBlendFunc,
+ NoOpCallList,
+ NoOpCallLists,
+ NoOpClear,
+ NoOpClearAccum,
+ NoOpClearColor,
+ NoOpClearDepth,
+ NoOpClearIndex,
+ NoOpClearStencil,
+ NoOpClipPlane,
+ NoOpColor3b,
+ NoOpColor3bv,
+ NoOpColor3d,
+ NoOpColor3dv,
+ NoOpColor3f,
+ NoOpColor3fv,
+ NoOpColor3i,
+ NoOpColor3iv,
+ NoOpColor3s,
+ NoOpColor3sv,
+ NoOpColor3ub,
+ NoOpColor3ubv,
+ NoOpColor3ui,
+ NoOpColor3uiv,
+ NoOpColor3us,
+ NoOpColor3usv,
+ NoOpColor4b,
+ NoOpColor4bv,
+ NoOpColor4d,
+ NoOpColor4dv,
+ NoOpColor4f,
+ NoOpColor4fv,
+ NoOpColor4i,
+ NoOpColor4iv,
+ NoOpColor4s,
+ NoOpColor4sv,
+ NoOpColor4ub,
+ NoOpColor4ubv,
+ NoOpColor4ui,
+ NoOpColor4uiv,
+ NoOpColor4us,
+ NoOpColor4usv,
+ NoOpColorMask,
+ NoOpColorMaterial,
+ NoOpCopyPixels,
+ NoOpCullFace,
+ NoOpDeleteLists,
+ NoOpDepthFunc,
+ NoOpDepthMask,
+ NoOpDepthRange,
+ NoOpDisable,
+ NoOpDrawBuffer,
+ NoOpDrawPixels,
+ NoOpEdgeFlag,
+ NoOpEdgeFlagv,
+ NoOpEnable,
+ NoOpEnd,
+ NoOpEndList,
+ NoOpEvalCoord1d,
+ NoOpEvalCoord1dv,
+ NoOpEvalCoord1f,
+ NoOpEvalCoord1fv,
+ NoOpEvalCoord2d,
+ NoOpEvalCoord2dv,
+ NoOpEvalCoord2f,
+ NoOpEvalCoord2fv,
+ NoOpEvalMesh1,
+ NoOpEvalMesh2,
+ NoOpEvalPoint1,
+ NoOpEvalPoint2,
+ NoOpFeedbackBuffer,
+ NoOpFinish,
+ NoOpFlush,
+ NoOpFogf,
+ NoOpFogfv,
+ NoOpFogi,
+ NoOpFogiv,
+ NoOpFrontFace,
+ NoOpFrustum,
+ NoOpGenLists,
+ NoOpGetBooleanv,
+ NoOpGetClipPlane,
+ NoOpGetDoublev,
+ NoOpGetError,
+ NoOpGetFloatv,
+ NoOpGetIntegerv,
+ NoOpGetLightfv,
+ NoOpGetLightiv,
+ NoOpGetMapdv,
+ NoOpGetMapfv,
+ NoOpGetMapiv,
+ NoOpGetMaterialfv,
+ NoOpGetMaterialiv,
+ NoOpGetPixelMapfv,
+ NoOpGetPixelMapuiv,
+ NoOpGetPixelMapusv,
+ NoOpGetPolygonStipple,
+ NoOpGetString,
+ NoOpGetTexEnvfv,
+ NoOpGetTexEnviv,
+ NoOpGetTexGendv,
+ NoOpGetTexGenfv,
+ NoOpGetTexGeniv,
+ NoOpGetTexImage,
+ NoOpGetTexLevelParameterfv,
+ NoOpGetTexLevelParameteriv,
+ NoOpGetTexParameterfv,
+ NoOpGetTexParameteriv,
+ NoOpHint,
+ NoOpIndexMask,
+ NoOpIndexd,
+ NoOpIndexdv,
+ NoOpIndexf,
+ NoOpIndexfv,
+ NoOpIndexi,
+ NoOpIndexiv,
+ NoOpIndexs,
+ NoOpIndexsv,
+ NoOpInitNames,
+ NoOpIsEnabled,
+ NoOpIsList,
+ NoOpLightModelf,
+ NoOpLightModelfv,
+ NoOpLightModeli,
+ NoOpLightModeliv,
+ NoOpLightf,
+ NoOpLightfv,
+ NoOpLighti,
+ NoOpLightiv,
+ NoOpLineStipple,
+ NoOpLineWidth,
+ NoOpListBase,
+ NoOpLoadIdentity,
+ NoOpLoadMatrixd,
+ NoOpLoadMatrixf,
+ NoOpLoadName,
+ NoOpLogicOp,
+ NoOpMap1d,
+ NoOpMap1f,
+ NoOpMap2d,
+ NoOpMap2f,
+ NoOpMapGrid1d,
+ NoOpMapGrid1f,
+ NoOpMapGrid2d,
+ NoOpMapGrid2f,
+ NoOpMaterialf,
+ NoOpMaterialfv,
+ NoOpMateriali,
+ NoOpMaterialiv,
+ NoOpMatrixMode,
+ NoOpMultMatrixd,
+ NoOpMultMatrixf,
+ NoOpNewList,
+ NoOpNormal3b,
+ NoOpNormal3bv,
+ NoOpNormal3d,
+ NoOpNormal3dv,
+ NoOpNormal3f,
+ NoOpNormal3fv,
+ NoOpNormal3i,
+ NoOpNormal3iv,
+ NoOpNormal3s,
+ NoOpNormal3sv,
+ NoOpOrtho,
+ NoOpPassThrough,
+ NoOpPixelMapfv,
+ NoOpPixelMapuiv,
+ NoOpPixelMapusv,
+ NoOpPixelStoref,
+ NoOpPixelStorei,
+ NoOpPixelTransferf,
+ NoOpPixelTransferi,
+ NoOpPixelZoom,
+ NoOpPointSize,
+ NoOpPolygonMode,
+ NoOpPolygonOffset,
+ NoOpPolygonStipple,
+ NoOpPopAttrib,
+ NoOpPopMatrix,
+ NoOpPopName,
+ NoOpPushAttrib,
+ NoOpPushMatrix,
+ NoOpPushName,
+ NoOpRasterPos2d,
+ NoOpRasterPos2dv,
+ NoOpRasterPos2f,
+ NoOpRasterPos2fv,
+ NoOpRasterPos2i,
+ NoOpRasterPos2iv,
+ NoOpRasterPos2s,
+ NoOpRasterPos2sv,
+ NoOpRasterPos3d,
+ NoOpRasterPos3dv,
+ NoOpRasterPos3f,
+ NoOpRasterPos3fv,
+ NoOpRasterPos3i,
+ NoOpRasterPos3iv,
+ NoOpRasterPos3s,
+ NoOpRasterPos3sv,
+ NoOpRasterPos4d,
+ NoOpRasterPos4dv,
+ NoOpRasterPos4f,
+ NoOpRasterPos4fv,
+ NoOpRasterPos4i,
+ NoOpRasterPos4iv,
+ NoOpRasterPos4s,
+ NoOpRasterPos4sv,
+ NoOpReadBuffer,
+ NoOpReadPixels,
+ NoOpRectd,
+ NoOpRectdv,
+ NoOpRectf,
+ NoOpRectfv,
+ NoOpRecti,
+ NoOpRectiv,
+ NoOpRects,
+ NoOpRectsv,
+ NoOpRenderMode,
+ NoOpRotated,
+ NoOpRotatef,
+ NoOpScaled,
+ NoOpScalef,
+ NoOpScissor,
+ NoOpSelectBuffer,
+ NoOpShadeModel,
+ NoOpStencilFunc,
+ NoOpStencilMask,
+ NoOpStencilOp,
+ NoOpTexCoord1d,
+ NoOpTexCoord1dv,
+ NoOpTexCoord1f,
+ NoOpTexCoord1fv,
+ NoOpTexCoord1i,
+ NoOpTexCoord1iv,
+ NoOpTexCoord1s,
+ NoOpTexCoord1sv,
+ NoOpTexCoord2d,
+ NoOpTexCoord2dv,
+ NoOpTexCoord2f,
+ NoOpTexCoord2fv,
+ NoOpTexCoord2i,
+ NoOpTexCoord2iv,
+ NoOpTexCoord2s,
+ NoOpTexCoord2sv,
+ NoOpTexCoord3d,
+ NoOpTexCoord3dv,
+ NoOpTexCoord3f,
+ NoOpTexCoord3fv,
+ NoOpTexCoord3i,
+ NoOpTexCoord3iv,
+ NoOpTexCoord3s,
+ NoOpTexCoord3sv,
+ NoOpTexCoord4d,
+ NoOpTexCoord4dv,
+ NoOpTexCoord4f,
+ NoOpTexCoord4fv,
+ NoOpTexCoord4i,
+ NoOpTexCoord4iv,
+ NoOpTexCoord4s,
+ NoOpTexCoord4sv,
+ NoOpTexEnvf,
+ NoOpTexEnvfv,
+ NoOpTexEnvi,
+ NoOpTexEnviv,
+ NoOpTexGend,
+ NoOpTexGendv,
+ NoOpTexGenf,
+ NoOpTexGenfv,
+ NoOpTexGeni,
+ NoOpTexGeniv,
+ NoOpTexImage1D,
+ NoOpTexImage2D,
+ NoOpTexParameterf,
+ NoOpTexParameterfv,
+ NoOpTexParameteri,
+ NoOpTexParameteriv,
+ NoOpTranslated,
+ NoOpTranslatef,
+ NoOpVertex2d,
+ NoOpVertex2dv,
+ NoOpVertex2f,
+ NoOpVertex2fv,
+ NoOpVertex2i,
+ NoOpVertex2iv,
+ NoOpVertex2s,
+ NoOpVertex2sv,
+ NoOpVertex3d,
+ NoOpVertex3dv,
+ NoOpVertex3f,
+ NoOpVertex3fv,
+ NoOpVertex3i,
+ NoOpVertex3iv,
+ NoOpVertex3s,
+ NoOpVertex3sv,
+ NoOpVertex4d,
+ NoOpVertex4dv,
+ NoOpVertex4f,
+ NoOpVertex4fv,
+ NoOpVertex4i,
+ NoOpVertex4iv,
+ NoOpVertex4s,
+ NoOpVertex4sv,
+ NoOpViewport,
+
+ /* GL 1.1 */
+ NoOpAreTexturesResident,
+ NoOpArrayElement,
+ NoOpBindTexture,
+ NoOpColorPointer,
+ NoOpCopyTexImage1D,
+ NoOpCopyTexImage2D,
+ NoOpCopyTexSubImage1D,
+ NoOpCopyTexSubImage2D,
+ NoOpDeleteTextures,
+ NoOpDisableClientState,
+ NoOpDrawArrays,
+ NoOpDrawElements,
+ NoOpEdgeFlagPointer,
+ NoOpEnableClientState,
+ NoOpGenTextures,
+ NoOpGetPointerv,
+ NoOpIndexPointer,
+ NoOpIndexub,
+ NoOpIndexubv,
+ NoOpInterleavedArrays,
+ NoOpIsTexture,
+ NoOpNormalPointer,
+ NoOpPopClientAttrib,
+ NoOpPrioritizeTextures,
+ NoOpPushClientAttrib,
+ NoOpTexCoordPointer,
+ NoOpTexSubImage1D,
+ NoOpTexSubImage2D,
+ NoOpVertexPointer,
+
+ /* GL 1.2 */
+ NoOpCopyTexSubImage3D,
+ NoOpDrawRangeElements,
+ NoOpTexImage3D,
+ NoOpTexSubImage3D,
+
+ /* GL_ARB_imaging */
+ NoOpBlendColor,
+ NoOpBlendEquation,
+ NoOpColorSubTable,
+ NoOpColorTable,
+ NoOpColorTableParameterfv,
+ NoOpColorTableParameteriv,
+ NoOpConvolutionFilter1D,
+ NoOpConvolutionFilter2D,
+ NoOpConvolutionParameterf,
+ NoOpConvolutionParameterfv,
+ NoOpConvolutionParameteri,
+ NoOpConvolutionParameteriv,
+ NoOpCopyColorSubTable,
+ NoOpCopyColorTable,
+ NoOpCopyConvolutionFilter1D,
+ NoOpCopyConvolutionFilter2D,
+ NoOpGetColorTable,
+ NoOpGetColorTableParameterfv,
+ NoOpGetColorTableParameteriv,
+ NoOpGetConvolutionFilter,
+ NoOpGetConvolutionParameterfv,
+ NoOpGetConvolutionParameteriv,
+ NoOpGetHistogram,
+ NoOpGetHistogramParameterfv,
+ NoOpGetHistogramParameteriv,
+ NoOpGetMinmax,
+ NoOpGetMinmaxParameterfv,
+ NoOpGetMinmaxParameteriv,
+ NoOpGetSeparableFilter,
+ NoOpHistogram,
+ NoOpMinmax,
+ NoOpResetHistogram,
+ NoOpResetMinmax,
+ NoOpSeparableFilter2D,
+
+ /* GL_ARB_multitexture */
+ NoOpActiveTextureARB,
+ NoOpClientActiveTextureARB,
+ NoOpMultiTexCoord1dARB,
+ NoOpMultiTexCoord1dvARB,
+ NoOpMultiTexCoord1fARB,
+ NoOpMultiTexCoord1fvARB,
+ NoOpMultiTexCoord1iARB,
+ NoOpMultiTexCoord1ivARB,
+ NoOpMultiTexCoord1sARB,
+ NoOpMultiTexCoord1svARB,
+ NoOpMultiTexCoord2dARB,
+ NoOpMultiTexCoord2dvARB,
+ NoOpMultiTexCoord2fARB,
+ NoOpMultiTexCoord2fvARB,
+ NoOpMultiTexCoord2iARB,
+ NoOpMultiTexCoord2ivARB,
+ NoOpMultiTexCoord2sARB,
+ NoOpMultiTexCoord2svARB,
+ NoOpMultiTexCoord3dARB,
+ NoOpMultiTexCoord3dvARB,
+ NoOpMultiTexCoord3fARB,
+ NoOpMultiTexCoord3fvARB,
+ NoOpMultiTexCoord3iARB,
+ NoOpMultiTexCoord3ivARB,
+ NoOpMultiTexCoord3sARB,
+ NoOpMultiTexCoord3svARB,
+ NoOpMultiTexCoord4dARB,
+ NoOpMultiTexCoord4dvARB,
+ NoOpMultiTexCoord4fARB,
+ NoOpMultiTexCoord4fvARB,
+ NoOpMultiTexCoord4iARB,
+ NoOpMultiTexCoord4ivARB,
+ NoOpMultiTexCoord4sARB,
+ NoOpMultiTexCoord4svARB,
+
+ /*
+ * Extensions
+ */
+
+ /* 2. GL_EXT_blend_color */
+ NoOpBlendColorEXT,
+
+ /* 3. GL_EXT_polygon_offset */
+ NoOpPolygonOffsetEXT,
+
+ /* 6. GL_EXT_texture3d */
+ NoOpCopyTexSubImage3DEXT,
+ NoOpTexImage3DEXT,
+ NoOpTexSubImage3DEXT,
+
+ /* 7. GL_SGI_texture_filter4 */
+ NoOpGetTexFilterFuncSGIS,
+ NoOpTexFilterFuncSGIS,
+
+ /* 9. GL_EXT_subtexture */
+ NoOpTexSubImage1DEXT,
+ NoOpTexSubImage2DEXT,
+
+ /* 10. GL_EXT_copy_texture */
+ NoOpCopyTexImage1DEXT,
+ NoOpCopyTexImage2DEXT,
+ NoOpCopyTexSubImage1DEXT,
+ NoOpCopyTexSubImage2DEXT,
+
+ /* 11. GL_EXT_histogram */
+ NoOpGetHistogramEXT,
+ NoOpGetHistogramParameterfvEXT,
+ NoOpGetHistogramParameterivEXT,
+ NoOpGetMinmaxEXT,
+ NoOpGetMinmaxParameterfvEXT,
+ NoOpGetMinmaxParameterivEXT,
+ NoOpHistogramEXT,
+ NoOpMinmaxEXT,
+ NoOpResetHistogramEXT,
+ NoOpResetMinmaxEXT,
+
+ /* 12. GL_EXT_convolution */
+ NoOpConvolutionFilter1DEXT,
+ NoOpConvolutionFilter2DEXT,
+ NoOpConvolutionParameterfEXT,
+ NoOpConvolutionParameterfvEXT,
+ NoOpConvolutionParameteriEXT,
+ NoOpConvolutionParameterivEXT,
+ NoOpCopyConvolutionFilter1DEXT,
+ NoOpCopyConvolutionFilter2DEXT,
+ NoOpGetConvolutionFilterEXT,
+ NoOpGetConvolutionParameterfvEXT,
+ NoOpGetConvolutionParameterivEXT,
+ NoOpGetSeparableFilterEXT,
+ NoOpSeparableFilter2DEXT,
+
+ /* 14. GL_SGI_color_table */
+ NoOpColorTableSGI,
+ NoOpColorTableParameterfvSGI,
+ NoOpColorTableParameterivSGI,
+ NoOpCopyColorTableSGI,
+ NoOpGetColorTableSGI,
+ NoOpGetColorTableParameterfvSGI,
+ NoOpGetColorTableParameterivSGI,
+
+ /* 15. GL_SGIS_pixel_texture */
+ NoOpPixelTexGenParameterfSGIS,
+ NoOpPixelTexGenParameteriSGIS,
+ NoOpGetPixelTexGenParameterfvSGIS,
+ NoOpGetPixelTexGenParameterivSGIS,
+
+ /* 16. GL_SGIS_texture4D */
+ NoOpTexImage4DSGIS,
+ NoOpTexSubImage4DSGIS,
+
+ /* 20. GL_EXT_texture_object */
+ NoOpAreTexturesResidentEXT,
+ NoOpBindTextureEXT,
+ NoOpDeleteTexturesEXT,
+ NoOpGenTexturesEXT,
+ NoOpIsTextureEXT,
+ NoOpPrioritizeTexturesEXT,
+
+ /* 21. GL_SGIS_detail_texture */
+ NoOpDetailTexFuncSGIS,
+ NoOpGetDetailTexFuncSGIS,
+
+ /* 22. GL_SGIS_sharpen_texture */
+ NoOpGetSharpenTexFuncSGIS,
+ NoOpSharpenTexFuncSGIS,
+
+ /* 25. GL_SGIS_multisample */
+ NoOpSampleMaskSGIS,
+ NoOpSamplePatternSGIS,
+
+ /* 30. GL_EXT_vertex_array */
+ NoOpArrayElementEXT,
+ NoOpColorPointerEXT,
+ NoOpDrawArraysEXT,
+ NoOpEdgeFlagPointerEXT,
+ NoOpGetPointervEXT,
+ NoOpIndexPointerEXT,
+ NoOpNormalPointerEXT,
+ NoOpTexCoordPointerEXT,
+ NoOpVertexPointerEXT,
+
+ /* 37. GL_EXT_blend_minmax */
+ NoOpBlendEquationEXT,
+
+ /* 52. GL_SGIX_sprite */
+ NoOpSpriteParameterfSGIX,
+ NoOpSpriteParameterfvSGIX,
+ NoOpSpriteParameteriSGIX,
+ NoOpSpriteParameterivSGIX,
+
+ /* 54. GL_EXT_point_parameters */
+ NoOpPointParameterfEXT,
+ NoOpPointParameterfvEXT,
+
+ /* 55. GL_SGIX_instruments */
+ NoOpGetInstrumentsSGIX,
+ NoOpInstrumentsBufferSGIX,
+ NoOpPollInstrumentsSGIX,
+ NoOpReadInstrumentsSGIX,
+ NoOpStartInstrumentsSGIX,
+ NoOpStopInstrumentsSGIX,
+
+ /* 57. GL_SGIX_framezoom */
+ NoOpFrameZoomSGIX,
+
+ /* 60. GL_SGIX_reference_plane */
+ NoOpReferencePlaneSGIX,
+
+ /* 61. GL_SGIX_flush_raster */
+ NoOpFlushRasterSGIX,
+
+ /* 66. GL_HP_image_transform */
+ NoOpGetImageTransformParameterfvHP,
+ NoOpGetImageTransformParameterivHP,
+ NoOpImageTransformParameterfHP,
+ NoOpImageTransformParameterfvHP,
+ NoOpImageTransformParameteriHP,
+ NoOpImageTransformParameterivHP,
+
+ /* 74. GL_EXT_color_subtable */
+ NoOpColorSubTableEXT,
+ NoOpCopyColorSubTableEXT,
+
+ /* 77. GL_PGI_misc_hints */
+ NoOpHintPGI,
+
+ /* 78. GL_EXT_paletted_texture */
+ NoOpColorTableEXT,
+ NoOpGetColorTableEXT,
+ NoOpGetColorTableParameterfvEXT,
+ NoOpGetColorTableParameterivEXT,
+
+ /* 80. GL_SGIX_list_priority */
+ NoOpGetListParameterfvSGIX,
+ NoOpGetListParameterivSGIX,
+ NoOpListParameterfSGIX,
+ NoOpListParameterfvSGIX,
+ NoOpListParameteriSGIX,
+ NoOpListParameterivSGIX,
+
+ /* 94. GL_EXT_index_material */
+ NoOpIndexMaterialEXT,
+
+ /* 95. GL_EXT_index_func */
+ NoOpIndexFuncEXT,
+
+ /* 96. GL_EXT_index_array_formats - no functions */
+
+ /* 97. GL_EXT_compiled_vertex_array */
+ NoOpLockArraysEXT,
+ NoOpUnlockArraysEXT,
+
+ /* 98. GL_EXT_cull_vertex */
+ NoOpCullParameterfvEXT,
+ NoOpCullParameterdvEXT,
+
+ /* 173. GL_EXT/INGR_blend_func_separate */
+ NoOpBlendFuncSeparateINGR,
+
+ /* GL_MESA_window_pos */
+ NoOpWindowPos4fMESA,
+
+ /* GL_MESA_resize_buffers */
+ NoOpResizeBuffersMESA,
+
+ /* GL_ARB_transpose_matrix */
+ NoOpLoadTransposeMatrixdARB,
+ NoOpLoadTransposeMatrixfARB,
+ NoOpMultTransposeMatrixdARB,
+ NoOpMultTransposeMatrixfARB,
+
+};
+
diff --git a/xc/extras/Mesa/src/glapinoop.h b/xc/extras/Mesa/src/glapinoop.h
new file mode 100644
index 000000000..87ae28279
--- /dev/null
+++ b/xc/extras/Mesa/src/glapinoop.h
@@ -0,0 +1,41 @@
+/* $Id: glapinoop.h,v 1.2 2000/01/30 00:27:02 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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 _GLAPINOOP_H
+#define _GLAPINOOP_H
+
+#include "glapi.h"
+
+
+extern void
+_glapi_noop_enable_warnings(GLboolean enable);
+
+
+extern struct _glapi_table __glapi_noop_table;
+
+
+#endif
diff --git a/xc/extras/Mesa/src/glapioffsets.h b/xc/extras/Mesa/src/glapioffsets.h
new file mode 100644
index 000000000..7e25737b8
--- /dev/null
+++ b/xc/extras/Mesa/src/glapioffsets.h
@@ -0,0 +1,801 @@
+/* $Id: glapioffsets.h,v 1.2 2000/01/30 00:27:02 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+/*
+ * This file defines a static offset for all GL functions within the
+ * dispatch table.
+ *
+ * Eventually a replacement for this file will be available from SGI
+ * or the ARB so all vendors have the same info.
+ *
+ * XXX this file is incomplete - many more extension functions left to add
+ */
+
+
+
+#ifndef _glextfunc_h_
+#define _glextfunc_h_
+
+#define _BASE 0
+
+
+/* GL 1.1 */
+#define _gloffset_Accum (_BASE + 1)
+#define _gloffset_AlphaFunc (_BASE + 2)
+#define _gloffset_Begin (_BASE + 3)
+#define _gloffset_Bitmap (_BASE + 4)
+#define _gloffset_BlendFunc (_BASE + 5)
+#define _gloffset_CallList (_BASE + 6)
+#define _gloffset_CallLists (_BASE + 7)
+#define _gloffset_Clear (_BASE + 8)
+#define _gloffset_ClearAccum (_BASE + 9)
+#define _gloffset_ClearColor (_BASE + 10)
+#define _gloffset_ClearDepth (_BASE + 11)
+#define _gloffset_ClearIndex (_BASE + 12)
+#define _gloffset_ClearStencil (_BASE + 13)
+#define _gloffset_ClipPlane (_BASE + 14)
+#define _gloffset_Color3b (_BASE + 15)
+#define _gloffset_Color3bv (_BASE + 16)
+#define _gloffset_Color3d (_BASE + 17)
+#define _gloffset_Color3dv (_BASE + 18)
+#define _gloffset_Color3f (_BASE + 19)
+#define _gloffset_Color3fv (_BASE + 20)
+#define _gloffset_Color3i (_BASE + 21)
+#define _gloffset_Color3iv (_BASE + 22)
+#define _gloffset_Color3s (_BASE + 23)
+#define _gloffset_Color3sv (_BASE + 24)
+#define _gloffset_Color3ub (_BASE + 25)
+#define _gloffset_Color3ubv (_BASE + 26)
+#define _gloffset_Color3ui (_BASE + 27)
+#define _gloffset_Color3uiv (_BASE + 28)
+#define _gloffset_Color3us (_BASE + 29)
+#define _gloffset_Color3usv (_BASE + 30)
+#define _gloffset_Color4b (_BASE + 31)
+#define _gloffset_Color4bv (_BASE + 32)
+#define _gloffset_Color4d (_BASE + 33)
+#define _gloffset_Color4dv (_BASE + 34)
+#define _gloffset_Color4f (_BASE + 35)
+#define _gloffset_Color4fv (_BASE + 36)
+#define _gloffset_Color4i (_BASE + 37)
+#define _gloffset_Color4iv (_BASE + 38)
+#define _gloffset_Color4s (_BASE + 39)
+#define _gloffset_Color4sv (_BASE + 40)
+#define _gloffset_Color4ub (_BASE + 41)
+#define _gloffset_Color4ubv (_BASE + 42)
+#define _gloffset_Color4ui (_BASE + 43)
+#define _gloffset_Color4uiv (_BASE + 44)
+#define _gloffset_Color4us (_BASE + 45)
+#define _gloffset_Color4usv (_BASE + 46)
+#define _gloffset_ColorMask (_BASE + 47)
+#define _gloffset_ColorMaterial (_BASE + 48)
+#define _gloffset_CopyPixels (_BASE + 49)
+#define _gloffset_CullFace (_BASE + 50)
+#define _gloffset_DeleteLists (_BASE + 51)
+#define _gloffset_DepthFunc (_BASE + 52)
+#define _gloffset_DepthMask (_BASE + 53)
+#define _gloffset_DepthRange (_BASE + 54)
+#define _gloffset_Disable (_BASE + 55)
+#define _gloffset_DrawBuffer (_BASE + 56)
+#define _gloffset_DrawPixels (_BASE + 57)
+#define _gloffset_EdgeFlag (_BASE + 58)
+#define _gloffset_EdgeFlagv (_BASE + 59)
+#define _gloffset_Enable (_BASE + 60)
+#define _gloffset_End (_BASE + 61)
+#define _gloffset_EndList (_BASE + 62)
+#define _gloffset_EvalCoord1d (_BASE + 63)
+#define _gloffset_EvalCoord1dv (_BASE + 64)
+#define _gloffset_EvalCoord1f (_BASE + 65)
+#define _gloffset_EvalCoord1fv (_BASE + 66)
+#define _gloffset_EvalCoord2d (_BASE + 67)
+#define _gloffset_EvalCoord2dv (_BASE + 68)
+#define _gloffset_EvalCoord2f (_BASE + 69)
+#define _gloffset_EvalCoord2fv (_BASE + 70)
+#define _gloffset_EvalMesh1 (_BASE + 71)
+#define _gloffset_EvalMesh2 (_BASE + 72)
+#define _gloffset_EvalPoint1 (_BASE + 73)
+#define _gloffset_EvalPoint2 (_BASE + 74)
+#define _gloffset_FeedbackBuffer (_BASE + 75)
+#define _gloffset_Finish (_BASE + 76)
+#define _gloffset_Flush (_BASE + 77)
+#define _gloffset_Fogf (_BASE + 78)
+#define _gloffset_Fogfv (_BASE + 79)
+#define _gloffset_Fogi (_BASE + 80)
+#define _gloffset_Fogiv (_BASE + 81)
+#define _gloffset_FrontFace (_BASE + 82)
+#define _gloffset_Frustum (_BASE + 83)
+#define _gloffset_GenLists (_BASE + 84)
+#define _gloffset_GetBooleanv (_BASE + 85)
+#define _gloffset_GetClipPlane (_BASE + 86)
+#define _gloffset_GetDoublev (_BASE + 87)
+#define _gloffset_GetError (_BASE + 88)
+#define _gloffset_GetFloatv (_BASE + 89)
+#define _gloffset_GetIntegerv (_BASE + 90)
+#define _gloffset_GetLightfv (_BASE + 91)
+#define _gloffset_GetLightiv (_BASE + 92)
+#define _gloffset_GetMapdv (_BASE + 93)
+#define _gloffset_GetMapfv (_BASE + 94)
+#define _gloffset_GetMapiv (_BASE + 95)
+#define _gloffset_GetMaterialfv (_BASE + 96)
+#define _gloffset_GetMaterialiv (_BASE + 97)
+#define _gloffset_GetPixelMapfv (_BASE + 98)
+#define _gloffset_GetPixelMapuiv (_BASE + 99)
+#define _gloffset_GetPixelMapusv (_BASE + 100)
+#define _gloffset_GetPolygonStipple (_BASE + 101)
+#define _gloffset_GetString (_BASE + 102)
+#define _gloffset_GetTexEnvfv (_BASE + 103)
+#define _gloffset_GetTexEnviv (_BASE + 104)
+#define _gloffset_GetTexGendv (_BASE + 105)
+#define _gloffset_GetTexGenfv (_BASE + 106)
+#define _gloffset_GetTexGeniv (_BASE + 107)
+#define _gloffset_GetTexImage (_BASE + 108)
+#define _gloffset_GetTexLevelParameterfv (_BASE + 109)
+#define _gloffset_GetTexLevelParameteriv (_BASE + 110)
+#define _gloffset_GetTexParameterfv (_BASE + 111)
+#define _gloffset_GetTexParameteriv (_BASE + 112)
+#define _gloffset_Hint (_BASE + 113)
+#define _gloffset_IndexMask (_BASE + 114)
+#define _gloffset_Indexd (_BASE + 115)
+#define _gloffset_Indexdv (_BASE + 116)
+#define _gloffset_Indexf (_BASE + 117)
+#define _gloffset_Indexfv (_BASE + 118)
+#define _gloffset_Indexi (_BASE + 119)
+#define _gloffset_Indexiv (_BASE + 120)
+#define _gloffset_Indexs (_BASE + 121)
+#define _gloffset_Indexsv (_BASE + 122)
+#define _gloffset_InitNames (_BASE + 123)
+#define _gloffset_IsEnabled (_BASE + 124)
+#define _gloffset_IsList (_BASE + 125)
+#define _gloffset_LightModelf (_BASE + 126)
+#define _gloffset_LightModelfv (_BASE + 127)
+#define _gloffset_LightModeli (_BASE + 128)
+#define _gloffset_LightModeliv (_BASE + 129)
+#define _gloffset_Lightf (_BASE + 130)
+#define _gloffset_Lightfv (_BASE + 131)
+#define _gloffset_Lighti (_BASE + 132)
+#define _gloffset_Lightiv (_BASE + 133)
+#define _gloffset_LineStipple (_BASE + 134)
+#define _gloffset_LineWidth (_BASE + 135)
+#define _gloffset_ListBase (_BASE + 136)
+#define _gloffset_LoadIdentity (_BASE + 137)
+#define _gloffset_LoadMatrixd (_BASE + 138)
+#define _gloffset_LoadMatrixf (_BASE + 139)
+#define _gloffset_LoadName (_BASE + 140)
+#define _gloffset_LogicOp (_BASE + 141)
+#define _gloffset_Map1d (_BASE + 142)
+#define _gloffset_Map1f (_BASE + 143)
+#define _gloffset_Map2d (_BASE + 144)
+#define _gloffset_Map2f (_BASE + 145)
+#define _gloffset_MapGrid1d (_BASE + 146)
+#define _gloffset_MapGrid1f (_BASE + 147)
+#define _gloffset_MapGrid2d (_BASE + 148)
+#define _gloffset_MapGrid2f (_BASE + 149)
+#define _gloffset_Materialf (_BASE + 150)
+#define _gloffset_Materialfv (_BASE + 151)
+#define _gloffset_Materiali (_BASE + 152)
+#define _gloffset_Materialiv (_BASE + 153)
+#define _gloffset_MatrixMode (_BASE + 154)
+#define _gloffset_MultMatrixd (_BASE + 155)
+#define _gloffset_MultMatrixf (_BASE + 156)
+#define _gloffset_NewList (_BASE + 157)
+#define _gloffset_Normal3b (_BASE + 158)
+#define _gloffset_Normal3bv (_BASE + 159)
+#define _gloffset_Normal3d (_BASE + 160)
+#define _gloffset_Normal3dv (_BASE + 161)
+#define _gloffset_Normal3f (_BASE + 162)
+#define _gloffset_Normal3fv (_BASE + 163)
+#define _gloffset_Normal3i (_BASE + 164)
+#define _gloffset_Normal3iv (_BASE + 165)
+#define _gloffset_Normal3s (_BASE + 166)
+#define _gloffset_Normal3sv (_BASE + 167)
+#define _gloffset_Ortho (_BASE + 168)
+#define _gloffset_PassThrough (_BASE + 169)
+#define _gloffset_PixelMapfv (_BASE + 170)
+#define _gloffset_PixelMapuiv (_BASE + 171)
+#define _gloffset_PixelMapusv (_BASE + 172)
+#define _gloffset_PixelStoref (_BASE + 173)
+#define _gloffset_PixelStorei (_BASE + 174)
+#define _gloffset_PixelTransferf (_BASE + 175)
+#define _gloffset_PixelTransferi (_BASE + 176)
+#define _gloffset_PixelZoom (_BASE + 177)
+#define _gloffset_PointSize (_BASE + 178)
+#define _gloffset_PolygonMode (_BASE + 179)
+#define _gloffset_PolygonOffset (_BASE + 180)
+#define _gloffset_PolygonStipple (_BASE + 181)
+#define _gloffset_PopAttrib (_BASE + 182)
+#define _gloffset_PopMatrix (_BASE + 183)
+#define _gloffset_PopName (_BASE + 184)
+#define _gloffset_PushAttrib (_BASE + 185)
+#define _gloffset_PushMatrix (_BASE + 186)
+#define _gloffset_PushName (_BASE + 187)
+#define _gloffset_RasterPos2d (_BASE + 188)
+#define _gloffset_RasterPos2dv (_BASE + 189)
+#define _gloffset_RasterPos2f (_BASE + 190)
+#define _gloffset_RasterPos2fv (_BASE + 191)
+#define _gloffset_RasterPos2i (_BASE + 192)
+#define _gloffset_RasterPos2iv (_BASE + 193)
+#define _gloffset_RasterPos2s (_BASE + 194)
+#define _gloffset_RasterPos2sv (_BASE + 195)
+#define _gloffset_RasterPos3d (_BASE + 196)
+#define _gloffset_RasterPos3dv (_BASE + 197)
+#define _gloffset_RasterPos3f (_BASE + 198)
+#define _gloffset_RasterPos3fv (_BASE + 199)
+#define _gloffset_RasterPos3i (_BASE + 200)
+#define _gloffset_RasterPos3iv (_BASE + 201)
+#define _gloffset_RasterPos3s (_BASE + 202)
+#define _gloffset_RasterPos3sv (_BASE + 203)
+#define _gloffset_RasterPos4d (_BASE + 204)
+#define _gloffset_RasterPos4dv (_BASE + 205)
+#define _gloffset_RasterPos4f (_BASE + 206)
+#define _gloffset_RasterPos4fv (_BASE + 207)
+#define _gloffset_RasterPos4i (_BASE + 208)
+#define _gloffset_RasterPos4iv (_BASE + 209)
+#define _gloffset_RasterPos4s (_BASE + 210)
+#define _gloffset_RasterPos4sv (_BASE + 211)
+#define _gloffset_ReadBuffer (_BASE + 212)
+#define _gloffset_ReadPixels (_BASE + 213)
+#define _gloffset_Rectd (_BASE + 214)
+#define _gloffset_Rectdv (_BASE + 215)
+#define _gloffset_Rectf (_BASE + 216)
+#define _gloffset_Rectfv (_BASE + 217)
+#define _gloffset_Recti (_BASE + 218)
+#define _gloffset_Rectiv (_BASE + 219)
+#define _gloffset_Rects (_BASE + 220)
+#define _gloffset_Rectsv (_BASE + 221)
+#define _gloffset_RenderMode (_BASE + 222)
+#define _gloffset_Rotated (_BASE + 223)
+#define _gloffset_Rotatef (_BASE + 224)
+#define _gloffset_Scaled (_BASE + 225)
+#define _gloffset_Scalef (_BASE + 226)
+#define _gloffset_Scissor (_BASE + 227)
+#define _gloffset_SelectBuffer (_BASE + 228)
+#define _gloffset_ShadeModel (_BASE + 229)
+#define _gloffset_StencilFunc (_BASE + 230)
+#define _gloffset_StencilMask (_BASE + 231)
+#define _gloffset_StencilOp (_BASE + 232)
+#define _gloffset_TexCoord1d (_BASE + 233)
+#define _gloffset_TexCoord1dv (_BASE + 234)
+#define _gloffset_TexCoord1f (_BASE + 235)
+#define _gloffset_TexCoord1fv (_BASE + 236)
+#define _gloffset_TexCoord1i (_BASE + 237)
+#define _gloffset_TexCoord1iv (_BASE + 238)
+#define _gloffset_TexCoord1s (_BASE + 239)
+#define _gloffset_TexCoord1sv (_BASE + 240)
+#define _gloffset_TexCoord2d (_BASE + 241)
+#define _gloffset_TexCoord2dv (_BASE + 242)
+#define _gloffset_TexCoord2f (_BASE + 243)
+#define _gloffset_TexCoord2fv (_BASE + 244)
+#define _gloffset_TexCoord2i (_BASE + 245)
+#define _gloffset_TexCoord2iv (_BASE + 246)
+#define _gloffset_TexCoord2s (_BASE + 247)
+#define _gloffset_TexCoord2sv (_BASE + 248)
+#define _gloffset_TexCoord3d (_BASE + 249)
+#define _gloffset_TexCoord3dv (_BASE + 250)
+#define _gloffset_TexCoord3f (_BASE + 251)
+#define _gloffset_TexCoord3fv (_BASE + 252)
+#define _gloffset_TexCoord3i (_BASE + 253)
+#define _gloffset_TexCoord3iv (_BASE + 254)
+#define _gloffset_TexCoord3s (_BASE + 255)
+#define _gloffset_TexCoord3sv (_BASE + 256)
+#define _gloffset_TexCoord4d (_BASE + 257)
+#define _gloffset_TexCoord4dv (_BASE + 258)
+#define _gloffset_TexCoord4f (_BASE + 259)
+#define _gloffset_TexCoord4fv (_BASE + 260)
+#define _gloffset_TexCoord4i (_BASE + 261)
+#define _gloffset_TexCoord4iv (_BASE + 262)
+#define _gloffset_TexCoord4s (_BASE + 263)
+#define _gloffset_TexCoord4sv (_BASE + 264)
+#define _gloffset_TexEnvf (_BASE + 265)
+#define _gloffset_TexEnvfv (_BASE + 266)
+#define _gloffset_TexEnvi (_BASE + 267)
+#define _gloffset_TexEnviv (_BASE + 268)
+#define _gloffset_TexGend (_BASE + 269)
+#define _gloffset_TexGendv (_BASE + 270)
+#define _gloffset_TexGenf (_BASE + 271)
+#define _gloffset_TexGenfv (_BASE + 272)
+#define _gloffset_TexGeni (_BASE + 273)
+#define _gloffset_TexGeniv (_BASE + 274)
+#define _gloffset_TexImage1D (_BASE + 275)
+#define _gloffset_TexImage2D (_BASE + 276)
+#define _gloffset_TexParameterf (_BASE + 277)
+#define _gloffset_TexParameterfv (_BASE + 278)
+#define _gloffset_TexParameteri (_BASE + 279)
+#define _gloffset_TexParameteriv (_BASE + 280)
+#define _gloffset_Translated (_BASE + 281)
+#define _gloffset_Translatef (_BASE + 282)
+#define _gloffset_Vertex2d (_BASE + 283)
+#define _gloffset_Vertex2dv (_BASE + 284)
+#define _gloffset_Vertex2f (_BASE + 285)
+#define _gloffset_Vertex2fv (_BASE + 286)
+#define _gloffset_Vertex2i (_BASE + 287)
+#define _gloffset_Vertex2iv (_BASE + 288)
+#define _gloffset_Vertex2s (_BASE + 289)
+#define _gloffset_Vertex2sv (_BASE + 290)
+#define _gloffset_Vertex3d (_BASE + 291)
+#define _gloffset_Vertex3dv (_BASE + 292)
+#define _gloffset_Vertex3f (_BASE + 293)
+#define _gloffset_Vertex3fv (_BASE + 294)
+#define _gloffset_Vertex3i (_BASE + 295)
+#define _gloffset_Vertex3iv (_BASE + 296)
+#define _gloffset_Vertex3s (_BASE + 297)
+#define _gloffset_Vertex3sv (_BASE + 298)
+#define _gloffset_Vertex4d (_BASE + 299)
+#define _gloffset_Vertex4dv (_BASE + 300)
+#define _gloffset_Vertex4f (_BASE + 301)
+#define _gloffset_Vertex4fv (_BASE + 302)
+#define _gloffset_Vertex4i (_BASE + 303)
+#define _gloffset_Vertex4iv (_BASE + 304)
+#define _gloffset_Vertex4s (_BASE + 305)
+#define _gloffset_Vertex4sv (_BASE + 306)
+#define _gloffset_Viewport (_BASE + 307)
+
+/* GL 1.1 */
+#define _gloffset_AreTexturesResident (_BASE + 308)
+#define _gloffset_ArrayElement (_BASE + 309)
+#define _gloffset_BindTexture (_BASE + 310)
+#define _gloffset_ColorPointer (_BASE + 311)
+#define _gloffset_CopyTexImage1D (_BASE + 312)
+#define _gloffset_CopyTexImage2D (_BASE + 313)
+#define _gloffset_CopyTexSubImage1D (_BASE + 314)
+#define _gloffset_CopyTexSubImage2D (_BASE + 315)
+#define _gloffset_DeleteTextures (_BASE + 316)
+#define _gloffset_DisableClientState (_BASE + 317)
+#define _gloffset_DrawArrays (_BASE + 318)
+#define _gloffset_DrawElements (_BASE + 319)
+#define _gloffset_EdgeFlagPointer (_BASE + 320)
+#define _gloffset_EnableClientState (_BASE + 321)
+#define _gloffset_GenTextures (_BASE + 322)
+#define _gloffset_GetPointerv (_BASE + 323)
+#define _gloffset_IndexPointer (_BASE + 324)
+#define _gloffset_Indexub (_BASE + 325)
+#define _gloffset_Indexubv (_BASE + 326)
+#define _gloffset_InterleavedArrays (_BASE + 327)
+#define _gloffset_IsTexture (_BASE + 328)
+#define _gloffset_NormalPointer (_BASE + 329)
+#define _gloffset_PopClientAttrib (_BASE + 330)
+#define _gloffset_PrioritizeTextures (_BASE + 331)
+#define _gloffset_PushClientAttrib (_BASE + 332)
+#define _gloffset_TexCoordPointer (_BASE + 333)
+#define _gloffset_TexSubImage1D (_BASE + 334)
+#define _gloffset_TexSubImage2D (_BASE + 335)
+#define _gloffset_VertexPointer (_BASE + 336)
+
+/* GL 1.2 */
+#define _gloffset_CopyTexSubImage3D (_BASE + 337)
+#define _gloffset_DrawRangeElements (_BASE + 338)
+#define _gloffset_TexImage3D (_BASE + 339)
+#define _gloffset_TexSubImage3D (_BASE + 340)
+
+/* GL_ARB_imaging */
+#define _gloffset_BlendColor (_BASE + 341)
+#define _gloffset_BlendEquation (_BASE + 342)
+#define _gloffset_ColorSubTable (_BASE + 343)
+#define _gloffset_ColorTable (_BASE + 344)
+#define _gloffset_ColorTableParameterfv (_BASE + 345)
+#define _gloffset_ColorTableParameteriv (_BASE + 346)
+#define _gloffset_ConvolutionFilter1D (_BASE + 347)
+#define _gloffset_ConvolutionFilter2D (_BASE + 348)
+#define _gloffset_ConvolutionParameterf (_BASE + 349)
+#define _gloffset_ConvolutionParameterfv (_BASE + 350)
+#define _gloffset_ConvolutionParameteri (_BASE + 351)
+#define _gloffset_ConvolutionParameteriv (_BASE + 352)
+#define _gloffset_CopyColorSubTable (_BASE + 353)
+#define _gloffset_CopyColorTable (_BASE + 354)
+#define _gloffset_CopyConvolutionFilter1D (_BASE + 355)
+#define _gloffset_CopyConvolutionFilter2D (_BASE + 356)
+#define _gloffset_GetColorTable (_BASE + 357)
+#define _gloffset_GetColorTableParameterfv (_BASE + 358)
+#define _gloffset_GetColorTableParameteriv (_BASE + 359)
+#define _gloffset_GetConvolutionFilter (_BASE + 360)
+#define _gloffset_GetConvolutionParameterfv (_BASE + 361)
+#define _gloffset_GetConvolutionParameteriv (_BASE + 362)
+#define _gloffset_GetHistogram (_BASE + 363)
+#define _gloffset_GetHistogramParameterfv (_BASE + 364)
+#define _gloffset_GetHistogramParameteriv (_BASE + 365)
+#define _gloffset_GetMinmax (_BASE + 366)
+#define _gloffset_GetMinmaxParameterfv (_BASE + 367)
+#define _gloffset_GetMinmaxParameteriv (_BASE + 368)
+#define _gloffset_GetSeparableFilter (_BASE + 369)
+#define _gloffset_Histogram (_BASE + 370)
+#define _gloffset_Minmax (_BASE + 371)
+#define _gloffset_ResetHistogram (_BASE + 372)
+#define _gloffset_ResetMinmax (_BASE + 373)
+#define _gloffset_SeparableFilter2D (_BASE + 374)
+
+/* GL_ARB_multitexture */
+#define _gloffset_ActiveTextureARB (_BASE + 375)
+#define _gloffset_ClientActiveTextureARB (_BASE + 376)
+#define _gloffset_MultiTexCoord1dARB (_BASE + 377)
+#define _gloffset_MultiTexCoord1dvARB (_BASE + 378)
+#define _gloffset_MultiTexCoord1fARB (_BASE + 379)
+#define _gloffset_MultiTexCoord1fvARB (_BASE + 380)
+#define _gloffset_MultiTexCoord1iARB (_BASE + 381)
+#define _gloffset_MultiTexCoord1ivARB (_BASE + 382)
+#define _gloffset_MultiTexCoord1sARB (_BASE + 383)
+#define _gloffset_MultiTexCoord1svARB (_BASE + 384)
+#define _gloffset_MultiTexCoord2dARB (_BASE + 385)
+#define _gloffset_MultiTexCoord2dvARB (_BASE + 386)
+#define _gloffset_MultiTexCoord2fARB (_BASE + 387)
+#define _gloffset_MultiTexCoord2fvARB (_BASE + 388)
+#define _gloffset_MultiTexCoord2iARB (_BASE + 389)
+#define _gloffset_MultiTexCoord2ivARB (_BASE + 390)
+#define _gloffset_MultiTexCoord2sARB (_BASE + 391)
+#define _gloffset_MultiTexCoord2svARB (_BASE + 392)
+#define _gloffset_MultiTexCoord3dARB (_BASE + 393)
+#define _gloffset_MultiTexCoord3dvARB (_BASE + 394)
+#define _gloffset_MultiTexCoord3fARB (_BASE + 395)
+#define _gloffset_MultiTexCoord3fvARB (_BASE + 396)
+#define _gloffset_MultiTexCoord3iARB (_BASE + 397)
+#define _gloffset_MultiTexCoord3ivARB (_BASE + 398)
+#define _gloffset_MultiTexCoord3sARB (_BASE + 399)
+#define _gloffset_MultiTexCoord3svARB (_BASE + 400)
+#define _gloffset_MultiTexCoord4dARB (_BASE + 401)
+#define _gloffset_MultiTexCoord4dvARB (_BASE + 402)
+#define _gloffset_MultiTexCoord4fARB (_BASE + 403)
+#define _gloffset_MultiTexCoord4fvARB (_BASE + 404)
+#define _gloffset_MultiTexCoord4iARB (_BASE + 405)
+#define _gloffset_MultiTexCoord4ivARB (_BASE + 406)
+#define _gloffset_MultiTexCoord4sARB (_BASE + 407)
+#define _gloffset_MultiTexCoord4svARB (_BASE + 408)
+
+
+
+#define _EXTBASE (_BASE + 409)
+
+
+/* 1. GL_EXT_abgr - no functions */
+
+/* 2. GL_EXT_blend_color */
+#define _gloffset_BlendColorEXT (_EXTBASE + 0)
+
+/* 3. GL_EXT_polygon_offset */
+#define _gloffset_PolygonOffsetEXT (_EXTBASE + 1)
+
+/* 4. GL_EXT_texture - no functions */
+
+/* 5. ??? */
+
+/* 6. GL_EXT_texture3D */
+#define _gloffset_CopyTexSubImage3DEXT (_EXTBASE + 2)
+#define _gloffset_TexImage3DEXT (_EXTBASE + 3)
+#define _gloffset_TexSubImage3DEXT (_EXTBASE + 4)
+
+/* 7. GL_SGI_texture_filter4 */
+#define _gloffset_GetTexFilterFuncSGIS (_EXTBASE + 5)
+#define _gloffset_TexFilterFuncSGIS (_EXTBASE + 6)
+
+/* 8. ??? */
+
+/* 9. GL_EXT_subtexture */
+#define _gloffset_TexSubImage1DEXT (_EXTBASE + 7)
+#define _gloffset_TexSubImage2DEXT (_EXTBASE + 8)
+/*#define _gloffset_TexSubImage3DEXT*/
+
+/* 10. GL_EXT_copy_texture */
+#define _gloffset_CopyTexImage1DEXT (_EXTBASE + 9)
+#define _gloffset_CopyTexImage2DEXT (_EXTBASE + 10)
+#define _gloffset_CopyTexSubImage1DEXT (_EXTBASE + 11)
+#define _gloffset_CopyTexSubImage2DEXT (_EXTBASE + 12)
+/*#define _gloffset_CopyTexSubImage3DEXT*/
+
+/* 11. GL_EXT_histogram */
+#define _gloffset_GetHistogramEXT (_EXTBASE + 13)
+#define _gloffset_GetHistogramParameterfvEXT (_EXTBASE + 15)
+#define _gloffset_GetHistogramParameterivEXT (_EXTBASE + 14)
+#define _gloffset_GetMinmaxEXT (_EXTBASE + 16)
+#define _gloffset_GetMinmaxParameterfvEXT (_EXTBASE + 18)
+#define _gloffset_GetMinmaxParameterivEXT (_EXTBASE + 17)
+#define _gloffset_HistogramEXT (_EXTBASE + 19)
+#define _gloffset_MinmaxEXT (_EXTBASE + 20)
+#define _gloffset_ResetHistogramEXT (_EXTBASE + 21)
+#define _gloffset_ResetMinmaxEXT (_EXTBASE + 22)
+
+/* 12. GL_EXT_convolution */
+#define _gloffset_ConvolutionFilter1DEXT (_EXTBASE + 23)
+#define _gloffset_ConvolutionFilter2DEXT (_EXTBASE + 24)
+#define _gloffset_ConvolutionParameterfEXT (_EXTBASE + 25)
+#define _gloffset_ConvolutionParameterfvEXT (_EXTBASE + 26)
+#define _gloffset_ConvolutionParameteriEXT (_EXTBASE + 27)
+#define _gloffset_ConvolutionParameterivEXT (_EXTBASE + 28)
+#define _gloffset_CopyConvolutionFilter1DEXT (_EXTBASE + 29)
+#define _gloffset_CopyConvolutionFilter2DEXT (_EXTBASE + 30)
+#define _gloffset_GetConvolutionFilterEXT (_EXTBASE + 31)
+#define _gloffset_GetConvolutionParameterivEXT (_EXTBASE + 32)
+#define _gloffset_GetConvolutionParameterfvEXT (_EXTBASE + 33)
+#define _gloffset_GetSeparableFilterEXT (_EXTBASE + 34)
+#define _gloffset_SeparableFilter2DEXT (_EXTBASE + 35)
+
+/* 13. GL_SGI_color_matrix - no functions */
+
+/* 14. GL_SGI_color_table */
+#define _gloffset_ColorTableSGI (_EXTBASE + 36)
+#define _gloffset_ColorTableParameterfvSGI (_EXTBASE + 37)
+#define _gloffset_ColorTableParameterivSGI (_EXTBASE + 38)
+#define _gloffset_CopyColorTableSGI (_EXTBASE + 39)
+#define _gloffset_GetColorTableSGI (_EXTBASE + 40)
+#define _gloffset_GetColorTableParameterfvSGI (_EXTBASE + 41)
+#define _gloffset_GetColorTableParameterivSGI (_EXTBASE + 42)
+
+/* 15. GL_SGIS_pixel_texture */
+#define _gloffset_PixelTexGenParameterfSGIS (_EXTBASE + 43)
+#define _gloffset_PixelTexGenParameteriSGIS (_EXTBASE + 44)
+#define _gloffset_GetPixelTexGenParameterfvSGIS (_EXTBASE + 45)
+#define _gloffset_GetPixelTexGenParameterivSGIS (_EXTBASE + 46)
+
+/* 16. GL_SGIS_texture4D */
+#define _gloffset_TexImage4DSGIS (_EXTBASE + 47)
+#define _gloffset_TexSubImage4DSGIS (_EXTBASE + 48)
+
+/* 17. GL_SGI_texture_color_table - no functions */
+
+/* 18. GL_EXT_cmyka - no functions */
+
+/* 19. ??? */
+
+/* 20. GL_EXT_texture_object */
+#define _gloffset_AreTexturesResidentEXT (_EXTBASE + 49)
+#define _gloffset_BindTextureEXT (_EXTBASE + 50)
+#define _gloffset_DeleteTexturesEXT (_EXTBASE + 51)
+#define _gloffset_GenTexturesEXT (_EXTBASE + 52)
+#define _gloffset_IsTextureEXT (_EXTBASE + 53)
+#define _gloffset_PrioritizeTexturesEXT (_EXTBASE + 54)
+
+/* 21. GL_SGIS_detail_texture */
+#define _gloffset_DetailTexFuncSGIS (_EXTBASE + 55)
+#define _gloffset_GetDetailTexFuncSGIS (_EXTBASE + 56)
+
+/* 22. GL_SGIS_sharpen_texture */
+#define _gloffset_GetSharpenTexFuncSGIS (_EXTBASE + 57)
+#define _gloffset_SharpenTexFuncSGIS (_EXTBASE + 58)
+
+/* 23. GL_EXT_packed_pixels - no functions */
+
+/* 24. GL_SGIS_texture_lod - no functions */
+
+/* 25. GL_SGIS_multisample */
+#define _gloffset_SampleMaskSGIS (_EXTBASE + 54)
+#define _gloffset_SamplePatternSGIS (_EXTBASE + 55)
+
+/* 26. ??? */
+
+/* 27. GL_EXT_rescale_normal - no functions */
+
+/* 28. GLX_EXT_visual_info - no functions */
+
+/* 29. ??? */
+
+/* 30. GL_EXT_vertex_array */
+#define _gloffset_ArrayElementEXT (_EXTBASE + 56)
+#define _gloffset_ColorPointerEXT (_EXTBASE + 57)
+#define _gloffset_DrawArraysEXT (_EXTBASE + 58)
+#define _gloffset_EdgeFlagPointerEXT (_EXTBASE + 59)
+#define _gloffset_GetPointervEXT (_EXTBASE + 60)
+#define _gloffset_IndexPointerEXT (_EXTBASE + 61)
+#define _gloffset_NormalPointerEXT (_EXTBASE + 62)
+#define _gloffset_TexCoordPointerEXT (_EXTBASE + 63)
+#define _gloffset_VertexPointerEXT (_EXTBASE + 64)
+
+/* 31. GL_EXT_misc_attribute - no functions */
+
+/* 32. GL_SGIS_generate_mipmap - no functions */
+
+/* 33. GL_SGIX_clipmap - no functions */
+
+/* 34. GL_SGIX_shadow - no functions */
+
+/* 35. GL_SGIS_texture_edge_clamp - no functions */
+
+/* 36. GL_SGIS_texture_border_clamp - no functions */
+
+/* 37. GL_EXT_blend_minmax */
+#define _gloffset_BlendEquationEXT (_EXTBASE + 65)
+
+/* 38. GL_EXT_blend_subtract - no functions */
+
+/* 39. GL_EXT_blend_logic_op - no functions */
+
+/* 40. GLX_SGI_swap_control - GLX functions */
+
+/* 41. GLX_SGI_video_sync - GLX functions */
+
+/* 42. GLX_SGI_make_current_read - GLX functions */
+
+/* 43. GLX_SGIX_video_source - GLX functions */
+
+/* 44. GLX_EXT_visual_rating - no functions */
+
+/* 45. GL_SGIX_interlace - no functions */
+
+/* 46. ??? */
+
+/* 47. GLX_EXT_import_context - GLX functions */
+
+/* 48. ??? */
+
+/* 49. GLX_SGIX_fbconfig - some GLX functions */
+
+/* 50. GLX_SGIX_pbuffer - GLX functions */
+
+/* 51. GL_SGIS_texture_select - no functions */
+
+/* 52. GL_SGIX_sprite */
+#define _gloffset_SpriteParameterfSGIX (_EXTBASE + 66)
+#define _gloffset_SpriteParameterfvSGIX (_EXTBASE + 67)
+#define _gloffset_SpriteParameteriSGIX (_EXTBASE + 68)
+#define _gloffset_SpriteParameterivSGIX (_EXTBASE + 69)
+
+/* 53. ??? */
+
+/* 54. GL_EXT_point_parameters */
+#define _gloffset_PointParameterfEXT (_EXTBASE + 70)
+#define _gloffset_PointParameterfvEXT (_EXTBASE + 71)
+
+/* 55. GL_SGIX_instruments */
+#define _gloffset_InstrumentsBufferSGIX (_EXTBASE + 72)
+#define _gloffset_StartInstrumentsSGIX (_EXTBASE + 73)
+#define _gloffset_StopInstrumentsSGIX (_EXTBASE + 74)
+#define _gloffset_ReadInstrumentsSGIX (_EXTBASE + 75)
+#define _gloffset_PollInstrumentsSGIX (_EXTBASE + 76)
+#define _gloffset_GetInstrumentsSGIX (_EXTBASE + 77)
+
+/* 56. GL_SGIX_texture_scale_bias - no functions */
+
+/* 57. GL_SGIX_framezoom */
+#define _gloffset_FrameZoomSGIX (_EXTBASE + 78)
+
+/* 58. GL_SGIX_tag_sample_buffer - no functions */
+
+/* 59. ??? */
+
+/* 60. GL_SGIX_reference_plane */
+#define _gloffset_ReferencePlaneSGIX (_EXTBASE + 79)
+
+/* 61. GL_SGIX_flush_raster */
+#define _gloffset_FlushRasterSGIX (_EXTBASE + 80)
+
+/* 62. GLX_SGI_cushion - GLX functions */
+
+/* 63. GL_SGIX_depth_texture - no functions */
+
+/* 64. ??? */
+
+/* 65. GL_SGIX_fog_offset - no functions */
+
+/* 66. GL_HP_image_transform */
+#define _gloffset_GetImageTransformParameterfvHP (_EXTBASE + 81)
+#define _gloffset_GetImageTransformParameterivHP (_EXTBASE + 82)
+#define _gloffset_ImageTransformParameterfHP (_EXTBASE + 83)
+#define _gloffset_ImageTransformParameterfvHP (_EXTBASE + 84)
+#define _gloffset_ImageTransformParameteriHP (_EXTBASE + 85)
+#define _gloffset_ImageTransformParameterivHP (_EXTBASE + 86)
+
+/* 67. GL_HP_convolution_border_modes - no functions */
+
+/* 68. ??? */
+
+/* 69. GL_SGIX_texture_add_env - no functions */
+
+/* 70. ??? */
+
+/* 71. ??? */
+
+/* 72. ??? */
+
+/* 73. ??? */
+
+/* 74. GL_EXT_color_subtable */
+#define _gloffset_ColorSubTableEXT (_EXTBASE + 87)
+#define _gloffset_CopyColorSubTableEXT (_EXTBASE + 88)
+
+/* 75. GLU_EXT_object_space_tess - GLU functions */
+
+/* 76. GL_PGI_vertex_hints - no functions */
+
+/* 77. GL_PGI_misc_hints */
+#define _gloffset_HintPGI (_EXTBASE + 89)
+
+/* 78. GL_EXT_paletted_texture */
+/* ColorSubTableEXT already defined */
+#define _gloffset_ColorTableEXT (_EXTBASE + 91)
+#define _gloffset_GetColorTableEXT (_EXTBASE + 92)
+#define _gloffset_GetColorTableParameterfvEXT (_EXTBASE + 93)
+#define _gloffset_GetColorTableParameterivEXT (_EXTBASE + 94)
+
+/* 79. GL_EXT_clip_volume_hint - no functions */
+
+/* 80. GL_SGIX_list_priority */
+#define _gloffset_GetListParameterfvSGIX (_EXTBASE + 95)
+#define _gloffset_GetListParameterivSGIX (_EXTBASE + 96)
+#define _gloffset_ListParameterfSGIX (_EXTBASE + 97)
+#define _gloffset_ListParameterfvSGIX (_EXTBASE + 98)
+#define _gloffset_ListParameteriSGIX (_EXTBASE + 99)
+#define _gloffset_ListParameterivSGIX (_EXTBASE + 100)
+
+/* 81. GL_SGIX_ir_instrument1 - no functions */
+
+/* 82. ??? */
+
+/* 83. GLX_SGIX_video_resize - GLX functions */
+
+/* 84. GL_SGIX_texture_lod_bias - no functions */
+
+/* 85. GLU_SGI_filter4_parameters - GLU functions */
+
+/* 86. GLX_SGIX_dm_buffer - GLX functions */
+
+/* 87. ??? */
+
+/* 88. ??? */
+
+/* 89. ??? */
+
+/* 90. ??? */
+
+/* 91. GLX_SGIX_swap_group - GLX functions */
+
+/* 92. GLX_SGIX_swap_barrier - GLX functions */
+
+/* 93. GL_EXT_index_texture - no functions */
+
+/* 94. GL_EXT_index_material */
+#define _gloffset_IndexMaterialEXT (_EXTBASE + 101)
+
+/* 95. GL_EXT_index_func */
+#define _gloffset_IndexFuncEXT (_EXTBASE + 102)
+
+/* 96. GL_EXT_index_array_formats - no functions */
+
+/* 97. GL_EXT_compiled_vertex_array */
+#define _gloffset_LockArraysEXT (_EXTBASE + 103)
+#define _gloffset_UnlockArraysEXT (_EXTBASE + 104)
+
+/* 98. GL_EXT_cull_vertex */
+#define _gloffset_CullParameterfvEXT (_EXTBASE + 105)
+#define _gloffset_CullParameterdvEXT (_EXTBASE + 106)
+
+/* 99. ??? */
+
+/* 100. GLU_EXT_nurbs_tessellator - GLU functions */
+
+/* 173. GL_EXT/INGR_blend_func_separate */
+#define _gloffset_BlendFuncSeparateINGR (_EXTBASE + 107)
+
+/* GL_MESA_window_pos */
+#define _gloffset_WindowPos4fMESA (_EXTBASE + 108)
+
+/* GL_MESA_resize_buffers */
+#define _gloffset_ResizeBuffersMESA (_EXTBASE + 109)
+
+/* GL_ARB_transpose_matrix */
+#define _gloffset_LoadTransposeMatrixdARB (_EXTBASE + 110)
+#define _gloffset_LoadTransposeMatrixfARB (_EXTBASE + 111)
+#define _gloffset_MultTransposeMatrixdARB (_EXTBASE + 112)
+#define _gloffset_MultTransposeMatrixfARB (_EXTBASE + 113)
+
+
+
+#endif
+
diff --git a/xc/extras/Mesa/src/glapitable.h b/xc/extras/Mesa/src/glapitable.h
new file mode 100644
index 000000000..63c34eb1a
--- /dev/null
+++ b/xc/extras/Mesa/src/glapitable.h
@@ -0,0 +1,833 @@
+/* $Id: glapitable.h,v 1.2 2000/01/30 00:27:02 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999-2000 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+/*
+ * This file is not specific to Mesa. It defines a dispatch table
+ * which could be used by any number of OpenGL implementations.
+ * It's designed to be gl.h-independent as well. That is, it does
+ * not depend on any particular extensions being defined in the gl.h
+ * header. We #define extension symbols (like _GLAPI_EXT_blend_color)
+ * to determine which entry points to compile. Clients of this dispatcher
+ * (like Mesa) can #ifdef test these symbols to know how to fill in the
+ * table.
+ */
+
+
+#ifndef _GLAPI_TABLE_H
+#define _GLAPI_TABLE_H
+
+
+#include "GL/gl.h"
+
+
+#define _GLAPI_EXTRA_SLOTS 1000
+
+
+/*
+ * This struct contains pointers for all the GL API entrypoints
+ * plus some reserved slots for dynamic extensions.
+ *
+ * Strictly speaking, this struct isn't needed if we have assembly
+ * language entrypoint functions since no knowledge of function
+ * arguments is needed.
+ *
+ * This struct may be replaced by an automatically-generated struct
+ * using the spec files in the OpenGL SI.
+ */
+struct _glapi_table
+{
+ void (*Dummy)(void);
+
+ /*
+ * OpenGL 1.0
+ */
+ void (*Accum)(GLenum, GLfloat);
+ void (*AlphaFunc)(GLenum, GLclampf);
+ void (*Begin)(GLenum);
+ void (*Bitmap)(GLsizei, GLsizei, GLfloat, GLfloat, GLfloat, GLfloat, const GLubyte *);
+ void (*BlendFunc)(GLenum, GLenum);
+ void (*CallList)(GLuint list);
+ void (*CallLists)(GLsizei, GLenum, const GLvoid *);
+ void (*Clear)(GLbitfield);
+ void (*ClearAccum)(GLfloat, GLfloat, GLfloat, GLfloat);
+ void (*ClearColor)(GLclampf, GLclampf, GLclampf, GLclampf);
+ void (*ClearDepth)(GLclampd);
+ void (*ClearIndex)(GLfloat);
+ void (*ClearStencil)(GLint);
+ void (*ClipPlane)(GLenum, const GLdouble *);
+ void (*Color3b)(GLbyte, GLbyte, GLbyte);
+ void (*Color3bv)(const GLbyte *);
+ void (*Color3d)(GLdouble, GLdouble, GLdouble);
+ void (*Color3dv)(const GLdouble *);
+ void (*Color3f)(GLfloat, GLfloat, GLfloat);
+ void (*Color3fv)(const GLfloat *);
+ void (*Color3i)(GLint, GLint, GLint);
+ void (*Color3iv)(const GLint *);
+ void (*Color3s)(GLshort, GLshort, GLshort);
+ void (*Color3sv)(const GLshort *);
+ void (*Color3ub)(GLubyte, GLubyte, GLubyte);
+ void (*Color3ubv)(const GLubyte *);
+ void (*Color3ui)(GLuint, GLuint, GLuint);
+ void (*Color3uiv)(const GLuint *);
+ void (*Color3us)(GLushort, GLushort, GLushort);
+ void (*Color3usv)(const GLushort *);
+ void (*Color4b)(GLbyte, GLbyte, GLbyte, GLbyte);
+ void (*Color4bv)(const GLbyte *);
+ void (*Color4d)(GLdouble, GLdouble, GLdouble, GLdouble);
+ void (*Color4dv)(const GLdouble *);
+ void (*Color4f)(GLfloat, GLfloat, GLfloat, GLfloat);
+ void (*Color4fv)(const GLfloat *);
+ void (*Color4i)(GLint, GLint, GLint, GLint);
+ void (*Color4iv)(const GLint *);
+ void (*Color4s)(GLshort, GLshort, GLshort, GLshort);
+ void (*Color4sv)(const GLshort *);
+ void (*Color4ub)(GLubyte, GLubyte, GLubyte, GLubyte);
+ void (*Color4ubv)(const GLubyte *);
+ void (*Color4ui)(GLuint, GLuint, GLuint, GLuint);
+ void (*Color4uiv)(const GLuint *);
+ void (*Color4us)(GLushort, GLushort, GLushort, GLushort);
+ void (*Color4usv)(const GLushort *);
+ void (*ColorMask)(GLboolean, GLboolean, GLboolean, GLboolean);
+ void (*ColorMaterial)(GLenum, GLenum);
+ void (*CopyPixels)(GLint, GLint, GLsizei, GLsizei, GLenum);
+ void (*CullFace)(GLenum);
+ void (*DeleteLists)(GLuint, GLsizei);
+ void (*DepthFunc)(GLenum);
+ void (*DepthMask)(GLboolean);
+ void (*DepthRange)(GLclampd, GLclampd);
+ void (*Disable)(GLenum);
+ void (*DrawBuffer)(GLenum);
+ void (*DrawPixels)(GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+ void (*EdgeFlag)(GLboolean);
+ void (*EdgeFlagv)(const GLboolean *);
+ void (*Enable)(GLenum);
+ void (*End)(void);
+ void (*EndList)(void);
+ void (*EvalCoord1d)(GLdouble);
+ void (*EvalCoord1dv)(const GLdouble *);
+ void (*EvalCoord1f)(GLfloat);
+ void (*EvalCoord1fv)(const GLfloat *);
+ void (*EvalCoord2d)(GLdouble u, GLdouble);
+ void (*EvalCoord2dv)(const GLdouble *);
+ void (*EvalCoord2f)(GLfloat u, GLfloat);
+ void (*EvalCoord2fv)(const GLfloat *);
+ void (*EvalMesh1)(GLenum, GLint, GLint);
+ void (*EvalMesh2)(GLenum, GLint, GLint, GLint, GLint);
+ void (*EvalPoint1)(GLint);
+ void (*EvalPoint2)(GLint, GLint);
+ void (*FeedbackBuffer)(GLsizei, GLenum, GLfloat *);
+ void (*Finish)(void);
+ void (*Flush)(void);
+ void (*Fogf)(GLenum, GLfloat);
+ void (*Fogfv)(GLenum, const GLfloat *);
+ void (*Fogi)(GLenum, GLint);
+ void (*Fogiv)(GLenum, const GLint *);
+ void (*FrontFace)(GLenum);
+ void (*Frustum)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
+ GLuint (*GenLists)(GLsizei);
+ void (*GetBooleanv)(GLenum, GLboolean *);
+ void (*GetClipPlane)(GLenum, GLdouble *);
+ void (*GetDoublev)(GLenum, GLdouble *);
+ GLenum (*GetError)(void);
+ void (*GetFloatv)(GLenum, GLfloat *);
+ void (*GetIntegerv)(GLenum, GLint *);
+ void (*GetLightfv)(GLenum light, GLenum, GLfloat *);
+ void (*GetLightiv)(GLenum light, GLenum, GLint *);
+ void (*GetMapdv)(GLenum, GLenum, GLdouble *);
+ void (*GetMapfv)(GLenum, GLenum, GLfloat *);
+ void (*GetMapiv)(GLenum, GLenum, GLint *);
+ void (*GetMaterialfv)(GLenum, GLenum, GLfloat *);
+ void (*GetMaterialiv)(GLenum, GLenum, GLint *);
+ void (*GetPixelMapfv)(GLenum, GLfloat *);
+ void (*GetPixelMapuiv)(GLenum, GLuint *);
+ void (*GetPixelMapusv)(GLenum, GLushort *);
+ void (*GetPolygonStipple)(GLubyte *);
+ const GLubyte* (*GetString)(GLenum name);
+ void (*GetTexEnvfv)(GLenum, GLenum, GLfloat *);
+ void (*GetTexEnviv)(GLenum, GLenum, GLint *);
+ void (*GetTexGendv)(GLenum coord, GLenum, GLdouble *);
+ void (*GetTexGenfv)(GLenum coord, GLenum, GLfloat *);
+ void (*GetTexGeniv)(GLenum coord, GLenum, GLint *);
+ void (*GetTexImage)(GLenum, GLint level, GLenum, GLenum, GLvoid *);
+ void (*GetTexLevelParameterfv)(GLenum, GLint, GLenum, GLfloat *);
+ void (*GetTexLevelParameteriv)(GLenum, GLint, GLenum, GLint *);
+ void (*GetTexParameterfv)(GLenum, GLenum, GLfloat *);
+ void (*GetTexParameteriv)(GLenum, GLenum, GLint *);
+ void (*Hint)(GLenum, GLenum);
+ void (*IndexMask)(GLuint);
+ void (*Indexd)(GLdouble);
+ void (*Indexdv)(const GLdouble *);
+ void (*Indexf)(GLfloat);
+ void (*Indexfv)(const GLfloat *);
+ void (*Indexi)(GLint);
+ void (*Indexiv)(const GLint *);
+ void (*Indexs)(GLshort);
+ void (*Indexsv)(const GLshort *);
+ void (*InitNames)(void);
+ GLboolean (*IsEnabled)(GLenum);
+ GLboolean (*IsList)(GLuint);
+ void (*LightModelf)(GLenum, GLfloat);
+ void (*LightModelfv)(GLenum, const GLfloat *);
+ void (*LightModeli)(GLenum, GLint);
+ void (*LightModeliv)(GLenum, const GLint *);
+ void (*Lightf)(GLenum light, GLenum, GLfloat);
+ void (*Lightfv)(GLenum light, GLenum, const GLfloat *);
+ void (*Lighti)(GLenum light, GLenum, GLint);
+ void (*Lightiv)(GLenum light, GLenum, const GLint *);
+ void (*LineStipple)(GLint factor, GLushort);
+ void (*LineWidth)(GLfloat);
+ void (*ListBase)(GLuint);
+ void (*LoadIdentity)(void);
+ void (*LoadMatrixd)(const GLdouble *);
+ void (*LoadMatrixf)(const GLfloat *);
+ void (*LoadName)(GLuint);
+ void (*LogicOp)(GLenum);
+ void (*Map1d)(GLenum, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
+ void (*Map1f)(GLenum, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
+ void (*Map2d)(GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
+ void (*Map2f)(GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
+ void (*MapGrid1d)(GLint, GLdouble, GLdouble);
+ void (*MapGrid1f)(GLint, GLfloat, GLfloat);
+ void (*MapGrid2d)(GLint, GLdouble, GLdouble, GLint, GLdouble, GLdouble);
+ void (*MapGrid2f)(GLint, GLfloat, GLfloat, GLint, GLfloat, GLfloat);
+ void (*Materialf)(GLenum, GLenum, GLfloat);
+ void (*Materialfv)(GLenum, GLenum, const GLfloat *);
+ void (*Materiali)(GLenum, GLenum, GLint);
+ void (*Materialiv)(GLenum, GLenum, const GLint *);
+ void (*MatrixMode)(GLenum);
+ void (*MultMatrixd)(const GLdouble *);
+ void (*MultMatrixf)(const GLfloat *);
+ void (*NewList)(GLuint list, GLenum);
+ void (*Normal3b)(GLbyte, GLbyte, GLbyte);
+ void (*Normal3bv)(const GLbyte *);
+ void (*Normal3d)(GLdouble, GLdouble, GLdouble);
+ void (*Normal3dv)(const GLdouble *);
+ void (*Normal3f)(GLfloat, GLfloat, GLfloat);
+ void (*Normal3fv)(const GLfloat *);
+ void (*Normal3i)(GLint, GLint, GLint);
+ void (*Normal3iv)(const GLint *);
+ void (*Normal3s)(GLshort, GLshort, GLshort);
+ void (*Normal3sv)(const GLshort *);
+ void (*Ortho)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
+ void (*PassThrough)(GLfloat);
+ void (*PixelMapfv)(GLenum, GLint, const GLfloat *);
+ void (*PixelMapuiv)(GLenum, GLint, const GLuint *);
+ void (*PixelMapusv)(GLenum, GLint, const GLushort *);
+ void (*PixelStoref)(GLenum, GLfloat);
+ void (*PixelStorei)(GLenum, GLint);
+ void (*PixelTransferf)(GLenum, GLfloat);
+ void (*PixelTransferi)(GLenum, GLint);
+ void (*PixelZoom)(GLfloat, GLfloat);
+ void (*PointSize)(GLfloat);
+ void (*PolygonMode)(GLenum, GLenum);
+ void (*PolygonOffset)(GLfloat, GLfloat);
+ void (*PolygonStipple)(const GLubyte *);
+ void (*PopAttrib)(void);
+ void (*PopMatrix)(void);
+ void (*PopName)(void);
+ void (*PushAttrib)(GLbitfield);
+ void (*PushMatrix)(void);
+ void (*PushName)(GLuint);
+ void (*RasterPos2d)(GLdouble, GLdouble);
+ void (*RasterPos2dv)(const GLdouble *);
+ void (*RasterPos2f)(GLfloat, GLfloat);
+ void (*RasterPos2fv)(const GLfloat *);
+ void (*RasterPos2i)(GLint, GLint);
+ void (*RasterPos2iv)(const GLint *);
+ void (*RasterPos2s)(GLshort, GLshort);
+ void (*RasterPos2sv)(const GLshort *);
+ void (*RasterPos3d)(GLdouble, GLdouble, GLdouble);
+ void (*RasterPos3dv)(const GLdouble *);
+ void (*RasterPos3f)(GLfloat, GLfloat, GLfloat);
+ void (*RasterPos3fv)(const GLfloat *);
+ void (*RasterPos3i)(GLint, GLint, GLint);
+ void (*RasterPos3iv)(const GLint *);
+ void (*RasterPos3s)(GLshort, GLshort, GLshort);
+ void (*RasterPos3sv)(const GLshort *);
+ void (*RasterPos4d)(GLdouble, GLdouble, GLdouble, GLdouble);
+ void (*RasterPos4dv)(const GLdouble *);
+ void (*RasterPos4f)(GLfloat, GLfloat, GLfloat, GLfloat);
+ void (*RasterPos4fv)(const GLfloat *);
+ void (*RasterPos4i)(GLint, GLint, GLint, GLint);
+ void (*RasterPos4iv)(const GLint *);
+ void (*RasterPos4s)(GLshort, GLshort, GLshort, GLshort);
+ void (*RasterPos4sv)(const GLshort *);
+ void (*ReadBuffer)(GLenum);
+ void (*ReadPixels)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid *);
+ void (*Rectd)(GLdouble, GLdouble, GLdouble, GLdouble);
+ void (*Rectdv)(const GLdouble *, const GLdouble *);
+ void (*Rectf)(GLfloat, GLfloat, GLfloat, GLfloat);
+ void (*Rectfv)(const GLfloat *, const GLfloat *);
+ void (*Recti)(GLint, GLint, GLint, GLint);
+ void (*Rectiv)(const GLint *, const GLint *);
+ void (*Rects)(GLshort, GLshort, GLshort, GLshort);
+ void (*Rectsv)(const GLshort *, const GLshort *);
+ GLint (*RenderMode)(GLenum);
+ void (*Rotated)(GLdouble, GLdouble, GLdouble, GLdouble);
+ void (*Rotatef)(GLfloat, GLfloat, GLfloat, GLfloat);
+ void (*Scaled)(GLdouble, GLdouble, GLdouble);
+ void (*Scalef)(GLfloat, GLfloat, GLfloat);
+ void (*Scissor)(GLint, GLint, GLsizei, GLsizei);
+ void (*SelectBuffer)(GLsizei, GLuint *);
+ void (*ShadeModel)(GLenum);
+ void (*StencilFunc)(GLenum, GLint, GLuint);
+ void (*StencilMask)(GLuint);
+ void (*StencilOp)(GLenum, GLenum, GLenum);
+ void (*TexCoord1d)(GLdouble);
+ void (*TexCoord1dv)(const GLdouble *);
+ void (*TexCoord1f)(GLfloat);
+ void (*TexCoord1fv)(const GLfloat *);
+ void (*TexCoord1i)(GLint);
+ void (*TexCoord1iv)(const GLint *);
+ void (*TexCoord1s)(GLshort);
+ void (*TexCoord1sv)(const GLshort *);
+ void (*TexCoord2d)(GLdouble, GLdouble);
+ void (*TexCoord2dv)(const GLdouble *);
+ void (*TexCoord2f)(GLfloat, GLfloat);
+ void (*TexCoord2fv)(const GLfloat *);
+ void (*TexCoord2i)(GLint, GLint);
+ void (*TexCoord2iv)(const GLint *);
+ void (*TexCoord2s)(GLshort, GLshort);
+ void (*TexCoord2sv)(const GLshort *);
+ void (*TexCoord3d)(GLdouble, GLdouble, GLdouble);
+ void (*TexCoord3dv)(const GLdouble *);
+ void (*TexCoord3f)(GLfloat, GLfloat, GLfloat);
+ void (*TexCoord3fv)(const GLfloat *);
+ void (*TexCoord3i)(GLint, GLint, GLint);
+ void (*TexCoord3iv)(const GLint *);
+ void (*TexCoord3s)(GLshort, GLshort, GLshort);
+ void (*TexCoord3sv)(const GLshort *);
+ void (*TexCoord4d)(GLdouble, GLdouble, GLdouble, GLdouble);
+ void (*TexCoord4dv)(const GLdouble *);
+ void (*TexCoord4f)(GLfloat, GLfloat, GLfloat, GLfloat);
+ void (*TexCoord4fv)(const GLfloat *);
+ void (*TexCoord4i)(GLint, GLint, GLint, GLint);
+ void (*TexCoord4iv)(const GLint *);
+ void (*TexCoord4s)(GLshort, GLshort, GLshort, GLshort);
+ void (*TexCoord4sv)(const GLshort *);
+ void (*TexEnvf)(GLenum, GLenum, GLfloat);
+ void (*TexEnvfv)(GLenum, GLenum, const GLfloat *);
+ void (*TexEnvi)(GLenum, GLenum, GLint);
+ void (*TexEnviv)(GLenum, GLenum, const GLint *);
+ void (*TexGend)(GLenum, GLenum, GLdouble);
+ void (*TexGendv)(GLenum, GLenum, const GLdouble *);
+ void (*TexGenf)(GLenum, GLenum, GLfloat);
+ void (*TexGenfv)(GLenum, GLenum, const GLfloat *);
+ void (*TexGeni)(GLenum, GLenum, GLint);
+ void (*TexGeniv)(GLenum, GLenum, const GLint *);
+ void (*TexImage1D)(GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+ void (*TexImage2D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+ void (*TexParameterf)(GLenum, GLenum, GLfloat);
+ void (*TexParameterfv)(GLenum, GLenum, const GLfloat *);
+ void (*TexParameteri)(GLenum, GLenum, GLint);
+ void (*TexParameteriv)(GLenum, GLenum, const GLint *);
+ void (*Translated)(GLdouble, GLdouble, GLdouble);
+ void (*Translatef)(GLfloat, GLfloat, GLfloat);
+ void (*Vertex2d)(GLdouble, GLdouble);
+ void (*Vertex2dv)(const GLdouble *);
+ void (*Vertex2f)(GLfloat, GLfloat);
+ void (*Vertex2fv)(const GLfloat *);
+ void (*Vertex2i)(GLint, GLint);
+ void (*Vertex2iv)(const GLint *);
+ void (*Vertex2s)(GLshort, GLshort);
+ void (*Vertex2sv)(const GLshort *);
+ void (*Vertex3d)(GLdouble, GLdouble, GLdouble);
+ void (*Vertex3dv)(const GLdouble *);
+ void (*Vertex3f)(GLfloat, GLfloat, GLfloat);
+ void (*Vertex3fv)(const GLfloat *);
+ void (*Vertex3i)(GLint, GLint, GLint);
+ void (*Vertex3iv)(const GLint *);
+ void (*Vertex3s)(GLshort, GLshort, GLshort);
+ void (*Vertex3sv)(const GLshort *);
+ void (*Vertex4d)(GLdouble, GLdouble, GLdouble, GLdouble);
+ void (*Vertex4dv)(const GLdouble *);
+ void (*Vertex4f)(GLfloat, GLfloat, GLfloat, GLfloat);
+ void (*Vertex4fv)(const GLfloat *);
+ void (*Vertex4i)(GLint, GLint, GLint, GLint);
+ void (*Vertex4iv)(const GLint *);
+ void (*Vertex4s)(GLshort, GLshort, GLshort, GLshort);
+ void (*Vertex4sv)(const GLshort *);
+ void (*Viewport)(GLint, GLint, GLsizei, GLsizei);
+
+ /*
+ * OpenGL 1.1
+ */
+ GLboolean (*AreTexturesResident)(GLsizei, const GLuint *, GLboolean *);
+ void (*ArrayElement)(GLint);
+ void (*BindTexture)(GLenum, GLuint);
+ void (*ColorPointer)(GLint, GLenum, GLsizei, const GLvoid *);
+ void (*CopyTexImage1D)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
+ void (*CopyTexImage2D)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
+ void (*CopyTexSubImage1D)(GLenum, GLint, GLint, GLint, GLint, GLsizei);
+ void (*CopyTexSubImage2D)(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+ void (*DeleteTextures)(GLsizei, const GLuint *);
+ void (*DisableClientState)(GLenum);
+ void (*DrawArrays)(GLenum, GLint, GLsizei);
+ void (*DrawElements)(GLenum, GLsizei, GLenum, const GLvoid *);
+ void (*EdgeFlagPointer)(GLsizei, const GLvoid *);
+ void (*EnableClientState)(GLenum);
+ void (*GenTextures)(GLsizei, GLuint *);
+ void (*GetPointerv)(GLenum, GLvoid **);
+ void (*IndexPointer)(GLenum, GLsizei, const GLvoid *);
+ void (*Indexub)(GLubyte);
+ void (*Indexubv)(const GLubyte *);
+ void (*InterleavedArrays)(GLenum, GLsizei, const GLvoid *);
+ GLboolean (*IsTexture)(GLuint);
+ void (*NormalPointer)(GLenum, GLsizei, const GLvoid *);
+ void (*PopClientAttrib)(void);
+ void (*PrioritizeTextures)(GLsizei, const GLuint *, const GLclampf *);
+ void (*PushClientAttrib)(GLbitfield);
+ void (*TexCoordPointer)(GLint, GLenum, GLsizei, const GLvoid *);
+ void (*TexSubImage1D)(GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
+ void (*TexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+ void (*VertexPointer)(GLint, GLenum, GLsizei, const GLvoid *);
+
+
+ /*
+ * OpenGL 1.2
+ */
+ void (*CopyTexSubImage3D)(GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+ void (*DrawRangeElements)(GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
+ void (*TexImage3D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+ void (*TexSubImage3D)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+
+
+ /*
+ * GL_ARB_imaging
+ */
+ void (*BlendColor)(GLclampf, GLclampf, GLclampf, GLclampf);
+ void (*BlendEquation)(GLenum);
+ void (*ColorSubTable)(GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+ void (*ColorTable)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+ void (*ColorTableParameterfv)(GLenum, GLenum, const GLfloat *);
+ void (*ColorTableParameteriv)(GLenum, GLenum, const GLint *);
+ void (*ConvolutionFilter1D)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+ void (*ConvolutionFilter2D)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+ void (*ConvolutionParameterf)(GLenum, GLenum, GLfloat);
+ void (*ConvolutionParameterfv)(GLenum, GLenum, const GLfloat *);
+ void (*ConvolutionParameteri)(GLenum, GLenum, GLint);
+ void (*ConvolutionParameteriv)(GLenum, GLenum, const GLint *);
+ void (*CopyColorSubTable)(GLenum, GLsizei, GLint, GLint, GLsizei);
+ void (*CopyColorTable)(GLenum, GLenum, GLint, GLint, GLsizei);
+ void (*CopyConvolutionFilter1D)(GLenum, GLenum, GLint x, GLint y, GLsizei);
+ void (*CopyConvolutionFilter2D)(GLenum, GLenum, GLint x, GLint y, GLsizei, GLsizei);
+ void (*GetColorTable)(GLenum, GLenum, GLenum, GLvoid *);
+ void (*GetColorTableParameterfv)(GLenum, GLenum, GLfloat *);
+ void (*GetColorTableParameteriv)(GLenum, GLenum, GLint *);
+ void (*GetConvolutionFilter)(GLenum, GLenum, GLenum, GLvoid *);
+ void (*GetConvolutionParameterfv)(GLenum, GLenum, GLfloat *);
+ void (*GetConvolutionParameteriv)(GLenum, GLenum, GLint *);
+ void (*GetHistogram)(GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+ void (*GetHistogramParameterfv)(GLenum, GLenum, GLfloat *);
+ void (*GetHistogramParameteriv)(GLenum, GLenum, GLint *);
+ void (*GetMinmax)(GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+ void (*GetMinmaxParameterfv)(GLenum, GLenum, GLfloat *);
+ void (*GetMinmaxParameteriv)(GLenum, GLenum, GLint *);
+ void (*GetSeparableFilter)(GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
+ void (*Histogram)(GLenum, GLsizei, GLenum, GLboolean);
+ void (*Minmax)(GLenum, GLenum, GLboolean);
+ void (*ResetHistogram)(GLenum);
+ void (*ResetMinmax)(GLenum);
+ void (*SeparableFilter2D)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
+
+ /*
+ * GL_ARB_multitexture
+ */
+ void (*ActiveTextureARB)(GLenum);
+ void (*ClientActiveTextureARB)(GLenum);
+ void (*MultiTexCoord1dARB)(GLenum, GLdouble);
+ void (*MultiTexCoord1dvARB)(GLenum, const GLdouble *);
+ void (*MultiTexCoord1fARB)(GLenum, GLfloat);
+ void (*MultiTexCoord1fvARB)(GLenum, const GLfloat *);
+ void (*MultiTexCoord1iARB)(GLenum, GLint);
+ void (*MultiTexCoord1ivARB)(GLenum, const GLint *);
+ void (*MultiTexCoord1sARB)(GLenum, GLshort);
+ void (*MultiTexCoord1svARB)(GLenum, const GLshort *);
+ void (*MultiTexCoord2dARB)(GLenum, GLdouble, GLdouble);
+ void (*MultiTexCoord2dvARB)(GLenum, const GLdouble *);
+ void (*MultiTexCoord2fARB)(GLenum, GLfloat, GLfloat);
+ void (*MultiTexCoord2fvARB)(GLenum, const GLfloat *);
+ void (*MultiTexCoord2iARB)(GLenum, GLint, GLint);
+ void (*MultiTexCoord2ivARB)(GLenum, const GLint *);
+ void (*MultiTexCoord2sARB)(GLenum, GLshort, GLshort);
+ void (*MultiTexCoord2svARB)(GLenum, const GLshort *);
+ void (*MultiTexCoord3dARB)(GLenum, GLdouble, GLdouble, GLdouble);
+ void (*MultiTexCoord3dvARB)(GLenum, const GLdouble *);
+ void (*MultiTexCoord3fARB)(GLenum, GLfloat, GLfloat, GLfloat);
+ void (*MultiTexCoord3fvARB)(GLenum, const GLfloat *);
+ void (*MultiTexCoord3iARB)(GLenum, GLint, GLint, GLint);
+ void (*MultiTexCoord3ivARB)(GLenum, const GLint *);
+ void (*MultiTexCoord3sARB)(GLenum, GLshort, GLshort, GLshort);
+ void (*MultiTexCoord3svARB)(GLenum, const GLshort *);
+ void (*MultiTexCoord4dARB)(GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+ void (*MultiTexCoord4dvARB)(GLenum, const GLdouble *);
+ void (*MultiTexCoord4fARB)(GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+ void (*MultiTexCoord4fvARB)(GLenum, const GLfloat *);
+ void (*MultiTexCoord4iARB)(GLenum, GLint, GLint, GLint, GLint);
+ void (*MultiTexCoord4ivARB)(GLenum, const GLint *);
+ void (*MultiTexCoord4sARB)(GLenum, GLshort, GLshort, GLshort, GLshort);
+ void (*MultiTexCoord4svARB)(GLenum, const GLshort *);
+
+
+ /*
+ * Extensions
+ */
+
+ /* 1. GL_EXT_abgr - no functions */
+
+ /* 2. GL_EXT_blend_color */
+ void (*BlendColorEXT)(GLclampf, GLclampf, GLclampf, GLclampf);
+
+ /* 3. GL_EXT_polygon_offset */
+ void (*PolygonOffsetEXT)(GLfloat, GLfloat);
+
+ /* 4. GL_EXT_texture - no functions */
+
+ /* 5. ??? */
+
+ /* 6. GL_EXT_texture3D */
+ void (*CopyTexSubImage3DEXT)(GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+ void (*TexImage3DEXT)(GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+ void (*TexSubImage3DEXT)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+
+ /* 7. GL_SGI_texture_filter4 */
+ void (*GetTexFilterFuncSGIS)(GLenum, GLenum, GLsizei, const GLfloat *);
+ void (*TexFilterFuncSGIS)(GLenum, GLenum, GLfloat *);
+
+ /* 8. ??? */
+
+ /* 9. GL_EXT_subtexture */
+ void (*TexSubImage1DEXT)(GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
+ void (*TexSubImage2DEXT)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+
+ /* 10. GL_EXT_copy_texture */
+ void (*CopyTexImage1DEXT)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
+ void (*CopyTexImage2DEXT)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
+ void (*CopyTexSubImage1DEXT)(GLenum, GLint, GLint, GLint, GLint, GLsizei);
+ void (*CopyTexSubImage2DEXT)(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+
+ /* 11. GL_EXT_histogram */
+ void (*GetHistogramEXT)(GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+ void (*GetHistogramParameterfvEXT)(GLenum, GLenum, GLfloat *);
+ void (*GetHistogramParameterivEXT)(GLenum, GLenum, GLint *);
+ void (*GetMinmaxEXT)(GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+ void (*GetMinmaxParameterfvEXT)(GLenum, GLenum, GLfloat *);
+ void (*GetMinmaxParameterivEXT)(GLenum, GLenum, GLint *);
+ void (*HistogramEXT)(GLenum, GLsizei, GLenum, GLboolean);
+ void (*MinmaxEXT)(GLenum, GLenum, GLboolean);
+ void (*ResetHistogramEXT)(GLenum);
+ void (*ResetMinmaxEXT)(GLenum);
+
+ /* 12. GL_EXT_convolution */
+ void (*ConvolutionFilter1DEXT)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+ void (*ConvolutionFilter2DEXT)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+ void (*ConvolutionParameterfEXT)(GLenum, GLenum, GLfloat);
+ void (*ConvolutionParameterfvEXT)(GLenum, GLenum, const GLfloat *);
+ void (*ConvolutionParameteriEXT)(GLenum, GLenum, GLint);
+ void (*ConvolutionParameterivEXT)(GLenum, GLenum, const GLint *);
+ void (*CopyConvolutionFilter1DEXT)(GLenum, GLenum, GLint x, GLint y, GLsizei);
+ void (*CopyConvolutionFilter2DEXT)(GLenum, GLenum, GLint x, GLint y, GLsizei, GLsizei);
+ void (*GetConvolutionFilterEXT)(GLenum, GLenum, GLenum, GLvoid *);
+ void (*GetConvolutionParameterfvEXT)(GLenum, GLenum, GLfloat *);
+ void (*GetConvolutionParameterivEXT)(GLenum, GLenum, GLint *);
+ void (*GetSeparableFilterEXT)(GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
+ void (*SeparableFilter2DEXT)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
+
+ /* 13. GL_SGI_color_matrix - no functions */
+
+ /* 14. GL_SGI_color_table */
+ void (*ColorTableSGI)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+ void (*ColorTableParameterfvSGI)(GLenum, GLenum, const GLfloat *);
+ void (*ColorTableParameterivSGI)(GLenum, GLenum, const GLint *);
+ void (*CopyColorTableSGI)(GLenum, GLenum, GLint, GLint, GLsizei);
+ void (*GetColorTableSGI)(GLenum, GLenum, GLenum, GLvoid *);
+ void (*GetColorTableParameterfvSGI)(GLenum, GLenum, GLfloat *);
+ void (*GetColorTableParameterivSGI)(GLenum, GLenum, GLint *);
+
+ /* 15. GL_SGIS_pixel_texture */
+ void (*PixelTexGenParameterfSGIS)(GLenum, GLfloat);
+ void (*PixelTexGenParameteriSGIS)(GLenum, GLint);
+ void (*GetPixelTexGenParameterfvSGIS)(GLenum, GLfloat *);
+ void (*GetPixelTexGenParameterivSGIS)(GLenum, GLint *);
+
+ /* 16. GL_SGIS_texture4D */
+ void (*TexImage4DSGIS)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const void *);
+ void (*TexSubImage4DSGIS)(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const void *);
+
+ /* 17. GL_SGI_texture_color_table - no functions */
+
+ /* 18. GL_EXT_cmyka - no functions */
+
+ /* 19. ??? */
+
+ /* 20. GL_EXT_texture_object */
+ GLboolean (*AreTexturesResidentEXT)(GLsizei, const GLuint *, GLboolean *);
+ void (*BindTextureEXT)(GLenum, GLuint);
+ void (*DeleteTexturesEXT)(GLsizei, const GLuint *);
+ void (*GenTexturesEXT)(GLsizei, GLuint *);
+ GLboolean (*IsTextureEXT)(GLuint);
+ void (*PrioritizeTexturesEXT)(GLsizei, const GLuint *, const GLclampf *);
+
+ /* 21. GL_SGIS_detail_texture */
+ void (*DetailTexFuncSGIS)(GLenum, GLsizei, const GLfloat *);
+ void (*GetDetailTexFuncSGIS)(GLenum target, GLfloat *);
+
+ /* 22. GL_SGIS_sharpen_texture */
+ void (*GetSharpenTexFuncSGIS)(GLenum, GLfloat *);
+ void (*SharpenTexFuncSGIS)(GLenum, GLsizei, const GLfloat *);
+
+ /* 23. GL_EXT_packed_pixels - no functions */
+
+ /* 24. GL_SGIS_texture_lod - no functions */
+
+ /* 25. GL_SGIS_multisample */
+ void (*SampleMaskSGIS)(GLclampf, GLboolean);
+ void (*SamplePatternSGIS)(GLenum);
+
+ /* 26. ??? */
+
+ /* 27. GL_EXT_rescale_normal - no functions */
+
+ /* 28. GLX_EXT_visual_info - no functions */
+
+ /* 29. ??? */
+
+ /* 30. GL_EXT_vertex_array */
+ void (*ArrayElementEXT)(GLint);
+ void (*ColorPointerEXT)(GLint, GLenum, GLsizei, GLsizei, const void *);
+ void (*DrawArraysEXT)(GLenum, GLint, GLsizei);
+ void (*EdgeFlagPointerEXT)(GLsizei, GLsizei, const GLboolean *);
+ void (*GetPointervEXT)(GLenum, void **);
+ void (*IndexPointerEXT)(GLenum, GLsizei, GLsizei, const void *);
+ void (*NormalPointerEXT)(GLenum, GLsizei, GLsizei, const void *);
+ void (*TexCoordPointerEXT)(GLint, GLenum, GLsizei, GLsizei, const void *);
+ void (*VertexPointerEXT)(GLint, GLenum, GLsizei, GLsizei, const void *);
+
+ /* 31. GL_EXT_misc_attribute - no functions */
+
+ /* 32. GL_SGIS_generate_mipmap - no functions */
+
+ /* 33. GL_SGIX_clipmap - no functions */
+
+ /* 34. GL_SGIX_shadow - no functions */
+
+ /* 35. GL_SGIS_texture_edge_clamp - no functions */
+
+ /* 36. GL_SGIS_texture_border_clamp - no functions */
+
+ /* 37. GL_EXT_blend_minmax */
+ void (*BlendEquationEXT)(GLenum);
+
+ /* 38. GL_EXT_blend_subtract - no functions */
+
+ /* 39. GL_EXT_blend_logic_op - no functions */
+
+ /* 40. GLX_SGI_swap_control - GLX functions */
+
+ /* 41. GLX_SGI_video_sync - GLX functions */
+
+ /* 42. GLX_SGI_make_current_read - GLX functions */
+
+ /* 43. GLX_SGIX_video_source - GLX functions */
+
+ /* 44. GLX_EXT_visual_rating - no functions */
+
+ /* 45. GL_SGIX_interlace - no functions */
+
+ /* 46. ??? */
+
+ /* 47. GLX_EXT_import_context - GLX functions */
+
+ /* 48. ??? */
+
+ /* 49. GLX_SGIX_fbconfig - GLX functions */
+
+ /* 50. GLX_SGIX_pbuffer - GLX functions */
+
+ /* 51. GL_SGIS_texture_select - no functions */
+
+ /* 52. GL_SGIX_sprite */
+ void (*SpriteParameterfSGIX)(GLenum, GLfloat);
+ void (*SpriteParameterfvSGIX)(GLenum, const GLfloat *);
+ void (*SpriteParameteriSGIX)(GLenum, GLint);
+ void (*SpriteParameterivSGIX)(GLenum, const GLint *);
+
+ /* 53. ??? */
+
+ /* 54. GL_EXT_point_parameters */
+ void (*PointParameterfEXT)(GLenum, GLfloat);
+ void (*PointParameterfvEXT)(GLenum, const GLfloat *);
+
+ /* 55. GL_SGIX_instruments */
+ GLint (*GetInstrumentsSGIX)(void);
+ void (*InstrumentsBufferSGIX)(GLsizei, GLint *);
+ GLint (*PollInstrumentsSGIX)(GLint *);
+ void (*ReadInstrumentsSGIX)(GLint);
+ void (*StartInstrumentsSGIX)(void);
+ void (*StopInstrumentsSGIX)(GLint);
+
+ /* 56. GL_SGIX_texture_scale_bias - no functions */
+
+ /* 57. GL_SGIX_framezoom */
+ void (*FrameZoomSGIX)(GLint);
+
+ /* 58. GL_SGIX_tag_sample_buffer - no functions */
+
+ /* 59. ??? */
+
+ /* 60. GL_SGIX_reference_plane */
+ void (*ReferencePlaneSGIX)(const GLdouble *);
+
+ /* 61. GL_SGIX_flush_raster */
+ void (*FlushRasterSGIX)(void);
+
+ /* 62. GLX_SGI_cushion - GLX functions */
+
+ /* 63. GL_SGIX_depth_texture - no functions */
+
+ /* 64. ??? */
+
+ /* 65. GL_SGIX_fog_offset - no functions */
+
+ /* 66. GL_HP_image_transform */
+ void (*GetImageTransformParameterfvHP)(GLenum, GLenum, GLfloat *);
+ void (*GetImageTransformParameterivHP)(GLenum, GLenum, GLint *);
+ void (*ImageTransformParameterfHP)(GLenum, GLenum, const GLfloat);
+ void (*ImageTransformParameterfvHP)(GLenum, GLenum, const GLfloat *);
+ void (*ImageTransformParameteriHP)(GLenum, GLenum, const GLint);
+ void (*ImageTransformParameterivHP)(GLenum, GLenum, const GLint *);
+
+ /* 67. GL_HP_convolution_border_modes - no functions */
+
+ /* 68. ??? */
+
+ /* 69. GL_SGIX_texture_add_env - no functions */
+
+ /* 70. ??? */
+
+ /* 71. ??? */
+
+ /* 72. ??? */
+
+ /* 73. ??? */
+
+ /* 74. GL_EXT_color_subtable */
+ void (*ColorSubTableEXT)(GLenum, GLsizei, GLsizei, GLenum, GLenum, const void *);
+ void (*CopyColorSubTableEXT)(GLenum, GLsizei, GLint, GLint, GLsizei);
+
+ /* 75. GLU_EXT_object_space_tess - GLU functions */
+
+ /* 76. GL_PGI_vertex_hints - no functions */
+
+ /* 77. GL_PGI_misc_hints */
+ void (*HintPGI)(GLenum, GLint);
+
+ /* 78. GL_EXT_paletted_texture */
+ /* ColorSubTableEXT already defined */
+ void (*ColorTableEXT)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+ void (*GetColorTableEXT)(GLenum, GLenum, GLenum, GLvoid *);
+ void (*GetColorTableParameterfvEXT)(GLenum, GLenum, GLfloat *);
+ void (*GetColorTableParameterivEXT)(GLenum, GLenum, GLint *);
+
+ /* 79. GL_EXT_clip_volume_hint - no functions */
+
+ /* 80. GL_SGIX_list_priority */
+ void (*GetListParameterfvSGIX)(GLuint, GLenum, GLfloat *);
+ void (*GetListParameterivSGIX)(GLuint, GLenum, GLint *);
+ void (*ListParameterfSGIX)(GLuint, GLenum, GLfloat);
+ void (*ListParameterfvSGIX)(GLuint, GLenum, const GLfloat *);
+ void (*ListParameteriSGIX)(GLuint, GLenum, GLint);
+ void (*ListParameterivSGIX)(GLuint, GLenum, const GLint *);
+
+ /* 81. GL_SGIX_ir_instrument1 - no functions */
+
+ /* 82. ??? */
+
+ /* 83. GLX_SGIX_video_resize - GLX functions */
+
+ /* 84. GL_SGIX_texture_lod_bias - no functions */
+
+ /* 85. GLU_SGI_filter4_parameters - GLU functions */
+
+ /* 86. GLX_SGIX_dm_buffer - GLX functions */
+
+ /* 87. ??? */
+
+ /* 88. ??? */
+
+ /* 89. ??? */
+
+ /* 90. ??? */
+
+ /* 91. GLX_SGIX_swap_group - GLX functions */
+
+ /* 92. GLX_SGIX_swap_barrier - GLX functions */
+
+ /* 93. GL_EXT_index_texture - no functions */
+
+ /* 94. GL_EXT_index_material */
+ void (*IndexMaterialEXT)(GLenum, GLenum);
+
+ /* 95. GL_EXT_index_func */
+ void (*IndexFuncEXT)(GLenum, GLfloat);
+
+ /* 96. GL_EXT_index_array_formats - no functions */
+
+ /* 97. GL_EXT_compiled_vertex_array */
+ void (*LockArraysEXT)(GLint, GLsizei);
+ void (*UnlockArraysEXT)(void);
+
+ /* 98. GL_EXT_cull_vertex */
+ void (*CullParameterfvEXT)(GLenum, const GLfloat *);
+ void (*CullParameterdvEXT)(GLenum, const GLdouble *);
+
+ /* 99. ??? */
+
+ /* 100. GLU_EXT_nurbs_tessellator - GLU functions */
+
+ /* 173. GL_EXT/INGR_blend_func_separate */
+ void (*BlendFuncSeparateINGR)(GLenum, GLenum, GLenum, GLenum);
+
+ /* GL_MESA_window_pos */
+ void (*WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+
+ /* GL_MESA_resize_buffers */
+ void (*ResizeBuffersMESA)(void);
+
+ /* GL_ARB_transpose_matrix */
+ void (*LoadTransposeMatrixdARB)(const GLdouble m[16]);
+ void (*LoadTransposeMatrixfARB)(const GLfloat m[16]);
+ void (*MultTransposeMatrixdARB)(const GLdouble m[16]);
+ void (*MultTransposeMatrixfARB)(const GLfloat m[16]);
+
+#if 0
+ void *ExtensionFuncs[_GLAPI_EXTRA_SLOTS];
+#endif
+};
+
+
+#endif
diff --git a/xc/extras/Mesa/src/glapitemp.h b/xc/extras/Mesa/src/glapitemp.h
new file mode 100644
index 000000000..b0d5d74f0
--- /dev/null
+++ b/xc/extras/Mesa/src/glapitemp.h
@@ -0,0 +1,2724 @@
+/* $Id: glapitemp.h,v 1.2 2000/01/30 00:27:02 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999-2000 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+/*
+ * This file is a template which generates the OpenGL API entry point
+ * functions. It should be included by a .c file which first defines
+ * the following macros:
+ * KEYWORD1 - usually nothing, but might be __declspec(dllexport) on Win32
+ * KEYWORD2 - usually nothing, but might be __stdcall on Win32
+ * NAME(n) - builds the final function name (usually add "gl" prefix)
+ * DISPATCH(func, args, msg) - code to do dispatch of named function.
+ * msg is a printf-style debug message.
+ * RETURN_DISPATCH(func, args, msg) - code to do dispatch with a return value
+ *
+ * Here's an example which generates the usual OpenGL functions:
+ * #define KEYWORD1
+ * #define KEYWORD2
+ * #define NAME(func) gl##func
+ * #define DISPATCH(func, args, msg) \
+ * struct _glapi_table *dispatch = CurrentDispatch; \
+ * (*dispatch->func) args
+ * #define RETURN DISPATCH(func, args, msg) \
+ * struct _glapi_table *dispatch = CurrentDispatch; \
+ * return (*dispatch->func) args
+ *
+ */
+
+
+#ifndef KEYWORD1
+#define KEYWORD1
+#endif
+
+#ifndef KEYWORD2
+#define KEYWORD2
+#endif
+
+#ifndef NAME
+#define NAME(func) gl##func
+#endif
+
+#ifndef DISPATCH
+#define DISPATCH(func, args, msg) \
+ const struct _glapi_table *dispatch; \
+ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
+ (dispatch->func) args
+#endif
+
+#ifndef RETURN_DISPATCH
+#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
+ const struct _glapi_table *dispatch; \
+ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
+ return (dispatch->func) args
+#endif
+
+
+/*
+ * XXX
+ * Most functions need the msg (printf-message) parameter to be finished.
+ * I.e. replace ";\n" with the real info.
+ */
+
+
+
+/* GL 1.0 */
+
+KEYWORD1 void KEYWORD2 NAME(Accum)(GLenum op, GLfloat value)
+{
+ DISPATCH(Accum, (op, value), ("glAccum(0x%x, %g);\n", op, value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(AlphaFunc)(GLenum func, GLclampf ref)
+{
+ DISPATCH(AlphaFunc, (func, ref), ("glAlphaFunc(0x%x, %g);\n", func, ref));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Begin)(GLenum mode)
+{
+ DISPATCH(Begin, (mode), ("glBegin(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap)
+{
+ DISPATCH(Bitmap, (width, height, xorig, yorig, xmove, ymove, bitmap), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendFunc)(GLenum sfactor, GLenum dfactor)
+{
+ DISPATCH(BlendFunc, (sfactor, dfactor), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CallList)(GLuint list)
+{
+ DISPATCH(CallList, (list), ("glCallList(%u);\n", list));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CallLists)(GLsizei n, GLenum type, const GLvoid *lists)
+{
+ DISPATCH(CallLists, (n, type, lists), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Clear)(GLbitfield mask)
+{
+ DISPATCH(Clear, (mask), ("glClear(0x%x);\n", mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+ DISPATCH(ClearAccum, (red, green, blue, alpha), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+ DISPATCH(ClearColor, (red, green, blue, alpha), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearDepth)(GLclampd depth)
+{
+ DISPATCH(ClearDepth, (depth), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearIndex)(GLfloat c)
+{
+ DISPATCH(ClearIndex, (c), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearStencil)(GLint s)
+{
+ DISPATCH(ClearStencil, (s), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClipPlane)(GLenum plane, const GLdouble *equation)
+{
+ DISPATCH(ClipPlane, (plane, equation), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3b)(GLbyte red, GLbyte green, GLbyte blue)
+{
+ DISPATCH(Color3b, (red, green, blue), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3d)(GLdouble red, GLdouble green, GLdouble blue)
+{
+ DISPATCH(Color3d, (red, green, blue), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3f)(GLfloat red, GLfloat green, GLfloat blue)
+{
+ DISPATCH(Color3f, (red, green, blue), ("glColor3f(%g, %g, %g);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3i)(GLint red, GLint green, GLint blue)
+{
+ DISPATCH(Color3i, (red, green, blue), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3s)(GLshort red, GLshort green, GLshort blue)
+{
+ DISPATCH(Color3s, (red, green, blue), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3ub)(GLubyte red, GLubyte green, GLubyte blue)
+{
+ DISPATCH(Color3ub, (red, green, blue), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3ui)(GLuint red, GLuint green, GLuint blue)
+{
+ DISPATCH(Color3ui, (red, green, blue), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3us)(GLushort red, GLushort green, GLushort blue)
+{
+ DISPATCH(Color3us, (red, green, blue), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
+{
+ DISPATCH(Color4b, (red, green, blue, alpha), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
+{
+ DISPATCH(Color4d, (red, green, blue, alpha), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+ DISPATCH(Color4f, (red, green, blue, alpha), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4i)(GLint red, GLint green, GLint blue, GLint alpha)
+{
+ DISPATCH(Color4i, (red, green, blue, alpha), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha)
+{
+ DISPATCH(Color4s, (red, green, blue, alpha), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
+{
+ DISPATCH(Color4ub, (red, green, blue, alpha), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha)
+{
+ DISPATCH(Color4ui, (red, green, blue, alpha), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha)
+{
+ DISPATCH(Color4us, (red, green, blue, alpha), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3bv)(const GLbyte *v)
+{
+ DISPATCH(Color3bv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3dv)(const GLdouble *v)
+{
+ DISPATCH(Color3dv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3fv)(const GLfloat *v)
+{
+ DISPATCH(Color3fv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3iv)(const GLint *v)
+{
+ DISPATCH(Color3iv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3sv)(const GLshort *v)
+{
+ DISPATCH(Color3sv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3ubv)(const GLubyte *v)
+{
+ DISPATCH(Color3ubv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3uiv)(const GLuint *v)
+{
+ DISPATCH(Color3uiv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3usv)(const GLushort *v)
+{
+ DISPATCH(Color3usv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4bv)(const GLbyte *v)
+{
+ DISPATCH(Color4bv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4dv)(const GLdouble *v)
+{
+ DISPATCH(Color4dv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4fv)(const GLfloat *v)
+{
+ DISPATCH(Color4fv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4iv)(const GLint *v)
+{
+ DISPATCH(Color4iv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4sv)(const GLshort *v)
+{
+ DISPATCH(Color4sv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4ubv)(const GLubyte *v)
+{
+ DISPATCH(Color4ubv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4uiv)(const GLuint *v)
+{
+ DISPATCH(Color4uiv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4usv)(const GLushort *v)
+{
+ DISPATCH(Color4usv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+{
+ DISPATCH(ColorMask, (red, green, blue, alpha), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorMaterial)(GLenum face, GLenum mode)
+{
+ DISPATCH(ColorMaterial, (face, mode), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
+{
+ DISPATCH(CopyPixels, (x, y, width, height, type), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CullFace)(GLenum mode)
+{
+ DISPATCH(CullFace, (mode), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DepthFunc)(GLenum func)
+{
+ DISPATCH(DepthFunc, (func), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DepthMask)(GLboolean flag)
+{
+ DISPATCH(DepthMask, (flag), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DepthRange)(GLclampd nearVal, GLclampd farVal)
+{
+ DISPATCH(DepthRange, (nearVal, farVal), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteLists)(GLuint list, GLsizei range)
+{
+ DISPATCH(DeleteLists, (list, range), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Disable)(GLenum cap)
+{
+ DISPATCH(Disable, (cap), ("glDisable(0x%x);\n", cap));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawBuffer)(GLenum mode)
+{
+ DISPATCH(DrawBuffer, (mode), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
+{
+ DISPATCH(DrawElements, (mode, count, type, indices), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ DISPATCH(DrawPixels, (width, height, format, type, pixels), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Enable)(GLenum cap)
+{
+ DISPATCH(Enable, (cap), ("glEnable(0x%x);\n", cap));
+}
+
+KEYWORD1 void KEYWORD2 NAME(End)(void)
+{
+ DISPATCH(End, (), ("glEnd();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EndList)(void)
+{
+ DISPATCH(EndList, (), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1d)(GLdouble u)
+{
+ DISPATCH(EvalCoord1d, (u), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1f)(GLfloat u)
+{
+ DISPATCH(EvalCoord1f, (u), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1dv)(const GLdouble *u)
+{
+ DISPATCH(EvalCoord1dv, (u), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1fv)(const GLfloat *u)
+{
+ DISPATCH(EvalCoord1fv, (u), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2d)(GLdouble u, GLdouble v)
+{
+ DISPATCH(EvalCoord2d, (u, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2f)(GLfloat u, GLfloat v)
+{
+ DISPATCH(EvalCoord2f, (u, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2dv)(const GLdouble *u)
+{
+ DISPATCH(EvalCoord2dv, (u), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2fv)(const GLfloat *u)
+{
+ DISPATCH(EvalCoord2fv, (u), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalPoint1)(GLint i)
+{
+ DISPATCH(EvalPoint1, (i), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalPoint2)(GLint i, GLint j)
+{
+ DISPATCH(EvalPoint2, (i, j), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalMesh1)(GLenum mode, GLint i1, GLint i2)
+{
+ DISPATCH(EvalMesh1, (mode, i1, i2), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EdgeFlag)(GLboolean flag)
+{
+ DISPATCH(EdgeFlag, (flag), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EdgeFlagv)(const GLboolean *flag)
+{
+ DISPATCH(EdgeFlagv, (flag), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
+{
+ DISPATCH(EvalMesh2, (mode, i1, i2, j1, j2), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FeedbackBuffer)(GLsizei size, GLenum type, GLfloat *buffer)
+{
+ DISPATCH(FeedbackBuffer, (size, type, buffer), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Finish)(void)
+{
+ DISPATCH(Finish, (), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Flush)(void)
+{
+ DISPATCH(Flush, (), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogf)(GLenum pname, GLfloat param)
+{
+ DISPATCH(Fogf, (pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogi)(GLenum pname, GLint param)
+{
+ DISPATCH(Fogi, (pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogfv)(GLenum pname, const GLfloat *params)
+{
+ DISPATCH(Fogfv, (pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogiv)(GLenum pname, const GLint *params)
+{
+ DISPATCH(Fogiv, (pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FrontFace)(GLenum mode)
+{
+ DISPATCH(FrontFace, (mode), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
+{
+ DISPATCH(Frustum, (left, right, bottom, top, nearval, farval), (";\n"));
+}
+
+KEYWORD1 GLuint KEYWORD2 NAME(GenLists)(GLsizei range)
+{
+ RETURN_DISPATCH(GenLists, (range), ("glGenLists(%d);\n", range));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBooleanv)(GLenum pname, GLboolean *params)
+{
+ DISPATCH(GetBooleanv, (pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetClipPlane)(GLenum plane, GLdouble *equation)
+{
+ DISPATCH(GetClipPlane, (plane, equation), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetDoublev)(GLenum pname, GLdouble *params)
+{
+ DISPATCH(GetDoublev, (pname, params), (";\n"));
+}
+
+KEYWORD1 GLenum KEYWORD2 NAME(GetError)(void)
+{
+ RETURN_DISPATCH(GetError, (), ("glGetError();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetFloatv)(GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetFloatv, (pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetIntegerv)(GLenum pname, GLint *params)
+{
+ DISPATCH(GetIntegerv, (pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetLightfv)(GLenum light, GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetLightfv, (light, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetLightiv)(GLenum light, GLenum pname, GLint *params)
+{
+ DISPATCH(GetLightiv, (light, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMapdv)(GLenum target, GLenum query, GLdouble *v)
+{
+ DISPATCH(GetMapdv, (target, query, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMapfv)(GLenum target, GLenum query, GLfloat *v)
+{
+ DISPATCH(GetMapfv, (target, query, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMapiv)(GLenum target, GLenum query, GLint *v)
+{
+ DISPATCH(GetMapiv, (target, query, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMaterialfv)(GLenum face, GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetMaterialfv, (face, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMaterialiv)(GLenum face, GLenum pname, GLint *params)
+{
+ DISPATCH(GetMaterialiv, (face, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPixelMapfv)(GLenum map, GLfloat *values)
+{
+ DISPATCH(GetPixelMapfv, (map, values), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPixelMapuiv)(GLenum map, GLuint *values)
+{
+ DISPATCH(GetPixelMapuiv, (map, values), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPixelMapusv)(GLenum map, GLushort *values)
+{
+ DISPATCH(GetPixelMapusv, (map, values), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPolygonStipple)(GLubyte *mask)
+{
+ DISPATCH(GetPolygonStipple, (mask), (";\n"));
+}
+
+KEYWORD1 const GLubyte * KEYWORD2 NAME(GetString)(GLenum name)
+{
+ RETURN_DISPATCH(GetString, (name), ("glGetString(0x%x);\n", name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexEnvfv)(GLenum target, GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetTexEnvfv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexEnviv)(GLenum target, GLenum pname, GLint *params)
+{
+ DISPATCH(GetTexEnviv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexGeniv)(GLenum target, GLenum pname, GLint *params)
+{
+ DISPATCH(GetTexGeniv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexGendv)(GLenum target, GLenum pname, GLdouble *params)
+{
+ DISPATCH(GetTexGendv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexGenfv)(GLenum target, GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetTexGenfv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels)
+{
+ DISPATCH(GetTexImage, (target, level, format, type, pixels), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetTexLevelParameterfv, (target, level, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params)
+{
+ DISPATCH(GetTexLevelParameteriv, (target, level, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetTexParameterfv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexParameteriv)(GLenum target, GLenum pname, GLint *params)
+{
+ DISPATCH(GetTexParameteriv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Hint)(GLenum target, GLenum mode)
+{
+ DISPATCH(Hint, (target, mode), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexd)(GLdouble c)
+{
+ DISPATCH(Indexd, (c), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexdv)(const GLdouble *c)
+{
+ DISPATCH(Indexdv, (c), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexf)(GLfloat c)
+{
+ DISPATCH(Indexf, (c), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexfv)(const GLfloat *c)
+{
+ DISPATCH(Indexfv, (c), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexi)(GLint c)
+{
+ DISPATCH(Indexi, (c), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexiv)(const GLint *c)
+{
+ DISPATCH(Indexiv, (c), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexs)(GLshort c)
+{
+ DISPATCH(Indexs, (c), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexsv)(const GLshort *c)
+{
+ DISPATCH(Indexsv, (c), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(IndexMask)(GLuint mask)
+{
+ DISPATCH(IndexMask, (mask), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(InitNames)(void)
+{
+ DISPATCH(InitNames, (), (";\n"));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsEnabled)(GLenum cap)
+{
+ RETURN_DISPATCH(IsEnabled, (cap), ("glIsEnabled(0x%x);\n", cap));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsList)(GLuint list)
+{
+ RETURN_DISPATCH(IsList, (list), ("glIsList(%u);\n", list));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Lightf)(GLenum light, GLenum pname, GLfloat param)
+{
+ DISPATCH(Lightf, (light, pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Lighti)(GLenum light, GLenum pname, GLint param)
+{
+ DISPATCH(Lighti, (light, pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Lightfv)(GLenum light, GLenum pname, const GLfloat *params)
+{
+ DISPATCH(Lightfv, (light, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Lightiv)(GLenum light, GLenum pname, const GLint *params)
+{
+ DISPATCH(Lightiv, (light, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LightModelf)(GLenum pname, GLfloat param)
+{
+ DISPATCH(LightModelf, (pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LightModeli)(GLenum pname, GLint param)
+{
+ DISPATCH(LightModeli, (pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LightModelfv)(GLenum pname, const GLfloat *params)
+{
+ DISPATCH(LightModelfv, (pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LightModeliv)(GLenum pname, const GLint *params)
+{
+ DISPATCH(LightModeliv, (pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LineWidth)(GLfloat width)
+{
+ DISPATCH(LineWidth, (width), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LineStipple)(GLint factor, GLushort pattern)
+{
+ DISPATCH(LineStipple, (factor, pattern), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ListBase)(GLuint base)
+{
+ DISPATCH(ListBase, (base), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadIdentity)(void)
+{
+ DISPATCH(LoadIdentity, (), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadMatrixd)(const GLdouble *m)
+{
+ DISPATCH(LoadMatrixd, (m), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadMatrixf)(const GLfloat *m)
+{
+ DISPATCH(LoadMatrixf, (m), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadName)(GLuint name)
+{
+ DISPATCH(LoadName, (name), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LogicOp)(GLenum opcode)
+{
+ DISPATCH(LogicOp, (opcode), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points)
+{
+ DISPATCH(Map1d, (target, u1, u2, stride, order, points), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points)
+{
+ DISPATCH(Map1f, (target, u1, u2, stride, order, points), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points)
+{
+ DISPATCH(Map2d, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points)
+{
+ DISPATCH(Map2f, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MapGrid1d)(GLint un, GLdouble u1, GLdouble u2)
+{
+ DISPATCH(MapGrid1d, (un, u1, u2), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MapGrid1f)(GLint un, GLfloat u1, GLfloat u2)
+{
+ DISPATCH(MapGrid1f, (un, u1, u2), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
+{
+ DISPATCH(MapGrid2d, (un, u1, u2, vn, v1, v2), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
+{
+ DISPATCH(MapGrid2f, (un, u1, u2, vn, v1, v2), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Materialf)(GLenum face, GLenum pname, GLfloat param)
+{
+ DISPATCH(Materialf, (face, pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Materiali)(GLenum face, GLenum pname, GLint param)
+{
+ DISPATCH(Materiali, (face, pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Materialfv)(GLenum face, GLenum pname, const GLfloat *params)
+{
+ DISPATCH(Materialfv, (face, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Materialiv)(GLenum face, GLenum pname, const GLint *params)
+{
+ DISPATCH(Materialiv, (face, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MatrixMode)(GLenum mode)
+{
+ DISPATCH(MatrixMode, (mode), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultMatrixd)(const GLdouble *m)
+{
+ DISPATCH(MultMatrixd, (m), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultMatrixf)(const GLfloat *m)
+{
+ DISPATCH(MultMatrixf, (m), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(NewList)(GLuint list, GLenum mode)
+{
+ DISPATCH(NewList, (list, mode), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz)
+{
+ DISPATCH(Normal3b, (nx, ny, nz), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3bv)(const GLbyte *v)
+{
+ DISPATCH(Normal3bv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz)
+{
+ DISPATCH(Normal3d, (nx, ny, nz), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3dv)(const GLdouble *v)
+{
+ DISPATCH(Normal3dv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz)
+{
+ DISPATCH(Normal3f, (nx, ny, nz), ("glNormal3f(%g, %g, %g);\n", nx, ny, nz));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3fv)(const GLfloat *v)
+{
+ DISPATCH(Normal3fv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3i)(GLint nx, GLint ny, GLint nz)
+{
+ DISPATCH(Normal3i, (nx, ny, nz), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3iv)(const GLint *v)
+{
+ DISPATCH(Normal3iv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3s)(GLshort nx, GLshort ny, GLshort nz)
+{
+ DISPATCH(Normal3s, (nx, ny, nz), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3sv)(const GLshort *v)
+{
+ DISPATCH(Normal3sv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
+{
+ DISPATCH(Ortho, (left, right, bottom, top, nearval, farval), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PassThrough)(GLfloat token)
+{
+ DISPATCH(PassThrough, (token), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelMapfv)(GLenum map, GLint mapsize, const GLfloat *values)
+{
+ DISPATCH(PixelMapfv, (map, mapsize, values), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelMapuiv)(GLenum map, GLint mapsize, const GLuint *values)
+{
+ DISPATCH(PixelMapuiv, (map, mapsize, values), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelMapusv)(GLenum map, GLint mapsize, const GLushort *values)
+{
+ DISPATCH(PixelMapusv, (map, mapsize, values), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelStoref)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PixelStoref, (pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelStorei)(GLenum pname, GLint param)
+{
+ DISPATCH(PixelStorei, (pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelTransferf)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PixelTransferf, (pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelTransferi)(GLenum pname, GLint param)
+{
+ DISPATCH(PixelTransferi, (pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelZoom)(GLfloat xfactor, GLfloat yfactor)
+{
+ DISPATCH(PixelZoom, (xfactor, yfactor), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointSize)(GLfloat size)
+{
+ DISPATCH(PointSize, (size), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PolygonMode)(GLenum face, GLenum mode)
+{
+ DISPATCH(PolygonMode, (face, mode), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PolygonStipple)(const GLubyte *pattern)
+{
+ DISPATCH(PolygonStipple, (pattern), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PopAttrib)(void)
+{
+ DISPATCH(PopAttrib, (), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PopMatrix)(void)
+{
+ DISPATCH(PopMatrix, (), ("glPopMatrix();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PopName)(void)
+{
+ DISPATCH(PopName, (), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PushAttrib)(GLbitfield mask)
+{
+ DISPATCH(PushAttrib, (mask), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PushMatrix)(void)
+{
+ DISPATCH(PushMatrix, (), ("glPushMatrix();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PushName)(GLuint name)
+{
+ DISPATCH(PushName, (name), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2d)(GLdouble x, GLdouble y)
+{
+ DISPATCH(RasterPos2d, (x, y), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2f)(GLfloat x, GLfloat y)
+{
+ DISPATCH(RasterPos2f, (x, y), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2i)(GLint x, GLint y)
+{
+ DISPATCH(RasterPos2i, (x, y), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2s)(GLshort x, GLshort y)
+{
+ DISPATCH(RasterPos2s, (x, y), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3d)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(RasterPos3d, (x, y, z), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(RasterPos3f, (x, y, z), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3i)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(RasterPos3i, (x, y, z), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3s)(GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(RasterPos3s, (x, y, z), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(RasterPos4d, (x, y, z, w), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(RasterPos4f, (x, y, z, w), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4i)(GLint x, GLint y, GLint z, GLint w)
+{
+ DISPATCH(RasterPos4i, (x, y, z, w), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(RasterPos4s, (x, y, z, w), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2dv)(const GLdouble *v)
+{
+ DISPATCH(RasterPos2dv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2fv)(const GLfloat *v)
+{
+ DISPATCH(RasterPos2fv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2iv)(const GLint *v)
+{
+ DISPATCH(RasterPos2iv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2sv)(const GLshort *v)
+{
+ DISPATCH(RasterPos2sv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3dv)(const GLdouble *v)
+{
+ DISPATCH(RasterPos3dv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3fv)(const GLfloat *v)
+{
+ DISPATCH(RasterPos3fv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3iv)(const GLint *v)
+{
+ DISPATCH(RasterPos3iv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3sv)(const GLshort *v)
+{
+ DISPATCH(RasterPos3sv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4dv)(const GLdouble *v)
+{
+ DISPATCH(RasterPos4dv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4fv)(const GLfloat *v)
+{
+ DISPATCH(RasterPos4fv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4iv)(const GLint *v)
+{
+ DISPATCH(RasterPos4iv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4sv)(const GLshort *v)
+{
+ DISPATCH(RasterPos4sv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ReadBuffer)(GLenum mode)
+{
+ DISPATCH(ReadBuffer, (mode), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
+{
+ DISPATCH(ReadPixels, (x, y, width, height, format, type, pixels), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
+{
+ DISPATCH(Rectd, (x1, y1, x2, y2), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectdv)(const GLdouble *v1, const GLdouble *v2)
+{
+ DISPATCH(Rectdv, (v1, v2), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
+{
+ DISPATCH(Rectf, (x1, y1, x2, y2), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectfv)(const GLfloat *v1, const GLfloat *v2)
+{
+ DISPATCH(Rectfv, (v1, v2), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Recti)(GLint x1, GLint y1, GLint x2, GLint y2)
+{
+ DISPATCH(Recti, (x1, y1, x2, y2), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectiv)(const GLint *v1, const GLint *v2)
+{
+ DISPATCH(Rectiv, (v1, v2), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
+{
+ DISPATCH(Rects, (x1, y1, x2, y2), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectsv)(const GLshort *v1, const GLshort *v2)
+{
+ DISPATCH(Rectsv, (v1, v2), (";\n"));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(RenderMode)(GLenum mode)
+{
+ RETURN_DISPATCH(RenderMode, (mode), ("glRenderMode(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(Rotated, (angle, x, y, z), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(Rotatef, (angle, x, y, z), ("glRotatef(%g, %g, %g, %g);\n", angle, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SelectBuffer)(GLsizei size, GLuint *buffer)
+{
+ DISPATCH(SelectBuffer, (size, buffer), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Scaled)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(Scaled, (x, y, z), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Scalef)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(Scalef, (x, y, z), ("glScalef(%g, %g, %g);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Scissor)(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(Scissor, (x, y, width, height), ("glScissor(%d, %d, %d, %d);\n", x, y, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ShadeModel)(GLenum mode)
+{
+ DISPATCH(ShadeModel, (mode), ("glShadeModel(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(StencilFunc)(GLenum func, GLint ref, GLuint mask)
+{
+ DISPATCH(StencilFunc, (func, ref, mask), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(StencilMask)(GLuint mask)
+{
+ DISPATCH(StencilMask, (mask), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(StencilOp)(GLenum fail, GLenum zfail, GLenum zpass)
+{
+ DISPATCH(StencilOp, (fail, zfail, zpass), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1d)(GLdouble s)
+{
+ DISPATCH(TexCoord1d, (s), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1f)(GLfloat s)
+{
+ DISPATCH(TexCoord1f, (s), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1i)(GLint s)
+{
+ DISPATCH(TexCoord1i, (s), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1s)(GLshort s)
+{
+ DISPATCH(TexCoord1s, (s), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2d)(GLdouble s, GLdouble t)
+{
+ DISPATCH(TexCoord2d, (s, t), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2f)(GLfloat s, GLfloat t)
+{
+ DISPATCH(TexCoord2f, (s, t), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2s)(GLshort s, GLshort t)
+{
+ DISPATCH(TexCoord2s, (s, t), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2i)(GLint s, GLint t)
+{
+ DISPATCH(TexCoord2i, (s, t), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3d)(GLdouble s, GLdouble t, GLdouble r)
+{
+ DISPATCH(TexCoord3d, (s, t, r), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3f)(GLfloat s, GLfloat t, GLfloat r)
+{
+ DISPATCH(TexCoord3f, (s, t, r), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3i)(GLint s, GLint t, GLint r)
+{
+ DISPATCH(TexCoord3i, (s, t, r), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3s)(GLshort s, GLshort t, GLshort r)
+{
+ DISPATCH(TexCoord3s, (s, t, r), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+ DISPATCH(TexCoord4d, (s, t, r, q), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+ DISPATCH(TexCoord4f, (s, t, r, q), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4i)(GLint s, GLint t, GLint r, GLint q)
+{
+ DISPATCH(TexCoord4i, (s, t, r, q), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q)
+{
+ DISPATCH(TexCoord4s, (s, t, r, q), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1dv)(const GLdouble *v)
+{
+ DISPATCH(TexCoord1dv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1fv)(const GLfloat *v)
+{
+ DISPATCH(TexCoord1fv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1iv)(const GLint *v)
+{
+ DISPATCH(TexCoord1iv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1sv)(const GLshort *v)
+{
+ DISPATCH(TexCoord1sv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2dv)(const GLdouble *v)
+{
+ DISPATCH(TexCoord2dv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2fv)(const GLfloat *v)
+{
+ DISPATCH(TexCoord2fv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2iv)(const GLint *v)
+{
+ DISPATCH(TexCoord2iv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2sv)(const GLshort *v)
+{
+ DISPATCH(TexCoord2sv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3dv)(const GLdouble *v)
+{
+ DISPATCH(TexCoord3dv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3fv)(const GLfloat *v)
+{
+ DISPATCH(TexCoord3fv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3iv)(const GLint *v)
+{
+ DISPATCH(TexCoord3iv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3sv)(const GLshort *v)
+{
+ DISPATCH(TexCoord3sv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4dv)(const GLdouble *v)
+{
+ DISPATCH(TexCoord4dv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4fv)(const GLfloat *v)
+{
+ DISPATCH(TexCoord4fv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4iv)(const GLint *v)
+{
+ DISPATCH(TexCoord4iv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4sv)(const GLshort *v)
+{
+ DISPATCH(TexCoord4sv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGend)(GLenum coord, GLenum pname, GLdouble param)
+{
+ DISPATCH(TexGend, (coord, pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGendv)(GLenum coord, GLenum pname, const GLdouble *params)
+{
+ DISPATCH(TexGendv, (coord, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGenf)(GLenum coord, GLenum pname, GLfloat param)
+{
+ DISPATCH(TexGenf, (coord, pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGenfv)(GLenum coord, GLenum pname, const GLfloat *params)
+{
+ DISPATCH(TexGenfv, (coord, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGeni)(GLenum coord, GLenum pname, GLint param)
+{
+ DISPATCH(TexGeni, (coord, pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGeniv)(GLenum coord, GLenum pname, const GLint *params)
+{
+ DISPATCH(TexGeniv, (coord, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexEnvf)(GLenum target, GLenum pname, GLfloat param)
+{
+ DISPATCH(TexEnvf, (target, pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexEnvfv)(GLenum target, GLenum pname, const GLfloat *param)
+{
+ DISPATCH(TexEnvfv, (target, pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexEnvi)(GLenum target, GLenum pname, GLint param)
+{
+ DISPATCH(TexEnvi, (target, pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexEnviv)(GLenum target, GLenum pname, const GLint *param)
+{
+ DISPATCH(TexEnviv, (target, pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ DISPATCH(TexImage1D, (target, level, internalformat, width, border, format, type, pixels), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ DISPATCH(TexImage2D, (target, level, internalformat, width, height, border, format, type, pixels), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameterf)(GLenum target, GLenum pname, GLfloat param)
+{
+ DISPATCH(TexParameterf, (target, pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameterfv)(GLenum target, GLenum pname, const GLfloat *params)
+{
+ DISPATCH(TexParameterfv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameteri)(GLenum target, GLenum pname, GLint param)
+{
+ DISPATCH(TexParameteri, (target, pname, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameteriv)(GLenum target, GLenum pname, const GLint *params)
+{
+ DISPATCH(TexParameteriv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Translated)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(Translated, (x, y, z), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Translatef)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(Translatef, (x, y, z), ("glTranslatef(%g, %g, %g);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2d)(GLdouble x, GLdouble y)
+{
+ DISPATCH(Vertex2d, (x, y), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2dv)(const GLdouble *v)
+{
+ DISPATCH(Vertex2dv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2f)(GLfloat x, GLfloat y)
+{
+ DISPATCH(Vertex2f, (x, y), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2fv)(const GLfloat *v)
+{
+ DISPATCH(Vertex2fv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2i)(GLint x, GLint y)
+{
+ DISPATCH(Vertex2i, (x, y), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2iv)(const GLint *v)
+{
+ DISPATCH(Vertex2iv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2s)(GLshort x, GLshort y)
+{
+ DISPATCH(Vertex2s, (x, y), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2sv)(const GLshort *v)
+{
+ DISPATCH(Vertex2sv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3d)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(Vertex3d, (x, y, z), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3dv)(const GLdouble *v)
+{
+ DISPATCH(Vertex3dv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(Vertex3f, (x, y, z), ("glVertex3f(%g, %g, %g);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3fv)(const GLfloat *v)
+{
+ DISPATCH(Vertex3fv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3i)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(Vertex3i, (x, y, z), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3iv)(const GLint *v)
+{
+ DISPATCH(Vertex3iv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3s)(GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(Vertex3s, (x, y, z), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3sv)(const GLshort *v)
+{
+ DISPATCH(Vertex3sv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(Vertex4d, (x, y, z, w), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4dv)(const GLdouble *v)
+{
+ DISPATCH(Vertex4dv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(Vertex4f, (x, y, z, w), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4fv)(const GLfloat *v)
+{
+ DISPATCH(Vertex4fv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4i)(GLint x, GLint y, GLint z, GLint w)
+{
+ DISPATCH(Vertex4i, (x, y, z, w), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4iv)(const GLint *v)
+{
+ DISPATCH(Vertex4iv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(Vertex4s, (x, y, z, w), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4sv)(const GLshort *v)
+{
+ DISPATCH(Vertex4sv, (v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Viewport)(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(Viewport, (x, y, width, height), (";\n"));
+}
+
+
+
+
+/* GL 1.1 */
+
+KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences)
+{
+ RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), ("glAreTexturesResident(%d, %p, %p);\n", n, textures, residences));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ArrayElement)(GLint i)
+{
+ DISPATCH(ArrayElement, (i), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindTexture)(GLenum target, GLuint texture)
+{
+ DISPATCH(BindTexture, (target, texture), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+ DISPATCH(ColorPointer, (size, type, stride, ptr), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
+{
+ DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+ DISPATCH(CopyTexImage2D, (target, level, internalformat, x, y, width, height, border), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyTexSubImage2D, (target, level, xoffset, yoffset, x, y, width, height), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteTextures)(GLsizei n, const GLuint *textures)
+{
+ DISPATCH(DeleteTextures, (n, textures), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DisableClientState)(GLenum cap)
+{
+ DISPATCH(DisableClientState, (cap), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawArrays)(GLenum mode, GLint first, GLsizei count)
+{
+ DISPATCH(DrawArrays, (mode, first, count), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointer)(GLsizei stride, const GLvoid *ptr)
+{
+ DISPATCH(EdgeFlagPointer, (stride, ptr), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EnableClientState)(GLenum cap)
+{
+ DISPATCH(EnableClientState, (cap), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenTextures)(GLsizei n, GLuint *textures)
+{
+ DISPATCH(GenTextures, (n, textures), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPointerv)(GLenum pname, GLvoid **params)
+{
+ DISPATCH(GetPointerv, (pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(IndexPointer)(GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+ DISPATCH(IndexPointer, (type, stride, ptr), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexub)(GLubyte c)
+{
+ DISPATCH(Indexub, (c), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexubv)(const GLubyte *c)
+{
+ DISPATCH(Indexubv, (c), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid *pointer)
+{
+ DISPATCH(InterleavedArrays, (format, stride, pointer), (";\n"));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsTexture)(GLuint texture)
+{
+ RETURN_DISPATCH(IsTexture, (texture), ("glIsTexture(%u);\n", texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(NormalPointer)(GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+ DISPATCH(NormalPointer, (type, stride, ptr), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PolygonOffset)(GLfloat factor, GLfloat units)
+{
+ DISPATCH(PolygonOffset, (factor, units), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PopClientAttrib)(void)
+{
+ DISPATCH(PopClientAttrib, (), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities)
+{
+ DISPATCH(PrioritizeTextures, (n, textures, priorities), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PushClientAttrib)(GLbitfield mask)
+{
+ DISPATCH(PushClientAttrib, (mask), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+ DISPATCH(TexCoordPointer, (size, type, stride, ptr), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ DISPATCH(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+ DISPATCH(VertexPointer, (size, type, stride, ptr), (";\n"));
+}
+
+
+
+
+/* GL 1.2 */
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)
+{
+ DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ DISPATCH(TexImage3D, (target, level, internalformat, width, height, depth, border, format, type, pixels), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (";\n"));
+}
+
+
+
+/* GL_ARB_imaging */
+
+KEYWORD1 void KEYWORD2 NAME(BlendColor)(GLclampf r, GLclampf g, GLclampf b, GLclampf a)
+{
+ DISPATCH(BlendColor, (r, g, b, a), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendEquation)(GLenum mode)
+{
+ DISPATCH(BlendEquation, (mode), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data)
+{
+ DISPATCH(ColorSubTable, (target, start, count, format, type, data), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
+{
+ DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat *params)
+{
+ DISPATCH(ColorTableParameterfv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorTableParameteriv)(GLenum target, GLenum pname, const GLint *params)
+{
+ DISPATCH(ColorTableParameteriv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image)
+{
+ DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)
+{
+ DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params)
+{
+ DISPATCH(ConvolutionParameterf, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat *params)
+{
+ DISPATCH(ConvolutionParameterfv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteri)(GLenum target, GLenum pname, GLint params)
+{
+ DISPATCH(ConvolutionParameteri, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint *params)
+{
+ DISPATCH(ConvolutionParameteriv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyColorSubTable, (target, start, x, y, width), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid *table)
+{
+ DISPATCH(GetColorTable, (target, format, type, table), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetColorTableParameterfv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint *params)
+{
+ DISPATCH(GetColorTableParameteriv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid *image)
+{
+ DISPATCH(GetConvolutionFilter, (target, format, type, image), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetConvolutionParameterfv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint *params)
+{
+ DISPATCH(GetConvolutionParameteriv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
+{
+ DISPATCH(GetHistogram, (target, reset, format, type, values), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetHistogramParameterfv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint *params)
+{
+ DISPATCH(GetHistogramParameteriv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values)
+{
+ DISPATCH(GetMinmax, (target, reset, format, types, values), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetMinmaxParameterfv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint *params)
+{
+ DISPATCH(GetMinmaxParameteriv, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)
+{
+ DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
+{
+ DISPATCH(Histogram, (target, width, internalformat, sink), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Minmax)(GLenum target, GLenum internalformat, GLboolean sink)
+{
+ DISPATCH(Minmax, (target, internalformat, sink), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ResetMinmax)(GLenum target)
+{
+ DISPATCH(ResetMinmax, (target), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ResetHistogram)(GLenum target)
+{
+ DISPATCH(ResetHistogram, (target), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)
+{
+ DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (";\n"));
+}
+
+
+
+/* GL_ARB_multitexture */
+
+KEYWORD1 void KEYWORD2 NAME(ActiveTextureARB)(GLenum texture)
+{
+ DISPATCH(ActiveTextureARB, (texture), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClientActiveTextureARB)(GLenum texture)
+{
+ DISPATCH(ClientActiveTextureARB, (texture), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dARB)(GLenum target, GLdouble s)
+{
+ DISPATCH(MultiTexCoord1dARB, (target, s), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dvARB)(GLenum target, const GLdouble *v)
+{
+ DISPATCH(MultiTexCoord1dvARB, (target, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fARB)(GLenum target, GLfloat s)
+{
+ DISPATCH(MultiTexCoord1fARB, (target, s), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fvARB)(GLenum target, const GLfloat *v)
+{
+ DISPATCH(MultiTexCoord1fvARB, (target, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iARB)(GLenum target, GLint s)
+{
+ DISPATCH(MultiTexCoord1iARB, (target, s), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1ivARB)(GLenum target, const GLint *v)
+{
+ DISPATCH(MultiTexCoord1ivARB, (target, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sARB)(GLenum target, GLshort s)
+{
+ DISPATCH(MultiTexCoord1sARB, (target, s), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1svARB)(GLenum target, const GLshort *v)
+{
+ DISPATCH(MultiTexCoord1svARB, (target, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t)
+{
+ DISPATCH(MultiTexCoord2dARB, (target, s, t), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dvARB)(GLenum target, const GLdouble *v)
+{
+ DISPATCH(MultiTexCoord2dvARB, (target, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t)
+{
+ DISPATCH(MultiTexCoord2fARB, (target, s, t), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fvARB)(GLenum target, const GLfloat *v)
+{
+ DISPATCH(MultiTexCoord2fvARB, (target, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iARB)(GLenum target, GLint s, GLint t)
+{
+ DISPATCH(MultiTexCoord2iARB, (target, s, t), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2ivARB)(GLenum target, const GLint *v)
+{
+ DISPATCH(MultiTexCoord2ivARB, (target, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t)
+{
+ DISPATCH(MultiTexCoord2sARB, (target, s, t), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2svARB)(GLenum target, const GLshort *v)
+{
+ DISPATCH(MultiTexCoord2svARB, (target, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
+{
+ DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dvARB)(GLenum target, const GLdouble *v)
+{
+ DISPATCH(MultiTexCoord3dvARB, (target, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r)
+{
+ DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fvARB)(GLenum target, const GLfloat *v)
+{
+ DISPATCH(MultiTexCoord3fvARB, (target, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r)
+{
+ DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3ivARB)(GLenum target, const GLint *v)
+{
+ DISPATCH(MultiTexCoord3ivARB, (target, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r)
+{
+ DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3svARB)(GLenum target, const GLshort *v)
+{
+ DISPATCH(MultiTexCoord3svARB, (target, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+ DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dvARB)(GLenum target, const GLdouble *v)
+{
+ DISPATCH(MultiTexCoord4dvARB, (target, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+ DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fvARB)(GLenum target, const GLfloat *v)
+{
+ DISPATCH(MultiTexCoord4fvARB, (target, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q)
+{
+ DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4ivARB)(GLenum target, const GLint *v)
+{
+ DISPATCH(MultiTexCoord4ivARB, (target, v), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
+{
+ DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4svARB)(GLenum target, const GLshort *v)
+{
+ DISPATCH(MultiTexCoord4svARB, (target, v), (";\n"));
+}
+
+
+
+/***
+ *** Extension functions
+ ***/
+
+
+/* 2. GL_EXT_blend_color */
+KEYWORD1 void KEYWORD2 NAME(BlendColorEXT)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+ DISPATCH(BlendColorEXT, (red, green, blue, alpha), (";\n"));
+}
+
+
+
+/* 3. GL_EXT_polygon_offset */
+KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias)
+{
+ DISPATCH(PolygonOffsetEXT, (factor, bias), (";\n"));
+}
+
+
+
+/* 6. GL_EXT_texture3D */
+
+KEYWORD1 void KEYWORD2 NAME(TexImage3DEXT)(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ DISPATCH(TexImage3D, (target, level, internalFormat, width, height, depth, border, format, type, pixels), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (";\n"));
+}
+
+
+
+/* 7. GL_SGI_texture_filter4 */
+
+KEYWORD1 void KEYWORD2 NAME(GetTexFilterFuncSGIS)(GLenum target, GLenum filter, GLsizei n, const GLfloat *weights)
+{
+ DISPATCH(GetTexFilterFuncSGIS, (target, filter, n, weights), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexFilterFuncSGIS)(GLenum target, GLenum filter, GLfloat *weights)
+{
+ DISPATCH(TexFilterFuncSGIS, (target, filter, weights), (";\n"));
+}
+
+
+
+/* 9. GL_EXT_subtexture */
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyTexSubImage1DEXT, (target, level, xoffset, x, y, width), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ DISPATCH(TexSubImage1DEXT, (target, level, xoffset, width, format, type, pixels), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ DISPATCH(TexSubImage2DEXT, (target, level, xoffset, yoffset, width, height, format, type, pixels), (";\n"));
+}
+
+
+/* 10. GL_EXT_copy_texture */
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage1DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
+{
+ DISPATCH(CopyTexImage1DEXT, (target, level, internalformat, x, y, width, border), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage2DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+ DISPATCH(CopyTexImage2DEXT, (target, level, internalformat, x, y, width, height, border), (";\n"));
+}
+
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyTexSubImage2DEXT, (target, level, xoffset, yoffset, x, y, width, height), (";\n"));
+}
+
+
+
+/* 11. GL_EXT_histogram */
+KEYWORD1 void KEYWORD2 NAME(GetHistogramEXT)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
+{
+ DISPATCH(GetHistogramEXT, (target, reset, format, type, values), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfvEXT)(GLenum target, GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetHistogramParameterfvEXT, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterivEXT)(GLenum target, GLenum pname, GLint *params)
+{
+ DISPATCH(GetHistogramParameterivEXT, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMinmaxEXT)(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values)
+{
+ DISPATCH(GetMinmaxEXT, (target, reset, format, types, values), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfvEXT)(GLenum target, GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetMinmaxParameterfvEXT, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterivEXT)(GLenum target, GLenum pname, GLint *params)
+{
+ DISPATCH(GetMinmaxParameterivEXT, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(HistogramEXT)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
+{
+ DISPATCH(HistogramEXT, (target, width, internalformat, sink), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MinmaxEXT)(GLenum target, GLenum internalformat, GLboolean sink)
+{
+ DISPATCH(MinmaxEXT, (target, internalformat, sink), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ResetHistogramEXT)(GLenum target)
+{
+ DISPATCH(ResetHistogramEXT, (target), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ResetMinmaxEXT)(GLenum target)
+{
+ DISPATCH(ResetMinmaxEXT, (target), (";\n"));
+}
+
+
+
+/* 12. GL_EXT_convolution */
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter1DEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image)
+{
+ DISPATCH(ConvolutionFilter1DEXT, (target, internalformat, width, format, type, image), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter2DEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)
+{
+ DISPATCH(ConvolutionFilter2DEXT, (target, internalformat, width, height, format, type, image), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterfEXT)(GLenum target, GLenum pname, GLfloat params)
+{
+ DISPATCH(ConvolutionParameterfEXT, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterfvEXT)(GLenum target, GLenum pname, const GLfloat *params)
+{
+ DISPATCH(ConvolutionParameterfvEXT, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteriEXT)(GLenum target, GLenum pname, GLint params)
+{
+ DISPATCH(ConvolutionParameteriEXT, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterivEXT)(GLenum target, GLenum pname, const GLint *params)
+{
+ DISPATCH(ConvolutionParameterivEXT, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter1DEXT)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyConvolutionFilter1DEXT, (target, internalformat, x, y, width), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter2DEXT)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyConvolutionFilter2DEXT, (target, internalformat, x, y, width, height), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilterEXT)(GLenum target, GLenum format, GLenum type, GLvoid *image)
+{
+ DISPATCH(GetConvolutionFilterEXT, (target, format, type, image), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfvEXT)(GLenum target, GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetConvolutionParameterfvEXT, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterivEXT)(GLenum target, GLenum pname, GLint *params)
+{
+ DISPATCH(GetConvolutionParameterivEXT, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetSeparableFilterEXT)(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)
+{
+ DISPATCH(GetSeparableFilterEXT, (target, format, type, row, column, span), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SeparableFilter2DEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)
+{
+ DISPATCH(SeparableFilter2DEXT, (target, internalformat, width, height, format, type, row, column), (";\n"));
+}
+
+
+
+/* 14. GL_SGI_color_table */
+
+KEYWORD1 void KEYWORD2 NAME(ColorTableParameterfvSGI)(GLenum target, GLenum pname, const GLfloat *params)
+{
+ DISPATCH(ColorTableParameterfvSGI, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorTableParameterivSGI)(GLenum target, GLenum pname, const GLint *params)
+{
+ DISPATCH(ColorTableParameterivSGI, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorTableSGI)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
+{
+ DISPATCH(ColorTableSGI, (target, internalformat, width, format, type, table), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyColorTableSGI)(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyColorTableSGI, (target, internalFormat, x, y, width), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableSGI)(GLenum target, GLenum format, GLenum type, GLvoid *table)
+{
+ DISPATCH(GetColorTableSGI, (target, format, type, table), (";\n"));
+}
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvSGI)(GLenum target, GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetColorTableParameterfvSGI, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivSGI)(GLenum target, GLenum pname, GLint *params)
+{
+ DISPATCH(GetColorTableParameterivSGI, (target, pname, params), (";\n"));
+}
+
+
+
+/* 20. GL_EXT_texture_object */
+
+KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint *textures)
+{
+ DISPATCH(GenTextures, (n, textures), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteTexturesEXT)(GLsizei n, const GLuint *texture)
+{
+ DISPATCH(DeleteTextures, (n, texture), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindTextureEXT)(GLenum target, GLuint texture)
+{
+ DISPATCH(BindTexture, (target, texture), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PrioritizeTexturesEXT)(GLsizei n, const GLuint *textures, const GLclampf *priorities)
+{
+ DISPATCH(PrioritizeTextures, (n, textures, priorities), (";\n"));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint *textures, GLboolean *residences)
+{
+ RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), ("glAreTexturesResidentEXT(%d %p %p);\n", n, textures, residences));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture)
+{
+ RETURN_DISPATCH(IsTexture, (texture), ("glIsTextureEXT(%u);\n", texture));
+}
+
+
+
+/* 37. GL_EXT_blend_minmax */
+KEYWORD1 void KEYWORD2 NAME(BlendEquationEXT)(GLenum mode)
+{
+ DISPATCH(BlendEquationEXT, (mode), (";\n"));
+}
+
+
+
+/* 30. GL_EXT_vertex_array */
+
+KEYWORD1 void KEYWORD2 NAME(VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr)
+{
+ DISPATCH(VertexPointer, (size, type, stride, ptr), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr)
+{
+ DISPATCH(NormalPointer, (type, stride, ptr), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr)
+{
+ DISPATCH(ColorPointer, (size, type, stride, ptr), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr)
+{
+ DISPATCH(IndexPointer, (type, stride, ptr), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr)
+{
+ DISPATCH(ColorPointer, (size, type, stride, ptr), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean *ptr)
+{
+ DISPATCH(EdgeFlagPointer, (stride, ptr), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPointervEXT)(GLenum pname, void **params)
+{
+ DISPATCH(GetPointerv, (pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ArrayElementEXT)(GLint i)
+{
+ DISPATCH(ArrayElement, (i), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawArraysEXT)(GLenum mode, GLint first, GLsizei count)
+{
+ DISPATCH(DrawArrays, (mode, first, count), (";\n"));
+}
+
+
+
+/* 54. GL_EXT_point_parameters */
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterfEXT)(GLenum target, GLfloat param)
+{
+ DISPATCH(PointParameterfEXT, (target, param), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum target, const GLfloat *param)
+{
+ DISPATCH(PointParameterfvEXT, (target, param), (";\n"));
+}
+
+
+/* 77. GL_PGI_misc_hints */
+KEYWORD1 void KEYWORD2 NAME(HintPGI)(GLenum target, GLint mode)
+{
+ DISPATCH(HintPGI, (target, mode), (";\n"));
+}
+
+
+/* 78. GL_EXT_paletted_texture */
+
+KEYWORD1 void KEYWORD2 NAME(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
+{
+ DISPATCH(ColorTableEXT, (target, internalformat, width, format, type, table), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorSubTableEXT)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data)
+{
+ DISPATCH(ColorSubTableEXT, (target, start, count, format, type, data), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid *table)
+{
+ DISPATCH(GetColorTableEXT, (target, format, type, table), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat *params)
+{
+ DISPATCH(GetColorTableParameterfvEXT, (target, pname, params), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint *params)
+{
+ DISPATCH(GetColorTableParameterivEXT, (target, pname, params), (";\n"));
+}
+
+
+
+
+/* 97. GL_EXT_compiled_vertex_array */
+
+KEYWORD1 void KEYWORD2 NAME(LockArraysEXT)(GLint first, GLsizei count)
+{
+ DISPATCH(LockArraysEXT, (first, count), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void)
+{
+ DISPATCH(UnlockArraysEXT, (), (";\n"));
+}
+
+
+
+/* 173. GL_EXT/INGR_blend_func_separate */
+KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateINGR)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+{
+ DISPATCH(BlendFuncSeparateINGR, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (";\n"));
+}
+
+
+
+/* GL_MESA_window_pos */
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2iMESA)(GLint x, GLint y)
+{
+ DISPATCH(WindowPos4fMESA, (x, y, 0, 1), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2sMESA)(GLshort x, GLshort y)
+{
+ DISPATCH(WindowPos4fMESA, (x, y, 0, 1), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fMESA)(GLfloat x, GLfloat y)
+{
+ DISPATCH(WindowPos4fMESA, (x, y, 0, 1), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dMESA)(GLdouble x, GLdouble y)
+{
+ DISPATCH(WindowPos4fMESA, (x, y, 0, 1), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2ivMESA)(const GLint *p)
+{
+ DISPATCH(WindowPos4fMESA, (p[0], p[1], 0, 1), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2svMESA)(const GLshort *p)
+{
+ DISPATCH(WindowPos4fMESA, (p[0], p[1], 0, 1), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fvMESA)(const GLfloat *p)
+{
+ DISPATCH(WindowPos4fMESA, (p[0], p[1], 0, 1), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dvMESA)(const GLdouble *p)
+{
+ DISPATCH(WindowPos4fMESA, (p[0], p[1], 0, 1), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3iMESA)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(WindowPos4fMESA, (x, y, z, 1), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3sMESA)(GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(WindowPos4fMESA, (x, y, z, 1), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(WindowPos4fMESA, (x, y, z, 1), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(WindowPos4fMESA, (x, y, z, 1), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3ivMESA)(const GLint *p)
+{
+ DISPATCH(WindowPos4fMESA, (p[0], p[1], p[2], 1.0), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3svMESA)(const GLshort *p)
+{
+ DISPATCH(WindowPos4fMESA, (p[0], p[1], p[2], 1.0), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fvMESA)(const GLfloat *p)
+{
+ DISPATCH(WindowPos4fMESA, (p[0], p[1], p[2], 1.0), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dvMESA)(const GLdouble *p)
+{
+ DISPATCH(WindowPos4fMESA, (p[0], p[1], p[2], 1.0), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w)
+{
+ DISPATCH(WindowPos4fMESA, (x, y, z, w), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(WindowPos4fMESA, (x, y, z, w), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(WindowPos4fMESA, (x, y, z, w), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(WindowPos4fMESA, (x, y, z, w), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4ivMESA)(const GLint *p)
+{
+ DISPATCH(WindowPos4fMESA, (p[0], p[1], p[2], p[3]), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort *p)
+{
+ DISPATCH(WindowPos4fMESA, (p[0], p[1], p[2], p[3]), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4fvMESA)(const GLfloat *p)
+{
+ DISPATCH(WindowPos4fMESA, (p[0], p[1], p[2], p[3]), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4dvMESA)(const GLdouble *p)
+{
+ DISPATCH(WindowPos4fMESA, (p[0], p[1], p[2], p[3]), (";\n"));
+}
+
+
+
+/* GL_MESA_resize_buffers */
+KEYWORD1 void KEYWORD2 NAME(ResizeBuffersMESA)(void)
+{
+ DISPATCH(ResizeBuffersMESA, (), (";\n"));
+}
+
+
+
+/* GL_ARB_transpose_matrix */
+KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixdARB)(const GLdouble m[16])
+{
+ DISPATCH(LoadTransposeMatrixdARB, (m), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixfARB)(const GLfloat m[16])
+{
+ DISPATCH(LoadTransposeMatrixfARB, (m), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixdARB)(const GLdouble m[16])
+{
+ DISPATCH(MultTransposeMatrixdARB, (m), (";\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixfARB)(const GLfloat m[16])
+{
+ DISPATCH(MultTransposeMatrixfARB, (m), (";\n"));
+}
+
+
+
+#undef KEYWORD1
+#undef KEYWORD2
+#undef NAME
+#undef DISPATCH
+#undef RETURN_DISPATCH
diff --git a/xc/extras/Mesa/src/glheader.h b/xc/extras/Mesa/src/glheader.h
new file mode 100644
index 000000000..bf88ab69d
--- /dev/null
+++ b/xc/extras/Mesa/src/glheader.h
@@ -0,0 +1,109 @@
+/* $Id: glheader.h,v 1.2 2000/01/30 00:27:02 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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 GLHEADER_H
+#define GLHEADER_H
+
+
+/*
+ * This is the top-most include file of the Mesa sources.
+ * It includes gl.h and all system headers which are needed.
+ * Other Mesa source files should _not_ directly include any system
+ * headers. This allows Mesa to be integrated into XFree86 and
+ * allows system-dependent hacks/work-arounds to be collected in one place.
+ *
+ * If you touch this file, everything gets recompiled!
+ *
+ * This file should be included before any other header in the .c files.
+ */
+
+
+#ifdef XFree86LOADER
+#include "xf86_ansic.h"
+#else
+#include <assert.h>
+#include <ctype.h>
+#include <float.h>
+#include <math.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "conf.h"
+#endif
+
+#include <GL/gl.h>
+
+
+/*
+ * Put compiler/OS/assembly pragmas and macros here to avoid
+ * cluttering other source files.
+ */
+
+
+/* Disable unreachable code warnings for Watcom C++ */
+#ifdef __WATCOMC__
+#pragma disable_message(201)
+#endif
+
+
+/* Turn off macro checking systems used by other libraries */
+#ifdef CHECK
+#undef CHECK
+#endif
+
+
+/* Create a macro so that asm functions can be linked into compilers other
+ * than GNU C
+ */
+#ifndef _ASMAPI
+#if !defined( __GNUC__ ) && !defined( VMS )
+#define _ASMAPI __cdecl
+#else
+#define _ASMAPI
+#endif
+#ifdef PTR_DECL_IN_FRONT
+#define _ASMAPIP * _ASMAPI
+#else
+#define _ASMAPIP _ASMAPI *
+#endif
+#endif
+
+#ifdef USE_X86_ASM
+#define _NORMAPI _ASMAPI
+#define _NORMAPIP _ASMAPIP
+#else
+#define _NORMAPI
+#define _NORMAPIP *
+#endif
+
+
+
+#endif /* GLHEADER_H */
diff --git a/xc/extras/Mesa/src/glmisc.c b/xc/extras/Mesa/src/glmisc.c
index 0e0e81e2b..2e8d978de 100644
--- a/xc/extras/Mesa/src/glmisc.c
+++ b/xc/extras/Mesa/src/glmisc.c
@@ -1,10 +1,10 @@
-/* $Id: glmisc.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: glmisc.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,18 +25,10 @@
*/
-/* $XFree86: xc/lib/GL/mesa/src/glmisc.c,v 1.2 1999/04/04 00:20:25 dawes Exp $ */
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "accum.h"
#include "alphabuf.h"
#include "context.h"
@@ -46,14 +38,17 @@
#include "glmisc.h"
#include "macros.h"
#include "masking.h"
+#include "mem.h"
#include "stencil.h"
#include "types.h"
#endif
-void gl_ClearIndex( GLcontext *ctx, GLfloat c )
+void
+_mesa_ClearIndex( GLfloat c )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClearIndex");
ctx->Color.ClearIndex = (GLuint) c;
if (!ctx->Visual->RGBAflag) {
@@ -64,9 +59,11 @@ void gl_ClearIndex( GLcontext *ctx, GLfloat c )
-void gl_ClearColor( GLcontext *ctx, GLclampf red, GLclampf green,
- GLclampf blue, GLclampf alpha )
+void
+_mesa_ClearColor( GLclampf red, GLclampf green,
+ GLclampf blue, GLclampf alpha )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClearColor");
ctx->Color.ClearColor[0] = CLAMP( red, 0.0F, 1.0F );
@@ -89,32 +86,22 @@ void gl_ClearColor( GLcontext *ctx, GLclampf red, GLclampf green,
/*
* Clear the color buffer when glColorMask or glIndexMask is in effect.
*/
-static void clear_color_buffer_with_masking( GLcontext *ctx )
+static void
+clear_color_buffer_with_masking( GLcontext *ctx )
{
- GLint x, y, height, width;
-
- /* Compute region to clear */
- if (ctx->Scissor.Enabled) {
- x = ctx->Buffer->Xmin;
- y = ctx->Buffer->Ymin;
- height = ctx->Buffer->Ymax - ctx->Buffer->Ymin + 1;
- width = ctx->Buffer->Xmax - ctx->Buffer->Xmin + 1;
- }
- else {
- x = 0;
- y = 0;
- height = ctx->Buffer->Height;
- width = ctx->Buffer->Width;
- }
+ const GLint x = ctx->DrawBuffer->Xmin;
+ const GLint y = ctx->DrawBuffer->Ymin;
+ const GLint height = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin + 1;
+ const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1;
if (ctx->Visual->RGBAflag) {
/* RGBA mode */
- GLubyte r = (GLint) (ctx->Color.ClearColor[0] * 255.0F);
- GLubyte g = (GLint) (ctx->Color.ClearColor[1] * 255.0F);
- GLubyte b = (GLint) (ctx->Color.ClearColor[2] * 255.0F);
- GLubyte a = (GLint) (ctx->Color.ClearColor[3] * 255.0F);
+ const GLubyte r = (GLint) (ctx->Color.ClearColor[0] * 255.0F);
+ const GLubyte g = (GLint) (ctx->Color.ClearColor[1] * 255.0F);
+ const GLubyte b = (GLint) (ctx->Color.ClearColor[2] * 255.0F);
+ const GLubyte a = (GLint) (ctx->Color.ClearColor[3] * 255.0F);
GLint i;
- for (i=0;i<height;i++,y++) {
+ for (i = 0; i < height; i++) {
GLubyte rgba[MAX_WIDTH][4];
GLint j;
for (j=0; j<width; j++) {
@@ -123,23 +110,23 @@ static void clear_color_buffer_with_masking( GLcontext *ctx )
rgba[j][BCOMP] = b;
rgba[j][ACOMP] = a;
}
- gl_mask_rgba_span( ctx, width, x, y, rgba );
- (*ctx->Driver.WriteRGBASpan)( ctx, width, x, y,
- (const GLubyte (*)[4])rgba, NULL );
+ gl_mask_rgba_span( ctx, width, x, y + i, rgba );
+ (*ctx->Driver.WriteRGBASpan)( ctx, width, x, y + i,
+ (CONST GLubyte (*)[4])rgba, NULL );
}
}
else {
/* Color index mode */
- GLuint indx[MAX_WIDTH];
+ GLuint span[MAX_WIDTH];
GLubyte mask[MAX_WIDTH];
GLint i, j;
MEMSET( mask, 1, width );
- for (i=0;i<height;i++,y++) {
+ for (i=0;i<height;i++) {
for (j=0;j<width;j++) {
- indx[j] = ctx->Color.ClearIndex;
+ span[j] = ctx->Color.ClearIndex;
}
- gl_mask_index_span( ctx, width, x, y, indx );
- (*ctx->Driver.WriteCI32Span)( ctx, width, x, y, indx, mask );
+ gl_mask_index_span( ctx, width, x, y + i, span );
+ (*ctx->Driver.WriteCI32Span)( ctx, width, x, y + i, span, mask );
}
}
}
@@ -147,125 +134,174 @@ static void clear_color_buffer_with_masking( GLcontext *ctx )
/*
- * Clear the front and/or back color buffers. Also clear the alpha
- * buffer(s) if present.
+ * Clear a color buffer without index/channel masking.
*/
-static void clear_color_buffers( GLcontext *ctx )
+static void
+clear_color_buffer(GLcontext *ctx)
{
+ const GLint x = ctx->DrawBuffer->Xmin;
+ const GLint y = ctx->DrawBuffer->Ymin;
+ const GLint height = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin + 1;
+ const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1;
- if (ctx->RasterMask & MULTI_DRAW_BIT) {
- GLuint bufferBit;
-
- if (ctx->Color.DrawBuffer == GL_NONE)
- return;
-
- /* loop over four possible dest color buffers */
- for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) {
- if (bufferBit & ctx->Color.DrawDestMask) {
- if (bufferBit == FRONT_LEFT_BIT) {
- (*ctx->Driver.SetBuffer)( ctx, GL_FRONT_LEFT);
- ctx->Buffer->Alpha = ctx->Buffer->FrontLeftAlpha;
- }
- else if (bufferBit == FRONT_RIGHT_BIT) {
- (*ctx->Driver.SetBuffer)( ctx, GL_FRONT_RIGHT);
- ctx->Buffer->Alpha = ctx->Buffer->FrontRightAlpha;
- }
- else if (bufferBit == BACK_LEFT_BIT) {
- (*ctx->Driver.SetBuffer)( ctx, GL_BACK_LEFT);
- ctx->Buffer->Alpha = ctx->Buffer->BackLeftAlpha;
- }
- else {
- (*ctx->Driver.SetBuffer)( ctx, GL_BACK_RIGHT);
- ctx->Buffer->Alpha = ctx->Buffer->BackRightAlpha;
- }
-
- if (ctx->Color.SWmasking) {
- clear_color_buffer_with_masking( ctx );
- }
- else {
- GLint x = ctx->Buffer->Xmin;
- GLint y = ctx->Buffer->Ymin;
- GLint height = ctx->Buffer->Ymax - ctx->Buffer->Ymin + 1;
- GLint width = ctx->Buffer->Xmax - ctx->Buffer->Xmin + 1;
- (void) (*ctx->Driver.Clear)( ctx, GL_COLOR_BUFFER_BIT,
- !ctx->Scissor.Enabled,
- x, y, width, height );
- }
- }
+ if (ctx->Visual->RGBAflag) {
+ /* RGBA mode */
+ const GLubyte r = (GLint) (ctx->Color.ClearColor[0] * 255.0F);
+ const GLubyte g = (GLint) (ctx->Color.ClearColor[1] * 255.0F);
+ const GLubyte b = (GLint) (ctx->Color.ClearColor[2] * 255.0F);
+ const GLubyte a = (GLint) (ctx->Color.ClearColor[3] * 255.0F);
+ GLubyte span[MAX_WIDTH][4];
+ GLint i;
+ ASSERT(ctx->Color.ColorMask[0] &&
+ ctx->Color.ColorMask[1] &&
+ ctx->Color.ColorMask[2] &&
+ ctx->Color.ColorMask[3]);
+ for (i = 0; i < width; i++) {
+ span[i][RCOMP] = r;
+ span[i][GCOMP] = g;
+ span[i][BCOMP] = b;
+ span[i][ACOMP] = a;
+ }
+ for (i = 0; i < height; i++) {
+ (*ctx->Driver.WriteRGBASpan)( ctx, width, x, y + i,
+ (CONST GLubyte (*)[4]) span, NULL );
}
-
- /* restore default dest buffer */
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer );
}
else {
- /* normal case: clear exactly one color buffer */
-
- if (ctx->Color.SWmasking) {
- clear_color_buffer_with_masking( ctx );
+ /* Color index mode */
+ ASSERT(ctx->Color.IndexMask == ~0);
+ if (ctx->Visual->IndexBits == 8) {
+ /* 8-bit clear */
+ GLubyte span[MAX_WIDTH];
+ GLint i;
+ MEMSET(span, ctx->Color.ClearIndex, width);
+ for (i = 0; i < height; i++) {
+ (*ctx->Driver.WriteCI8Span)( ctx, width, x, y + i, span, NULL );
+ }
}
else {
- GLint x = ctx->Buffer->Xmin;
- GLint y = ctx->Buffer->Ymin;
- GLint height = ctx->Buffer->Ymax - ctx->Buffer->Ymin + 1;
- GLint width = ctx->Buffer->Xmax - ctx->Buffer->Xmin + 1;
- (void) (*ctx->Driver.Clear)( ctx, GL_COLOR_BUFFER_BIT,
- !ctx->Scissor.Enabled,
- x, y, width, height );
+ /* non 8-bit clear */
+ GLuint span[MAX_WIDTH];
+ GLint i;
+ for (i = 0; i < width; i++) {
+ span[i] = ctx->Color.ClearIndex;
+ }
+ for (i = 0; i < height; i++) {
+ (*ctx->Driver.WriteCI32Span)( ctx, width, x, y + i, span, NULL );
+ }
+ }
+ }
+}
+
+
+
+/*
+ * Clear the front/back/left/right color buffers.
+ * This function is usually only called if we need to clear the
+ * buffers with masking.
+ */
+static void
+clear_color_buffers(GLcontext *ctx)
+{
+ GLuint bufferBit;
+
+ /* loop over four possible dest color buffers */
+ for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) {
+ if (bufferBit & ctx->Color.DrawDestMask) {
+ if (bufferBit == FRONT_LEFT_BIT) {
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_LEFT);
+ }
+ else if (bufferBit == FRONT_RIGHT_BIT) {
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_RIGHT);
+ }
+ else if (bufferBit == BACK_LEFT_BIT) {
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_LEFT);
+ }
+ else {
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT);
+ }
+
+ if (ctx->Color.SWmasking) {
+ clear_color_buffer_with_masking(ctx);
+ }
+ else {
+ clear_color_buffer(ctx);
+ }
}
}
+
+ /* restore default dest buffer */
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, ctx->Color.DriverDrawBuffer );
}
-void gl_Clear( GLcontext *ctx, GLbitfield mask )
+void
+_mesa_Clear( GLbitfield mask )
{
+ GET_CURRENT_CONTEXT(ctx);
#ifdef PROFILE
GLdouble t0 = gl_time();
#endif
-
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClear");
if (MESA_VERBOSE & VERBOSE_API)
fprintf(stderr, "glClear 0x%x\n", mask);
+ if (ctx->NewState) {
+ gl_update_state( ctx );
+ }
+
if (ctx->RenderMode==GL_RENDER) {
- GLint x, y, width, height;
+ const GLint x = ctx->DrawBuffer->Xmin;
+ const GLint y = ctx->DrawBuffer->Ymin;
+ const GLint height = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin + 1;
+ const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1;
+ GLbitfield ddMask;
GLbitfield newMask;
- if (ctx->NewState) {
- gl_update_state( ctx );
+ /* don't clear depth buffer if depth writing disabled */
+ if (!ctx->Depth.Mask)
+ CLEAR_BITS(mask, GL_DEPTH_BUFFER_BIT);
+
+ /* Build bitmask to send to driver Clear function */
+ ddMask = mask & (GL_DEPTH_BUFFER_BIT |
+ GL_STENCIL_BUFFER_BIT |
+ GL_ACCUM_BUFFER_BIT);
+ if (mask & GL_COLOR_BUFFER_BIT) {
+ ddMask |= ctx->Color.DrawDestMask;
}
- x = ctx->Buffer->Xmin;
- y = ctx->Buffer->Ymin;
- height = ctx->Buffer->Ymax - ctx->Buffer->Ymin + 1;
- width = ctx->Buffer->Xmax - ctx->Buffer->Xmin + 1;
+ ASSERT(ctx->Driver.Clear);
+ newMask = (*ctx->Driver.Clear)( ctx, ddMask, !ctx->Scissor.Enabled,
+ x, y, width, height );
- /* clear software alpha buffer(s) */
- if ( (mask & GL_COLOR_BUFFER_BIT) && (ctx->RasterMask & ALPHABUF_BIT) ) {
- gl_clear_alpha_buffers( ctx );
+#ifdef DEBUG
+ {
+ GLbitfield legalBits = DD_FRONT_LEFT_BIT |
+ DD_FRONT_RIGHT_BIT |
+ DD_BACK_LEFT_BIT |
+ DD_BACK_RIGHT_BIT |
+ DD_DEPTH_BIT |
+ DD_STENCIL_BIT |
+ DD_ACCUM_BIT;
+ assert((newMask & (~legalBits)) == 0);
}
+#endif
- /* let device driver try to clear the buffers */
- if ((mask & GL_COLOR_BUFFER_BIT) != 0
- && (ctx->Color.SWmasking || (ctx->RasterMask & MULTI_DRAW_BIT))) {
- /* Driver can't clear color buffer for some reason, let it try
- * to clear the other ancillary buffers.
- */
- GLbitfield mask2 = mask & (~GL_COLOR_BUFFER_BIT);
- newMask = (*ctx->Driver.Clear)( ctx, mask2, !ctx->Scissor.Enabled,
- x, y, width, height );
- newMask |= GL_COLOR_BUFFER_BIT;
- }
- else {
- newMask = (*ctx->Driver.Clear)( ctx, mask, !ctx->Scissor.Enabled,
- x, y, width, height );
+ /* do software clearing here */
+ if (newMask) {
+ if (newMask & ctx->Color.DrawDestMask) clear_color_buffers( ctx );
+ if (newMask & GL_DEPTH_BUFFER_BIT) gl_clear_depth_buffer( ctx );
+ if (newMask & GL_ACCUM_BUFFER_BIT) gl_clear_accum_buffer( ctx );
+ if (newMask & GL_STENCIL_BUFFER_BIT) gl_clear_stencil_buffer( ctx );
}
- if (newMask & GL_COLOR_BUFFER_BIT) clear_color_buffers( ctx );
- if (newMask & GL_DEPTH_BUFFER_BIT) gl_clear_depth_buffer( ctx );
- if (newMask & GL_ACCUM_BUFFER_BIT) gl_clear_accum_buffer( ctx );
- if (newMask & GL_STENCIL_BUFFER_BIT) gl_clear_stencil_buffer( ctx );
+ /* clear software-based alpha buffer(s) */
+ if ( (mask & GL_COLOR_BUFFER_BIT) && ctx->Visual->SoftwareAlpha
+ && ctx->Color.ColorMask[RCOMP]) {
+ gl_clear_alpha_buffers( ctx );
+ }
#ifdef PROFILE
ctx->ClearTime += gl_time() - t0;
@@ -276,8 +312,10 @@ void gl_Clear( GLcontext *ctx, GLbitfield mask )
-void gl_Finish( GLcontext *ctx )
+void
+_mesa_Finish( void )
{
+ GET_CURRENT_CONTEXT(ctx);
/* Don't compile into display list */
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glFinish");
if (ctx->Driver.Finish) {
@@ -287,8 +325,10 @@ void gl_Finish( GLcontext *ctx )
-void gl_Flush( GLcontext *ctx )
+void
+_mesa_Flush( void )
{
+ GET_CURRENT_CONTEXT(ctx);
/* Don't compile into display list */
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glFlush");
if (ctx->Driver.Flush) {
@@ -297,8 +337,16 @@ void gl_Flush( GLcontext *ctx )
}
+void
+_mesa_Hint( GLenum target, GLenum mode )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) _mesa_try_Hint( ctx, target, mode );
+}
+
-GLboolean gl_Hint( GLcontext *ctx, GLenum target, GLenum mode )
+GLboolean
+_mesa_try_Hint( GLcontext *ctx, GLenum target, GLenum mode )
{
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glHint", GL_FALSE);
@@ -386,10 +434,51 @@ GLboolean gl_Hint( GLcontext *ctx, GLenum target, GLenum mode )
return GL_TRUE;
}
+
+void
+_mesa_HintPGI( GLenum target, GLint mode )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glHintPGI");
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ fprintf(stderr, "glHintPGI %s %d\n", gl_lookup_enum_by_nr(target), mode);
+
+ switch (target) {
+ case GL_PREFER_DOUBLEBUFFER_HINT_PGI:
+ case GL_STRICT_DEPTHFUNC_HINT_PGI:
+ case GL_STRICT_LIGHTING_HINT_PGI:
+ case GL_STRICT_SCISSOR_HINT_PGI:
+ case GL_FULL_STIPPLE_HINT_PGI:
+ case GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI:
+ case GL_NATIVE_GRAPHICS_END_HINT_PGI:
+ case GL_CONSERVE_MEMORY_HINT_PGI:
+ case GL_RECLAIM_MEMORY_HINT_PGI:
+ case GL_ALWAYS_FAST_HINT_PGI:
+ case GL_ALWAYS_SOFT_HINT_PGI:
+ case GL_ALLOW_DRAW_OBJ_HINT_PGI:
+ case GL_ALLOW_DRAW_WIN_HINT_PGI:
+ case GL_ALLOW_DRAW_SPN_HINT_PGI:
+ case GL_ALLOW_DRAW_MEM_HINT_PGI:
+ case GL_CLIP_NEAR_HINT_PGI:
+ case GL_CLIP_FAR_HINT_PGI:
+ case GL_WIDE_LINE_HINT_PGI:
+ case GL_BACK_NORMALS_HINT_PGI:
+ case GL_NATIVE_GRAPHICS_HANDLE_PGI:
+ (void) _mesa_try_Hint(ctx, target, (GLenum) mode);
+ break;
+ default:
+ gl_error( ctx, GL_INVALID_ENUM, "glHintPGI(target)" );
+ return;
+ }
+}
+
-void gl_DrawBuffer( GLcontext *ctx, GLenum mode )
+void
+_mesa_DrawBuffer( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDrawBuffer");
if (MESA_VERBOSE & VERBOSE_API)
@@ -505,13 +594,13 @@ void gl_DrawBuffer( GLcontext *ctx, GLenum mode )
*/
if (ctx->Visual->SoftwareAlpha) {
if (ctx->Color.DriverDrawBuffer == GL_FRONT_LEFT)
- ctx->Buffer->Alpha = ctx->Buffer->FrontLeftAlpha;
+ ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontLeftAlpha;
else if (ctx->Color.DriverDrawBuffer == GL_BACK_LEFT)
- ctx->Buffer->Alpha = ctx->Buffer->BackLeftAlpha;
+ ctx->DrawBuffer->Alpha = ctx->DrawBuffer->BackLeftAlpha;
else if (ctx->Color.DriverDrawBuffer == GL_FRONT_RIGHT)
- ctx->Buffer->Alpha = ctx->Buffer->FrontRightAlpha;
+ ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontRightAlpha;
else if (ctx->Color.DriverDrawBuffer == GL_BACK_RIGHT)
- ctx->Buffer->Alpha = ctx->Buffer->BackRightAlpha;
+ ctx->DrawBuffer->Alpha = ctx->DrawBuffer->BackRightAlpha;
}
/*
@@ -521,8 +610,8 @@ void gl_DrawBuffer( GLcontext *ctx, GLenum mode )
* for example. We'll take care of that in the core code by looping
* over the individual buffers.
*/
- ASSERT(ctx->Driver.SetBuffer);
- if ( (*ctx->Driver.SetBuffer)(ctx, ctx->Color.DriverDrawBuffer) ) {
+ ASSERT(ctx->Driver.SetDrawBuffer);
+ if ( (*ctx->Driver.SetDrawBuffer)(ctx, ctx->Color.DriverDrawBuffer) ) {
/* All OK, the driver will do all buffer writes */
ctx->Color.MultiDrawBuffer = GL_FALSE;
}
@@ -530,7 +619,7 @@ void gl_DrawBuffer( GLcontext *ctx, GLenum mode )
/* We'll have to loop over the multiple draw buffer targets */
ctx->Color.MultiDrawBuffer = GL_TRUE;
/* Set drawing buffer to front for now */
- (*ctx->Driver.SetBuffer)(ctx, GL_FRONT_LEFT);
+ (void) (*ctx->Driver.SetDrawBuffer)(ctx, GL_FRONT_LEFT);
}
ctx->Color.DrawBuffer = mode;
@@ -539,8 +628,10 @@ void gl_DrawBuffer( GLcontext *ctx, GLenum mode )
-void gl_ReadBuffer( GLcontext *ctx, GLenum mode )
+void
+_mesa_ReadBuffer( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glReadBuffer");
if (MESA_VERBOSE & VERBOSE_API)
diff --git a/xc/extras/Mesa/src/glmisc.h b/xc/extras/Mesa/src/glmisc.h
index ef57f3c20..a00203b35 100644
--- a/xc/extras/Mesa/src/glmisc.h
+++ b/xc/extras/Mesa/src/glmisc.h
@@ -1,10 +1,10 @@
-/* $Id: glmisc.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: glmisc.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,8 +25,6 @@
*/
-/* $XFree86: xc/lib/GL/mesa/src/glmisc.h,v 1.1 1999/03/14 03:20:45 dawes Exp $ */
-
#ifndef GLMISC_H
#define GLMISC_H
@@ -34,22 +32,36 @@
#include "types.h"
-extern void gl_ClearIndex( GLcontext *ctx, GLfloat c );
+extern void
+_mesa_ClearIndex( GLfloat c );
+
+extern void
+_mesa_ClearColor( GLclampf red, GLclampf green,
+ GLclampf blue, GLclampf alpha );
+
+extern void
+_mesa_Clear( GLbitfield mask );
-extern void gl_ClearColor( GLcontext *ctx, GLclampf red, GLclampf green,
- GLclampf blue, GLclampf alpha );
+extern void
+_mesa_Finish( void );
-extern void gl_Clear( GLcontext *ctx, GLbitfield mask );
+extern void
+_mesa_Flush( void );
-extern void gl_Finish( GLcontext *ctx );
+extern GLboolean
+_mesa_try_Hint( GLcontext *ctx, GLenum target, GLenum mode );
-extern void gl_Flush( GLcontext *ctx );
+extern void
+_mesa_Hint( GLenum target, GLenum mode );
-extern GLboolean gl_Hint( GLcontext *ctx, GLenum target, GLenum mode );
+extern void
+_mesa_HintPGI( GLenum target, GLint mode );
-extern void gl_DrawBuffer( GLcontext *ctx, GLenum mode );
+extern void
+_mesa_DrawBuffer( GLenum mode );
-extern void gl_ReadBuffer( GLcontext *ctx, GLenum mode );
+extern void
+_mesa_ReadBuffer( GLenum mode );
#endif
diff --git a/xc/extras/Mesa/src/glthread.c b/xc/extras/Mesa/src/glthread.c
new file mode 100644
index 000000000..ade862e5c
--- /dev/null
+++ b/xc/extras/Mesa/src/glthread.c
@@ -0,0 +1,246 @@
+/* $Id: glthread.c,v 1.2 2000/01/30 00:27:02 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999-2000 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+/*
+ * Thread support for gl dispatch.
+ *
+ * Initial version by John Stone (j.stone@acm.org) (johns@cs.umr.edu)
+ * and Christoph Poliwoda (poliwoda@volumegraphics.com)
+ *
+ * Revised by Keith Whitwell
+ * Adapted for new gl dispatcher by Brian Paul
+ *
+ * XXX There's probably some work to do in order to make this file
+ * truly reusable outside of Mesa. First, the glheader.h include must go.
+ */
+
+
+#ifdef PC_ALL
+#include "all.h"
+#else
+#include "glheader.h"
+#endif
+
+
+
+/*
+ * This file should still compile even when THREADS is not defined.
+ * This is to make things easier to deal with on the makefile scene..
+ */
+#ifdef THREADS
+#include <errno.h>
+#include "glthread.h"
+
+
+/*
+ * Error messages
+ */
+#define INIT_TSD_ERROR "_glthread_: failed to allocate key for thread specific data"
+#define GET_TSD_ERROR "_glthread_: failed to get thread specific data"
+#define SET_TSD_ERROR "_glthread_: thread failed to set thread specific data"
+
+
+/*
+ * magic number for win32 and solaris threads equivalents of pthread_once
+ * This could probably be done better, but we haven't figured out how yet.
+ */
+#define INITFUNC_CALLED_MAGIC 0xff8adc98
+
+
+
+/*
+ * POSIX Threads -- The best way to go if your platform supports them.
+ * Solaris >= 2.5 have POSIX threads, IRIX >= 6.4 reportedly
+ * has them, and many of the free Unixes now have them.
+ * Be sure to use appropriate -mt or -D_REENTRANT type
+ * compile flags when building.
+ */
+#ifdef PTHREADS
+
+unsigned long
+_glthread_GetID(void)
+{
+ return (unsigned long) pthread_self();
+}
+
+
+void
+_glthread_InitTSD(_glthread_TSD *tsd)
+{
+ if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
+ perror(INIT_TSD_ERROR);
+ exit(-1);
+ }
+}
+
+
+void *
+_glthread_GetTSD(_glthread_TSD *tsd)
+{
+ return pthread_getspecific(tsd->key);
+}
+
+
+void
+_glthread_SetTSD(_glthread_TSD *tsd, void *ptr, void (*initfunc)(void))
+{
+ pthread_once(&tsd->once, initfunc);
+ if (pthread_setspecific(tsd->key, ptr) != 0) {
+ perror(SET_TSD_ERROR);
+ exit(-1);
+ }
+}
+
+#endif /* PTHREADS */
+
+
+
+/*
+ * Solaris/Unix International Threads -- Use only if POSIX threads
+ * aren't available on your Unix platform. Solaris 2.[34] are examples
+ * of platforms where this is the case. Be sure to use -mt and/or
+ * -D_REENTRANT when compiling.
+ */
+#ifdef SOLARIS_THREADS
+#define USE_LOCK_FOR_KEY /* undef this to try a version without
+ lock for the global key... */
+
+unsigned long
+_glthread_GetID(void)
+{
+ abort(); /* XXX not implemented yet */
+ return (unsigned long) 0;
+}
+
+
+void
+_glthread_InitTSD(_glthread_TSD *tsd)
+{
+ if ((errno = mutex_init(&tsd->keylock, 0, NULL)) != 0 ||
+ (errno = thr_keycreate(&(tsd->key), free)) != 0) {
+ perror(INIT_TSD_ERROR);
+ exit(-1);
+ }
+}
+
+
+void *
+_glthread_GetTSD(_glthread_TSD *tsd)
+{
+ void* ret;
+#ifdef USE_LOCK_FOR_KEY
+ mutex_lock(&tsd->keylock);
+ thr_getspecific(tsd->key, &ret);
+ mutex_unlock(&tsd->keylock);
+#else
+ if ((errno = thr_getspecific(tsd->key, &ret)) != 0) {
+ perror(GET_TSD_ERROR);
+ exit(-1);
+ }
+#endif
+ return ret;
+}
+
+
+void
+_glthread_SetTSD(_glthread_TSD *tsd, void *ptr, void (*initfunc)(void))
+{
+ /* the following code assumes that the _glthread_TSD has been initialized
+ to zero at creation */
+ fprintf(stderr, "initfuncCalled = %d\n", tsd->initfuncCalled);
+ if (tsd->initfuncCalled != INITFUNC_CALLED_MAGIC) {
+ initfunc();
+ tsd->initfuncCalled = INITFUNC_CALLED_MAGIC;
+ }
+ if ((errno = thr_setspecific(tsd->key, ptr)) != 0) {
+ perror(SET_TSD_ERROR);
+ exit(-1);
+ }
+}
+
+#undef USE_LOCK_FOR_KEY
+#endif /* SOLARIS_THREADS */
+
+
+
+/*
+ * Win32 Threads. The only available option for Windows 95/NT.
+ * Be sure that you compile using the Multithreaded runtime, otherwise
+ * bad things will happen.
+ */
+#ifdef WIN32
+
+unsigned long
+_glthread_GetID(void)
+{
+ abort(); /* XXX not implemented yet */
+ return (unsigned long) 0;
+}
+
+
+void
+_glthread_InitTSD(_glthread_TSD *tsd)
+{
+ tsd->key = TlsAlloc();
+ if (tsd->key == 0xffffffff) {
+ /* Can Windows handle stderr messages for non-console
+ applications? Does Windows have perror? */
+ /* perror(SET_INIT_ERROR);*/
+ exit(-1);
+ }
+}
+
+
+void *
+_glthread_GetTSD(_glthread_TSD *tsd)
+{
+ return TlsGetValue(tsd->key);
+}
+
+
+void
+_glthread_SetTSD(_glthread_TSD *tsd, void *ptr, void (*initfunc)(void))
+{
+ /* the following code assumes that the _glthread_TSD has been initialized
+ to zero at creation */
+ if (tsd->initfuncCalled != INITFUNC_CALLED_MAGIC) {
+ initfunc();
+ tsd->initfuncCalled = INITFUNC_CALLED_MAGIC;
+ }
+ if (TlsSetValue(tsd->key, ptr) == 0) {
+ /* Can Windows handle stderr messages for non-console
+ applications? Does Windows have perror? */
+ /* perror(SET_TSD_ERROR);*/
+ exit(-1);
+ }
+}
+
+#endif /* WIN32 */
+
+#endif /* THREADS */
+
+
diff --git a/xc/extras/Mesa/src/glthread.h b/xc/extras/Mesa/src/glthread.h
new file mode 100644
index 000000000..9b35ff6c3
--- /dev/null
+++ b/xc/extras/Mesa/src/glthread.h
@@ -0,0 +1,145 @@
+/* $Id: glthread.h,v 1.2 2000/01/30 00:27:02 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+/*
+ * Thread support for gl dispatch.
+ *
+ * Initial version by John Stone (j.stone@acm.org) (johns@cs.umr.edu)
+ * and Christoph Poliwoda (poliwoda@volumegraphics.com)
+ * Revised by Keith Whitwell
+ * Adapted for new gl dispatcher by Brian Paul
+ */
+
+
+
+/*
+ * If this file is accidentally included by a non-threaded build,
+ * it should not cause the build to fail, or otherwise cause problems.
+ * In general, it should only be included when needed however.
+ */
+#ifdef THREADS
+/*
+ * It is an error not to select a specific threads API when compiling.
+ */
+#if !defined(PTHREADS) && !defined(SOLARIS_THREADS) && !defined(WIN32)
+#error One of PTHREADS, SOLARIS_THREADS or WIN32 must be defined.
+#endif
+
+
+
+/*
+ * POSIX threads. This should be your choice in the Unix world
+ * whenever possible. When building with POSIX threads, be sure
+ * to enable any compiler flags which will cause the MT-safe
+ * libc (if one exists) to be used when linking, as well as any
+ * header macros for MT-safe errno, etc. For Solaris, this is the -mt
+ * compiler flag. On Solaris with gcc, use -D_REENTRANT to enable
+ * proper compiling for MT-safe libc etc.
+ */
+#ifdef PTHREADS
+#include <pthread.h> /* POSIX threads headers */
+
+typedef struct {
+ pthread_key_t key;
+ pthread_once_t once;
+} _glthread_TSD;
+
+typedef pthread_mutex_t _glthread_Mutex;
+typedef pthread_t _glthread_Thread;
+
+#endif /* PTHREADS */
+
+
+
+
+/*
+ * Solaris threads. Use only up to Solaris 2.4.
+ * Solaris 2.5 and higher provide POSIX threads.
+ * Be sure to compile with -mt on the Solaris compilers, or
+ * use -D_REENTRANT if using gcc.
+ */
+#ifdef SOLARIS_THREADS
+#include <thread.h>
+
+typedef struct {
+ thread_key_t key;
+ mutex_t keylock;
+ int initfuncCalled;
+} _glthread_TSD;
+
+typedef mutex_t _glthread_Mutex;
+typedef thread_t _glthread_Thread;
+
+#endif /* SOLARIS_THREADS */
+
+
+
+
+/*
+ * Windows threads. Should work with Windows NT and 95.
+ * IMPORTANT: Link with multithreaded runtime library when THREADS are
+ * used!
+ */
+
+#ifdef WIN32
+#include <windows.h>
+
+typedef struct {
+ DWORD key;
+ int initfuncCalled;
+} _glthread_TSD;
+
+typedef CRITICAL_SECTION _glthread_Mutex;
+typedef HANDLE _glthread_Thread;
+
+#endif /* WIN32 */
+
+
+
+
+/*
+ * Platform independent thread specific data API.
+ */
+
+extern unsigned long
+_glthread_GetID(void);
+
+
+extern void
+_glthread_InitTSD(_glthread_TSD *);
+
+
+extern void *
+_glthread_GetTSD(_glthread_TSD *);
+
+
+extern void
+_glthread_SetTSD(_glthread_TSD *, void *, void (*initfunc)(void));
+
+
+
+#endif
diff --git a/xc/extras/Mesa/src/hash.c b/xc/extras/Mesa/src/hash.c
index 99f52dbc6..a7b2b6b45 100644
--- a/xc/extras/Mesa/src/hash.c
+++ b/xc/extras/Mesa/src/hash.c
@@ -1,10 +1,10 @@
-/* $Id: hash.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: hash.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,24 +25,17 @@
*/
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "hash.h"
-#include "macros.h"
+#include "mem.h"
#endif
/*
- * Generic hash table. Only dependency is the GLuint datatype.
+ * Generic hash table.
*
* This is used to implement display list and texture object lookup.
* NOTE: key=0 is illegal.
@@ -57,7 +50,7 @@ struct HashEntry {
struct HashEntry *Next;
};
-struct HashTable {
+struct _mesa_HashTable {
struct HashEntry *Table[TABLE_SIZE];
GLuint MaxKey;
};
@@ -67,9 +60,9 @@ struct HashTable {
/*
* Return pointer to a new, empty hash table.
*/
-struct HashTable *NewHashTable(void)
+struct _mesa_HashTable *_mesa_NewHashTable(void)
{
- return CALLOC_STRUCT(HashTable);
+ return CALLOC_STRUCT(_mesa_HashTable);
}
@@ -77,7 +70,7 @@ struct HashTable *NewHashTable(void)
/*
* Delete a hash table.
*/
-void DeleteHashTable(struct HashTable *table)
+void _mesa_DeleteHashTable(struct _mesa_HashTable *table)
{
GLuint i;
assert(table);
@@ -100,7 +93,7 @@ void DeleteHashTable(struct HashTable *table)
* key - the key
* Return: user data pointer or NULL if key not in table
*/
-void *HashLookup(const struct HashTable *table, GLuint key)
+void *_mesa_HashLookup(const struct _mesa_HashTable *table, GLuint key)
{
GLuint pos;
const struct HashEntry *entry;
@@ -128,7 +121,7 @@ void *HashLookup(const struct HashTable *table, GLuint key)
* key - the key (not zero)
* data - pointer to user data
*/
-void HashInsert(struct HashTable *table, GLuint key, void *data)
+void _mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data)
{
/* search for existing entry with this key */
GLuint pos;
@@ -166,7 +159,7 @@ void HashInsert(struct HashTable *table, GLuint key, void *data)
* Input: table - the hash table
* key - key of entry to remove
*/
-void HashRemove(struct HashTable *table, GLuint key)
+void _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key)
{
GLuint pos;
struct HashEntry *entry, *prev;
@@ -201,7 +194,7 @@ void HashRemove(struct HashTable *table, GLuint key)
* By calling this function until zero is returned we can get
* the keys of all entries in the table.
*/
-GLuint HashFirstEntry(const struct HashTable *table)
+GLuint _mesa_HashFirstEntry(const struct _mesa_HashTable *table)
{
GLuint pos;
assert(table);
@@ -217,7 +210,7 @@ GLuint HashFirstEntry(const struct HashTable *table)
/*
* Dump contents of hash table for debugging.
*/
-void HashPrint(const struct HashTable *table)
+void _mesa_HashPrint(const struct _mesa_HashTable *table)
{
GLuint i;
assert(table);
@@ -236,9 +229,9 @@ void HashPrint(const struct HashTable *table)
* Find a block of 'numKeys' adjacent unused hash keys.
* Input: table - the hash table
* numKeys - number of keys needed
- * Return: startint key of free block or 0 if failure
+ * Return: starting key of free block or 0 if failure
*/
-GLuint HashFindFreeKeyBlock(const struct HashTable *table, GLuint numKeys)
+GLuint _mesa_HashFindFreeKeyBlock(const struct _mesa_HashTable *table, GLuint numKeys)
{
GLuint maxKey = ~((GLuint) 0);
if (maxKey - numKeys > table->MaxKey) {
@@ -248,10 +241,10 @@ GLuint HashFindFreeKeyBlock(const struct HashTable *table, GLuint numKeys)
else {
/* the slow solution */
GLuint freeCount = 0;
- GLuint freeStart = 0;
+ GLuint freeStart = 1;
GLuint key;
- for (key=0; key!=maxKey; key++) {
- if (HashLookup(table, key)) {
+ for (key=1; key!=maxKey; key++) {
+ if (_mesa_HashLookup(table, key)) {
/* darn, this key is already in use */
freeCount = 0;
freeStart = key+1;
@@ -280,15 +273,15 @@ int main(int argc, char *argv[])
printf("&a = %p\n", &a);
printf("&b = %p\n", &b);
- t = NewHashTable();
- HashInsert(t, 501, &a);
- HashInsert(t, 10, &c);
- HashInsert(t, 0xfffffff8, &b);
- HashPrint(t);
- printf("Find 501: %p\n", HashLookup(t,501));
- printf("Find 1313: %p\n", HashLookup(t,1313));
- printf("Find block of 100: %d\n", HashFindFreeKeyBlock(t, 100));
- DeleteHashTable(t);
+ t = _mesa_NewHashTable();
+ _mesa_HashInsert(t, 501, &a);
+ _mesa_HashInsert(t, 10, &c);
+ _mesa_HashInsert(t, 0xfffffff8, &b);
+ _mesa_HashPrint(t);
+ printf("Find 501: %p\n", _mesa_HashLookup(t,501));
+ printf("Find 1313: %p\n", _mesa_HashLookup(t,1313));
+ printf("Find block of 100: %d\n", _mesa_HashFindFreeKeyBlock(t, 100));
+ _mesa_DeleteHashTable(t);
return 0;
}
diff --git a/xc/extras/Mesa/src/hash.h b/xc/extras/Mesa/src/hash.h
index de1ad408d..d4094d0e9 100644
--- a/xc/extras/Mesa/src/hash.h
+++ b/xc/extras/Mesa/src/hash.h
@@ -1,10 +1,10 @@
-/* $Id: hash.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: hash.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,35 +25,32 @@
*/
-
-
-
#ifndef HASH_H
#define HASH_H
-#include "GL/gl.h"
+#include "glheader.h"
struct HashTable;
-extern struct HashTable *NewHashTable(void);
+extern struct _mesa_HashTable *_mesa_NewHashTable(void);
-extern void DeleteHashTable(struct HashTable *table);
+extern void _mesa_DeleteHashTable(struct _mesa_HashTable *table);
-extern void *HashLookup(const struct HashTable *table, GLuint key);
+extern void *_mesa_HashLookup(const struct _mesa_HashTable *table, GLuint key);
-extern void HashInsert(struct HashTable *table, GLuint key, void *data);
+extern void _mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data);
-extern void HashRemove(struct HashTable *table, GLuint key);
+extern void _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key);
-extern GLuint HashFirstEntry(const struct HashTable *table);
+extern GLuint _mesa_HashFirstEntry(const struct _mesa_HashTable *table);
-extern void HashPrint(const struct HashTable *table);
+extern void _mesa_HashPrint(const struct _mesa_HashTable *table);
-extern GLuint HashFindFreeKeyBlock(const struct HashTable *table, GLuint numKeys);
+extern GLuint _mesa_HashFindFreeKeyBlock(const struct _mesa_HashTable *table, GLuint numKeys);
#endif
diff --git a/xc/extras/Mesa/src/highpc.c b/xc/extras/Mesa/src/highpc.c
index e856847dc..813d2d346 100644
--- a/xc/extras/Mesa/src/highpc.c
+++ b/xc/extras/Mesa/src/highpc.c
@@ -1,4 +1,4 @@
-/* $Id: highpc.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: highpc.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,13 +24,13 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifndef XFree86Server
-#include <stdio.h>
-#include <stdlib.h>
+
+#ifdef PC_HEADER
+#include "all.h"
#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "types.h" /* for MESA_VERBOSE */
+#endif
/*
diff --git a/xc/extras/Mesa/src/image.c b/xc/extras/Mesa/src/image.c
index b6e3198c8..6d8122e36 100644
--- a/xc/extras/Mesa/src/image.c
+++ b/xc/extras/Mesa/src/image.c
@@ -1,10 +1,10 @@
-/* $Id: image.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: image.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,20 +25,14 @@
*/
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "image.h"
#include "macros.h"
+#include "mem.h"
#include "mmath.h"
#include "pixel.h"
#include "types.h"
@@ -47,6 +41,26 @@
/*
+ * These are the image packing parameters for Mesa's internal images.
+ * That is, _mesa_unpack_image() returns image data in this format.
+ * When we execute image commands (glDrawPixels, glTexImage, etc)
+ * from within display lists we have to be sure to set the current
+ * unpacking params to these values!
+ */
+struct gl_pixelstore_attrib _mesa_native_packing = {
+ 1, /* Alignment */
+ 0, /* RowLength */
+ 0, /* SkipPixels */
+ 0, /* SkipRows */
+ 0, /* ImageHeight */
+ 0, /* SkipImages */
+ GL_FALSE, /* SwapBytes */
+ GL_FALSE /* LsbFirst */
+};
+
+
+
+/*
* Flip the 8 bits in each byte of the given array.
*/
void gl_flip_bytes( GLubyte *p, GLuint n )
@@ -207,7 +221,6 @@ GLint gl_components_in_format( GLenum format )
case GL_BLUE:
case GL_ALPHA:
case GL_LUMINANCE:
- case GL_INTENSITY:
return 1;
case GL_LUMINANCE_ALPHA:
return 2;
@@ -477,441 +490,6 @@ GLvoid *gl_pixel_addr_in_image( const struct gl_pixelstore_attrib *packing,
/*
- * Allocate a new gl_image. All fields are initialized to zero.
- */
-static struct gl_image *alloc_image( void )
-{
- return CALLOC_STRUCT(gl_image);
-}
-
-
-
-/*
- * Allocate a new gl_image with the error flag set.
- */
-static struct gl_image *alloc_error_image( GLint width, GLint height,
- GLint depth, GLenum format,
- GLenum type )
-{
- struct gl_image *image = alloc_image();
- if (image) {
- image->Width = width;
- image->Height = height;
- image->Depth = depth;
- image->Format = format;
- image->Type = type;
- image->ErrorFlag = GL_TRUE;
- }
- return image;
-}
-
-
-
-/*
- * Free a gl_image.
- */
-void gl_free_image( struct gl_image *image )
-{
- if (image->Data) {
- FREE(image->Data);
- }
- FREE(image);
-}
-
-
-
-/*
- * Do error checking on an image. If there's an error, register it and
- * return GL_TRUE, else return GL_FALSE.
- */
-GLboolean gl_image_error_test( GLcontext *ctx, const struct gl_image *image,
- const char *msg )
-{
- if (!image) {
- gl_error( ctx, GL_OUT_OF_MEMORY, msg );
- return GL_TRUE;
- }
- if (image->Width <= 0 || image->Height <= 0 || image->Depth <= 0) {
- gl_error( ctx, GL_INVALID_VALUE, msg );
- return GL_TRUE;
- }
- else if (!gl_is_legal_format_and_type(image->Format, image->Type)) {
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
-}
-
-
-
-/*
- * Unpack a depth-buffer image storing values as GLshort, GLuint, or GLfloats.
- * Input: type - datatype of src depth image
- * Return pointer to a new gl_image structure.
- *
- * Notes: if the source image type is GLushort then the gl_image will
- * also store GLushorts. If the src image type is GLuint then the gl_image
- * will also store GLuints. For all other src image types the gl_image
- * will store GLfloats. The integer cases can later be optimized.
- */
-static struct gl_image *
-unpack_depth_image( GLcontext *ctx, GLenum type, GLint width, GLint height,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing)
-
-{
- struct gl_image *image;
- GLfloat *fDst;
- GLushort *sDst;
- GLuint *iDst;
- GLint i, j;
- GLboolean errorType;
-
- errorType = type != GL_BYTE &&
- type != GL_UNSIGNED_BYTE &&
- type != GL_SHORT &&
- type != GL_UNSIGNED_SHORT &&
- type != GL_INT &&
- type != GL_UNSIGNED_INT &&
- type != GL_FLOAT;
-
- image = alloc_image();
- if (image) {
- image->Width = width;
- image->Height = height;
- image->Depth = 1;
- image->Components = 1;
- image->Format = GL_DEPTH_COMPONENT;
- if (errorType) {
- image->Type = type;
- image->Data = NULL;
- }
- if (type==GL_UNSIGNED_SHORT) {
- image->Type = GL_UNSIGNED_SHORT;
- image->Data = MALLOC( width * height * sizeof(GLushort));
- }
- else if (type==GL_UNSIGNED_INT) {
- image->Type = GL_UNSIGNED_INT;
- image->Data = MALLOC( width * height * sizeof(GLuint));
- }
- else {
- image->Type = GL_FLOAT;
- image->Data = MALLOC( width * height * sizeof(GLfloat));
- }
- image->RefCount = 0;
- if (!image->Data)
- return image;
- }
- else {
- return NULL;
- }
-
- if (errorType)
- return image;
-
- fDst = (GLfloat *) image->Data;
- sDst = (GLushort *) image->Data;
- iDst = (GLuint *) image->Data;
-
- for (i=0;i<height;i++) {
- GLvoid *src = gl_pixel_addr_in_image( packing, pixels,
- width, height,
- GL_DEPTH_COMPONENT, type,
- 0, i, 0 );
- if (!src) {
- return image;
- }
-
- switch (type) {
- case GL_BYTE:
- assert(image->Type == GL_FLOAT);
- for (j=0; j<width; j++) {
- *fDst++ = BYTE_TO_FLOAT(((GLbyte*)src)[j]);
- }
- break;
- case GL_UNSIGNED_BYTE:
- assert(image->Type == GL_FLOAT);
- for (j=0; j<width; j++) {
- *fDst++ = UBYTE_TO_FLOAT(((GLubyte*)src)[j]);
- }
- break;
- case GL_UNSIGNED_SHORT:
- assert(image->Type == GL_UNSIGNED_SHORT);
- MEMCPY( sDst, src, width * sizeof(GLushort) );
- if (packing->SwapBytes) {
- gl_swap2( sDst, width );
- }
- sDst += width;
- break;
- case GL_SHORT:
- assert(image->Type == GL_FLOAT);
- if (packing->SwapBytes) {
- for (j=0;j<width;j++) {
- GLshort value = ((GLshort*)src)[j];
- value = ((value >> 8) & 0xff) | ((value&0xff) << 8);
- *fDst++ = SHORT_TO_FLOAT(value);
- }
- }
- else {
- for (j=0;j<width;j++) {
- *fDst++ = SHORT_TO_FLOAT(((GLshort*)src)[j]);
- }
- }
- break;
- case GL_INT:
- assert(image->Type == GL_FLOAT);
- if (packing->SwapBytes) {
- for (j=0;j<width;j++) {
- GLint value = ((GLint*)src)[j];
- value = ((value >> 24) & 0x000000ff) |
- ((value >> 8) & 0x0000ff00) |
- ((value << 8) & 0x00ff0000) |
- ((value << 24) & 0xff000000);
- *fDst++ = INT_TO_FLOAT(value);
- }
- }
- else {
- for (j=0;j<width;j++) {
- *fDst++ = INT_TO_FLOAT(((GLint*)src)[j]);
- }
- }
- iDst += width;
- break;
- case GL_UNSIGNED_INT:
- assert(image->Type == GL_UNSIGNED_INT);
- MEMCPY( iDst, src, width * sizeof(GLuint) );
- if (packing->SwapBytes) {
- gl_swap4( iDst, width );
- }
- iDst += width;
- break;
- case GL_FLOAT:
- assert(image->Type == GL_FLOAT);
- MEMCPY( fDst, src, width * sizeof(GLfloat) );
- if (packing->SwapBytes) {
- gl_swap4( (GLuint*) fDst, width );
- }
- fDst += width;
- break;
- default:
- gl_problem(ctx, "unpack_depth_image type" );
- return image;
- }
- }
-
- return image;
-}
-
-
-
-/*
- * Unpack a stencil image. Store as GLubytes in a gl_image structure.
- * Return: pointer to new gl_image structure.
- */
-static struct gl_image *
-unpack_stencil_image( GLcontext *ctx, GLenum type, GLint width, GLint height,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing )
-{
- struct gl_image *image;
- GLubyte *dst;
- GLint i, j;
- GLboolean errorType;
-
- assert(sizeof(GLstencil) == sizeof(GLubyte));
-
- errorType = type != GL_BYTE &&
- type != GL_UNSIGNED_BYTE &&
- type != GL_SHORT &&
- type != GL_UNSIGNED_SHORT &&
- type != GL_INT &&
- type != GL_UNSIGNED_INT &&
- type != GL_FLOAT &&
- type != GL_BITMAP;
-
- image = alloc_image();
- if (image) {
- image->Width = width;
- image->Height = height;
- image->Depth = 1;
- image->Components = 1;
- image->Format = GL_STENCIL_INDEX;
- if (errorType) {
- image->Type = type;
- image->Data = NULL;
- }
- else {
- image->Type = GL_UNSIGNED_BYTE;
- image->Data = MALLOC( width * height * sizeof(GLubyte));
- }
- image->RefCount = 0;
- if (!image->Data)
- return image;
- }
- else {
- return NULL;
- }
-
- if (errorType)
- return image; /* error will be generated later */
-
- dst = (GLubyte *) image->Data;
-
- for (i=0;i<height;i++) {
- GLvoid *src = gl_pixel_addr_in_image( packing, pixels,
- width, height,
- GL_STENCIL_INDEX, type,
- 0, i, 0 );
- if (!src) {
- return image;
- }
-
- switch (type) {
- case GL_UNSIGNED_BYTE:
- case GL_BYTE:
- MEMCPY( dst, src, width * sizeof(GLubyte) );
- dst += width * sizeof(GLubyte);
- break;
- case GL_UNSIGNED_SHORT:
- case GL_SHORT:
- if (packing->SwapBytes) {
- /* grab upper byte */
- for (j=0; j < width; j++) {
- *dst++ = (((GLushort*)src)[j] & 0xff00) >> 8;
- }
- }
- else {
- for (j=0; j < width; j++) {
- *dst++ = (((GLushort*)src)[j]) & 0xff;
- }
- }
- break;
- case GL_INT:
- if (packing->SwapBytes) {
- /* grab upper byte */
- for (j=0; j < width; j++) {
- *dst++ = (((GLuint*)src)[j] & 0xff000000) >> 8;
- }
- }
- else {
- for (j=0; j < width; j++) {
- *dst++ = (((GLuint*)src)[j]) & 0xff;
- }
- }
- break;
- case GL_UNSIGNED_INT:
- if (packing->SwapBytes) {
- /* grab upper byte */
- for (j=0; j < width; j++) {
- *dst++ = (((GLuint*)src)[j] & 0xff000000) >> 8;
- }
- }
- else {
- for (j=0; j < width; j++) {
- *dst++ = (((GLuint*)src)[j]) & 0xff;
- }
- }
- break;
- case GL_FLOAT:
- if (packing->SwapBytes) {
- for (j=0; j < width; j++) {
- GLfloat fvalue;
- GLint value = ((GLuint*)src)[j];
- value = ((value & 0xff000000) >> 24)
- | ((value & 0x00ff0000) >> 8)
- | ((value & 0x0000ff00) << 8)
- | ((value & 0x000000ff) << 24);
- fvalue = *((GLfloat*) &value);
- *dst++ = ((GLint) fvalue) & 0xff;
- }
- }
- else {
- for (j=0; j < width; j++) {
- GLfloat fvalue = ((GLfloat *)src)[j];
- *dst++ = ((GLint) fvalue) & 0xff;
- }
- }
- break;
- default:
- gl_problem(ctx, "unpack_stencil_image type" );
- return image;
- }
- }
-
- return image;
-}
-
-
-
-/*
- * Unpack a bitmap, return a new gl_image struct.
- */
-static struct gl_image *
-unpack_bitmap( GLenum format, GLint width, GLint height,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing )
-{
- struct gl_image *image;
- GLint bytes, i, width_in_bytes;
- GLubyte *buffer, *dst;
-
- assert(format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX);
-
- /* Alloc dest storage */
- bytes = ((width+7)/8 * height);
- if (bytes>0 && pixels!=NULL) {
- buffer = (GLubyte *) MALLOC( bytes );
- if (!buffer) {
- return NULL;
- }
- /* Copy/unpack pixel data to buffer */
- width_in_bytes = CEILING( width, 8 );
- dst = buffer;
- for (i=0; i<height; i++) {
- GLvoid *src = gl_pixel_addr_in_image( packing, pixels,
- width, height,
- GL_COLOR_INDEX, GL_BITMAP,
- 0, i, 0 );
- if (!src) {
- FREE(buffer);
- return NULL;
- }
- MEMCPY( dst, src, width_in_bytes );
- dst += width_in_bytes;
- }
- /* Bit flipping */
- if (packing->LsbFirst) {
- gl_flip_bytes( buffer, bytes );
- }
- }
- else {
- /* a 'null' bitmap */
- buffer = NULL;
- }
-
- image = alloc_image();
- if (image) {
- image->Width = width;
- image->Height = height;
- image->Depth = 1;
- image->Components = 0;
- image->Format = format;
- image->Type = GL_BITMAP;
- image->Data = buffer;
- image->RefCount = 0;
- }
- else {
- FREE( buffer );
- return NULL;
- }
-
- return image;
-}
-
-
-
-/*
* Unpack a 32x32 pixel polygon stipple from user memory using the
* current pixel unpack settings.
*/
@@ -963,701 +541,6 @@ void gl_pack_polygon_stipple( const GLcontext *ctx,
/*
- * Unpack an RGBA or CI image and store it as unsigned bytes
- */
-static struct gl_image *
-unpack_ubyte_image( GLint width, GLint height,
- GLint depth, GLenum format, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing )
-{
- struct gl_image *image;
- GLint width_in_bytes;
- GLint components;
- GLubyte *buffer, *dst;
- GLint i, d;
-
- components = gl_components_in_format( format );
-
- width_in_bytes = width * components * sizeof(GLubyte);
- buffer = (GLubyte *) MALLOC( height * width_in_bytes * depth );
- if (!buffer) {
- return NULL;
- }
-
- /* Copy/unpack pixel data to buffer */
- dst = buffer;
- for (d=0; d<depth; d++ ) {
- for (i=0;i<height;i++) {
- GLubyte *src = (GLubyte *) gl_pixel_addr_in_image( packing,
- pixels, width, height, format, GL_UNSIGNED_BYTE,
- d, i, 0 );
- if (!src) {
- FREE(buffer);
- return NULL;
- }
- MEMCPY( dst, src, width_in_bytes );
- dst += width_in_bytes;
- }
- }
-
- if (format == GL_BGR) {
- /* swap order of every ubyte triplet from BGR to RGB */
- for (i=0; i<width*height; i++) {
- GLubyte b = buffer[i*3+0];
- GLubyte r = buffer[i*3+2];
- buffer[i*3+0] = r;
- buffer[i*3+2] = b;
- }
- }
- else if (format == GL_BGRA) {
- /* swap order of every ubyte quadruplet from BGRA to RGBA */
- for (i=0; i<width*height; i++) {
- GLubyte b = buffer[i*4+0];
- GLubyte r = buffer[i*4+2];
- buffer[i*4+0] = r;
- buffer[i*4+2] = b;
- }
- }
- else if (format == GL_ABGR_EXT) {
- /* swap order of every ubyte quadruplet from ABGR to RGBA */
- for (i=0; i<width*height; i++) {
- GLubyte a = buffer[i*4+0];
- GLubyte b = buffer[i*4+1];
- GLubyte g = buffer[i*4+2];
- GLubyte r = buffer[i*4+3];
- buffer[i*4+0] = r;
- buffer[i*4+1] = g;
- buffer[i*4+2] = b;
- buffer[i*4+3] = a;
- }
- }
-
-
- image = alloc_image();
- if (image) {
- image->Width = width;
- image->Height = height;
- image->Depth = depth;
- image->Components = components;
- if (format == GL_BGR)
- image->Format = GL_RGB;
- else if (format == GL_BGRA)
- image->Format = GL_RGBA;
- else if (format == GL_ABGR_EXT)
- image->Format = GL_RGBA;
- else
- image->Format = format;
- image->Type = GL_UNSIGNED_BYTE;
- image->Data = buffer;
- image->RefCount = 0;
- }
- else {
- FREE( buffer );
- }
-
- return image;
-}
-
-
-
-/*
- * Unpack a color image storing image as GLfloats
- */
-static struct gl_image *
-unpack_float_image( GLcontext *ctx, GLint width, GLint height, GLint depth,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing )
-{
- struct gl_image *image;
- GLfloat *dst;
- GLint elems_per_row;
- GLint components;
- GLint i, j, d;
- GLboolean normalize;
-
- assert(type != GL_BITMAP);
-
- components = gl_components_in_format( format );
- assert(components > 0); /* should have been caught earlier */
-
- if (!gl_is_legal_format_and_type( format, type )) {
- /* bad pixel type for format, make dummy image */
- image = alloc_image();
- if (image) {
- image->Width = width;
- image->Height = height;
- image->Depth = depth;
- image->Components = components;
- image->Format = format;
- image->Type = type;
- image->Data = NULL;
- image->RefCount = 0;
- }
- return image;
- }
-
- elems_per_row = width * components;
-
- image = alloc_image();
- if (image) {
- image->Width = width;
- image->Height = height;
- image->Depth = depth;
- image->Components = components;
- if (format == GL_BGR)
- image->Format = GL_RGB;
- else if (format == GL_BGRA)
- image->Format = GL_RGBA;
- else if (format == GL_ABGR_EXT)
- image->Format = GL_RGBA;
- else
- image->Format = format;
- image->Type = GL_FLOAT;
- image->Data = MALLOC( elems_per_row * height * depth * sizeof(GLfloat));
- image->RefCount = 0;
- if (!image->Data)
- return image;
- }
- else {
- return NULL;
- }
-
- normalize = (format != GL_COLOR_INDEX) && (format != GL_STENCIL_INDEX);
-
- dst = (GLfloat *) image->Data;
-
- for (d=0; d<depth; d++) {
- for (i=0;i<height;i++) {
- GLvoid *src = gl_pixel_addr_in_image( packing, pixels,
- width, height,
- format, type,
- d, i, 0 );
- if (!src) {
- return image;
- }
-
- switch (type) {
- case GL_UNSIGNED_BYTE:
- {
- GLubyte *ubsrc = (GLubyte *) src;
- if (normalize) {
- for (j=0;j<elems_per_row;j++) {
- *dst++ = UBYTE_TO_FLOAT(ubsrc[j]);
- }
- }
- else {
- for (j=0;j<elems_per_row;j++) {
- *dst++ = (GLfloat) ubsrc[j];
- }
- }
- }
- break;
- case GL_BYTE:
- if (normalize) {
- for (j=0;j<elems_per_row;j++) {
- *dst++ = BYTE_TO_FLOAT(((GLbyte*)src)[j]);
- }
- }
- else {
- for (j=0;j<elems_per_row;j++) {
- *dst++ = (GLfloat) ((GLbyte*)src)[j];
- }
- }
- break;
- case GL_UNSIGNED_SHORT:
- if (packing->SwapBytes) {
- for (j=0;j<elems_per_row;j++) {
- GLushort value = ((GLushort*)src)[j];
- value = ((value >> 8) & 0xff) | ((value&0xff) << 8);
- if (normalize) {
- *dst++ = USHORT_TO_FLOAT(value);
- }
- else {
- *dst++ = (GLfloat) value;
- }
- }
- }
- else {
- if (normalize) {
- for (j=0;j<elems_per_row;j++) {
- *dst++ = USHORT_TO_FLOAT(((GLushort*)src)[j]);
- }
- }
- else {
- for (j=0;j<elems_per_row;j++) {
- *dst++ = (GLfloat) ((GLushort*)src)[j];
- }
- }
- }
- break;
- case GL_SHORT:
- if (packing->SwapBytes) {
- for (j=0;j<elems_per_row;j++) {
- GLshort value = ((GLshort*)src)[j];
- value = ((value >> 8) & 0xff) | ((value&0xff) << 8);
- if (normalize) {
- *dst++ = SHORT_TO_FLOAT(value);
- }
- else {
- *dst++ = (GLfloat) value;
- }
- }
- }
- else {
- if (normalize) {
- for (j=0;j<elems_per_row;j++) {
- *dst++ = SHORT_TO_FLOAT(((GLshort*)src)[j]);
- }
- }
- else {
- for (j=0;j<elems_per_row;j++) {
- *dst++ = (GLfloat) ((GLshort*)src)[j];
- }
- }
- }
- break;
- case GL_UNSIGNED_INT:
- if (packing->SwapBytes) {
- GLuint value;
- for (j=0;j<elems_per_row;j++) {
- value = ((GLuint*)src)[j];
- value = ((value & 0xff000000) >> 24)
- | ((value & 0x00ff0000) >> 8)
- | ((value & 0x0000ff00) << 8)
- | ((value & 0x000000ff) << 24);
- if (normalize) {
- *dst++ = UINT_TO_FLOAT(value);
- }
- else {
- *dst++ = (GLfloat) value;
- }
- }
- }
- else {
- if (normalize) {
- for (j=0;j<elems_per_row;j++) {
- *dst++ = UINT_TO_FLOAT(((GLuint*)src)[j]);
- }
- }
- else {
- for (j=0;j<elems_per_row;j++) {
- *dst++ = (GLfloat) ((GLuint*)src)[j];
- }
- }
- }
- break;
- case GL_INT:
- if (packing->SwapBytes) {
- GLint value;
- for (j=0;j<elems_per_row;j++) {
- value = ((GLint*)src)[j];
- value = ((value & 0xff000000) >> 24)
- | ((value & 0x00ff0000) >> 8)
- | ((value & 0x0000ff00) << 8)
- | ((value & 0x000000ff) << 24);
- if (normalize) {
- *dst++ = INT_TO_FLOAT(value);
- }
- else {
- *dst++ = (GLfloat) value;
- }
- }
- }
- else {
- if (normalize) {
- for (j=0;j<elems_per_row;j++) {
- *dst++ = INT_TO_FLOAT(((GLint*)src)[j]);
- }
- }
- else {
- for (j=0;j<elems_per_row;j++) {
- *dst++ = (GLfloat) ((GLint*)src)[j];
- }
- }
- }
- break;
- case GL_FLOAT:
- if (packing->SwapBytes) {
- GLint value;
- for (j=0;j<elems_per_row;j++) {
- value = ((GLuint*)src)[j];
- value = ((value & 0xff000000) >> 24)
- | ((value & 0x00ff0000) >> 8)
- | ((value & 0x0000ff00) << 8)
- | ((value & 0x000000ff) << 24);
- *dst++ = *((GLfloat*) &value);
- }
- }
- else {
- MEMCPY( dst, src, elems_per_row*sizeof(GLfloat) );
- dst += elems_per_row;
- }
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- {
- GLubyte *ubsrc = (GLubyte *) src;
- for (j=0;j<width;j++) {
- GLubyte p = ubsrc[j];
- *dst++ = ((p >> 5) ) * (1.0F / 7.0F); /* red */
- *dst++ = ((p >> 2) & 0x7) * (1.0F / 7.0F); /* green */
- *dst++ = ((p ) & 0x3) * (1.0F / 3.0F); /* blue */
- }
- }
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- {
- GLubyte *ubsrc = (GLubyte *) src;
- for (j=0;j<width;j++) {
- GLubyte p = ubsrc[j];
- *dst++ = ((p ) & 0x7) * (1.0F / 7.0F); /* red */
- *dst++ = ((p >> 3) & 0x7) * (1.0F / 7.0F); /* green */
- *dst++ = ((p >> 6) ) * (1.0F / 3.0F); /* blue */
- }
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- {
- GLushort *ussrc = (GLushort *) src;
- for (j=0;j<width;j++) {
- GLushort p = ussrc[j];
- *dst++ = ((p >> 11) ) * (1.0F / 31.0F); /* red */
- *dst++ = ((p >> 5) & 0x3f) * (1.0F / 63.0F); /* green */
- *dst++ = ((p ) & 0x1f) * (1.0F / 31.0F); /* blue */
- }
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- {
- GLushort *ussrc = (GLushort *) src;
- for (j=0;j<width;j++) {
- GLushort p = ussrc[j];
- *dst++ = ((p ) & 0x1f) * (1.0F / 31.0F); /* red */
- *dst++ = ((p >> 5) & 0x3f) * (1.0F / 63.0F); /* green */
- *dst++ = ((p >> 11) ) * (1.0F / 31.0F); /* blue */
- }
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- {
- GLushort *ussrc = (GLushort *) src;
- for (j=0;j<width;j++) {
- GLushort p = ussrc[j];
- *dst++ = ((p >> 12) ) * (1.0F / 15.0F); /* red */
- *dst++ = ((p >> 8) & 0xf) * (1.0F / 15.0F); /* green */
- *dst++ = ((p >> 4) & 0xf) * (1.0F / 15.0F); /* blue */
- *dst++ = ((p ) & 0xf) * (1.0F / 15.0F); /* alpha */
- }
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- {
- GLushort *ussrc = (GLushort *) src;
- for (j=0;j<width;j++) {
- GLushort p = ussrc[j];
- *dst++ = ((p ) & 0xf) * (1.0F / 15.0F); /* red */
- *dst++ = ((p >> 4) & 0xf) * (1.0F / 15.0F); /* green */
- *dst++ = ((p >> 8) & 0xf) * (1.0F / 15.0F); /* blue */
- *dst++ = ((p >> 12) ) * (1.0F / 15.0F); /* alpha */
- }
- }
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- {
- GLushort *ussrc = (GLushort *) src;
- for (j=0;j<width;j++) {
- GLushort p = ussrc[j];
- *dst++ = ((p >> 11) ) * (1.0F / 31.0F); /* red */
- *dst++ = ((p >> 6) & 0x1f) * (1.0F / 31.0F); /* green */
- *dst++ = ((p >> 1) & 0x1f) * (1.0F / 31.0F); /* blue */
- *dst++ = ((p ) & 0x1) * (1.0F / 1.0F); /* alpha */
- }
- }
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- {
- GLushort *ussrc = (GLushort *) src;
- for (j=0;j<width;j++) {
- GLushort p = ussrc[j];
- *dst++ = ((p ) & 0x1f) * (1.0F / 31.0F); /* red */
- *dst++ = ((p >> 5) & 0x1f) * (1.0F / 31.0F); /* green */
- *dst++ = ((p >> 10) & 0x1f) * (1.0F / 31.0F); /* blue */
- *dst++ = ((p >> 15) ) * (1.0F / 1.0F); /* alpha */
- }
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- {
- GLuint *uisrc = (GLuint *) src;
- for (j=0;j<width;j++) {
- GLuint p = uisrc[j];
- *dst++ = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 24) );
- *dst++ = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 16) & 0xff);
- *dst++ = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 8) & 0xff);
- *dst++ = UBYTE_COLOR_TO_FLOAT_COLOR((p ) & 0xff);
- }
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- {
- GLuint *uisrc = (GLuint *) src;
- for (j=0;j<width;j++) {
- GLuint p = uisrc[j];
- *dst++ = UBYTE_COLOR_TO_FLOAT_COLOR((p ) & 0xff);
- *dst++ = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 8) & 0xff);
- *dst++ = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 16) & 0xff);
- *dst++ = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 24) );
- }
- }
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- {
- GLuint *uisrc = (GLuint *) src;
- for (j=0;j<width;j++) {
- GLuint p = uisrc[j];
- *dst++ = ((p >> 22) ) * (1.0F / 1023.0F); /* r */
- *dst++ = ((p >> 12) & 0x3ff) * (1.0F / 1023.0F); /* g */
- *dst++ = ((p >> 2) & 0x3ff) * (1.0F / 1023.0F); /* b */
- *dst++ = ((p ) & 0x3 ) * (1.0F / 3.0F); /* a */
- }
- }
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- {
- GLuint *uisrc = (GLuint *) src;
- for (j=0;j<width;j++) {
- GLuint p = uisrc[j];
- *dst++ = ((p ) & 0x3ff) * (1.0F / 1023.0F); /* r*/
- *dst++ = ((p >> 10) & 0x3ff) * (1.0F / 1023.0F); /* g */
- *dst++ = ((p >> 20) & 0x3ff) * (1.0F / 1023.0F); /* b */
- *dst++ = ((p >> 30) ) * (1.0F / 3.0F); /* a */
- }
- }
- break;
- default:
- gl_problem(ctx, "unpack_float_image type" );
- return image;
- }
- }
- }
-
- if (format == GL_BGR) {
- /* swap order of every float triplet from BGR to RGBA */
- GLfloat *buffer = (GLfloat *) image->Data;
- for (i=0; i<width*height*depth; i++) {
- GLfloat b = buffer[i*3+0];
- GLfloat r = buffer[i*3+2];
- buffer[i*3+0] = r;
- buffer[i*3+2] = b;
- }
- }
- else if (format == GL_BGRA) {
- /* swap order of every float quadruplet from BGRA to RGBA */
- GLfloat *buffer = (GLfloat *) image->Data;
- for (i=0; i<width*height*depth; i++) {
- GLfloat b = buffer[i*4+0];
- GLfloat r = buffer[i*4+2];
- buffer[i*4+0] = r;
- buffer[i*4+2] = b;
- }
- }
- else if (format == GL_ABGR_EXT) {
- /* swap order of every float quadruplet from ABGR to RGBA */
- GLfloat *buffer = (GLfloat *) image->Data;
- for (i=0; i<width*height*depth; i++) {
- GLfloat a = buffer[i*4+0];
- GLfloat b = buffer[i*4+1];
- GLfloat g = buffer[i*4+2];
- GLfloat r = buffer[i*4+3];
- buffer[i*4+0] = r;
- buffer[i*4+1] = g;
- buffer[i*4+2] = b;
- buffer[i*4+3] = a;
- }
- }
-
- return image;
-}
-
-
-
-/*
- * Unpack a bitmap image, using current glPixelStore parameters,
- * making a new gl_image.
- */
-struct gl_image *gl_unpack_bitmap( GLcontext *ctx,
- GLsizei width, GLsizei height,
- const GLubyte *bitmap,
- const struct gl_pixelstore_attrib *packing )
-{
- return gl_unpack_image( ctx, width, height,
- GL_COLOR_INDEX, GL_BITMAP, bitmap, packing );
-}
-
-
-
-/*
- * Unpack a 2-D image from user's buffer. Return pointer to new
- * gl_image struct.
- *
- * Input: width, height - size in pixels
- * format - format of incoming pixel data
- * type - datatype of incoming pixel data
- * pixels - pointer to unpacked image in user buffer
- */
-struct gl_image *gl_unpack_image( GLcontext *ctx,
- GLint width, GLint height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing )
-{
- return gl_unpack_image3D( ctx, width, height, 1,
- format, type, pixels, packing );
-}
-
-
-
-/*
- * Unpack a 1, 2 or 3-D image from user-supplied address, returning a
- * pointer to a new gl_image struct.
- * This function is always called by a higher-level unpack function such
- * as gl_unpack_texsubimage() or gl_unpack_bitmap().
- *
- * Input: width, height, depth - size in pixels
- * format - format of incoming pixel data
- * type - datatype of incoming pixel data
- * pixels - pointer to unpacked image.
- */
-struct gl_image *gl_unpack_image3D( GLcontext *ctx,
- GLint width, GLint height, GLint depth,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing)
-{
- if (width <= 0 || height <= 0 || depth <= 0) {
- return alloc_error_image(width, height, depth, format, type);
- }
-
- if (type==GL_BITMAP) {
- if (format != GL_COLOR_INDEX && format != GL_STENCIL_INDEX) {
- return alloc_error_image(width, height, depth, format, type);
- }
- else {
- return unpack_bitmap( format, width, height, pixels, packing );
- }
- }
- else if (format==GL_DEPTH_COMPONENT) {
- /* TODO: pack as GLdepth values (GLushort or GLuint) */
- return unpack_depth_image( ctx, type, width, height, pixels, packing );
- }
- else if (format==GL_STENCIL_INDEX) {
- /* TODO: pack as GLstencil (GLubyte or GLushort) */
- return unpack_stencil_image( ctx, type, width, height, pixels, packing );
- }
- else if (type==GL_UNSIGNED_BYTE) {
- /* upack, convert to GLubytes */
- return unpack_ubyte_image( width, height, depth, format, pixels, packing );
- }
- else {
- /* upack, convert to floats */
- return unpack_float_image( ctx, width, height, depth,
- format, type, pixels, packing );
- }
-
- /* never get here */
- /*return NULL;*/
-}
-
-
-/*
- * Apply pixel-transfer operations (scale, bias, mapping) to a single row
- * of a gl_image. Put resulting color components into result array.
- */
-void gl_scale_bias_map_image_data( const GLcontext *ctx,
- const struct gl_image *image,
- GLint row, GLubyte result[] )
-{
- GLint start, i;
-
- assert(ctx);
- assert(image);
- assert(result);
- assert(row >= 0);
-
- start = row * image->Width * image->Components;
-
- for (i=0; i < image->Width; i++) {
- GLint pos = start+i;
- GLfloat red, green, blue, alpha;
- if (image->Type == GL_UNSIGNED_BYTE) {
- const GLubyte *data = (GLubyte *) image->Data;
- switch (image->Format) {
- case GL_RED:
- red = data[pos] * (1.0F/255.0F);
- green = 0;
- blue = 0;
- alpha = 0;
- break;
- case GL_RGB:
- red = data[pos*3+0] * (1.0F/255.0F);
- green = data[pos*3+1] * (1.0F/255.0F);
- blue = data[pos*3+2] * (1.0F/255.0F);
- alpha = 0;
- break;
- default:
- gl_problem(ctx, "bad image format in gl_scale...image_data");
- return;
- }
- }
- else if (image->Type == GL_FLOAT) {
- const GLubyte *data = (GLubyte *) image->Data;
- switch (image->Format) {
- case GL_RED:
- red = data[pos];
- green = 0;
- blue = 0;
- alpha = 0;
- break;
- case GL_RGB:
- red = data[pos*3+0];
- green = data[pos*3+1];
- blue = data[pos*3+2];
- alpha = 0;
- break;
- default:
- gl_problem(ctx, "bad image format in gl_scale...image_data");
- return;
- }
- }
- else {
- gl_problem(ctx, "Bad image type in gl_scale_...image_data");
- return;
- }
-
- assert(red >= 0.0 && red <= 1.0);
- assert(green >= 0.0 && green <= 1.0);
- assert(blue >= 0.0 && blue <= 1.0);
- assert(alpha >= 0.0 && alpha <= 1.0);
-
- /*
- if (scale or bias) {
-
-
- }
- if (mapping) {
-
- }
- */
-
- result[i*4+0] = (GLubyte) (red * 255.0);
- result[i*4+1] = (GLubyte) (green * 255.0);
- result[i*4+2] = (GLubyte) (blue * 255.0);
- result[i*4+3] = (GLubyte) (alpha * 255.0);
- }
-}
-
-
-
-/*
* Pack the given RGBA span into client memory at 'dest' address
* in the given pixel format and type.
* Optionally apply the enabled pixel transfer ops.
@@ -1678,14 +561,14 @@ void gl_pack_rgba_span( const GLcontext *ctx,
const struct gl_pixelstore_attrib *packing,
GLboolean applyTransferOps )
{
+ applyTransferOps &= (ctx->Pixel.ScaleOrBiasRGBA || ctx->Pixel.MapColorFlag);
+
/* Test for optimized case first */
- if (!ctx->Pixel.ScaleOrBiasRGBA && !ctx->Pixel.MapColorFlag &&
- format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
+ if (!applyTransferOps && format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
/* common simple case */
MEMCPY( destination, rgba, n * 4 * sizeof(GLubyte) );
}
- else if (!ctx->Pixel.ScaleOrBiasRGBA && !ctx->Pixel.MapColorFlag &&
- format == GL_RGB && type == GL_UNSIGNED_BYTE) {
+ else if (!applyTransferOps && format == GL_RGB && type == GL_UNSIGNED_BYTE) {
/* common simple case */
GLint i;
GLubyte *dest = (GLubyte *) destination;
@@ -1697,6 +580,7 @@ void gl_pack_rgba_span( const GLcontext *ctx,
}
}
else {
+ /* general solution */
GLfloat red[MAX_WIDTH], green[MAX_WIDTH], blue[MAX_WIDTH];
GLfloat alpha[MAX_WIDTH], luminance[MAX_WIDTH];
const GLfloat rscale = 1.0F / 255.0F;
@@ -2470,11 +1354,6 @@ void gl_pack_rgba_span( const GLcontext *ctx,
}
-
-/*
- * New (3.3) functions
- */
-
#define SWAP2BYTE(VALUE) \
{ \
GLubyte *bytes = (GLubyte *) &(VALUE); \
@@ -2679,16 +1558,6 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4],
GLint stride;
GLint rComp, bComp, gComp, aComp;
- if (0)
- {
- int i;
- for (i = 0; i<n;i++) {
- rgba[i][0] = rgba[i][1] = rgba[i][2] = rgba[i][3] = 0;
- }
- return;
- }
-
-
ASSERT(srcFormat == GL_RED ||
srcFormat == GL_GREEN ||
srcFormat == GL_BLUE ||
@@ -2710,17 +1579,12 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4],
srcType == GL_INT ||
srcType == GL_FLOAT ||
srcType == GL_UNSIGNED_BYTE_3_3_2 ||
- srcType == GL_UNSIGNED_BYTE_2_3_3_REV ||
- srcType == GL_UNSIGNED_SHORT_5_6_5 ||
- srcType == GL_UNSIGNED_SHORT_5_6_5_REV ||
srcType == GL_UNSIGNED_SHORT_4_4_4_4 ||
- srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
srcType == GL_UNSIGNED_SHORT_5_5_5_1 ||
- srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
srcType == GL_UNSIGNED_INT_8_8_8_8 ||
- srcType == GL_UNSIGNED_INT_8_8_8_8_REV ||
- srcType == GL_UNSIGNED_INT_10_10_10_2 ||
- srcType == GL_UNSIGNED_INT_2_10_10_10_REV);
+ srcType == GL_UNSIGNED_INT_10_10_10_2);
+
+ rComp = gComp = bComp = aComp = -1;
switch (srcFormat) {
case GL_RED:
@@ -2810,10 +1674,6 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4],
return;
}
- assert(redIndex >= -1 && redIndex <= 4);
- assert(greenIndex >= -1 && greenIndex <= 4);
- assert(blueIndex >= -1 && blueIndex <= 4);
- assert(alphaIndex >= -1 && alphaIndex <= 4);
#define PROCESS(INDEX, CHANNEL, DEFAULT, TYPE, CONVERSION) \
if ((INDEX) < 0) { \
@@ -3228,22 +2088,16 @@ _mesa_unpack_ubyte_color_span( const GLcontext *ctx,
srcType == GL_INT ||
srcType == GL_FLOAT ||
srcType == GL_UNSIGNED_BYTE_3_3_2 ||
- srcType == GL_UNSIGNED_BYTE_2_3_3_REV ||
- srcType == GL_UNSIGNED_SHORT_5_6_5 ||
- srcType == GL_UNSIGNED_SHORT_5_6_5_REV ||
srcType == GL_UNSIGNED_SHORT_4_4_4_4 ||
- srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
srcType == GL_UNSIGNED_SHORT_5_5_5_1 ||
- srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
srcType == GL_UNSIGNED_INT_8_8_8_8 ||
- srcType == GL_UNSIGNED_INT_8_8_8_8_REV ||
- srcType == GL_UNSIGNED_INT_10_10_10_2 ||
- srcType == GL_UNSIGNED_INT_2_10_10_10_REV);
+ srcType == GL_UNSIGNED_INT_10_10_10_2);
/* this is intended for RGBA mode */
- ASSERT(ctx->Visual->RGBAflag);
+ assert(ctx->Visual->RGBAflag);
applyTransferOps &= (ctx->Pixel.ScaleOrBiasRGBA ||
+ ctx->Pixel.MapColorFlag ||
ctx->Pixel.MapColorFlag);
/* Try simple cases first */
@@ -3417,15 +2271,14 @@ _mesa_unpack_ubyte_color_span( const GLcontext *ctx,
dstAlphaIndex = 3;
dstLuminanceIndex = dstIntensityIndex = -1;
break;
- case GL_COLOR_INDEX:
- assert(0);
- break;
default:
gl_problem(ctx, "bad dstFormat in _mesa_unpack_ubyte_span()");
+ return;
}
/* Now return the GLubyte data in the requested dstFormat */
+
if (dstRedIndex >= 0) {
GLubyte *dst = dest;
GLuint i;
@@ -3589,6 +2442,206 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n,
/*
+ * Unpack a row of stencil data from a client buffer according to
+ * the pixel unpacking parameters. Apply pixel transfer ops if enabled
+ * and applyTransferOps is true.
+ * This is (or will be) used by glDrawPixels
+ *
+ * Args: ctx - the context
+ * n - number of pixels
+ * dstType - destination datatype
+ * dest - destination array
+ * srcType - source pixel type
+ * source - source data pointer
+ * unpacking - pixel unpacking parameters
+ * applyTransferOps - apply offset/bias/lookup ops?
+ */
+void
+_mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n,
+ GLenum dstType, GLvoid *dest,
+ GLenum srcType, const GLvoid *source,
+ const struct gl_pixelstore_attrib *unpacking,
+ GLboolean applyTransferOps )
+{
+ ASSERT(srcType == GL_BITMAP ||
+ srcType == GL_UNSIGNED_BYTE ||
+ srcType == GL_BYTE ||
+ srcType == GL_UNSIGNED_SHORT ||
+ srcType == GL_SHORT ||
+ srcType == GL_UNSIGNED_INT ||
+ srcType == GL_INT ||
+ srcType == GL_FLOAT);
+
+ ASSERT(dstType == GL_UNSIGNED_BYTE ||
+ dstType == GL_UNSIGNED_SHORT ||
+ dstType == GL_UNSIGNED_INT);
+
+ applyTransferOps &= (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset || ctx->Pixel.MapColorFlag);
+
+ /*
+ * Try simple cases first
+ */
+ if (!applyTransferOps && srcType == GL_UNSIGNED_BYTE
+ && dstType == GL_UNSIGNED_BYTE) {
+ MEMCPY(dest, source, n * sizeof(GLubyte));
+ }
+ else if (!applyTransferOps && srcType == GL_UNSIGNED_INT
+ && dstType == GL_UNSIGNED_INT && !unpacking->SwapBytes) {
+ MEMCPY(dest, source, n * sizeof(GLuint));
+ }
+ else {
+ /*
+ * general solution
+ */
+ GLuint indexes[MAX_WIDTH];
+ assert(n <= MAX_WIDTH);
+
+ extract_uint_indexes(n, indexes, GL_COLOR_INDEX, srcType, source,
+ unpacking);
+
+ if (applyTransferOps) {
+ if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset) {
+ /* shift and offset indexes */
+ gl_shift_and_offset_ci(ctx, n, indexes);
+ }
+
+ if (ctx->Pixel.MapStencilFlag) {
+ /* Apply stencil lookup table */
+ GLuint mask = ctx->Pixel.MapStoSsize - 1;
+ GLuint i;
+ for (i=0;i<n;i++) {
+ indexes[i] = ctx->Pixel.MapStoS[ indexes[i] & mask ];
+ }
+ }
+ }
+
+ /* convert to dest type */
+ switch (dstType) {
+ case GL_UNSIGNED_BYTE:
+ {
+ GLubyte *dst = (GLubyte *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = (GLubyte) (indexes[i] & 0xff);
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ {
+ GLuint *dst = (GLuint *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = (GLushort) (indexes[i] & 0xffff);
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT:
+ MEMCPY(dest, indexes, n * sizeof(GLuint));
+ break;
+ default:
+ gl_problem(ctx, "bad dstType in _mesa_unpack_stencil_span");
+ }
+ }
+}
+
+
+
+void
+_mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLdepth *dest,
+ GLenum srcType, const GLvoid *source,
+ const struct gl_pixelstore_attrib *unpacking,
+ GLboolean applyTransferOps )
+{
+ GLfloat *depth = MALLOC(n * sizeof(GLfloat));
+ if (!depth)
+ return;
+
+ switch (srcType) {
+ case GL_BYTE:
+ {
+ GLuint i;
+ const GLubyte *src = (const GLubyte *) source;
+ for (i = 0; i < n; i++) {
+ depth[i] = BYTE_TO_FLOAT(src[i]);
+ }
+ }
+ break;
+ case GL_UNSIGNED_BYTE:
+ {
+ GLuint i;
+ const GLubyte *src = (const GLubyte *) source;
+ for (i = 0; i < n; i++) {
+ depth[i] = UBYTE_TO_FLOAT(src[i]);
+ }
+ }
+ break;
+ case GL_SHORT:
+ {
+ GLuint i;
+ const GLshort *src = (const GLshort *) source;
+ for (i = 0; i < n; i++) {
+ depth[i] = SHORT_TO_FLOAT(src[i]);
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ {
+ GLuint i;
+ const GLushort *src = (const GLushort *) source;
+ for (i = 0; i < n; i++) {
+ depth[i] = USHORT_TO_FLOAT(src[i]);
+ }
+ }
+ break;
+ case GL_INT:
+ {
+ GLuint i;
+ const GLint *src = (const GLint *) source;
+ for (i = 0; i < n; i++) {
+ depth[i] = INT_TO_FLOAT(src[i]);
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT:
+ {
+ GLuint i;
+ const GLuint *src = (const GLuint *) source;
+ for (i = 0; i < n; i++) {
+ depth[i] = UINT_TO_FLOAT(src[i]);
+ }
+ }
+ break;
+ case GL_FLOAT:
+ MEMCPY(depth, source, n * sizeof(GLfloat));
+ break;
+ default:
+ gl_problem(NULL, "bad type in _mesa_unpack_depth_span()");
+ return;
+ }
+
+
+ /* apply depth scale and bias */
+ if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) {
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ depth[i] = depth[i] * ctx->Pixel.DepthScale + ctx->Pixel.DepthBias;
+ }
+ }
+
+ /* clamp depth values to [0,1] and convert from floats to integers */
+ {
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dest[i] = (GLdepth) (CLAMP(depth[i], 0.0F, 1.0F) * DEPTH_SCALE);
+ }
+ }
+
+ FREE(depth);
+}
+
+
+
+/*
* Unpack image data. Apply byteswapping, byte flipping (bitmap).
* Return all image data in a contiguous block.
*/
@@ -3656,3 +2709,106 @@ _mesa_unpack_image( GLsizei width, GLsizei height, GLsizei depth,
return destBuffer;
}
}
+
+
+/*
+ * Unpack bitmap data. Resulting data will be in most-significant-bit-first
+ * order with row alignment = 1 byte.
+ */
+GLvoid *
+_mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
+ const struct gl_pixelstore_attrib *packing )
+{
+ GLint bytes, row, width_in_bytes;
+ GLubyte *buffer, *dst;
+
+ if (!pixels)
+ return NULL;
+
+ /* Alloc dest storage */
+ bytes = ((width + 7) / 8 * height);
+ buffer = (GLubyte *) MALLOC( bytes );
+ if (!buffer)
+ return NULL;
+
+
+ width_in_bytes = CEILING( width, 8 );
+ dst = buffer;
+ for (row = 0; row < height; row++) {
+ GLubyte *src = gl_pixel_addr_in_image( packing, pixels, width, height,
+ GL_COLOR_INDEX, GL_BITMAP,
+ 0, row, 0 );
+ if (!src) {
+ FREE(buffer);
+ return NULL;
+ }
+
+ if (packing->SkipPixels == 0) {
+ MEMCPY( dst, src, width_in_bytes );
+ if (packing->LsbFirst) {
+ gl_flip_bytes( dst, width_in_bytes );
+ }
+ }
+ else {
+ /* handling SkipPixels is a bit tricky (no pun intended!) */
+ GLint i;
+ if (packing->LsbFirst) {
+ GLubyte srcMask = 1 << (packing->SkipPixels & 0x7);
+ GLubyte dstMask = 128;
+ GLubyte *s = src;
+ GLubyte *d = dst;
+ *d = 0;
+ for (i = 0; i < width; i++) {
+ if (*s & srcMask) {
+ *d |= dstMask;
+ }
+ if (srcMask == 128) {
+ srcMask = 1;
+ s++;
+ }
+ else {
+ srcMask = srcMask << 1;
+ }
+ if (dstMask == 1) {
+ dstMask = 128;
+ d++;
+ *d = 0;
+ }
+ else {
+ dstMask = dstMask >> 1;
+ }
+ }
+ }
+ else {
+ GLubyte srcMask = 128 >> (packing->SkipPixels & 0x7);
+ GLubyte dstMask = 128;
+ GLubyte *s = src;
+ GLubyte *d = dst;
+ *d = 0;
+ for (i = 0; i < width; i++) {
+ if (*s & srcMask) {
+ *d |= dstMask;
+ }
+ if (srcMask == 1) {
+ srcMask = 128;
+ s++;
+ }
+ else {
+ srcMask = srcMask >> 1;
+ }
+ if (dstMask == 1) {
+ dstMask = 128;
+ d++;
+ *d = 0;
+ }
+ else {
+ dstMask = dstMask >> 1;
+ }
+ }
+ }
+ }
+ dst += width_in_bytes;
+ }
+
+ return buffer;
+}
diff --git a/xc/extras/Mesa/src/image.h b/xc/extras/Mesa/src/image.h
index a47bab970..682e53b0b 100644
--- a/xc/extras/Mesa/src/image.h
+++ b/xc/extras/Mesa/src/image.h
@@ -1,4 +1,4 @@
-/* $Id: image.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: image.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef IMAGE_H
#define IMAGE_H
@@ -35,6 +32,9 @@
#include "types.h"
+extern struct gl_pixelstore_attrib _mesa_native_packing;
+
+
extern void gl_flip_bytes( GLubyte *p, GLuint n );
@@ -61,33 +61,16 @@ gl_pixel_addr_in_image( const struct gl_pixelstore_attrib *packing,
GLint img, GLint row, GLint column );
-extern struct gl_image *
-gl_unpack_bitmap( GLcontext *ctx, GLsizei width, GLsizei height,
- const GLubyte *bitmap,
- const struct gl_pixelstore_attrib *packing );
-
-
-extern void gl_unpack_polygon_stipple( const GLcontext *ctx,
- const GLubyte *pattern,
- GLuint dest[32] );
-
-
-extern void gl_pack_polygon_stipple( const GLcontext *ctx,
- const GLuint pattern[32],
- GLubyte *dest );
-
-
-extern struct gl_image *
-gl_unpack_image( GLcontext *ctx, GLint width, GLint height,
- GLenum srcFormat, GLenum srcType, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing );
-
+extern void
+gl_unpack_polygon_stipple( const GLcontext *ctx,
+ const GLubyte *pattern,
+ GLuint dest[32] );
-struct gl_image *
-gl_unpack_image3D( GLcontext *ctx, GLint width, GLint height,GLint depth,
- GLenum srcFormat, GLenum srcType, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing );
+extern void
+gl_pack_polygon_stipple( const GLcontext *ctx,
+ const GLuint pattern[32],
+ GLubyte *dest );
extern void
@@ -98,19 +81,6 @@ gl_pack_rgba_span( const GLcontext *ctx,
GLboolean applyTransferOps );
-extern void gl_free_image( struct gl_image *image );
-
-
-extern GLboolean gl_image_error_test( GLcontext *ctx,
- const struct gl_image *image,
- const char *msg );
-
-
-/*
- * New (3.3) functions
- */
-
-
extern void
_mesa_unpack_ubyte_color_span( const GLcontext *ctx,
GLuint n, GLenum dstFormat, GLubyte dest[],
@@ -127,10 +97,31 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n,
const struct gl_pixelstore_attrib *unpacking,
GLboolean applyTransferOps );
+
+extern void
+_mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n,
+ GLenum dstType, GLvoid *dest,
+ GLenum srcType, const GLvoid *source,
+ const struct gl_pixelstore_attrib *unpacking,
+ GLboolean applyTransferOps );
+
+
+extern void
+_mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLdepth *dest,
+ GLenum srcType, const GLvoid *source,
+ const struct gl_pixelstore_attrib *unpacking,
+ GLboolean applyTransferOps );
+
+
extern void *
_mesa_unpack_image( GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLenum type, const GLvoid *pixels,
const struct gl_pixelstore_attrib *unpack );
+extern GLvoid *
+_mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
+ const struct gl_pixelstore_attrib *packing );
+
+
#endif
diff --git a/xc/extras/Mesa/src/imaging.c b/xc/extras/Mesa/src/imaging.c
new file mode 100644
index 000000000..ce555e036
--- /dev/null
+++ b/xc/extras/Mesa/src/imaging.c
@@ -0,0 +1,347 @@
+/* $Id: imaging.c,v 1.2 2000/01/30 00:27:02 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999-2000 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+/* Stub functions for GL_ARB_imaging subset */
+
+
+#ifdef PC_HEADER
+#include "all.h"
+#else
+#include "glheader.h"
+#include "imaging.h"
+#endif
+
+
+
+#define WARNING(MSG) fprintf(stderr,"Mesa warning: GL_ARB_imaging functions not implemented\n")
+
+
+
+void _mesa_BlendColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a)
+{
+ (void) r;
+ (void) g;
+ (void) b;
+ (void) a;
+ WARNING("glBlendColor");
+}
+
+void _mesa_BlendEquation(GLenum eq)
+{
+ (void) eq;
+ WARNING("glBlendEquation");
+}
+
+void _mesa_ColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data)
+{
+ (void) target;
+ (void) start;
+ (void) count;
+ (void) format;
+ (void) type;
+ (void) data;
+ WARNING("glColorSubTable");
+}
+
+void _mesa_ColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
+{
+ (void) target;
+ (void) internalformat;
+ (void) width;
+ (void) format;
+ (void) type;
+ (void) table;
+ WARNING("glColorTable");
+}
+
+void _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ WARNING("glColorTableParameterfv");
+}
+
+void _mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ WARNING("glColorTableParameteriv");
+}
+
+
+void _mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image)
+{
+ (void) target;
+ (void) internalformat;
+ (void) width;
+ (void) format;
+ (void) type;
+ (void) image;
+ WARNING("glConvolutionFilter1D");
+}
+
+void _mesa_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)
+{
+ (void) target;
+ (void) internalformat;
+ (void) width;
+ (void) height;
+ (void) format;
+ (void) type;
+ (void) image;
+ WARNING("glConvolutionFilter2D");
+}
+
+void _mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ WARNING("glConvolutionParameterf");
+}
+
+void _mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ WARNING("glConvolutionParameterfv");
+}
+
+void _mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ WARNING("glConvolutionParameteri");
+}
+
+void _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ WARNING("glConvolutionParameteriv");
+}
+
+void _mesa_CopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
+{
+ (void) target;
+ (void) start;
+ (void) x;
+ (void) y;
+ (void) width;
+ WARNING("glCopyColorSubTable");
+}
+
+void _mesa_CopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ (void) target;
+ (void) internalformat;
+ (void) x;
+ (void) y;
+ (void) width;
+ WARNING("glCopyColorTable");
+}
+
+void _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ (void) target;
+ (void) internalformat;
+ (void) x;
+ (void) y;
+ (void) width;
+ WARNING("glCopyConvolutionFilter1D");
+}
+
+void _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ (void) target;
+ (void) internalformat;
+ (void) x;
+ (void) y;
+ (void) width;
+ (void) height;
+ WARNING("glCopyConvolutionFilter2D");
+}
+
+void _mesa_GetColorTable(GLenum target, GLenum format, GLenum type, GLvoid *table)
+{
+ (void) target;
+ (void) format;
+ (void) type;
+ (void) table;
+ WARNING("glGetColorTable");
+}
+
+void _mesa_GetColorTableParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ WARNING("glGetColorTableParameterfv");
+}
+
+void _mesa_GetColorTableParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ WARNING("glGetColorTableParameteriv");
+}
+
+void _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image)
+{
+ (void) target;
+ (void) format;
+ (void) type;
+ (void) image;
+ WARNING("glGetConvolutionFilter");
+}
+
+void _mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ WARNING("glGetConvolutionParameterfv");
+}
+
+void _mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ WARNING("glGetConvolutionParameteriv");
+}
+
+void _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values)
+{
+ (void) target;
+ (void) reset;
+ (void) format;
+ (void) types;
+ (void) values;
+ WARNING("glGetMinmax");
+}
+
+void _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
+{
+ (void) target;
+ (void) reset;
+ (void) format;
+ (void) type;
+ (void) values;
+ WARNING("glGetHistogram");
+}
+
+void _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ WARNING("glGetHistogramParameterfv");
+}
+
+void _mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ WARNING("glGetHistogramParameteriv");
+}
+
+void _mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ WARNING("glGetMinmaxParameterfv");
+}
+
+void _mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ (void) target;
+ (void) pname;
+ (void) params;
+ WARNING("glGetMinmaxParameteriv");
+}
+
+void _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)
+{
+ (void) target;
+ (void) format;
+ (void) type;
+ (void) row;
+ (void) column;
+ (void) span;
+ WARNING("glGetSeperableFilter");
+}
+
+void _mesa_Histogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
+{
+ (void) target;
+ (void) width;
+ (void) internalformat;
+ (void) sink;
+ WARNING("glHistogram");
+}
+
+void _mesa_Minmax(GLenum target, GLenum internalformat, GLboolean sink)
+{
+ (void) target;
+ (void) internalformat;
+ (void) sink;
+ WARNING("glMinmax");
+}
+
+void _mesa_ResetHistogram(GLenum target)
+{
+ (void) target;
+ WARNING("glResetHistogram");
+}
+
+void _mesa_ResetMinmax(GLenum target)
+{
+ (void) target;
+ WARNING("glResetMinmax");
+}
+
+void _mesa_SeparableFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)
+{
+ (void) target;
+ (void) internalformat;
+ (void) width;
+ (void) height;
+ (void) format;
+ (void) type;
+ (void) row;
+ (void) column;
+ WARNING("glSeparableFilter2D");
+}
diff --git a/xc/extras/Mesa/src/imaging.h b/xc/extras/Mesa/src/imaging.h
new file mode 100644
index 000000000..64936521e
--- /dev/null
+++ b/xc/extras/Mesa/src/imaging.h
@@ -0,0 +1,108 @@
+/* $Id: imaging.h,v 1.2 2000/01/30 00:27:02 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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 IMAGING_H
+#define IMAGING_H
+
+
+#ifdef PC_HEADER
+#include "all.h"
+#else
+#include "glheader.h"
+#endif
+
+
+
+extern void _mesa_BlendColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a);
+
+extern void _mesa_BlendEquation(GLenum eq);
+
+extern void _mesa_ColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+
+extern void _mesa_ColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+
+extern void _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params);
+
+extern void _mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params);
+
+extern void _mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+
+extern void _mesa_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+
+extern void _mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat params);
+
+extern void _mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params);
+
+extern void _mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint params);
+
+extern void _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params);
+
+extern void _mesa_CopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+
+extern void _mesa_CopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+
+extern void _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+
+extern void _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+
+extern void _mesa_GetColorTable(GLenum target, GLenum format, GLenum type, GLvoid *table);
+
+extern void _mesa_GetColorTableParameterfv(GLenum target, GLenum pname, GLfloat *params);
+
+extern void _mesa_GetColorTableParameteriv(GLenum target, GLenum pname, GLint *params);
+
+extern void _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image);
+
+extern void _mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params);
+
+extern void _mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params);
+
+extern void _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values);
+
+extern void _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+
+extern void _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params);
+
+extern void _mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params);
+
+extern void _mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params);
+
+extern void _mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params);
+
+extern void _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+
+extern void _mesa_Histogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+
+extern void _mesa_Minmax(GLenum target, GLenum internalformat, GLboolean sink);
+
+extern void _mesa_ResetHistogram(GLenum target);
+
+extern void _mesa_ResetMinmax(GLenum target);
+
+extern void _mesa_SeparableFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+
+#endif
diff --git a/xc/extras/Mesa/src/indirect_tmp.h b/xc/extras/Mesa/src/indirect_tmp.h
index 89c085cb6..f2d675dc4 100644
--- a/xc/extras/Mesa/src/indirect_tmp.h
+++ b/xc/extras/Mesa/src/indirect_tmp.h
@@ -1,4 +1,4 @@
-/* $Id: indirect_tmp.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: indirect_tmp.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/interp_tmp.h b/xc/extras/Mesa/src/interp_tmp.h
index d8321950d..450ad1517 100644
--- a/xc/extras/Mesa/src/interp_tmp.h
+++ b/xc/extras/Mesa/src/interp_tmp.h
@@ -1,4 +1,4 @@
-/* $Id: interp_tmp.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: interp_tmp.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -28,7 +28,7 @@
static void NAME( struct vertex_buffer *VB,
GLuint dst, GLfloat t, GLuint in, GLuint out )
{
-#if (IND & (CLIP_RGBA0|CLIP_FOG_COORD))
+#if (IND & CLIP_RGBA0)
GLfloat col[3][4];
#endif
@@ -57,26 +57,18 @@ static void NAME( struct vertex_buffer *VB,
{
UBYTE_RGBA_TO_FLOAT_RGBA(col[1], VB->Spec[0][in]);
UBYTE_RGBA_TO_FLOAT_RGBA(col[2], VB->Spec[0][out]);
- INTERP_SZ( t, col, 0, 1, 2, 3 );
+ INTERP_SZ( t, col, 0, 1, 2, 4 );
FLOAT_RGBA_TO_UBYTE_RGBA(VB->Spec[0][dst], col[0]);
if (VB->ctx->TriangleCaps & DD_TRI_LIGHT_TWOSIDE) {
UBYTE_RGBA_TO_FLOAT_RGBA(col[1], VB->Spec[1][in]);
UBYTE_RGBA_TO_FLOAT_RGBA(col[2], VB->Spec[1][out]);
- INTERP_SZ( t, col, 0, 1, 2, 3 );
+ INTERP_SZ( t, col, 0, 1, 2, 4 );
FLOAT_RGBA_TO_UBYTE_RGBA(VB->Spec[1][dst], col[0]);
}
}
#endif
-#if (IND & CLIP_FOG_COORD)
- col[0][0] = UBYTE_COLOR_TO_FLOAT_COLOR( VB->Spec[0][in][3]);
- col[0][1] = UBYTE_COLOR_TO_FLOAT_COLOR( VB->Spec[0][out][3]);
- col[0][2] = LINTERP( t, col[0][0], col[0][1] );
- FLOAT_COLOR_TO_UBYTE_COLOR(VB->Spec[0][dst][3], col[0][2]);
-#endif
-
-
#if (IND & CLIP_INDEX0)
VB->IndexPtr->data[dst] = (GLuint) (GLint)
LINTERP( t,
diff --git a/xc/extras/Mesa/src/light.c b/xc/extras/Mesa/src/light.c
index 0e7631968..c6a05392a 100644
--- a/xc/extras/Mesa/src/light.c
+++ b/xc/extras/Mesa/src/light.c
@@ -1,10 +1,10 @@
-/* $Id: light.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: light.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,27 +25,16 @@
*/
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#include <float.h>
-#ifndef XFree86Server
-#include <assert.h>
-#include <float.h>
-#include <math.h>
-#include <stdlib.h>
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "enums.h"
#include "light.h"
#include "macros.h"
#include "matrix.h"
+#include "mem.h"
#include "mmath.h"
#include "simple_list.h"
#include "types.h"
@@ -55,8 +44,10 @@
-void gl_ShadeModel( GLcontext *ctx, GLenum mode )
+void
+_mesa_ShadeModel( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glShadeModel");
if (MESA_VERBOSE & VERBOSE_API)
@@ -64,12 +55,12 @@ void gl_ShadeModel( GLcontext *ctx, GLenum mode )
if (mode == GL_FLAT || mode == GL_SMOOTH) {
if (ctx->Light.ShadeModel != mode) {
- ctx->Light.ShadeModel = mode;
+ ctx->Light.ShadeModel = mode;
if (ctx->Light.ShadeModel == GL_FLAT)
- ctx->TriangleCaps |= DD_FLATSHADE;
+ SET_BITS(ctx->TriangleCaps, DD_FLATSHADE);
else
- ctx->TriangleCaps &= ~DD_FLATSHADE;
- ctx->NewState |= NEW_RASTER_OPS;
+ CLEAR_BITS(ctx->TriangleCaps, DD_FLATSHADE);
+ ctx->NewState |= NEW_RASTER_OPS;
if (ctx->Driver.ShadeModel)
(*ctx->Driver.ShadeModel)( ctx, mode );
}
@@ -81,19 +72,25 @@ void gl_ShadeModel( GLcontext *ctx, GLenum mode )
-void gl_Lightfv( GLcontext *ctx,
- GLenum light, GLenum pname, const GLfloat *params,
- GLint nparams )
+void
+_mesa_Lightf( GLenum light, GLenum pname, GLfloat param )
{
- GLint l;
+ _mesa_Lightfv( light, pname, &param );
+}
+
- (void) nparams;
+void
+_mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint l;
+ GLint nParams;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLight");
l = (GLint) (light - GL_LIGHT0);
- if (l<0 || l>=MAX_LIGHTS) {
+ if (l < 0 || l >= MAX_LIGHTS) {
gl_error( ctx, GL_INVALID_ENUM, "glLight" );
return;
}
@@ -101,18 +98,22 @@ void gl_Lightfv( GLcontext *ctx,
switch (pname) {
case GL_AMBIENT:
COPY_4V( ctx->Light.Light[l].Ambient, params );
+ nParams = 4;
break;
case GL_DIFFUSE:
COPY_4V( ctx->Light.Light[l].Diffuse, params );
+ nParams = 4;
break;
case GL_SPECULAR:
COPY_4V( ctx->Light.Light[l].Specular, params );
+ nParams = 4;
break;
case GL_POSITION:
/* transform position by ModelView matrix */
TRANSFORM_POINT( ctx->Light.Light[l].EyePosition,
ctx->ModelView.m,
params );
+ nParams = 4;
break;
case GL_SPOT_DIRECTION:
/* transform direction by inverse modelview */
@@ -122,6 +123,7 @@ void gl_Lightfv( GLcontext *ctx,
TRANSFORM_NORMAL( ctx->Light.Light[l].EyeDirection,
params,
ctx->ModelView.inv );
+ nParams = 3;
break;
case GL_SPOT_EXPONENT:
if (params[0]<0.0 || params[0]>128.0) {
@@ -132,6 +134,7 @@ void gl_Lightfv( GLcontext *ctx,
ctx->Light.Light[l].SpotExponent = params[0];
gl_compute_spot_exp_table( &ctx->Light.Light[l] );
}
+ nParams = 1;
break;
case GL_SPOT_CUTOFF:
if ((params[0]<0.0 || params[0]>90.0) && params[0]!=180.0) {
@@ -142,6 +145,7 @@ void gl_Lightfv( GLcontext *ctx,
ctx->Light.Light[l].CosCutoff = cos(params[0]*DEG2RAD);
if (ctx->Light.Light[l].CosCutoff < 0)
ctx->Light.Light[l].CosCutoff = 0;
+ nParams = 1;
break;
case GL_CONSTANT_ATTENUATION:
if (params[0]<0.0) {
@@ -149,6 +153,7 @@ void gl_Lightfv( GLcontext *ctx,
return;
}
ctx->Light.Light[l].ConstantAttenuation = params[0];
+ nParams = 1;
break;
case GL_LINEAR_ATTENUATION:
if (params[0]<0.0) {
@@ -156,6 +161,7 @@ void gl_Lightfv( GLcontext *ctx,
return;
}
ctx->Light.Light[l].LinearAttenuation = params[0];
+ nParams = 1;
break;
case GL_QUADRATIC_ATTENUATION:
if (params[0]<0.0) {
@@ -163,23 +169,73 @@ void gl_Lightfv( GLcontext *ctx,
return;
}
ctx->Light.Light[l].QuadraticAttenuation = params[0];
+ nParams = 1;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glLight" );
- break;
+ return;
}
if (ctx->Driver.Lightfv)
- ctx->Driver.Lightfv( ctx, light, pname, params, nparams );
+ ctx->Driver.Lightfv( ctx, light, pname, params, nParams );
ctx->NewState |= NEW_LIGHTING;
}
+void
+_mesa_Lighti( GLenum light, GLenum pname, GLint param )
+{
+ _mesa_Lightiv( light, pname, &param );
+}
+
+
+void
+_mesa_Lightiv( GLenum light, GLenum pname, const GLint *params )
+{
+ GLfloat fparam[4];
+
+ switch (pname) {
+ case GL_AMBIENT:
+ case GL_DIFFUSE:
+ case GL_SPECULAR:
+ fparam[0] = INT_TO_FLOAT( params[0] );
+ fparam[1] = INT_TO_FLOAT( params[1] );
+ fparam[2] = INT_TO_FLOAT( params[2] );
+ fparam[3] = INT_TO_FLOAT( params[3] );
+ break;
+ case GL_POSITION:
+ fparam[0] = (GLfloat) params[0];
+ fparam[1] = (GLfloat) params[1];
+ fparam[2] = (GLfloat) params[2];
+ fparam[3] = (GLfloat) params[3];
+ break;
+ case GL_SPOT_DIRECTION:
+ fparam[0] = (GLfloat) params[0];
+ fparam[1] = (GLfloat) params[1];
+ fparam[2] = (GLfloat) params[2];
+ break;
+ case GL_SPOT_EXPONENT:
+ case GL_SPOT_CUTOFF:
+ case GL_CONSTANT_ATTENUATION:
+ case GL_LINEAR_ATTENUATION:
+ case GL_QUADRATIC_ATTENUATION:
+ fparam[0] = (GLfloat) params[0];
+ break;
+ default:
+ /* error will be caught later in gl_Lightfv */
+ ;
+ }
+
+ _mesa_Lightfv( light, pname, fparam );
+}
+
+
-void gl_GetLightfv( GLcontext *ctx,
- GLenum light, GLenum pname, GLfloat *params )
+void
+_mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint l = (GLint) (light - GL_LIGHT0);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetLight");
@@ -228,8 +284,10 @@ void gl_GetLightfv( GLcontext *ctx,
-void gl_GetLightiv( GLcontext *ctx, GLenum light, GLenum pname, GLint *params )
+void
+_mesa_GetLightiv( GLenum light, GLenum pname, GLint *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint l = (GLint) (light - GL_LIGHT0);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetLight");
@@ -297,9 +355,11 @@ void gl_GetLightiv( GLcontext *ctx, GLenum light, GLenum pname, GLint *params )
/**********************************************************************/
-void gl_LightModelfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
+void
+_mesa_LightModelfv( GLenum pname, const GLfloat *params )
{
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLightModel");
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLightModelfv");
switch (pname) {
case GL_LIGHT_MODEL_AMBIENT:
@@ -320,11 +380,11 @@ void gl_LightModelfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
case GL_LIGHT_MODEL_COLOR_CONTROL:
if (params[0] == (GLfloat) GL_SINGLE_COLOR) {
ctx->Light.Model.ColorControl = GL_SINGLE_COLOR;
- ctx->TriangleCaps &= ~DD_SEPERATE_SPECULAR;
+ CLEAR_BITS(ctx->TriangleCaps, DD_SEPERATE_SPECULAR);
}
else if (params[0] == (GLfloat) GL_SEPARATE_SPECULAR_COLOR) {
ctx->Light.Model.ColorControl = GL_SEPARATE_SPECULAR_COLOR;
- ctx->TriangleCaps |= DD_SEPERATE_SPECULAR;
+ SET_BITS(ctx->TriangleCaps, DD_SEPERATE_SPECULAR);
}
else {
gl_error( ctx, GL_INVALID_ENUM, "glLightModel(param)" );
@@ -343,6 +403,46 @@ void gl_LightModelfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
}
+void
+_mesa_LightModeliv( GLenum pname, const GLint *params )
+{
+ GLfloat fparam[4];
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLightModeliv");
+
+ switch (pname) {
+ case GL_LIGHT_MODEL_AMBIENT:
+ fparam[0] = INT_TO_FLOAT( params[0] );
+ fparam[1] = INT_TO_FLOAT( params[1] );
+ fparam[2] = INT_TO_FLOAT( params[2] );
+ fparam[3] = INT_TO_FLOAT( params[3] );
+ break;
+ case GL_LIGHT_MODEL_LOCAL_VIEWER:
+ case GL_LIGHT_MODEL_TWO_SIDE:
+ case GL_LIGHT_MODEL_COLOR_CONTROL:
+ fparam[0] = (GLfloat) params[0];
+ break;
+ default:
+ /* Error will be caught later in gl_LightModelfv */
+ ;
+ }
+ _mesa_LightModelfv( pname, fparam );
+}
+
+
+void
+_mesa_LightModeli( GLenum pname, GLint param )
+{
+ _mesa_LightModeliv( pname, &param );
+}
+
+
+void
+_mesa_LightModelf( GLenum pname, GLfloat param )
+{
+ _mesa_LightModelfv( pname, &param );
+}
+
/********** MATERIAL **********/
@@ -568,11 +668,11 @@ void gl_update_color_material( GLcontext *ctx,
GLfloat tmp[4], color[4];
UBYTE_RGBA_TO_FLOAT_RGBA( color, rgba );
-
+
if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
fprintf(stderr, "gl_update_color_material, mask %x\n", bitmask);
-
+
if (bitmask & FRONT_AMBIENT_BIT) {
struct gl_material *mat = &ctx->Light.Material[0];
SUB_3V( tmp, color, mat->Ambient );
@@ -675,8 +775,10 @@ void gl_update_color_material( GLcontext *ctx,
-void gl_ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode )
+void
+_mesa_ColorMaterial( GLenum face, GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint bitmask;
GLuint legal = (FRONT_EMISSION_BIT | BACK_EMISSION_BIT |
FRONT_SPECULAR_BIT | BACK_SPECULAR_BIT |
@@ -704,12 +806,21 @@ void gl_ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode )
+
+void
+_mesa_Materialf( GLenum face, GLenum pname, GLfloat param )
+{
+ _mesa_Materialfv( face, pname, &param );
+}
+
+
/* KW: This is now called directly (ie by name) from the glMaterial*
* API functions.
*/
-void gl_Materialfv( GLcontext *ctx,
- GLenum face, GLenum pname, const GLfloat *params )
+void
+_mesa_Materialfv( GLenum face, GLenum pname, const GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
struct immediate *IM;
struct gl_material *mat;
GLuint bitmask;
@@ -735,6 +846,7 @@ void gl_Materialfv( GLcontext *ctx,
IM->MaterialMask[count] = 0;
}
+
IM->MaterialMask[count] |= bitmask;
mat = IM->Material[count];
@@ -783,11 +895,48 @@ void gl_Materialfv( GLcontext *ctx,
}
+void
+_mesa_Materiali(GLenum face, GLenum pname, GLint param )
+{
+ _mesa_Materialiv(face, pname, &param);
+}
-void gl_GetMaterialfv( GLcontext *ctx,
- GLenum face, GLenum pname, GLfloat *params )
+void
+_mesa_Materialiv(GLenum face, GLenum pname, const GLint *params )
{
+ GLfloat fparam[4];
+ switch (pname) {
+ case GL_AMBIENT:
+ case GL_DIFFUSE:
+ case GL_SPECULAR:
+ case GL_EMISSION:
+ case GL_AMBIENT_AND_DIFFUSE:
+ fparam[0] = INT_TO_FLOAT( params[0] );
+ fparam[1] = INT_TO_FLOAT( params[1] );
+ fparam[2] = INT_TO_FLOAT( params[2] );
+ fparam[3] = INT_TO_FLOAT( params[3] );
+ break;
+ case GL_SHININESS:
+ fparam[0] = (GLfloat) params[0];
+ break;
+ case GL_COLOR_INDEXES:
+ fparam[0] = (GLfloat) params[0];
+ fparam[1] = (GLfloat) params[1];
+ fparam[2] = (GLfloat) params[2];
+ break;
+ default:
+ /* Error will be caught later in gl_Materialfv */
+ ;
+ }
+ _mesa_Materialfv(face, pname, fparam);
+}
+
+
+void
+_mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params )
+{
+ GET_CURRENT_CONTEXT(ctx);
GLuint f;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetMaterialfv");
@@ -830,9 +979,10 @@ void gl_GetMaterialfv( GLcontext *ctx,
-void gl_GetMaterialiv( GLcontext *ctx,
- GLenum face, GLenum pname, GLint *params )
+void
+_mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint f;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetMaterialiv");
@@ -1010,8 +1160,8 @@ void gl_compute_shine_table( GLcontext *ctx, GLuint i, GLfloat shininess )
-
-void gl_reinit_light_attrib( GLcontext *ctx, struct gl_light_attrib *l )
+#if 0
+static void gl_reinit_light_attrib( GLcontext *ctx, struct gl_light_attrib *l )
{
GLuint i;
@@ -1031,7 +1181,7 @@ void gl_reinit_light_attrib( GLcontext *ctx, struct gl_light_attrib *l )
insert_at_tail( &l->EnabledList, &l->Light[i] );
}
}
-
+#endif
/*
@@ -1121,7 +1271,7 @@ void gl_update_lighting( GLcontext *ctx )
void gl_compute_light_positions( GLcontext *ctx )
{
struct gl_light *light;
-
+
if (ctx->Light.NeedVertices && !ctx->Light.Model.LocalViewer) {
GLfloat eye_z[3] = { 0, 0, 1 };
if (!ctx->NeedEyeCoords) {
diff --git a/xc/extras/Mesa/src/light.h b/xc/extras/Mesa/src/light.h
index ef2999670..8ac4fc4fc 100644
--- a/xc/extras/Mesa/src/light.h
+++ b/xc/extras/Mesa/src/light.h
@@ -1,8 +1,8 @@
-/* $Id: light.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: light.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef LIGHT_H
#define LIGHT_H
@@ -42,44 +39,69 @@ struct gl_shine_tab {
};
-extern void gl_ShadeModel( GLcontext *ctx, GLenum mode );
+extern void
+_mesa_ShadeModel( GLenum mode );
-extern void gl_ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode );
+extern void
+_mesa_ColorMaterial( GLenum face, GLenum mode );
-extern void gl_Lightfv( GLcontext *ctx,
- GLenum light, GLenum pname, const GLfloat *params,
- GLint nparams );
+extern void
+_mesa_Lightf( GLenum light, GLenum pname, GLfloat param );
-extern void gl_LightModelfv( GLcontext *ctx,
- GLenum pname, const GLfloat *params );
+extern void
+_mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params );
+extern void
+_mesa_Lightiv( GLenum light, GLenum pname, const GLint *params );
-extern GLuint gl_material_bitmask( GLcontext *ctx,
- GLenum face, GLenum pname,
- GLuint legal,
- const char * );
+extern void
+_mesa_Lighti( GLenum light, GLenum pname, GLint param );
-extern void gl_set_material( GLcontext *ctx, GLuint bitmask,
- const GLfloat *params);
+extern void
+_mesa_LightModelf( GLenum pname, GLfloat param );
+
+extern void
+_mesa_LightModelfv( GLenum pname, const GLfloat *params );
+
+extern void
+_mesa_LightModeli( GLenum pname, GLint param );
-extern void gl_Materialfv( GLcontext *ctx,
- GLenum face, GLenum pname, const GLfloat *params );
+extern void
+_mesa_LightModeliv( GLenum pname, const GLint *params );
+extern void
+_mesa_Materialf( GLenum face, GLenum pname, GLfloat param );
+extern void
+_mesa_Materialfv( GLenum face, GLenum pname, const GLfloat *params );
-extern void gl_GetLightfv( GLcontext *ctx,
- GLenum light, GLenum pname, GLfloat *params );
+extern void
+_mesa_Materiali( GLenum face, GLenum pname, GLint param );
-extern void gl_GetLightiv( GLcontext *ctx,
- GLenum light, GLenum pname, GLint *params );
+extern void
+_mesa_Materialiv( GLenum face, GLenum pname, const GLint *params );
+extern void
+_mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params );
-extern void gl_GetMaterialfv( GLcontext *ctx,
- GLenum face, GLenum pname, GLfloat *params );
+extern void
+_mesa_GetLightiv( GLenum light, GLenum pname, GLint *params );
-extern void gl_GetMaterialiv( GLcontext *ctx,
- GLenum face, GLenum pname, GLint *params );
+extern void
+_mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params );
+extern void
+_mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params );
+
+
+
+extern GLuint gl_material_bitmask( GLcontext *ctx,
+ GLenum face, GLenum pname,
+ GLuint legal,
+ const char * );
+
+extern void gl_set_material( GLcontext *ctx, GLuint bitmask,
+ const GLfloat *params);
extern void gl_compute_spot_exp_table( struct gl_light *l );
diff --git a/xc/extras/Mesa/src/lines.c b/xc/extras/Mesa/src/lines.c
index 4abeede62..5df684fdf 100644
--- a/xc/extras/Mesa/src/lines.c
+++ b/xc/extras/Mesa/src/lines.c
@@ -1,8 +1,8 @@
-/* $Id: lines.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: lines.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,17 +25,10 @@
*/
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "depth.h"
#include "feedback.h"
@@ -50,8 +43,10 @@
-void gl_LineWidth( GLcontext *ctx, GLfloat width )
+void
+_mesa_LineWidth( GLfloat width )
{
+ GET_CURRENT_CONTEXT(ctx);
if (width<=0.0) {
gl_error( ctx, GL_INVALID_VALUE, "glLineWidth" );
return;
@@ -68,8 +63,10 @@ void gl_LineWidth( GLcontext *ctx, GLfloat width )
-void gl_LineStipple( GLcontext *ctx, GLint factor, GLushort pattern )
+void
+_mesa_LineStipple( GLint factor, GLushort pattern )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLineStipple");
ctx->Line.StippleFactor = CLAMP( factor, 1, 256 );
ctx->Line.StipplePattern = pattern;
@@ -1027,7 +1024,8 @@ void gl_set_line_function( GLcontext *ctx )
else {
if (ctx->Light.ShadeModel==GL_SMOOTH) {
/* Width==1, non-stippled, smooth-shaded */
- if (ctx->Depth.Test || ctx->FogMode == FOG_FRAGMENT) {
+ if (ctx->Depth.Test
+ || (ctx->Fog.Enabled && ctx->Hint.Fog==GL_NICEST)) {
if (rgbmode)
ctx->Driver.LineFunc = smooth_rgba_z_line;
else
@@ -1042,7 +1040,8 @@ void gl_set_line_function( GLcontext *ctx )
}
else {
/* Width==1, non-stippled, flat-shaded */
- if (ctx->Depth.Test || ctx->FogMode == FOG_FRAGMENT) {
+ if (ctx->Depth.Test
+ || (ctx->Fog.Enabled && ctx->Hint.Fog==GL_NICEST)) {
if (rgbmode)
ctx->Driver.LineFunc = flat_rgba_z_line;
else
diff --git a/xc/extras/Mesa/src/lines.h b/xc/extras/Mesa/src/lines.h
index 570e5ff0c..9dc5ff591 100644
--- a/xc/extras/Mesa/src/lines.h
+++ b/xc/extras/Mesa/src/lines.h
@@ -1,8 +1,8 @@
-/* $Id: lines.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: lines.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef LINES_H
#define LINES_H
@@ -35,11 +32,14 @@
#include "types.h"
-extern void gl_LineWidth( GLcontext *ctx, GLfloat width );
+extern void
+_mesa_LineWidth( GLfloat width );
-extern void gl_LineStipple( GLcontext *ctx, GLint factor, GLushort pattern );
+extern void
+_mesa_LineStipple( GLint factor, GLushort pattern );
-extern void gl_set_line_function( GLcontext *ctx );
+extern void
+gl_set_line_function( GLcontext *ctx );
#endif
diff --git a/xc/extras/Mesa/src/linetemp.h b/xc/extras/Mesa/src/linetemp.h
index 83d6b1615..eb5e4099b 100644
--- a/xc/extras/Mesa/src/linetemp.h
+++ b/xc/extras/Mesa/src/linetemp.h
@@ -1,4 +1,4 @@
-/* $Id: linetemp.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: linetemp.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -180,8 +180,8 @@
*/
#if CLIP_HACK
{
- GLint w = ctx->Buffer->Width;
- GLint h = ctx->Buffer->Height;
+ GLint w = ctx->DrawBuffer->Width;
+ GLint h = ctx->DrawBuffer->Height;
if ((x0==w) | (x1==w)) {
if ((x0==w) & (x1==w))
return;
@@ -253,7 +253,7 @@
ystep = -1;
#endif
#if INTERP_Z
- zPtrYstep = -ctx->Buffer->Width * ((GLint)sizeof(GLdepth));
+ zPtrYstep = -ctx->DrawBuffer->Width * ((GLint)sizeof(GLdepth));
#endif
#ifdef PIXEL_ADDRESS
pixelYstep = BYTES_PER_ROW;
@@ -264,7 +264,7 @@
ystep = 1;
#endif
#if INTERP_Z
- zPtrYstep = ctx->Buffer->Width * ((GLint)sizeof(GLdepth));
+ zPtrYstep = ctx->DrawBuffer->Width * ((GLint)sizeof(GLdepth));
#endif
#ifdef PIXEL_ADDRESS
pixelYstep = -(BYTES_PER_ROW);
diff --git a/xc/extras/Mesa/src/lnaatemp.h b/xc/extras/Mesa/src/lnaatemp.h
index 1fab71128..9b5bc89aa 100644
--- a/xc/extras/Mesa/src/lnaatemp.h
+++ b/xc/extras/Mesa/src/lnaatemp.h
@@ -1,4 +1,4 @@
-/* $Id: lnaatemp.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: lnaatemp.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/logic.c b/xc/extras/Mesa/src/logic.c
index dcf4e73fd..3e05e3ac6 100644
--- a/xc/extras/Mesa/src/logic.c
+++ b/xc/extras/Mesa/src/logic.c
@@ -1,8 +1,8 @@
-/* $Id: logic.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: logic.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,17 +25,10 @@
*/
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <stdlib.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "alphabuf.h"
#include "context.h"
#include "logic.h"
@@ -47,8 +40,10 @@
-void gl_LogicOp( GLcontext *ctx, GLenum opcode )
+void
+_mesa_LogicOp( GLenum opcode )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLogicOp");
switch (opcode) {
case GL_CLEAR:
@@ -74,9 +69,6 @@ void gl_LogicOp( GLcontext *ctx, GLenum opcode )
gl_error( ctx, GL_INVALID_ENUM, "glLogicOp" );
return;
}
-
- if (ctx->Driver.LogicOpcode)
- ctx->Driver.LogicOpcode( ctx, opcode );
}
@@ -378,7 +370,7 @@ void gl_logicop_rgba_span( GLcontext *ctx,
GLubyte rgba[][4], const GLubyte mask[] )
{
GLubyte dest[MAX_WIDTH][4];
- gl_read_rgba_span( ctx, n, x, y, dest );
+ gl_read_rgba_span( ctx, ctx->DrawBuffer, n, x, y, dest );
rgba_logicop( ctx, n, mask, (GLuint *) rgba, (const GLuint *) dest );
}
diff --git a/xc/extras/Mesa/src/logic.h b/xc/extras/Mesa/src/logic.h
index 415c127b0..ca3af0f73 100644
--- a/xc/extras/Mesa/src/logic.h
+++ b/xc/extras/Mesa/src/logic.h
@@ -1,8 +1,8 @@
-/* $Id: logic.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: logic.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef LOGIC_H
#define LOGIC_H
@@ -35,7 +32,8 @@
#include "types.h"
-extern void gl_LogicOp( GLcontext *ctx, GLenum opcode );
+extern void
+_mesa_LogicOp( GLenum opcode );
extern void gl_logicop_ci_span( GLcontext *ctx,
diff --git a/xc/extras/Mesa/src/lowpc.c b/xc/extras/Mesa/src/lowpc.c
index 39d84a45e..7073f6941 100644
--- a/xc/extras/Mesa/src/lowpc.c
+++ b/xc/extras/Mesa/src/lowpc.c
@@ -1,4 +1,4 @@
-/* $Id: lowpc.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: lowpc.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/macros.h b/xc/extras/Mesa/src/macros.h
index fa7ff081e..7be0641a4 100644
--- a/xc/extras/Mesa/src/macros.h
+++ b/xc/extras/Mesa/src/macros.h
@@ -1,8 +1,8 @@
-/* $Id: macros.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: macros.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
/*
* A collection of useful macros.
*/
@@ -36,13 +33,8 @@
#ifndef MACROS_H
#define MACROS_H
-#ifndef XFree86Server
-#include <assert.h>
-#include <math.h>
-#include <string.h>
-#else
-#include <GL/glx_ansic.h>
-#endif
+
+#include "glheader.h"
#ifdef DEBUG
@@ -61,6 +53,43 @@
#endif
+/* Limits: */
+#define MAX_GLUSHORT 0xffff
+#define MAX_GLUINT 0xffffffff
+
+
+/* Some compilers don't like some of Mesa's const usage */
+#ifdef NO_CONST
+# define CONST
+#else
+# define CONST const
+#endif
+
+
+/* Pi */
+#ifndef M_PI
+#define M_PI (3.1415926)
+#endif
+
+
+/* Degrees to radians conversion: */
+#define DEG2RAD (M_PI/180.0)
+
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+
+
+/*
+ * Bitmask helpers
+ */
+#define SET_BITS(WORD, BITS) (WORD) |= (BITS)
+#define CLEAR_BITS(WORD, BITS) (WORD) &= ~(BITS)
+#define TEST_BITS(WORD, BITS) ((WORD) & (BITS))
+
+
/* Stepping a GLfloat pointer by a byte stride
*/
#define STRIDE_F(p, i) (p = (GLfloat *)((GLubyte *)p + i))
@@ -68,11 +97,6 @@
#define STRIDE_T(p, t, i) (p = (t *)((GLubyte *)p + i))
-/* Limits: */
-#define MAX_GLUSHORT 0xffff
-#define MAX_GLUINT 0xffffffff
-
-
#define ZERO_2V( DST ) (DST)[0] = (DST)[1] = 0
#define ZERO_3V( DST ) (DST)[0] = (DST)[1] = (DST)[2] = 0
#define ZERO_4V( DST ) (DST)[0] = (DST)[1] = (DST)[2] = (DST)[3] = 0
@@ -165,26 +189,26 @@ do { \
#define ACC_4V( DST, SRC ) \
do { \
- (DST)[0] += (SRC)[0]; \
- (DST)[1] += (SRC)[1]; \
- (DST)[2] += (SRC)[2]; \
- (DST)[3] += (SRC)[3]; \
+ (DST)[0] += (SRC)[0]; \
+ (DST)[1] += (SRC)[1]; \
+ (DST)[2] += (SRC)[2]; \
+ (DST)[3] += (SRC)[3]; \
} while (0)
#define ACC_SCALE_4V( DST, SRCA, SRCB ) \
do { \
- (DST)[0] += (SRCA)[0] * (SRCB)[0]; \
- (DST)[1] += (SRCA)[1] * (SRCB)[1]; \
- (DST)[2] += (SRCA)[2] * (SRCB)[2]; \
- (DST)[3] += (SRCA)[3] * (SRCB)[3]; \
+ (DST)[0] += (SRCA)[0] * (SRCB)[0]; \
+ (DST)[1] += (SRCA)[1] * (SRCB)[1]; \
+ (DST)[2] += (SRCA)[2] * (SRCB)[2]; \
+ (DST)[3] += (SRCA)[3] * (SRCB)[3]; \
} while (0)
#define ACC_SCALE_SCALAR_4V( DST, S, SRCB ) \
do { \
- (DST)[0] += S * (SRCB)[0]; \
- (DST)[1] += S * (SRCB)[1]; \
- (DST)[2] += S * (SRCB)[2]; \
- (DST)[3] += S * (SRCB)[3]; \
+ (DST)[0] += S * (SRCB)[0]; \
+ (DST)[1] += S * (SRCB)[1]; \
+ (DST)[2] += S * (SRCB)[2]; \
+ (DST)[3] += S * (SRCB)[3]; \
} while (0)
#define SCALE_SCALAR_4V( DST, S, SRCB ) \
@@ -421,18 +445,12 @@ do { \
* Integer / float conversion for colors, normals, etc.
*/
-
-
-
#define BYTE_TO_UBYTE(b) (b < 0 ? 0 : (GLubyte) b)
#define SHORT_TO_UBYTE(s) (s < 0 ? 0 : (GLubyte) (s >> 7))
#define USHORT_TO_UBYTE(s) (GLubyte) (s >> 8)
#define INT_TO_UBYTE(i) (i < 0 ? 0 : (GLubyte) (i >> 23))
#define UINT_TO_UBYTE(i) (GLubyte) (i >> 24)
-
-
-
/* Convert GLubyte in [0,255] to GLfloat in [0.0,1.0] */
#define UBYTE_TO_FLOAT(B) ((GLfloat) (B) * (1.0F / 255.0F))
@@ -479,93 +497,4 @@ do { \
#define FLOAT_TO_INT(X) ( (GLint) (2147483647.0 * (X)) )
-
-/*
- * Memory allocation
- * XXX these should probably go into a new glmemory.h file.
- */
-#ifdef DEBUG
-extern void *gl_malloc(size_t bytes);
-extern void *gl_calloc(size_t bytes);
-extern void gl_free(void *ptr);
-#define MALLOC(BYTES) gl_malloc(BYTES)
-#define CALLOC(BYTES) gl_calloc(BYTES)
-#define MALLOC_STRUCT(T) (struct T *) gl_malloc(sizeof(struct T))
-#define CALLOC_STRUCT(T) (struct T *) gl_calloc(sizeof(struct T))
-#define FREE(PTR) gl_free(PTR)
-#else
-#define MALLOC(BYTES) (void *) malloc(BYTES)
-#define CALLOC(BYTES) (void *) calloc(1, BYTES)
-#define MALLOC_STRUCT(T) (struct T *) malloc(sizeof(struct T))
-#define CALLOC_STRUCT(T) (struct T *) calloc(1,sizeof(struct T))
-#define FREE(PTR) free(PTR)
-#endif
-
-
-/* Memory copy: */
-#ifdef SUNOS4
-#define MEMCPY( DST, SRC, BYTES) \
- memcpy( (char *) (DST), (char *) (SRC), (int) (BYTES) )
-#else
-#define MEMCPY( DST, SRC, BYTES) \
- memcpy( (void *) (DST), (void *) (SRC), (size_t) (BYTES) )
-#endif
-
-
-/* Memory set: */
-#ifdef SUNOS4
-#define MEMSET( DST, VAL, N ) \
- memset( (char *) (DST), (int) (VAL), (int) (N) )
-#else
-#define MEMSET( DST, VAL, N ) \
- memset( (void *) (DST), (int) (VAL), (size_t) (N) )
-#endif
-
-
-/* MACs and BeOS don't support static larger than 32kb, so... */
-#if defined(macintosh) && !defined(__MRC__)
- extern char *AGLAlloc(int size);
- extern void AGLFree(char* ptr);
-# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)AGLAlloc(sizeof(TYPE)*(SIZE))
-# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])AGLAlloc(sizeof(TYPE)*(SIZE1)*(SIZE2))
-# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)
-# define UNDEFARRAY(NAME) do {if ((NAME)) {AGLFree((char*)NAME);} }while (0)
-#elif defined(__BEOS__)
-# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)malloc(sizeof(TYPE)*(SIZE))
-# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])malloc(sizeof(TYPE)*(SIZE1)*(SIZE2))
-# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)
-# define UNDEFARRAY(NAME) do {if ((NAME)) {free((char*)NAME);} }while (0)
-#else
-# define DEFARRAY(TYPE,NAME,SIZE) TYPE NAME[SIZE]
-# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE NAME[SIZE1][SIZE2]
-# define CHECKARRAY(NAME,CMD) do {} while(0)
-# define UNDEFARRAY(NAME)
-#endif
-
-
-/* Some compilers don't like some of Mesa's const usage */
-#ifdef NO_CONST
-# define CONST
-#else
-# define CONST const
-#endif
-
-
-
-/* Pi */
-#ifndef M_PI
-#define M_PI (3.1415926)
-#endif
-
-
-/* Degrees to radians conversion: */
-#define DEG2RAD (M_PI/180.0)
-
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-
-
#endif /*MACROS_H*/
diff --git a/xc/extras/Mesa/src/masking.c b/xc/extras/Mesa/src/masking.c
index 33bb282bd..8fdfdef55 100644
--- a/xc/extras/Mesa/src/masking.c
+++ b/xc/extras/Mesa/src/masking.c
@@ -1,8 +1,8 @@
-/* $Id: masking.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: masking.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
/*
* Implement the effect of glColorMask and glIndexMask in software.
*/
@@ -36,12 +33,7 @@
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <string.h>
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "alphabuf.h"
#include "context.h"
#include "enums.h"
@@ -54,8 +46,10 @@
-void gl_IndexMask( GLcontext *ctx, GLuint mask )
+void
+_mesa_IndexMask( GLuint mask )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glIndexMask");
ctx->Color.IndexMask = mask;
ctx->NewState |= NEW_RASTER_OPS;
@@ -63,9 +57,11 @@ void gl_IndexMask( GLcontext *ctx, GLuint mask )
-void gl_ColorMask( GLcontext *ctx, GLboolean red, GLboolean green,
- GLboolean blue, GLboolean alpha )
+void
+_mesa_ColorMask( GLboolean red, GLboolean green,
+ GLboolean blue, GLboolean alpha )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glColorMask");
if (MESA_VERBOSE & VERBOSE_API)
@@ -98,7 +94,7 @@ void gl_mask_rgba_span( GLcontext *ctx,
GLuint *dest32 = (GLuint *) dest;
GLuint i;
- gl_read_rgba_span( ctx, n, x, y, dest );
+ gl_read_rgba_span( ctx, ctx->DrawBuffer, n, x, y, dest );
for (i=0; i<n; i++) {
rgba32[i] = (rgba32[i] & srcMask) | (dest32[i] & dstMask);
@@ -143,7 +139,7 @@ void gl_mask_index_span( GLcontext *ctx,
GLuint fbindexes[MAX_WIDTH];
GLuint msrc, mdest;
- gl_read_index_span( ctx, n, x, y, fbindexes );
+ gl_read_index_span( ctx, ctx->DrawBuffer, n, x, y, fbindexes );
msrc = ctx->Color.IndexMask;
mdest = ~msrc;
diff --git a/xc/extras/Mesa/src/masking.h b/xc/extras/Mesa/src/masking.h
index a340c1ef4..514abee5a 100644
--- a/xc/extras/Mesa/src/masking.h
+++ b/xc/extras/Mesa/src/masking.h
@@ -1,8 +1,8 @@
-/* $Id: masking.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: masking.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef MASKING_H
#define MASKING_H
@@ -36,10 +33,12 @@
-extern void gl_IndexMask( GLcontext *ctx, GLuint mask );
+extern void
+_mesa_IndexMask( GLuint mask );
-extern void gl_ColorMask( GLcontext *ctx, GLboolean red, GLboolean green,
- GLboolean blue, GLboolean alpha );
+extern void
+_mesa_ColorMask( GLboolean red, GLboolean green,
+ GLboolean blue, GLboolean alpha );
/*
diff --git a/xc/extras/Mesa/src/matrix.c b/xc/extras/Mesa/src/matrix.c
index 3cf98c415..64d6274cf 100644
--- a/xc/extras/Mesa/src/matrix.c
+++ b/xc/extras/Mesa/src/matrix.c
@@ -1,10 +1,10 @@
-/* $Id: matrix.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: matrix.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -25,9 +25,6 @@
*/
-
-
-
/*
* Matrix operations
*
@@ -43,18 +40,11 @@
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "enums.h"
-#include "macros.h"
#include "matrix.h"
+#include "mem.h"
#include "mmath.h"
#include "types.h"
#endif
@@ -547,6 +537,50 @@ GLboolean gl_matrix_invert( GLmatrix *mat )
+void gl_matrix_transposef( GLfloat to[16], const GLfloat from[16] )
+{
+ to[0] = from[0];
+ to[1] = from[4];
+ to[2] = from[8];
+ to[3] = from[12];
+ to[4] = from[1];
+ to[5] = from[5];
+ to[6] = from[9];
+ to[7] = from[13];
+ to[8] = from[2];
+ to[9] = from[6];
+ to[10] = from[10];
+ to[11] = from[14];
+ to[12] = from[3];
+ to[13] = from[7];
+ to[14] = from[11];
+ to[15] = from[15];
+}
+
+
+
+void gl_matrix_transposed( GLdouble to[16], const GLdouble from[16] )
+{
+ to[0] = from[0];
+ to[1] = from[4];
+ to[2] = from[8];
+ to[3] = from[12];
+ to[4] = from[1];
+ to[5] = from[5];
+ to[6] = from[9];
+ to[7] = from[13];
+ to[8] = from[2];
+ to[9] = from[6];
+ to[10] = from[10];
+ to[11] = from[14];
+ to[12] = from[3];
+ to[13] = from[7];
+ to[14] = from[11];
+ to[15] = from[15];
+}
+
+
+
/*
* Generate a 4x4 transformation matrix from glRotate parameters.
*/
@@ -902,11 +936,12 @@ do { \
} while (0)
-void gl_Frustum( GLcontext *ctx,
- GLdouble left, GLdouble right,
- GLdouble bottom, GLdouble top,
- GLdouble nearval, GLdouble farval )
+void
+_mesa_Frustum( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble nearval, GLdouble farval )
{
+ GET_CURRENT_CONTEXT(ctx);
GLfloat x, y, a, b, c, d;
GLfloat m[16];
GLmatrix *mat = 0;
@@ -952,11 +987,12 @@ void gl_Frustum( GLcontext *ctx,
}
-void gl_Ortho( GLcontext *ctx,
- GLdouble left, GLdouble right,
- GLdouble bottom, GLdouble top,
- GLdouble nearval, GLdouble farval )
+void
+_mesa_Ortho( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble nearval, GLdouble farval )
{
+ GET_CURRENT_CONTEXT(ctx);
GLfloat x, y, z;
GLfloat tx, ty, tz;
GLfloat m[16];
@@ -991,8 +1027,10 @@ void gl_Ortho( GLcontext *ctx,
}
-void gl_MatrixMode( GLcontext *ctx, GLenum mode )
+void
+_mesa_MatrixMode( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMatrixMode");
switch (mode) {
case GL_MODELVIEW:
@@ -1007,8 +1045,10 @@ void gl_MatrixMode( GLcontext *ctx, GLenum mode )
-void gl_PushMatrix( GLcontext *ctx )
+void
+_mesa_PushMatrix( void )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPushMatrix");
if (MESA_VERBOSE&VERBOSE_API)
@@ -1056,8 +1096,10 @@ void gl_PushMatrix( GLcontext *ctx )
-void gl_PopMatrix( GLcontext *ctx )
+void
+_mesa_PopMatrix( void )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPopMatrix");
if (MESA_VERBOSE&VERBOSE_API)
@@ -1111,8 +1153,10 @@ void gl_PopMatrix( GLcontext *ctx )
-void gl_LoadIdentity( GLcontext *ctx )
+void
+_mesa_LoadIdentity( void )
{
+ GET_CURRENT_CONTEXT(ctx);
GLmatrix *mat = 0;
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glLoadIdentity");
@@ -1131,8 +1175,10 @@ void gl_LoadIdentity( GLcontext *ctx )
}
-void gl_LoadMatrixf( GLcontext *ctx, const GLfloat *m )
+void
+_mesa_LoadMatrixf( const GLfloat *m )
{
+ GET_CURRENT_CONTEXT(ctx);
GLmatrix *mat = 0;
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glLoadMatrix");
@@ -1162,12 +1208,25 @@ void gl_LoadMatrixf( GLcontext *ctx, const GLfloat *m )
}
+void
+_mesa_LoadMatrixd( const GLdouble *m )
+{
+ GLfloat f[16];
+ GLint i;
+ for (i = 0; i < 16; i++)
+ f[i] = m[i];
+ _mesa_LoadMatrixf(f);
+}
+
+
/*
* Multiply the active matrix by an arbitary matrix.
*/
-void gl_MultMatrixf( GLcontext *ctx, const GLfloat *m )
+void
+_mesa_MultMatrixf( const GLfloat *m )
{
+ GET_CURRENT_CONTEXT(ctx);
GLmatrix *mat = 0;
GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glMultMatrix" );
matmul4( mat->m, mat->m, m );
@@ -1178,8 +1237,10 @@ void gl_MultMatrixf( GLcontext *ctx, const GLfloat *m )
/*
* Multiply the active matrix by an arbitary matrix.
*/
-void gl_MultMatrixd( GLcontext *ctx, const GLdouble *m )
+void
+_mesa_MultMatrixd( const GLdouble *m )
{
+ GET_CURRENT_CONTEXT(ctx);
GLmatrix *mat = 0;
GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glMultMatrix" );
matmul4fd( mat->m, mat->m, m );
@@ -1227,9 +1288,10 @@ void gl_mat_mul_mat( GLmatrix *mat, const GLmatrix *m )
/*
* Execute a glRotate call
*/
-void gl_Rotatef( GLcontext *ctx,
- GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
+void
+_mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
{
+ GET_CURRENT_CONTEXT(ctx);
GLfloat m[16];
if (angle != 0.0F) {
GLmatrix *mat = 0;
@@ -1240,11 +1302,20 @@ void gl_Rotatef( GLcontext *ctx,
}
}
+void
+_mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z )
+{
+ _mesa_Rotatef(angle, x, y, z);
+}
+
+
/*
* Execute a glScale call
*/
-void gl_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z )
+void
+_mesa_Scalef( GLfloat x, GLfloat y, GLfloat z )
{
+ GET_CURRENT_CONTEXT(ctx);
GLmatrix *mat = 0;
GLfloat *m;
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glScale");
@@ -1265,11 +1336,21 @@ void gl_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z )
MAT_DIRTY_DEPENDENTS);
}
+
+void
+_mesa_Scaled( GLdouble x, GLdouble y, GLdouble z )
+{
+ _mesa_Scalef(x, y, z);
+}
+
+
/*
* Execute a glTranslate call
*/
-void gl_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z )
+void
+_mesa_Translatef( GLfloat x, GLfloat y, GLfloat z )
{
+ GET_CURRENT_CONTEXT(ctx);
GLmatrix *mat = 0;
GLfloat *m;
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glTranslate");
@@ -1286,12 +1367,72 @@ void gl_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z )
}
+void
+_mesa_Translated( GLdouble x, GLdouble y, GLdouble z )
+{
+ _mesa_Translatef(x, y, z);
+}
+
+
+
+void
+_mesa_LoadTransposeMatrixfARB( const GLfloat *m )
+{
+ GLfloat tm[16];
+ gl_matrix_transposef(tm, m);
+ _mesa_LoadMatrixf(tm);
+}
+
+
+void
+_mesa_LoadTransposeMatrixdARB( const GLdouble *m )
+{
+ GLdouble tm[16];
+ gl_matrix_transposed(tm, m);
+ _mesa_LoadMatrixd(tm);
+}
+
+
+void
+_mesa_MultTransposeMatrixfARB( const GLfloat *m )
+{
+ GLfloat tm[16];
+ gl_matrix_transposef(tm, m);
+ _mesa_MultMatrixf(tm);
+}
+
+
+void
+_mesa_MultTransposeMatrixdARB( const GLdouble *m )
+{
+ GLdouble tm[16];
+ gl_matrix_transposed(tm, m);
+ _mesa_MultMatrixd(tm);
+}
+
+
+/*
+ * Called via glViewport or display list execution.
+ */
+void
+_mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ gl_Viewport(ctx, x, y, width, height);
+}
+
+
+
/*
* Define a new viewport and reallocate auxillary buffers if the size of
* the window (color buffer) has changed.
+ *
+ * XXX This is directly called by device drivers, BUT this function
+ * may be renamed _mesa_Viewport (without ctx arg) in the future so
+ * use of _mesa_Viewport is encouraged.
*/
-void gl_Viewport( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height )
+void
+gl_Viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height )
{
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glViewport");
@@ -1330,15 +1471,15 @@ void gl_Viewport( GLcontext *ctx,
/* Check if window/buffer has been resized and if so, reallocate the
* ancillary buffers.
*/
- gl_ResizeBuffersMESA(ctx);
+ _mesa_ResizeBuffersMESA();
ctx->RasterMask &= ~WINCLIP_BIT;
if ( ctx->Viewport.X<0
- || ctx->Viewport.X + ctx->Viewport.Width > ctx->Buffer->Width
+ || ctx->Viewport.X + ctx->Viewport.Width > ctx->DrawBuffer->Width
|| ctx->Viewport.Y<0
- || ctx->Viewport.Y + ctx->Viewport.Height > ctx->Buffer->Height) {
+ || ctx->Viewport.Y + ctx->Viewport.Height > ctx->DrawBuffer->Height) {
ctx->RasterMask |= WINCLIP_BIT;
}
@@ -1350,7 +1491,8 @@ void gl_Viewport( GLcontext *ctx,
-void gl_DepthRange( GLcontext *ctx, GLclampd nearval, GLclampd farval )
+void
+_mesa_DepthRange( GLclampd nearval, GLclampd farval )
{
/*
* nearval - specifies mapping of the near clipping plane to window
@@ -1364,7 +1506,7 @@ void gl_DepthRange( GLcontext *ctx, GLclampd nearval, GLclampd farval )
* this range to window z coords.
*/
GLfloat n, f;
-
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDepthRange");
if (MESA_VERBOSE&VERBOSE_API)
@@ -1412,13 +1554,14 @@ void gl_matrix_dtr( GLmatrix *m )
}
}
+#if 0
void gl_matrix_set_identity( GLmatrix *m )
{
MEMCPY( m->m, Identity, sizeof(Identity));
m->type = MATRIX_IDENTITY;
m->flags = MAT_DIRTY_DEPENDENTS;
}
-
+#endif
void gl_matrix_alloc_inv( GLmatrix *m )
{
diff --git a/xc/extras/Mesa/src/matrix.h b/xc/extras/Mesa/src/matrix.h
index 158ce53b0..4257e603e 100644
--- a/xc/extras/Mesa/src/matrix.h
+++ b/xc/extras/Mesa/src/matrix.h
@@ -1,8 +1,8 @@
-/* $Id: matrix.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: matrix.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,16 +25,14 @@
*/
-
-
-
#ifndef MATRIX_H
#define MATRIX_H
-#include "GL/gl.h"
+#include "types.h"
#include "config.h"
+
typedef struct {
GLfloat m[16];
GLfloat *inv; /* optional */
@@ -42,78 +40,120 @@ typedef struct {
GLuint type;
} GLmatrix;
+
#ifdef VMS
#define gl_calculate_model_project_matrix gl_calculate_model_project_matr
#endif
+extern void gl_matrix_transposef( GLfloat to[16], const GLfloat from[16] );
+
+extern void gl_matrix_transposed( GLdouble to[16], const GLdouble from[16] );
+
+
extern void gl_rotation_matrix( GLfloat angle, GLfloat x, GLfloat y, GLfloat z,
GLfloat m[] );
+extern void gl_mat_mul_floats( GLmatrix *mat, const GLfloat *m, GLuint flags );
-extern void gl_Frustum( GLcontext *ctx,
- GLdouble left, GLdouble right,
- GLdouble bottom, GLdouble top,
- GLdouble nearval, GLdouble farval );
+extern void gl_mat_mul_mat( GLmatrix *mat, const GLmatrix *mat2 );
-extern void gl_Ortho( GLcontext *ctx,
- GLdouble left, GLdouble right,
- GLdouble bottom, GLdouble top,
- GLdouble nearval, GLdouble farval );
+extern void gl_calculate_model_project_matrix( GLcontext *ctx );
-extern void gl_PushMatrix( GLcontext *ctx );
+extern void gl_matrix_copy( GLmatrix *to, const GLmatrix *from );
-extern void gl_PopMatrix( GLcontext *ctx );
+extern void gl_matrix_ctr( GLmatrix *m );
-extern void gl_LoadIdentity( GLcontext *ctx );
+extern void gl_matrix_dtr( GLmatrix *m );
-extern void gl_LoadMatrixf( GLcontext *ctx, const GLfloat *m );
+extern void gl_matrix_alloc_inv( GLmatrix *m );
-extern void gl_MatrixMode( GLcontext *ctx, GLenum mode );
+extern void gl_matrix_mul( GLmatrix *dest,
+ const GLmatrix *a,
+ const GLmatrix *b );
-extern void gl_MultMatrixf( GLcontext *ctx, const GLfloat *m );
+extern void gl_matrix_analyze( GLmatrix *mat );
-extern void gl_mat_mul_floats( GLmatrix *mat, const GLfloat *m, GLuint flags );
-extern void gl_mat_mul_mat( GLmatrix *mat, const GLmatrix *mat2 );
+extern GLboolean gl_matrix_invert( GLmatrix *mat );
-extern void gl_Rotatef( GLcontext *ctx,
- GLfloat angle, GLfloat x, GLfloat y, GLfloat z );
+extern void gl_print_matrix( const GLmatrix *m );
-extern void gl_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z );
-extern void gl_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z );
-extern void gl_Viewport( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height );
+extern void
+_mesa_Frustum( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble nearval, GLdouble farval );
-extern void gl_DepthRange( GLcontext* ctx, GLclampd nearval, GLclampd farval );
+extern void
+_mesa_Ortho( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble nearval, GLdouble farval );
+extern void
+_mesa_PushMatrix( void );
+extern void
+_mesa_PopMatrix( void );
+extern void
+_mesa_LoadIdentity( void );
+extern void
+_mesa_LoadMatrixf( const GLfloat *m );
-extern void gl_calculate_model_project_matrix( GLcontext *ctx );
+extern void
+_mesa_LoadMatrixd( const GLdouble *m );
+extern void
+_mesa_MatrixMode( GLenum mode );
-extern void gl_matrix_ctr( GLmatrix *m );
+extern void
+_mesa_MultMatrixf( const GLfloat *m );
-extern void gl_matrix_dtr( GLmatrix *m );
+extern void
+_mesa_MultMatrixd( const GLdouble *m );
-extern void gl_matrix_alloc_inv( GLmatrix *m );
+extern void
+_mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z );
-extern void gl_matrix_copy( GLmatrix *to, const GLmatrix *from );
+extern void
+_mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z );
-extern void gl_matrix_mul( GLmatrix *dest,
- const GLmatrix *a,
- const GLmatrix *b );
+extern void
+_mesa_Scalef( GLfloat x, GLfloat y, GLfloat z );
-extern void gl_matrix_analyze( GLmatrix *mat );
+extern void
+_mesa_Scaled( GLdouble x, GLdouble y, GLdouble z );
+extern void
+_mesa_Translatef( GLfloat x, GLfloat y, GLfloat z );
+
+extern void
+_mesa_Translated( GLdouble x, GLdouble y, GLdouble z );
+
+extern void
+_mesa_LoadTransposeMatrixfARB( const GLfloat *m );
+
+extern void
+_mesa_LoadTransposeMatrixdARB( const GLdouble *m );
+
+extern void
+_mesa_MultTransposeMatrixfARB( const GLfloat *m );
+
+extern void
+_mesa_MultTransposeMatrixdARB( const GLdouble *m );
+
+extern void
+_mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height );
+
+extern void
+gl_Viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height );
+
+extern void
+_mesa_DepthRange( GLclampd nearval, GLclampd farval );
-extern void gl_MultMatrixd( GLcontext *ctx, const GLdouble *m );
-extern GLboolean gl_matrix_invert( GLmatrix *mat );
-extern void gl_print_matrix( const GLmatrix *m );
#endif
diff --git a/xc/extras/Mesa/src/mem.c b/xc/extras/Mesa/src/mem.c
new file mode 100644
index 000000000..73cd6c1c1
--- /dev/null
+++ b/xc/extras/Mesa/src/mem.c
@@ -0,0 +1,74 @@
+/* $Id: mem.c,v 1.2 2000/01/30 00:27:02 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+/*
+ * Memory allocation functions. Called via the MALLOC, CALLOC and
+ * FREE macros when DEBUG symbol is defined.
+ * You might want to set breakpoints on these functions or plug in
+ * other memory allocation functions. The Mesa sources should only
+ * use the MALLOC and FREE macros (which could also be overriden).
+ */
+
+#ifdef PC_HEADER
+#include "all.h"
+#else
+#include "glheader.h"
+#include "mem.h"
+#endif
+
+
+
+/*
+ * Allocate memory (uninitialized)
+ */
+void *
+_mesa_malloc(size_t bytes)
+{
+ return malloc(bytes);
+}
+
+
+/*
+ * Allocate memory and initialize to zero.
+ */
+void *
+_mesa_calloc(size_t bytes)
+{
+ return calloc(1, bytes);
+}
+
+
+/*
+ * Free memory
+ */
+void
+_mesa_free(void *ptr)
+{
+ free(ptr);
+}
+
+
diff --git a/xc/extras/Mesa/src/mem.h b/xc/extras/Mesa/src/mem.h
new file mode 100644
index 000000000..86d0b81e9
--- /dev/null
+++ b/xc/extras/Mesa/src/mem.h
@@ -0,0 +1,106 @@
+/* $Id: mem.h,v 1.2 2000/01/30 00:27:02 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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 MEM_H
+#define MEM_H
+
+
+#include "glheader.h"
+
+
+/*
+ * Memory allocation
+ */
+#ifdef DEBUG
+
+/* call Mesa memory functions */
+extern void *_mesa_malloc(size_t bytes);
+extern void *_mesa_calloc(size_t bytes);
+extern void _mesa_free(void *ptr);
+#define MALLOC(BYTES) _mesa_malloc(BYTES)
+#define CALLOC(BYTES) _mesa_calloc(BYTES)
+#define MALLOC_STRUCT(T) (struct T *) _mesa_malloc(sizeof(struct T))
+#define CALLOC_STRUCT(T) (struct T *) _mesa_calloc(sizeof(struct T))
+#define FREE(PTR) _mesa_free(PTR)
+
+#else
+
+/* directly call C lib memory functions */
+#define MALLOC(BYTES) (void *) malloc(BYTES)
+#define CALLOC(BYTES) (void *) calloc(1, BYTES)
+#define MALLOC_STRUCT(T) (struct T *) malloc(sizeof(struct T))
+#define CALLOC_STRUCT(T) (struct T *) calloc(1,sizeof(struct T))
+#define FREE(PTR) free(PTR)
+
+#endif
+
+
+/* Memory copy: */
+#ifdef SUNOS4
+#define MEMCPY( DST, SRC, BYTES) \
+ memcpy( (char *) (DST), (char *) (SRC), (int) (BYTES) )
+#else
+#define MEMCPY( DST, SRC, BYTES) \
+ memcpy( (void *) (DST), (void *) (SRC), (size_t) (BYTES) )
+#endif
+
+
+/* Memory set: */
+#ifdef SUNOS4
+#define MEMSET( DST, VAL, N ) \
+ memset( (char *) (DST), (int) (VAL), (int) (N) )
+#else
+#define MEMSET( DST, VAL, N ) \
+ memset( (void *) (DST), (int) (VAL), (size_t) (N) )
+#endif
+
+
+
+/* MACs and BeOS don't support static larger than 32kb, so... */
+#if defined(macintosh) && !defined(__MRC__)
+ extern char *AGLAlloc(int size);
+ extern void AGLFree(char* ptr);
+# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)AGLAlloc(sizeof(TYPE)*(SIZE))
+# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])AGLAlloc(sizeof(TYPE)*(SIZE1)*(SIZE2))
+# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)
+# define UNDEFARRAY(NAME) do {if ((NAME)) {AGLFree((char*)NAME);} }while (0)
+#elif defined(__BEOS__)
+# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)malloc(sizeof(TYPE)*(SIZE))
+# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])malloc(sizeof(TYPE)*(SIZE1)*(SIZE2))
+# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)
+# define UNDEFARRAY(NAME) do {if ((NAME)) {free((char*)NAME);} }while (0)
+#else
+# define DEFARRAY(TYPE,NAME,SIZE) TYPE NAME[SIZE]
+# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE NAME[SIZE1][SIZE2]
+# define CHECKARRAY(NAME,CMD) do {} while(0)
+# define UNDEFARRAY(NAME)
+#endif
+
+
+
+
+#endif
diff --git a/xc/extras/Mesa/src/mmath.c b/xc/extras/Mesa/src/mmath.c
index 537655494..e7fed551a 100644
--- a/xc/extras/Mesa/src/mmath.c
+++ b/xc/extras/Mesa/src/mmath.c
@@ -1,4 +1,4 @@
-/* $Id: mmath.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: mmath.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,28 +23,18 @@
* 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.
*/
-/* $XFree86: xc/lib/GL/mesa/src/mmath.c,v 1.2 1999/04/04 00:20:28 dawes Exp $ */
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <math.h>
-#else
-#include "GL/xf86glx.h"
-#endif
-#include "GL/gl.h"
+#include "glheader.h"
#include "mmath.h"
#endif
static int in_fast_math;
-
/*
* A High Speed, Low Precision Square Root
* by Paul Lalonde and Robert Dawson
@@ -99,8 +89,8 @@ static void init_sqrt(void)
sqrttab[i+0x80] = (*fi & 0x7fffff) >> 16;
}
#else
- (void) sqrttab; /* silence compiler warning - unused var */
-#endif
+ (void) sqrttab; /* silence compiler warnings */
+#endif /*FAST_MATH*/
}
diff --git a/xc/extras/Mesa/src/mmath.h b/xc/extras/Mesa/src/mmath.h
index 44037716b..08c1b70c3 100644
--- a/xc/extras/Mesa/src/mmath.h
+++ b/xc/extras/Mesa/src/mmath.h
@@ -1,8 +1,8 @@
-/* $Id: mmath.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: mmath.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -23,10 +23,6 @@
* 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.
*/
-/* $XFree86: xc/lib/GL/mesa/src/mmath.h,v 1.2 1999/04/04 00:20:28 dawes Exp $ */
-
-
-
/*
@@ -39,15 +35,9 @@
#ifndef MMATH_H
#define MMATH_H
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-#ifndef XFree86Server
-#include <math.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
+
/*
* Set the x86 FPU control word to guarentee only 32 bits of presision
@@ -73,7 +63,7 @@ typedef unsigned short fpu_control_t;
/* Set it up how we want it.
*/
#if !defined(NO_FAST_MATH)
-#define START_FAST_MATH(x) \
+#define START_FAST_MATH(x) \
{ \
static fpu_control_t mask = _FPU_SINGLE | _FPU_MASK_IM \
| _FPU_MASK_DM | _FPU_MASK_ZM | _FPU_MASK_OM \
@@ -99,6 +89,47 @@ typedef unsigned short fpu_control_t;
#define HAVE_FAST_MATH
+#elif defined(__WATCOMC__) && !defined(NO_FAST_MATH)
+
+/* This is the watcom specific inline assembly version of setcw and getcw */
+
+void START_FAST_MATH2(unsigned short *x);
+#pragma aux START_FAST_MATH2 = \
+ "fstcw word ptr [esi]" \
+ "or word ptr [esi], 0x3f" \
+ "fldcw word ptr [esi]" \
+ parm [esi] \
+ modify exact [];
+
+void END_FAST_MATH2(unsigned short *x);
+#pragma aux END_FAST_MATH2 = \
+ "fldcw word ptr [esi]" \
+ parm [esi] \
+ modify exact [];
+
+#define START_FAST_MATH(x) START_FAST_MATH2(& x)
+#define END_FAST_MATH(x) END_FAST_MATH2(& x)
+
+/*
+__inline START_FAST_MATH(unsigned short x)
+ {
+ _asm {
+ fstcw ax
+ mov x , ax
+ or ax, 0x3f
+ fldcw ax
+ }
+ }
+
+__inline END_FAST_MATH(unsigned short x)
+ {
+ _asm {
+ fldcw x
+ }
+ }
+*/
+#define HAVE_FAST_MATH
+
#else
#define START_FAST_MATH(x) (void)(x)
#define END_FAST_MATH(x) (void)(x)
@@ -131,34 +162,51 @@ static __inline int FloatToInt(float f)
{
int r;
_asm {
- fld f
- fistp r
- }
+ fld f
+ fistp r
+ }
return r;
}
+#elif defined(__WATCOMC__)
+long FloatToInt(float f);
+#pragma aux FloatToInt = \
+ "push eax" \
+ "fistp dword ptr [esp]" \
+ "pop eax" \
+ parm [8087] \
+ value [eax] \
+ modify exact [eax];
+float asm_sqrt (float x);
+#pragma aux asm_sqrt = \
+ "fsqrt" \
+ parm [8087] \
+ value [8087] \
+ modify exact [];
+#else
+#define FloatToInt(F) ((int) (F))
#endif
#else
#define FloatToInt(F) ((int) (F))
#endif
-
-
-
/*
* Square root
*/
extern float gl_sqrt(float x);
-
+
#ifdef FAST_MATH
+#if defined (__WATCOMC__) && defined(USE_X86_ASM)
+# define GL_SQRT(X) asm_sqrt(X)
+#else
# define GL_SQRT(X) gl_sqrt(X)
+#endif
#else
# define GL_SQRT(X) sqrt(X)
#endif
-
/*
* Normalize a 3-element vector to unit length.
*/
diff --git a/xc/extras/Mesa/src/mthreads.c b/xc/extras/Mesa/src/mthreads.c
index f038e0599..81896d6cf 100644
--- a/xc/extras/Mesa/src/mthreads.c
+++ b/xc/extras/Mesa/src/mthreads.c
@@ -1,8 +1,8 @@
-/* $Id: mthreads.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: mthreads.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,8 +25,6 @@
*/
-
-
/*
* mthreads.c -- platform dependent thread support for Mesa
*
@@ -34,26 +32,24 @@
* and Christoph Poliwoda (poliwoda@volumegraphics.com)
*
* Revised by Keith Whitwell
+ *
*/
-#ifndef XFree86Server
-#include <stdio.h> /* for printing errors etc. */
-#include <stdlib.h> /* malloc/free and the boys. */
-#include <errno.h> /* error determination for system calls */
- /* NOTE: Some platforms will do bad things with errno */
- /* if correct compile-time options are not used. */
- /* See mthreads.h for specific examples. */
+#ifdef PC_ALL
+#include "all.h"
#else
-#include "GL/xf86glx.h"
+#include "glheader.h"
#endif
+
/*
* This file should still compile even when THREADS is not defined.
* This is to make things easier to deal with on the makefile scene..
*/
#ifdef THREADS
+#include <errno.h>
#include "mthreads.h"
diff --git a/xc/extras/Mesa/src/mthreads.h b/xc/extras/Mesa/src/mthreads.h
index aeddf2efa..77f32d8e4 100644
--- a/xc/extras/Mesa/src/mthreads.h
+++ b/xc/extras/Mesa/src/mthreads.h
@@ -1,8 +1,8 @@
-/* $Id: mthreads.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: mthreads.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,8 +25,6 @@
*/
-
-
/*
* mthreads.h -- platform dependent thread support for Mesa
*
diff --git a/xc/extras/Mesa/src/norm_tmp.h b/xc/extras/Mesa/src/norm_tmp.h
index 48c926e4a..5a8e41de3 100644
--- a/xc/extras/Mesa/src/norm_tmp.h
+++ b/xc/extras/Mesa/src/norm_tmp.h
@@ -1,4 +1,4 @@
-/* $Id: norm_tmp.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: norm_tmp.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -29,7 +29,7 @@
*/
-static void TAG(transform_normalize_normals)( const GLmatrix *mat,
+static void _XFORMAPI TAG(transform_normalize_normals)( const GLmatrix *mat,
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
@@ -103,7 +103,7 @@ static void TAG(transform_normalize_normals)( const GLmatrix *mat,
dest->count = in->count;
}
-static void TAG(transform_normalize_normals_no_rot)( const GLmatrix *mat,
+static void _XFORMAPI TAG(transform_normalize_normals_no_rot)( const GLmatrix *mat,
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
@@ -176,7 +176,7 @@ static void TAG(transform_normalize_normals_no_rot)( const GLmatrix *mat,
}
-static void TAG(transform_rescale_normals_no_rot)( const GLmatrix *mat,
+static void _XFORMAPI TAG(transform_rescale_normals_no_rot)( const GLmatrix *mat,
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
@@ -205,7 +205,7 @@ static void TAG(transform_rescale_normals_no_rot)( const GLmatrix *mat,
dest->count = in->count;
}
-static void TAG(transform_rescale_normals)( const GLmatrix *mat,
+static void _XFORMAPI TAG(transform_rescale_normals)( const GLmatrix *mat,
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
@@ -238,7 +238,7 @@ static void TAG(transform_rescale_normals)( const GLmatrix *mat,
}
-static void TAG(transform_normals_no_rot)(const GLmatrix *mat,
+static void _XFORMAPI TAG(transform_normals_no_rot)(const GLmatrix *mat,
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
@@ -268,7 +268,7 @@ static void TAG(transform_normals_no_rot)(const GLmatrix *mat,
dest->count = in->count;
}
-static void TAG(transform_normals)( const GLmatrix *mat,
+static void _XFORMAPI TAG(transform_normals)( const GLmatrix *mat,
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
@@ -299,7 +299,7 @@ static void TAG(transform_normals)( const GLmatrix *mat,
}
-static void TAG(normalize_normals)( const GLmatrix *mat,
+static void _XFORMAPI TAG(normalize_normals)( const GLmatrix *mat,
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
@@ -348,7 +348,7 @@ static void TAG(normalize_normals)( const GLmatrix *mat,
}
-static void TAG(rescale_normals)( const GLmatrix *mat,
+static void _XFORMAPI TAG(rescale_normals)( const GLmatrix *mat,
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
@@ -373,7 +373,7 @@ static void TAG(rescale_normals)( const GLmatrix *mat,
}
-static void TAG(init_c_norm_transform)( void )
+static void _XFORMAPI TAG(init_c_norm_transform)( void )
{
gl_normal_tab[NORM_TRANSFORM_NO_ROT][IDX] =
TAG(transform_normals_no_rot);
diff --git a/xc/extras/Mesa/src/pb.c b/xc/extras/Mesa/src/pb.c
index ae7736f3d..1285541c5 100644
--- a/xc/extras/Mesa/src/pb.c
+++ b/xc/extras/Mesa/src/pb.c
@@ -1,8 +1,8 @@
-/* $Id: pb.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: pb.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -26,8 +26,6 @@
-
-
/*
* Pixel buffer:
*
@@ -38,25 +36,19 @@
* maximize the number of pixels processed inside loops and to minimize
* the number of function calls.
*/
-/* $XFree86: xc/lib/GL/mesa/src/pb.c,v 1.3 1999/04/04 00:20:28 dawes Exp $ */
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <stdlib.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "alpha.h"
#include "alphabuf.h"
#include "blend.h"
#include "depth.h"
#include "fog.h"
#include "logic.h"
-#include "macros.h"
+#include "mem.h"
#include "masking.h"
#include "pb.h"
#include "scissor.h"
@@ -73,7 +65,7 @@
struct pixel_buffer *gl_alloc_pb(void)
{
struct pixel_buffer *pb;
- pb = (struct pixel_buffer *) calloc(sizeof(struct pixel_buffer), 1);
+ pb = CALLOC_STRUCT(pixel_buffer);
if (pb) {
int i, j;
/* set non-zero fields */
@@ -113,13 +105,13 @@ static void multi_write_index_pixels( GLcontext *ctx, GLuint n,
ASSERT(n < MAX_WIDTH);
if (bufferBit == FRONT_LEFT_BIT)
- (*ctx->Driver.SetBuffer)( ctx, GL_FRONT_LEFT);
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_LEFT);
else if (bufferBit == FRONT_RIGHT_BIT)
- (*ctx->Driver.SetBuffer)( ctx, GL_FRONT_RIGHT);
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_RIGHT);
else if (bufferBit == BACK_LEFT_BIT)
- (*ctx->Driver.SetBuffer)( ctx, GL_BACK_LEFT);
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_LEFT);
else
- (*ctx->Driver.SetBuffer)( ctx, GL_BACK_RIGHT);
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT);
/* make copy of incoming indexes */
MEMCPY( indexTmp, indexes, n * sizeof(GLuint) );
@@ -134,7 +126,7 @@ static void multi_write_index_pixels( GLcontext *ctx, GLuint n,
}
/* restore default dest buffer */
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer);
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, ctx->Color.DriverDrawBuffer);
}
@@ -159,20 +151,20 @@ static void multi_write_rgba_pixels( GLcontext *ctx, GLuint n,
ASSERT(n < MAX_WIDTH);
if (bufferBit == FRONT_LEFT_BIT) {
- (*ctx->Driver.SetBuffer)( ctx, GL_FRONT_LEFT);
- ctx->Buffer->Alpha = ctx->Buffer->FrontLeftAlpha;
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_LEFT);
+ ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontLeftAlpha;
}
else if (bufferBit == FRONT_RIGHT_BIT) {
- (*ctx->Driver.SetBuffer)( ctx, GL_FRONT_RIGHT);
- ctx->Buffer->Alpha = ctx->Buffer->FrontRightAlpha;
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_RIGHT);
+ ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontRightAlpha;
}
else if (bufferBit == BACK_LEFT_BIT) {
- (*ctx->Driver.SetBuffer)( ctx, GL_BACK_LEFT);
- ctx->Buffer->Alpha = ctx->Buffer->BackLeftAlpha;
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_LEFT);
+ ctx->DrawBuffer->Alpha = ctx->DrawBuffer->BackLeftAlpha;
}
else {
- (*ctx->Driver.SetBuffer)( ctx, GL_BACK_RIGHT);
- ctx->Buffer->Alpha = ctx->Buffer->BackRightAlpha;
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT);
+ ctx->DrawBuffer->Alpha = ctx->DrawBuffer->BackRightAlpha;
}
/* make copy of incoming colors */
@@ -198,7 +190,7 @@ static void multi_write_rgba_pixels( GLcontext *ctx, GLuint n,
}
/* restore default dest buffer */
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer);
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, ctx->Color.DriverDrawBuffer);
}
@@ -238,10 +230,10 @@ void gl_flush_pb( GLcontext *ctx )
/* initialize mask array and clip pixels simultaneously */
{
- GLint xmin = ctx->Buffer->Xmin;
- GLint xmax = ctx->Buffer->Xmax;
- GLint ymin = ctx->Buffer->Ymin;
- GLint ymax = ctx->Buffer->Ymax;
+ GLint xmin = ctx->DrawBuffer->Xmin;
+ GLint xmax = ctx->DrawBuffer->Xmax;
+ GLint ymin = ctx->DrawBuffer->Ymin;
+ GLint ymax = ctx->DrawBuffer->Ymax;
GLint *x = PB->x;
GLint *y = PB->y;
GLuint i, n = PB->count;
@@ -285,7 +277,8 @@ void gl_flush_pb( GLcontext *ctx )
}
if (ctx->Fog.Enabled
- && (ctx->FogMode == FOG_FRAGMENT || PB->primitive==GL_BITMAP)) {
+ && (ctx->Hint.Fog==GL_NICEST || PB->primitive==GL_BITMAP
+ || ctx->Texture.ReallyEnabled)) {
gl_fog_rgba_pixels( ctx, PB->count, PB->z, PB->rgba );
}
@@ -300,16 +293,14 @@ void gl_flush_pb( GLcontext *ctx )
if (ctx->Stencil.Enabled) {
/* first stencil test */
- if (gl_stencil_pixels( ctx, PB->count, PB->x, PB->y, mask )==0) {
+ if (gl_stencil_and_depth_test_pixels(ctx, PB->count,
+ PB->x, PB->y, PB->z, mask) == 0) {
goto CleanUp;
}
- /* depth buffering w/ stencil */
- gl_depth_stencil_pixels( ctx, PB->count, PB->x, PB->y, PB->z, mask );
}
else if (ctx->Depth.Test) {
/* regular depth testing */
- (*ctx->Driver.DepthTestPixels)( ctx, PB->count, PB->x, PB->y,
- PB->z, mask );
+ gl_depth_test_pixels( ctx, PB->count, PB->x, PB->y, PB->z, mask );
}
@@ -354,15 +345,14 @@ void gl_flush_pb( GLcontext *ctx )
if (ctx->Stencil.Enabled) {
/* first stencil test */
- if (gl_stencil_pixels( ctx, PB->count, PB->x, PB->y, mask )==0) {
+ if (gl_stencil_and_depth_test_pixels(ctx, PB->count,
+ PB->x, PB->y, PB->z, mask) == 0) {
goto CleanUp;
}
- /* depth buffering w/ stencil */
- gl_depth_stencil_pixels( ctx, PB->count, PB->x, PB->y, PB->z, mask );
}
else if (ctx->Depth.Test) {
/* regular depth testing */
- (*ctx->Driver.DepthTestPixels)( ctx, PB->count, PB->x, PB->y, PB->z, mask );
+ gl_depth_test_pixels( ctx, PB->count, PB->x, PB->y, PB->z, mask );
}
if (ctx->Color.DrawBuffer == GL_NONE) {
@@ -419,7 +409,7 @@ void gl_flush_pb( GLcontext *ctx )
if (ctx->MutablePixels || !PB->mono) {
if (ctx->Fog.Enabled
- && (ctx->FogMode==FOG_FRAGMENT || PB->primitive==GL_BITMAP)) {
+ && (ctx->Hint.Fog==GL_NICEST || PB->primitive==GL_BITMAP)) {
gl_fog_ci_pixels( ctx, PB->count, PB->z, PB->i );
}
@@ -427,15 +417,14 @@ void gl_flush_pb( GLcontext *ctx )
if (ctx->Stencil.Enabled) {
/* first stencil test */
- if (gl_stencil_pixels( ctx, PB->count, PB->x, PB->y, mask )==0) {
+ if (gl_stencil_and_depth_test_pixels(ctx, PB->count,
+ PB->x, PB->y, PB->z, mask) == 0) {
goto CleanUp;
}
- /* depth buffering w/ stencil */
- gl_depth_stencil_pixels( ctx, PB->count, PB->x, PB->y, PB->z, mask );
}
else if (ctx->Depth.Test) {
/* regular depth testing */
- (*ctx->Driver.DepthTestPixels)( ctx, PB->count, PB->x, PB->y, PB->z, mask );
+ gl_depth_test_pixels( ctx, PB->count, PB->x, PB->y, PB->z, mask );
}
if (ctx->RasterMask & MULTI_DRAW_BIT) {
@@ -464,15 +453,14 @@ void gl_flush_pb( GLcontext *ctx )
if (ctx->Stencil.Enabled) {
/* first stencil test */
- if (gl_stencil_pixels( ctx, PB->count, PB->x, PB->y, mask )==0) {
+ if (gl_stencil_and_depth_test_pixels(ctx, PB->count,
+ PB->x, PB->y, PB->z, mask) == 0) {
goto CleanUp;
}
- /* depth buffering w/ stencil */
- gl_depth_stencil_pixels( ctx, PB->count, PB->x, PB->y, PB->z, mask );
}
else if (ctx->Depth.Test) {
/* regular depth testing */
- (*ctx->Driver.DepthTestPixels)( ctx, PB->count, PB->x, PB->y, PB->z, mask );
+ gl_depth_test_pixels( ctx, PB->count, PB->x, PB->y, PB->z, mask );
}
if (ctx->RasterMask & MULTI_DRAW_BIT) {
diff --git a/xc/extras/Mesa/src/pb.h b/xc/extras/Mesa/src/pb.h
index 4d2b65de0..c8350ae6f 100644
--- a/xc/extras/Mesa/src/pb.h
+++ b/xc/extras/Mesa/src/pb.h
@@ -1,4 +1,4 @@
-/* $Id: pb.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: pb.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/pipeline.c b/xc/extras/Mesa/src/pipeline.c
index 3d0d5ef1e..373682a65 100644
--- a/xc/extras/Mesa/src/pipeline.c
+++ b/xc/extras/Mesa/src/pipeline.c
@@ -1,10 +1,10 @@
-/* $Id: pipeline.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: pipeline.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -28,28 +28,31 @@
* Copyright (C) 1999 Keith Whitwell.
*/
-#ifndef XFree86Server
-#include <stdio.h>
+#ifdef PC_HEADER
+#include "all.h"
#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "bbox.h"
#include "clip.h"
#include "context.h"
#include "cva.h"
-#include "pipeline.h"
-#include "vbcull.h"
-#include "vbindirect.h"
-#include "vbrender.h"
-#include "vbxform.h"
#include "fog.h"
#include "light.h"
+#include "mem.h"
#include "mmath.h"
+#include "pipeline.h"
#include "shade.h"
#include "stages.h"
#include "types.h"
#include "translate.h"
+#include "vbcull.h"
+#include "vbindirect.h"
+#include "vbrender.h"
+#include "vbxform.h"
#include "xform.h"
+#endif
+
+
#ifndef MESA_VERBOSE
int MESA_VERBOSE = 0
@@ -58,11 +61,10 @@ int MESA_VERBOSE = 0
/* | VERBOSE_VARRAY */
/* | VERBOSE_TEXTURE */
/* | VERBOSE_API */
-/* | VERBOSE_DRIVER */
+ | VERBOSE_DRIVER
/* | VERBOSE_STATE */
/* | VERBOSE_CULL */
/* | VERBOSE_DISPLAY_LIST */
-/* | VERBOSE_LIGHTING */
;
#endif
@@ -206,7 +208,7 @@ void gl_pipeline_init( GLcontext *ctx )
/* Called prior to every recomputation of the CVA precalc data, except where
* the driver is able to calculate the pipeline unassisted.
*/
-void gl_build_full_precalc_pipeline( GLcontext *ctx )
+static void build_full_precalc_pipeline( GLcontext *ctx )
{
struct gl_pipeline_stage *pipeline = ctx->PipelineStage;
struct gl_cva *cva = &ctx->CVA;
@@ -317,7 +319,7 @@ void gl_build_precalc_pipeline( GLcontext *ctx )
if (!ctx->Driver.BuildPrecalcPipeline ||
!ctx->Driver.BuildPrecalcPipeline( ctx ))
- gl_build_full_precalc_pipeline( ctx );
+ build_full_precalc_pipeline( ctx );
pre->data_valid = 0;
pre->pipeline_valid = 1;
@@ -330,7 +332,7 @@ void gl_build_precalc_pipeline( GLcontext *ctx )
}
-static void gl_build_full_immediate_pipeline( GLcontext *ctx )
+static void build_full_immediate_pipeline( GLcontext *ctx )
{
struct gl_pipeline_stage *pipeline = ctx->PipelineStage;
struct gl_cva *cva = &ctx->CVA;
@@ -402,7 +404,7 @@ void gl_build_immediate_pipeline( GLcontext *ctx )
if (!ctx->Driver.BuildEltPipeline ||
!ctx->Driver.BuildEltPipeline( ctx )) {
- gl_build_full_immediate_pipeline( ctx );
+ build_full_immediate_pipeline( ctx );
}
elt->pipeline_valid = 1;
@@ -480,7 +482,7 @@ void gl_run_pipeline( struct vertex_buffer *VB )
{
struct gl_pipeline *pipe = VB->pipeline;
struct gl_pipeline_stage **stages = pipe->stages;
- short x;
+ unsigned short x;
pipe->data_valid = 1; /* optimized stages might want to reset this. */
diff --git a/xc/extras/Mesa/src/pipeline.h b/xc/extras/Mesa/src/pipeline.h
index 15478195e..7bb9a7779 100644
--- a/xc/extras/Mesa/src/pipeline.h
+++ b/xc/extras/Mesa/src/pipeline.h
@@ -1,4 +1,4 @@
-/* $Id: pipeline.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: pipeline.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/pixel.c b/xc/extras/Mesa/src/pixel.c
index f06e40677..9c34d7012 100644
--- a/xc/extras/Mesa/src/pixel.c
+++ b/xc/extras/Mesa/src/pixel.c
@@ -1,8 +1,8 @@
-/* $Id: pixel.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: pixel.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
/*
* glPixelStore, glPixelTransfer, glPixelMap, glPixelZoom, etc.
*/
@@ -36,15 +33,10 @@
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "macros.h"
+#include "mem.h"
#include "pixel.h"
#include "types.h"
#endif
@@ -57,8 +49,10 @@
-void gl_PixelZoom( GLcontext *ctx, GLfloat xfactor, GLfloat yfactor )
+void
+_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelZoom");
ctx->Pixel.ZoomX = xfactor;
@@ -72,13 +66,13 @@ void gl_PixelZoom( GLcontext *ctx, GLfloat xfactor, GLfloat yfactor )
/**********************************************************************/
-void gl_PixelStorei( GLcontext *ctx, GLenum pname, GLint param )
+void
+_mesa_PixelStorei( GLenum pname, GLint param )
{
/* NOTE: this call can't be compiled into the display list */
-
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelStore");
-
switch (pname) {
case GL_PACK_SWAP_BYTES:
ctx->Pack.SwapBytes = param ? GL_TRUE : GL_FALSE;
@@ -174,6 +168,11 @@ void gl_PixelStorei( GLcontext *ctx, GLenum pname, GLint param )
}
+void
+_mesa_PixelStoref( GLenum pname, GLfloat param )
+{
+ _mesa_PixelStorei( pname, (GLint) param );
+}
@@ -183,11 +182,11 @@ void gl_PixelStorei( GLcontext *ctx, GLenum pname, GLint param )
-void gl_PixelMapfv( GLcontext *ctx,
- GLenum map, GLint mapsize, const GLfloat *values )
+void
+_mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values )
{
GLint i;
-
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelMapfv");
@@ -288,10 +287,50 @@ void gl_PixelMapfv( GLcontext *ctx,
+void
+_mesa_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values )
+{
+ GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
+ GLint i;
+ if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
+ for (i=0;i<mapsize;i++) {
+ fvalues[i] = (GLfloat) values[i];
+ }
+ }
+ else {
+ for (i=0;i<mapsize;i++) {
+ fvalues[i] = UINT_TO_FLOAT( values[i] );
+ }
+ }
+ _mesa_PixelMapfv(map, mapsize, fvalues);
+}
+
+
+
+void
+_mesa_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values )
+{
+ GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
+ GLint i;
+ if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
+ for (i=0;i<mapsize;i++) {
+ fvalues[i] = (GLfloat) values[i];
+ }
+ }
+ else {
+ for (i=0;i<mapsize;i++) {
+ fvalues[i] = USHORT_TO_FLOAT( values[i] );
+ }
+ }
+ _mesa_PixelMapfv(map, mapsize, fvalues);
+}
+
-void gl_GetPixelMapfv( GLcontext *ctx, GLenum map, GLfloat *values )
+void
+_mesa_GetPixelMapfv( GLenum map, GLfloat *values )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint i;
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetPixelMapfv");
@@ -337,8 +376,10 @@ void gl_GetPixelMapfv( GLcontext *ctx, GLenum map, GLfloat *values )
}
-void gl_GetPixelMapuiv( GLcontext *ctx, GLenum map, GLuint *values )
+void
+_mesa_GetPixelMapuiv( GLenum map, GLuint *values )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint i;
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetPixelMapfv");
@@ -396,8 +437,10 @@ void gl_GetPixelMapuiv( GLcontext *ctx, GLenum map, GLuint *values )
}
-void gl_GetPixelMapusv( GLcontext *ctx, GLenum map, GLushort *values )
+void
+_mesa_GetPixelMapusv( GLenum map, GLushort *values )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint i;
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetPixelMapfv");
@@ -469,8 +512,10 @@ void gl_GetPixelMapusv( GLcontext *ctx, GLenum map, GLushort *values )
* Implements glPixelTransfer[fi] whether called immediately or from a
* display list.
*/
-void gl_PixelTransferf( GLcontext *ctx, GLenum pname, GLfloat param )
+void
+_mesa_PixelTransferf( GLenum pname, GLfloat param )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelTransfer");
@@ -534,6 +579,13 @@ void gl_PixelTransferf( GLcontext *ctx, GLenum pname, GLfloat param )
}
+void
+_mesa_PixelTransferi( GLenum pname, GLint param )
+{
+ _mesa_PixelTransferf( pname, (GLfloat) param );
+}
+
+
/*
diff --git a/xc/extras/Mesa/src/pixel.h b/xc/extras/Mesa/src/pixel.h
index b6c6e116a..2b808d3ba 100644
--- a/xc/extras/Mesa/src/pixel.h
+++ b/xc/extras/Mesa/src/pixel.h
@@ -1,8 +1,8 @@
-/* $Id: pixel.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: pixel.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef PIXEL_H
#define PIXEL_H
@@ -40,21 +37,39 @@
*/
-extern void gl_GetPixelMapfv( GLcontext *ctx, GLenum map, GLfloat *values );
+extern void
+_mesa_GetPixelMapfv( GLenum map, GLfloat *values );
+
+extern void
+_mesa_GetPixelMapuiv( GLenum map, GLuint *values );
+
+extern void
+_mesa_GetPixelMapusv( GLenum map, GLushort *values );
+
+extern void
+_mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values );
+
+extern void
+_mesa_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values );
-extern void gl_GetPixelMapuiv( GLcontext *ctx, GLenum map, GLuint *values );
+extern void
+_mesa_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values );
-extern void gl_GetPixelMapusv( GLcontext *ctx, GLenum map, GLushort *values );
+extern void
+_mesa_PixelStoref( GLenum pname, GLfloat param );
+extern void
+_mesa_PixelStorei( GLenum pname, GLint param );
-extern void gl_PixelMapfv( GLcontext *ctx,
- GLenum map, GLint mapsize, const GLfloat *values );
+extern void
+_mesa_PixelTransferf( GLenum pname, GLfloat param );
-extern void gl_PixelStorei( GLcontext *ctx, GLenum pname, GLint param );
+extern void
+_mesa_PixelTransferi( GLenum pname, GLint param );
-extern void gl_PixelTransferf( GLcontext *ctx, GLenum pname, GLfloat param );
+extern void
+_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor );
-extern void gl_PixelZoom( GLcontext *ctx, GLfloat xfactor, GLfloat yfactor );
/*
diff --git a/xc/extras/Mesa/src/pointers.c b/xc/extras/Mesa/src/pointers.c
deleted file mode 100644
index ef72b7a84..000000000
--- a/xc/extras/Mesa/src/pointers.c
+++ /dev/null
@@ -1,290 +0,0 @@
-/* $Id: pointers.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.1
- *
- * Copyright (C) 1999 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"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-
-
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
-#ifndef XFree86Server
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
-#include "accum.h"
-#include "alpha.h"
-#include "attrib.h"
-#include "bitmap.h"
-#include "blend.h"
-#include "clip.h"
-#include "context.h"
-#include "colortab.h"
-#include "copypix.h"
-#include "depth.h"
-#include "dlist.h"
-#include "drawpix.h"
-#include "enable.h"
-#include "eval.h"
-#include "feedback.h"
-#include "fog.h"
-#include "get.h"
-#include "glmisc.h"
-#include "extensions.h"
-#include "light.h"
-#include "lines.h"
-#include "logic.h"
-#include "macros.h"
-#include "masking.h"
-#include "matrix.h"
-#include "pixel.h"
-#include "points.h"
-#include "polygon.h"
-#include "pointers.h"
-#include "rastpos.h"
-#include "readpix.h"
-#include "rect.h"
-#include "scissor.h"
-#include "stencil.h"
-#include "teximage.h"
-#include "texobj.h"
-#include "texstate.h"
-#include "types.h"
-#include "varray.h"
-#include "vbfill.h"
-#include "winpos.h"
-#endif
-
-
-#ifdef DEBUG
-/*
- * For debugging
- */
-static void check_pointers( struct gl_api_table *table )
-{
- void **entry;
- int numentries = sizeof( struct gl_api_table ) / sizeof(void*);
- int i;
-
- entry = (void **) table;
-
- for (i=0;i<numentries;i++) {
- if (!entry[i]) {
- printf("found uninitialized function pointer at %d\n", i );
- gl_problem(NULL, "Missing pointer in pointers.c");
- /*abort()*/
- }
- }
-}
-#endif
-
-
-/*
- * Assign all the pointers in 'table' to point to Mesa's immediate-mode
- * execution functions.
- */
-static void init_execution_pointers( struct gl_api_table *table )
-{
- table->Accum = gl_Accum;
- table->AlphaFunc = gl_AlphaFunc;
- table->AreTexturesResident = gl_AreTexturesResident;
- table->BindTexture = gl_BindTexture;
- table->Bitmap = gl_Bitmap;
- table->BlendColor = gl_BlendColor;
- table->BlendEquation = gl_BlendEquation;
- table->BlendFunc = gl_BlendFunc;
- table->BlendFuncSeparate = gl_BlendFuncSeparate;
- table->CallList = gl_CallList;
- table->CallLists = gl_CallLists;
- table->Clear = gl_Clear;
- table->ClearAccum = gl_ClearAccum;
- table->ClearColor = gl_ClearColor;
- table->ClearDepth = gl_ClearDepth;
- table->ClearIndex = gl_ClearIndex;
- table->ClearStencil = gl_ClearStencil;
- table->ClipPlane = gl_ClipPlane;
- table->ColorMask = gl_ColorMask;
- table->ColorMaterial = gl_ColorMaterial;
- table->ColorTable = gl_ColorTable;
- table->ColorSubTable = gl_ColorSubTable;
- table->CopyPixels = gl_CopyPixels;
- table->CopyTexImage1D = gl_CopyTexImage1D;
- table->CopyTexImage2D = gl_CopyTexImage2D;
- table->CopyTexSubImage1D = gl_CopyTexSubImage1D;
- table->CopyTexSubImage2D = gl_CopyTexSubImage2D;
- table->CopyTexSubImage3D = gl_CopyTexSubImage3D;
- table->CullFace = gl_CullFace;
- table->DeleteLists = gl_DeleteLists;
- table->DeleteTextures = gl_DeleteTextures;
- table->DepthFunc = gl_DepthFunc;
- table->DepthMask = gl_DepthMask;
- table->DepthRange = gl_DepthRange;
- table->Disable = gl_Disable;
- table->DisableClientState = gl_DisableClientState;
- table->DrawBuffer = gl_DrawBuffer;
- table->DrawPixels = gl_DrawPixels;
- table->Enable = gl_Enable;
- table->Error = gl_error;
- table->EnableClientState = gl_EnableClientState;
- table->EndList = gl_EndList;
- table->EvalMesh1 = gl_EvalMesh1;
- table->EvalMesh2 = gl_EvalMesh2;
- table->FeedbackBuffer = gl_FeedbackBuffer;
- table->Finish = gl_Finish;
- table->Flush = gl_Flush;
- table->Fogfv = gl_Fogfv;
- table->FrontFace = gl_FrontFace;
- table->Frustum = gl_Frustum;
- table->GenLists = gl_GenLists;
- table->GenTextures = gl_GenTextures;
- table->GetBooleanv = gl_GetBooleanv;
- table->GetClipPlane = gl_GetClipPlane;
- table->GetColorTable = gl_GetColorTable;
- table->GetColorTableParameteriv = gl_GetColorTableParameteriv;
- table->GetDoublev = gl_GetDoublev;
- table->GetError = gl_GetError;
- table->GetFloatv = gl_GetFloatv;
- table->GetIntegerv = gl_GetIntegerv;
- table->GetPointerv = gl_GetPointerv;
- table->GetLightfv = gl_GetLightfv;
- table->GetLightiv = gl_GetLightiv;
- table->GetMapdv = gl_GetMapdv;
- table->GetMapfv = gl_GetMapfv;
- table->GetMapiv = gl_GetMapiv;
- table->GetMaterialfv = gl_GetMaterialfv;
- table->GetMaterialiv = gl_GetMaterialiv;
- table->GetPixelMapfv = gl_GetPixelMapfv;
- table->GetPixelMapuiv = gl_GetPixelMapuiv;
- table->GetPixelMapusv = gl_GetPixelMapusv;
- table->GetPolygonStipple = gl_GetPolygonStipple;
- table->GetString = gl_GetString;
- table->GetTexEnvfv = gl_GetTexEnvfv;
- table->GetTexEnviv = gl_GetTexEnviv;
- table->GetTexGendv = gl_GetTexGendv;
- table->GetTexGenfv = gl_GetTexGenfv;
- table->GetTexGeniv = gl_GetTexGeniv;
- table->GetTexImage = gl_GetTexImage;
- table->GetTexLevelParameterfv = gl_GetTexLevelParameterfv;
- table->GetTexLevelParameteriv = gl_GetTexLevelParameteriv;
- table->GetTexParameterfv = gl_GetTexParameterfv;
- table->GetTexParameteriv = gl_GetTexParameteriv;
- table->Hint = gl_Hint;
- table->IndexMask = gl_IndexMask;
- table->InitNames = gl_InitNames;
- table->IsEnabled = gl_IsEnabled;
- table->IsList = gl_IsList;
- table->IsTexture = gl_IsTexture;
- table->LightModelfv = gl_LightModelfv;
- table->Lightfv = gl_Lightfv;
- table->LineStipple = gl_LineStipple;
- table->LineWidth = gl_LineWidth;
- table->ListBase = gl_ListBase;
- table->LoadIdentity = gl_LoadIdentity;
- table->LoadMatrixf = gl_LoadMatrixf;
- table->LoadName = gl_LoadName;
- table->LogicOp = gl_LogicOp;
- table->Map1f = gl_Map1f;
- table->Map2f = gl_Map2f;
- table->MapGrid1f = gl_MapGrid1f;
- table->MapGrid2f = gl_MapGrid2f;
- table->MatrixMode = gl_MatrixMode;
- table->MultMatrixf = gl_MultMatrixf;
- table->NewList = gl_NewList;
- table->Ortho = gl_Ortho;
- table->PassThrough = gl_PassThrough;
- table->PixelMapfv = gl_PixelMapfv;
- table->PixelStorei = gl_PixelStorei;
- table->PixelTransferf = gl_PixelTransferf;
- table->PixelZoom = gl_PixelZoom;
- table->PointSize = gl_PointSize;
- table->PolygonMode = gl_PolygonMode;
- table->PolygonOffset = gl_PolygonOffset;
- table->PolygonStipple = gl_PolygonStipple;
- table->PopAttrib = gl_PopAttrib;
- table->PopClientAttrib = gl_PopClientAttrib;
- table->PopMatrix = gl_PopMatrix;
- table->PopName = gl_PopName;
- table->PrioritizeTextures = gl_PrioritizeTextures;
- table->PushAttrib = gl_PushAttrib;
- table->PushClientAttrib = gl_PushClientAttrib;
- table->PushMatrix = gl_PushMatrix;
- table->PushName = gl_PushName;
- table->RasterPos4f = gl_RasterPos4f;
- table->ReadBuffer = gl_ReadBuffer;
- table->ReadPixels = gl_ReadPixels;
- table->Rectf = gl_Rectf;
- table->RenderMode = gl_RenderMode;
- table->Rotatef = gl_Rotatef;
- table->Scalef = gl_Scalef;
- table->Scissor = gl_Scissor;
- table->SelectBuffer = gl_SelectBuffer;
- table->ShadeModel = gl_ShadeModel;
- table->StencilFunc = gl_StencilFunc;
- table->StencilMask = gl_StencilMask;
- table->StencilOp = gl_StencilOp;
- table->TexEnvfv = gl_TexEnvfv;
- table->TexGenfv = gl_TexGenfv;
- table->TexImage1D = gl_TexImage1D;
- table->TexImage2D = gl_TexImage2D;
- table->TexImage3D = gl_TexImage3D;
- table->TexSubImage1D = gl_TexSubImage1D;
- table->TexSubImage2D = gl_TexSubImage2D;
- table->TexSubImage3D = gl_TexSubImage3D;
- table->PointParameterfvEXT = gl_PointParameterfvEXT;
- table->TexParameterfv = gl_TexParameterfv;
- table->Translatef = gl_Translatef;
- table->Viewport = gl_Viewport;
-
- /* GL_MESA_window_pos extension */
- table->WindowPos4fMESA = gl_WindowPos4fMESA;
-
- /* GL_MESA_resize_buffers extension */
- table->ResizeBuffersMESA = gl_ResizeBuffersMESA;
-
- /* GL_ARB_multitexture */
- table->ActiveTexture = gl_ActiveTexture;
- table->ClientActiveTexture = gl_ClientActiveTexture;
-}
-
-
-
-
-void gl_init_api_function_pointers( GLcontext *ctx )
-{
- init_execution_pointers( &ctx->Exec );
-
- gl_init_dlist_pointers( &ctx->Save );
-
-#ifdef DEBUG
- /* make sure there's no NULL pointers */
- check_pointers( &ctx->Exec );
- check_pointers( &ctx->Save );
-#endif
-}
-
diff --git a/xc/extras/Mesa/src/points.c b/xc/extras/Mesa/src/points.c
index 4334be44c..1643e8f8a 100644
--- a/xc/extras/Mesa/src/points.c
+++ b/xc/extras/Mesa/src/points.c
@@ -1,8 +1,8 @@
-/* $Id: points.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: points.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -23,18 +23,12 @@
* 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.
*/
-/* $XFree86: xc/lib/GL/mesa/src/points.c,v 1.4 1999/04/04 00:20:29 dawes Exp $ */
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <math.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "feedback.h"
#include "macros.h"
@@ -45,18 +39,20 @@
#include "texstate.h"
#include "types.h"
#include "vb.h"
-#include "mmath.h"
#endif
-void gl_PointSize( GLcontext *ctx, GLfloat size )
+void
+_mesa_PointSize( GLfloat size )
{
- if (size<=0.0) {
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPointSize");
+
+ if (size <= 0.0) {
gl_error( ctx, GL_INVALID_VALUE, "glPointSize" );
return;
}
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPointSize");
if (ctx->Point.Size != size) {
ctx->Point.Size = size;
@@ -68,42 +64,61 @@ void gl_PointSize( GLcontext *ctx, GLfloat size )
-void gl_PointParameterfvEXT( GLcontext *ctx, GLenum pname,
- const GLfloat *params)
+void
+_mesa_PointParameterfEXT( GLenum pname, GLfloat param)
{
+ _mesa_PointParameterfvEXT(pname, &param);
+}
+
+
+void
+_mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPointParameterfvEXT");
- if(pname==GL_DISTANCE_ATTENUATION_EXT) {
- GLboolean tmp = ctx->Point.Attenuated;
- COPY_3V(ctx->Point.Params,params);
- ctx->Point.Attenuated = (params[0] != 1.0 ||
- params[1] != 0.0 ||
- params[2] != 0.0);
-
- if (tmp != ctx->Point.Attenuated) {
- ctx->Enabled ^= ENABLE_POINT_ATTEN;
- ctx->TriangleCaps ^= DD_POINT_ATTEN;
- ctx->NewState |= NEW_RASTER_OPS;
- }
- } else {
- if (*params<0.0 ) {
+
+ switch (pname) {
+ case GL_DISTANCE_ATTENUATION_EXT:
+ {
+ const GLboolean tmp = ctx->Point.Attenuated;
+ COPY_3V(ctx->Point.Params, params);
+ ctx->Point.Attenuated = (params[0] != 1.0 ||
+ params[1] != 0.0 ||
+ params[2] != 0.0);
+
+ if (tmp != ctx->Point.Attenuated) {
+ ctx->Enabled ^= ENABLE_POINT_ATTEN;
+ ctx->TriangleCaps ^= DD_POINT_ATTEN;
+ ctx->NewState |= NEW_RASTER_OPS;
+ }
+ }
+ break;
+ case GL_POINT_SIZE_MIN_EXT:
+ if (*params < 0.0F) {
gl_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" );
return;
- }
- switch (pname) {
- case GL_POINT_SIZE_MIN_EXT:
- ctx->Point.MinSize=*params;
- break;
- case GL_POINT_SIZE_MAX_EXT:
- ctx->Point.MaxSize=*params;
- break;
- case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
- ctx->Point.Threshold=*params;
- break;
- default:
- gl_error( ctx, GL_INVALID_ENUM, "glPointParameterfvEXT" );
- return;
- }
+ }
+ ctx->Point.MinSize = *params;
+ break;
+ case GL_POINT_SIZE_MAX_EXT:
+ if (*params < 0.0F) {
+ gl_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" );
+ return;
+ }
+ ctx->Point.MaxSize = *params;
+ break;
+ case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
+ if (*params < 0.0F) {
+ gl_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" );
+ return;
+ }
+ ctx->Point.Threshold = *params;
+ break;
+ default:
+ gl_error( ctx, GL_INVALID_ENUM, "glPointParameterfvEXT" );
+ return;
}
+
ctx->NewState |= NEW_RASTER_OPS;
}
diff --git a/xc/extras/Mesa/src/points.h b/xc/extras/Mesa/src/points.h
index 0232471ce..6f832df65 100644
--- a/xc/extras/Mesa/src/points.h
+++ b/xc/extras/Mesa/src/points.h
@@ -1,8 +1,8 @@
-/* $Id: points.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: points.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -35,11 +35,19 @@
#include "types.h"
-extern void gl_PointSize( GLcontext *ctx, GLfloat size );
+extern void
+_mesa_PointSize( GLfloat size );
+
+
+extern void
+_mesa_PointParameterfEXT( GLenum pname, GLfloat param);
+
+
+extern void
+_mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params );
+
extern void gl_set_point_function( GLcontext *ctx );
-extern void gl_PointParameterfvEXT( GLcontext *ctx, GLenum pname,
- const GLfloat *params );
#endif
diff --git a/xc/extras/Mesa/src/polygon.c b/xc/extras/Mesa/src/polygon.c
index 1a48d82b2..327ade230 100644
--- a/xc/extras/Mesa/src/polygon.c
+++ b/xc/extras/Mesa/src/polygon.c
@@ -1,8 +1,8 @@
-/* $Id: polygon.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: polygon.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,31 +25,25 @@
*/
-/* $XFree86: xc/lib/GL/mesa/src/polygon.c,v 1.3 1999/04/04 00:20:29 dawes Exp $ */
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "image.h"
#include "enums.h"
#include "macros.h"
+#include "mem.h"
#include "polygon.h"
#include "types.h"
#endif
-void gl_CullFace( GLcontext *ctx, GLenum mode )
+void
+_mesa_CullFace( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCullFace");
if (MESA_VERBOSE&VERBOSE_API)
@@ -69,8 +63,10 @@ void gl_CullFace( GLcontext *ctx, GLenum mode )
-void gl_FrontFace( GLcontext *ctx, GLenum mode )
+void
+_mesa_FrontFace( GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glFrontFace");
if (MESA_VERBOSE&VERBOSE_API)
@@ -91,8 +87,10 @@ void gl_FrontFace( GLcontext *ctx, GLenum mode )
-void gl_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode )
+void
+_mesa_PolygonMode( GLenum face, GLenum mode )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonMode");
if (MESA_VERBOSE&VERBOSE_API)
@@ -137,8 +135,11 @@ void gl_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode )
/*
* NOTE: stipple pattern has already been unpacked.
*/
-void gl_PolygonStipple( GLcontext *ctx, const GLuint pattern[32] )
+void
+_mesa_PolygonStipple( const GLubyte *mask )
{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint *pattern = (GLuint *) mask; /* XXX verify */
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonStipple");
if (MESA_VERBOSE&VERBOSE_API)
@@ -153,8 +154,10 @@ void gl_PolygonStipple( GLcontext *ctx, const GLuint pattern[32] )
-void gl_GetPolygonStipple( GLcontext *ctx, GLubyte *dest )
+void
+_mesa_GetPolygonStipple( GLubyte *dest )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonOffset");
if (MESA_VERBOSE&VERBOSE_API)
@@ -165,9 +168,10 @@ void gl_GetPolygonStipple( GLcontext *ctx, GLubyte *dest )
-void gl_PolygonOffset( GLcontext *ctx,
- GLfloat factor, GLfloat units )
+void
+_mesa_PolygonOffset( GLfloat factor, GLfloat units )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonOffset");
if (MESA_VERBOSE&VERBOSE_API)
@@ -177,3 +181,10 @@ void gl_PolygonOffset( GLcontext *ctx,
ctx->Polygon.OffsetUnits = units;
}
+
+void
+_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
+{
+ _mesa_PolygonOffset(factor, bias * DEPTH_SCALE );
+}
+
diff --git a/xc/extras/Mesa/src/polygon.h b/xc/extras/Mesa/src/polygon.h
index d26628ef4..13c55e2f1 100644
--- a/xc/extras/Mesa/src/polygon.h
+++ b/xc/extras/Mesa/src/polygon.h
@@ -1,8 +1,8 @@
-/* $Id: polygon.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: polygon.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef POLYGON_H
#define POLYGON_H
@@ -35,18 +32,26 @@
#include "types.h"
-extern void gl_CullFace( GLcontext *ctx, GLenum mode );
+extern void
+_mesa_CullFace( GLenum mode );
+
+extern void
+_mesa_FrontFace( GLenum mode );
-extern void gl_FrontFace( GLcontext *ctx, GLenum mode );
+extern void
+_mesa_PolygonMode( GLenum face, GLenum mode );
-extern void gl_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode );
+extern void
+_mesa_PolygonOffset( GLfloat factor, GLfloat units );
-extern void gl_PolygonOffset( GLcontext *ctx,
- GLfloat factor, GLfloat units );
+extern void
+_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias );
-extern void gl_PolygonStipple( GLcontext *ctx, const GLuint pattern[32] );
+extern void
+_mesa_PolygonStipple( const GLubyte *mask );
-extern void gl_GetPolygonStipple( GLcontext *ctx, GLubyte *mask );
+extern void
+_mesa_GetPolygonStipple( GLubyte *mask );
#endif
diff --git a/xc/extras/Mesa/src/quads.c b/xc/extras/Mesa/src/quads.c
index 9d1c2142d..20d86d070 100644
--- a/xc/extras/Mesa/src/quads.c
+++ b/xc/extras/Mesa/src/quads.c
@@ -1,8 +1,8 @@
-/* $Id: quads.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: quads.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -23,10 +23,6 @@
* 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.
*/
-/* $XFree86: xc/lib/GL/mesa/src/quads.c,v 1.2 1999/04/04 00:20:30 dawes Exp $ */
-
-
-
/*
@@ -37,13 +33,9 @@
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
-#include "types.h"
+#include "glheader.h"
#include "quads.h"
+#include "types.h"
#endif
diff --git a/xc/extras/Mesa/src/quads.h b/xc/extras/Mesa/src/quads.h
index fc0474c63..7fc88e9cb 100644
--- a/xc/extras/Mesa/src/quads.h
+++ b/xc/extras/Mesa/src/quads.h
@@ -1,4 +1,4 @@
-/* $Id: quads.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: quads.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/rastpos.c b/xc/extras/Mesa/src/rastpos.c
index fd8f58431..166bb274f 100644
--- a/xc/extras/Mesa/src/rastpos.c
+++ b/xc/extras/Mesa/src/rastpos.c
@@ -1,8 +1,8 @@
-/* $Id: rastpos.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: rastpos.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,18 +25,10 @@
*/
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <math.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "clip.h"
#include "context.h"
#include "feedback.h"
@@ -54,8 +46,8 @@
/*
* Caller: context->API.RasterPos4f
*/
-void gl_RasterPos4f( GLcontext *ctx,
- GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+static void raster_pos4f( GLcontext *ctx,
+ GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
GLfloat v[4], eye[4], clip[4], ndc[3], d;
@@ -161,69 +153,147 @@ void gl_RasterPos4f( GLcontext *ctx,
-/*
- * This is a MESA extension function. Pretty much just like glRasterPos
- * except we don't apply the modelview or projection matrices; specify a
- * window coordinate directly.
- * Caller: context->API.WindowPos4fMESA pointer.
- */
-void gl_windowpos( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+void
+_mesa_RasterPos2d(GLdouble x, GLdouble y)
{
- /* KW: Assume that like rasterpos, this must be outside begin/end.
- */
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "glWindowPosMESA" );
+ _mesa_RasterPos4f(x, y, 0.0F, 1.0F);
+}
- /* set raster position */
- ctx->Current.RasterPos[0] = x;
- ctx->Current.RasterPos[1] = y;
- ctx->Current.RasterPos[2] = CLAMP( z, 0.0F, 1.0F );
- ctx->Current.RasterPos[3] = w;
+void
+_mesa_RasterPos2f(GLfloat x, GLfloat y)
+{
+ _mesa_RasterPos4f(x, y, 0.0F, 1.0F);
+}
- ctx->Current.RasterPosValid = GL_TRUE;
+void
+_mesa_RasterPos2i(GLint x, GLint y)
+{
+ _mesa_RasterPos4f(x, y, 0.0F, 1.0F);
+}
- /* raster color */
- if (0 && ctx->Light.Enabled) {
-
- /* KW: I don't see how this can work - would have to take the
- * inverse of the projection matrix or the combined
- * modelProjection matrix, transform point and normal, and
- * do the lighting. Those inverses are not used for
- * anything else. This is not an object-space lighting
- * issue - what this is trying to do is something like
- * clip-space or window-space lighting...
- *
- * Anyway, since the implementation was never correct, I'm
- * not fixing it now - just use the unlit color.
- */
-
- /* KW: As a reprise, we now *do* keep the inverse of the projection
- * matrix, so it is not infeasible to try to swim up stream
- * in this manner. I still don't want to implement it,
- * however.
- */
- }
- else {
- /* use current color or index */
- if (ctx->Visual->RGBAflag) {
- UBYTE_RGBA_TO_FLOAT_RGBA(ctx->Current.RasterColor,
- ctx->Current.ByteColor);
- }
- else {
- ctx->Current.RasterIndex = ctx->Current.Index;
- }
- }
+void
+_mesa_RasterPos2s(GLshort x, GLshort y)
+{
+ _mesa_RasterPos4f(x, y, 0.0F, 1.0F);
+}
- ctx->Current.RasterDistance = 0.0;
+void
+_mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
+{
+ _mesa_RasterPos4f(x, y, z, 1.0F);
+}
- {
- GLuint texSet;
- for (texSet=0; texSet<MAX_TEXTURE_UNITS; texSet++) {
- COPY_4FV( ctx->Current.RasterMultiTexCoord[texSet],
- ctx->Current.Texcoord[texSet] );
- }
- }
+void
+_mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
+{
+ _mesa_RasterPos4f(x, y, z, 1.0F);
+}
- if (ctx->RenderMode==GL_SELECT) {
- gl_update_hitflag( ctx, ctx->Current.RasterPos[2] );
- }
+void
+_mesa_RasterPos3i(GLint x, GLint y, GLint z)
+{
+ _mesa_RasterPos4f(x, y, z, 1.0F);
+}
+
+void
+_mesa_RasterPos3s(GLshort x, GLshort y, GLshort z)
+{
+ _mesa_RasterPos4f(x, y, z, 1.0F);
+}
+
+void
+_mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ _mesa_RasterPos4f(x, y, z, w);
+}
+
+void
+_mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ raster_pos4f(ctx, x, y, z, w);
+}
+
+void
+_mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
+{
+ _mesa_RasterPos4f(x, y, z, w);
+}
+
+void
+_mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ _mesa_RasterPos4f(x, y, z, w);
+}
+
+void
+_mesa_RasterPos2dv(const GLdouble *v)
+{
+ _mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
+}
+
+void
+_mesa_RasterPos2fv(const GLfloat *v)
+{
+ _mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
+}
+
+void
+_mesa_RasterPos2iv(const GLint *v)
+{
+ _mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
+}
+
+void
+_mesa_RasterPos2sv(const GLshort *v)
+{
+ _mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
+}
+
+void
+_mesa_RasterPos3dv(const GLdouble *v)
+{
+ _mesa_RasterPos4f(v[0], v[1], v[2], 1.0F);
+}
+
+void
+_mesa_RasterPos3fv(const GLfloat *v)
+{
+ _mesa_RasterPos4f(v[0], v[1], v[2], 1.0F);
+}
+
+void
+_mesa_RasterPos3iv(const GLint *v)
+{
+ _mesa_RasterPos4f(v[0], v[1], v[2], 1.0F);
+}
+
+void
+_mesa_RasterPos3sv(const GLshort *v)
+{
+ _mesa_RasterPos4f(v[0], v[1], v[2], 1.0F);
+}
+
+void
+_mesa_RasterPos4dv(const GLdouble *v)
+{
+ _mesa_RasterPos4f(v[0], v[1], v[2], v[3]);
+}
+
+void
+_mesa_RasterPos4fv(const GLfloat *v)
+{
+ _mesa_RasterPos4f(v[0], v[1], v[2], v[3]);
+}
+
+void
+_mesa_RasterPos4iv(const GLint *v)
+{
+ _mesa_RasterPos4f(v[0], v[1], v[2], v[3]);
+}
+
+void
+_mesa_RasterPos4sv(const GLshort *v)
+{
+ _mesa_RasterPos4f(v[0], v[1], v[2], v[3]);
}
diff --git a/xc/extras/Mesa/src/rastpos.h b/xc/extras/Mesa/src/rastpos.h
index 061c303ef..7e416f62e 100644
--- a/xc/extras/Mesa/src/rastpos.h
+++ b/xc/extras/Mesa/src/rastpos.h
@@ -1,8 +1,8 @@
-/* $Id: rastpos.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: rastpos.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,23 +25,84 @@
*/
+#ifndef RASTPOS_H
+#define RASTPOS_H
+#include "glheader.h"
-#ifndef RASTPOS_H
-#define RASTPOS_H
+extern void
+_mesa_RasterPos2d(GLdouble x, GLdouble y);
+
+extern void
+_mesa_RasterPos2f(GLfloat x, GLfloat y);
+
+extern void
+_mesa_RasterPos2i(GLint x, GLint y);
+
+extern void
+_mesa_RasterPos2s(GLshort x, GLshort y);
+
+extern void
+_mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z);
+
+extern void
+_mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z);
+
+extern void
+_mesa_RasterPos3i(GLint x, GLint y, GLint z);
+
+extern void
+_mesa_RasterPos3s(GLshort x, GLshort y, GLshort z);
+
+extern void
+_mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+
+extern void
+_mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+
+extern void
+_mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w);
+
+extern void
+_mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w);
+
+extern void
+_mesa_RasterPos2dv(const GLdouble *v);
+
+extern void
+_mesa_RasterPos2fv(const GLfloat *v);
+
+extern void
+_mesa_RasterPos2iv(const GLint *v);
+
+extern void
+_mesa_RasterPos2sv(const GLshort *v);
+
+extern void
+_mesa_RasterPos3dv(const GLdouble *v);
+
+extern void
+_mesa_RasterPos3fv(const GLfloat *v);
-#include "types.h"
+extern void
+_mesa_RasterPos3iv(const GLint *v);
+extern void
+_mesa_RasterPos3sv(const GLshort *v);
-extern void gl_RasterPos4f( GLcontext *ctx,
- GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+extern void
+_mesa_RasterPos4dv(const GLdouble *v);
+extern void
+_mesa_RasterPos4fv(const GLfloat *v);
-extern void gl_windowpos( GLcontext *ctx,
- GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+extern void
+_mesa_RasterPos4iv(const GLint *v);
+extern void
+_mesa_RasterPos4sv(const GLshort *v);
#endif
diff --git a/xc/extras/Mesa/src/readpix.c b/xc/extras/Mesa/src/readpix.c
index 1d676d1aa..1065cd967 100644
--- a/xc/extras/Mesa/src/readpix.c
+++ b/xc/extras/Mesa/src/readpix.c
@@ -1,8 +1,8 @@
-/* $Id: readpix.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: readpix.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,25 +25,17 @@
*/
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "alphabuf.h"
#include "context.h"
#include "depth.h"
#include "feedback.h"
#include "image.h"
#include "macros.h"
+#include "mem.h"
#include "pixel.h"
#include "readpix.h"
#include "span.h"
@@ -71,7 +63,8 @@ static void read_index_pixels( GLcontext *ctx,
return;
}
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.DriverReadBuffer );
+ ASSERT(ctx->Driver.SetReadBuffer);
+ (*ctx->Driver.SetReadBuffer)(ctx, ctx->ReadBuffer, ctx->Pixel.DriverReadBuffer);
readWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width;
@@ -171,7 +164,7 @@ static void read_index_pixels( GLcontext *ctx,
}
}
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer );
+ (*ctx->Driver.SetReadBuffer)(ctx, ctx->DrawBuffer, ctx->Color.DriverDrawBuffer);
}
@@ -213,7 +206,7 @@ static void read_depth_pixels( GLcontext *ctx,
for (j=0;j<height;j++,y++) {
GLushort *dst = (GLushort*) gl_pixel_addr_in_image( packing, pixels,
width, height, GL_DEPTH_COMPONENT, type, 0, j, 0 );
- (*ctx->Driver.ReadDepthSpanInt)( ctx, width, x, y, (GLdepth*) dst);
+ (*ctx->Driver.ReadDepthSpan)( ctx, width, x, y, (GLdepth*) dst);
}
}
else if (type==GL_UNSIGNED_INT && sizeof(GLdepth)==sizeof(GLuint)
@@ -229,7 +222,7 @@ static void read_depth_pixels( GLcontext *ctx,
for (j=0;j<height;j++,y++) {
GLuint *dst = (GLuint *) gl_pixel_addr_in_image( packing, pixels,
width, height, GL_DEPTH_COMPONENT, type, 0, j, 0 );
- (*ctx->Driver.ReadDepthSpanInt)( ctx, width, x, y, (GLdepth*) dst);
+ (*ctx->Driver.ReadDepthSpan)( ctx, width, x, y, (GLdepth*) dst);
for (i=0;i<width;i++) {
dst[i] = dst[i] << shift;
}
@@ -241,7 +234,7 @@ static void read_depth_pixels( GLcontext *ctx,
GLfloat depth[MAX_WIDTH];
GLvoid *dest;
- (*ctx->Driver.ReadDepthSpanFloat)( ctx, readWidth, x, y, depth );
+ gl_read_depth_span_float(ctx, readWidth, x, y, depth);
if (bias_or_scale) {
for (i=0;i<readWidth;i++) {
@@ -537,24 +530,24 @@ read_fast_rgba_pixels( GLcontext *ctx,
rowLength = width;
/* horizontal clipping */
- if (srcX < ctx->Buffer->Xmin) {
- skipPixels += (ctx->Buffer->Xmin - srcX);
- readWidth -= (ctx->Buffer->Xmin - srcX);
- srcX = ctx->Buffer->Xmin;
+ if (srcX < ctx->ReadBuffer->Xmin) {
+ skipPixels += (ctx->ReadBuffer->Xmin - srcX);
+ readWidth -= (ctx->ReadBuffer->Xmin - srcX);
+ srcX = ctx->ReadBuffer->Xmin;
}
- if (srcX + readWidth > ctx->Buffer->Xmax)
- readWidth -= (srcX + readWidth - ctx->Buffer->Xmax - 1);
+ if (srcX + readWidth > ctx->ReadBuffer->Xmax)
+ readWidth -= (srcX + readWidth - ctx->ReadBuffer->Xmax - 1);
if (readWidth <= 0)
return GL_TRUE;
/* vertical clipping */
- if (srcY < ctx->Buffer->Ymin) {
- skipRows += (ctx->Buffer->Ymin - srcY);
- readHeight -= (ctx->Buffer->Ymin - srcY);
- srcY = ctx->Buffer->Ymin;
+ if (srcY < ctx->ReadBuffer->Ymin) {
+ skipRows += (ctx->ReadBuffer->Ymin - srcY);
+ readHeight -= (ctx->ReadBuffer->Ymin - srcY);
+ srcY = ctx->ReadBuffer->Ymin;
}
- if (srcY + readHeight > ctx->Buffer->Ymax)
- readHeight -= (srcY + readHeight - ctx->Buffer->Ymax - 1);
+ if (srcY + readHeight > ctx->ReadBuffer->Ymax)
+ readHeight -= (srcY + readHeight - ctx->ReadBuffer->Ymax - 1);
if (readHeight <= 0)
return GL_TRUE;
@@ -601,13 +594,13 @@ static void read_rgba_pixels( GLcontext *ctx,
{
GLint readWidth;
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.DriverReadBuffer );
+ (*ctx->Driver.SetReadBuffer)(ctx, ctx->ReadBuffer, ctx->Pixel.DriverReadBuffer);
/* Try optimized path first */
if (read_fast_rgba_pixels( ctx, x, y, width, height,
format, type, pixels, packing )) {
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer );
+ (*ctx->Driver.SetReadBuffer)(ctx, ctx->DrawBuffer, ctx->Color.DriverDrawBuffer);
return; /* done! */
}
@@ -652,7 +645,7 @@ static void read_rgba_pixels( GLcontext *ctx,
GLubyte rgba[MAX_WIDTH][4];
GLvoid *dest;
- gl_read_rgba_span( ctx, readWidth, x, y, rgba );
+ gl_read_rgba_span( ctx, ctx->ReadBuffer, readWidth, x, y, rgba );
dest = gl_pixel_addr_in_image( packing, pixels, width, height,
format, type, 0, j, 0);
@@ -684,15 +677,16 @@ static void read_rgba_pixels( GLcontext *ctx,
}
}
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer );
+ (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, ctx->Color.DriverDrawBuffer );
}
-void gl_ReadPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type, GLvoid *pixels )
+void
+_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type, GLvoid *pixels )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glReadPixels");
if (!pixels) {
diff --git a/xc/extras/Mesa/src/readpix.h b/xc/extras/Mesa/src/readpix.h
index ec1d8e9ad..950bfebb1 100644
--- a/xc/extras/Mesa/src/readpix.h
+++ b/xc/extras/Mesa/src/readpix.h
@@ -1,8 +1,8 @@
-/* $Id: readpix.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: readpix.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,19 +25,16 @@
*/
-
-
-
#ifndef READPIX_H
#define READPIX_H
-#include "types.h"
+#include "glheader.h"
-extern void gl_ReadPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type, GLvoid *pixels );
+extern void
+_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type, GLvoid *pixels );
#endif
diff --git a/xc/extras/Mesa/src/rect.c b/xc/extras/Mesa/src/rect.c
index 41e9058a5..e81b4393a 100644
--- a/xc/extras/Mesa/src/rect.c
+++ b/xc/extras/Mesa/src/rect.c
@@ -1,4 +1,4 @@
-/* $Id: rect.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: rect.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,22 +23,16 @@
* 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.
*/
-/* $XFree86: xc/lib/GL/mesa/src/rect.c,v 1.2 1999/04/04 00:20:30 dawes Exp $ */
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "macros.h"
#include "rect.h"
+#include "varray.h"
#include "vbfill.h"
#endif
@@ -47,7 +41,8 @@
/*
* Execute a glRect*() function.
*/
-void gl_Rectf( GLcontext *ctx, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
+void
+_mesa_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
{
/*
* TODO: we could examine a bunch of state variables and ultimately
@@ -56,6 +51,7 @@ void gl_Rectf( GLcontext *ctx, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
*
* KW: What happens to cull mode here?
*/
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx, "glRect");
RESET_IMMEDIATE(ctx);
gl_Begin( ctx, GL_QUADS );
@@ -65,3 +61,47 @@ void gl_Rectf( GLcontext *ctx, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
gl_Vertex2f( ctx, x1, y2 );
gl_End( ctx );
}
+
+
+void
+_mesa_Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
+{
+ _mesa_Rectf(x1, y1, x2, y2);
+}
+
+void
+_mesa_Rectdv(const GLdouble *v1, const GLdouble *v2)
+{
+ _mesa_Rectf(v1[0], v1[1], v2[0], v2[1]);
+}
+
+void
+_mesa_Rectfv(const GLfloat *v1, const GLfloat *v2)
+{
+ _mesa_Rectf(v1[0], v1[1], v2[0], v2[1]);
+}
+
+void
+_mesa_Recti(GLint x1, GLint y1, GLint x2, GLint y2)
+{
+ _mesa_Rectf(x1, y1, x2, y2);
+}
+
+void
+_mesa_Rectiv(const GLint *v1, const GLint *v2)
+{
+ _mesa_Rectf(v1[0], v1[1], v2[0], v2[1]);
+}
+
+void
+_mesa_Rects(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
+{
+ _mesa_Rectf(x1, y1, x2, y2);
+}
+
+void
+_mesa_Rectsv(const GLshort *v1, const GLshort *v2)
+{
+ _mesa_Rectf(v1[0], v1[1], v2[0], v2[1]);
+}
+
diff --git a/xc/extras/Mesa/src/rect.h b/xc/extras/Mesa/src/rect.h
index a0345e22a..9f218ec6f 100644
--- a/xc/extras/Mesa/src/rect.h
+++ b/xc/extras/Mesa/src/rect.h
@@ -1,8 +1,8 @@
-/* $Id: rect.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: rect.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,18 +25,36 @@
*/
+#ifndef RECT_H
+#define RECT_H
+#include "glheader.h"
-#ifndef RECT_H
-#define RECT_H
+extern void
+_mesa_Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
+
+extern void
+_mesa_Rectdv(const GLdouble *v1, const GLdouble *v2);
+
+extern void
+_mesa_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
+
+extern void
+_mesa_Rectfv(const GLfloat *v1, const GLfloat *v2);
+
+extern void
+_mesa_Recti(GLint x1, GLint y1, GLint x2, GLint y2);
-#include "types.h"
+extern void
+_mesa_Rectiv(const GLint *v1, const GLint *v2);
+extern void
+_mesa_Rects(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
-extern void gl_Rectf( GLcontext *ctx,
- GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 );
+extern void
+_mesa_Rectsv(const GLshort *v1, const GLshort *v2);
#endif
diff --git a/xc/extras/Mesa/src/render_tmp.h b/xc/extras/Mesa/src/render_tmp.h
index 90ebad1e7..dff69c596 100644
--- a/xc/extras/Mesa/src/render_tmp.h
+++ b/xc/extras/Mesa/src/render_tmp.h
@@ -1,4 +1,4 @@
-/* $Id: render_tmp.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: render_tmp.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -42,10 +42,6 @@
#define EDGEFLAG_QUAD(a,b,c,d,e)
#endif
-#ifndef RESET_STIPPLE
-#define RESET_STIPPLE
-#endif
-
static void TAG(render_vb_points)( struct vertex_buffer *VB,
GLuint start,
@@ -65,13 +61,14 @@ static void TAG(render_vb_lines)( struct vertex_buffer *VB,
GLuint parity )
{
GLuint j;
+ GLuint *stipplecounter = &VB->ctx->StippleCounter;
LOCAL_VARS;
(void) parity;
INIT(GL_LINES);
for (j=start+1; j<count; j+=2 ) {
RENDER_LINE( j-1, j );
- RESET_STIPPLE;
+ *stipplecounter = 0;
}
POSTFIX;
}
@@ -89,8 +86,9 @@ static void TAG(render_vb_line_strip)( struct vertex_buffer *VB,
INIT(GL_LINES);
for (j=start+1; j<count; j++ ) {
RENDER_LINE( j-1, j );
- }
- RESET_STIPPLE;
+ }
+
+ VB->ctx->StippleCounter = 0;
POSTFIX;
}
@@ -113,7 +111,7 @@ static void TAG(render_vb_line_loop)( struct vertex_buffer *VB,
RENDER_LINE( i-1, start );
}
- RESET_STIPPLE;
+ VB->ctx->StippleCounter = 0;
POSTFIX;
}
@@ -130,7 +128,6 @@ static void TAG(render_vb_triangles)( struct vertex_buffer *VB,
INIT(GL_POLYGON);
for (j=start+2; j<count; j+=3) {
RENDER_TRI( j-2, j-1, j, j, 0 );
- RESET_STIPPLE;
}
POSTFIX;
}
@@ -150,7 +147,6 @@ static void TAG(render_vb_tri_strip)( struct vertex_buffer *VB,
for (j=start+2;j<count;j++,parity^=1) {
EDGEFLAG_TRI( j-2, j-1, j, j, parity );
RENDER_TRI( j-2, j-1, j, j, parity );
- RESET_STIPPLE;
}
} else {
for (j=start+2;j<count;j++,parity^=1) {
@@ -174,7 +170,6 @@ static void TAG(render_vb_tri_fan)( struct vertex_buffer *VB,
for (j=start+2;j<count;j++) {
EDGEFLAG_TRI( start, j-1, j, j, 0 );
RENDER_TRI( start, j-1, j, j, 0 );
- RESET_STIPPLE;
}
} else {
for (j=start+2;j<count;j++) {
@@ -198,7 +193,6 @@ static void TAG(render_vb_poly)( struct vertex_buffer *VB,
for (j=start+2;j<count;j++) {
RENDER_TRI( start, j-1, j, start, 0 );
}
- RESET_STIPPLE;
POSTFIX;
}
@@ -214,7 +208,6 @@ static void TAG(render_vb_quads)( struct vertex_buffer *VB,
INIT(GL_POLYGON);
for (j=start+3; j<count; j+=4) {
RENDER_QUAD( j-3, j-2, j-1, j, j );
- RESET_STIPPLE;
}
POSTFIX;
}
@@ -232,7 +225,6 @@ static void TAG(render_vb_quad_strip)( struct vertex_buffer *VB,
for (j=start+3;j<count;j+=2) {
EDGEFLAG_QUAD( j-3, j-2, j, j-1, j );
RENDER_QUAD( j-3, j-2, j, j-1, j );
- RESET_STIPPLE;
}
} else {
for (j=start+3;j<count;j+=2) {
@@ -282,7 +274,6 @@ static void TAG(render_init)( void )
#undef LOCAL_VARS
#undef INIT
#undef POSTFIX
-#undef RESET_STIPPLE
#endif
#ifndef PRESERVE_TAG
diff --git a/xc/extras/Mesa/src/scissor.c b/xc/extras/Mesa/src/scissor.c
index 161e4deaa..a9aaa55ef 100644
--- a/xc/extras/Mesa/src/scissor.c
+++ b/xc/extras/Mesa/src/scissor.c
@@ -1,8 +1,8 @@
-/* $Id: scissor.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: scissor.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -23,20 +23,12 @@
* 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.
*/
-/* $XFree86: xc/lib/GL/mesa/src/scissor.c,v 1.2 1999/04/04 00:20:31 dawes Exp $ */
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "macros.h"
#include "scissor.h"
@@ -44,20 +36,24 @@
#endif
-void gl_Scissor( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height )
+void
+_mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
{
- if (width<0 || height<0) {
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glScissor");
+
+ if (width < 0 || height < 0) {
gl_error( ctx, GL_INVALID_VALUE, "glScissor" );
return;
}
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBegin");
if (MESA_VERBOSE & VERBOSE_API)
fprintf(stderr, "glScissor %d %d %d %d\n", x, y, width, height);
- if (x!=ctx->Scissor.X || y!=ctx->Scissor.Y ||
- width!=ctx->Scissor.Width || height!=ctx->Scissor.Height) {
+ if (x != ctx->Scissor.X ||
+ y != ctx->Scissor.Y ||
+ width != ctx->Scissor.Width ||
+ height != ctx->Scissor.Height) {
ctx->Scissor.X = x;
ctx->Scissor.Y = y;
ctx->Scissor.Width = width;
@@ -80,18 +76,20 @@ GLint gl_scissor_span( GLcontext *ctx,
GLuint n, GLint x, GLint y, GLubyte mask[] )
{
/* first check if whole span is outside the scissor box */
- if (y<ctx->Buffer->Ymin || y>ctx->Buffer->Ymax
- || x>ctx->Buffer->Xmax || x+(GLint)n-1<ctx->Buffer->Xmin) {
+ if (y < ctx->DrawBuffer->Ymin
+ || y > ctx->DrawBuffer->Ymax
+ || x > ctx->DrawBuffer->Xmax
+ || x + (GLint) n - 1 < ctx->DrawBuffer->Xmin) {
return 0;
}
else {
+ const GLint xMin = ctx->DrawBuffer->Xmin;
+ const GLint xMax = ctx->DrawBuffer->Xmax;
GLint i;
- GLint xMin = ctx->Buffer->Xmin;
- GLint xMax = ctx->Buffer->Xmax;
- for (i=0; x+i < xMin; i++) {
+ for (i = 0; x + i < xMin; i++) {
mask[i] = 0;
}
- for (i=(GLint)n-1; x+i > xMax; i--) {
+ for (i = (GLint) n - 1; x + i > xMax; i--) {
mask[i] = 0;
}
@@ -109,10 +107,10 @@ GLuint gl_scissor_pixels( GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
GLubyte mask[] )
{
- GLint xmin = ctx->Buffer->Xmin;
- GLint xmax = ctx->Buffer->Xmax;
- GLint ymin = ctx->Buffer->Ymin;
- GLint ymax = ctx->Buffer->Ymax;
+ const GLint xmin = ctx->DrawBuffer->Xmin;
+ const GLint xmax = ctx->DrawBuffer->Xmax;
+ const GLint ymin = ctx->DrawBuffer->Ymin;
+ const GLint ymax = ctx->DrawBuffer->Ymax;
GLuint i;
for (i=0;i<n;i++) {
diff --git a/xc/extras/Mesa/src/scissor.h b/xc/extras/Mesa/src/scissor.h
index f537d2758..b40f5ff20 100644
--- a/xc/extras/Mesa/src/scissor.h
+++ b/xc/extras/Mesa/src/scissor.h
@@ -1,8 +1,8 @@
-/* $Id: scissor.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: scissor.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef SCISSOR_H
#define SCISSOR_H
@@ -35,17 +32,17 @@
#include "types.h"
-extern void gl_Scissor( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height );
+extern void
+_mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height );
-extern GLint gl_scissor_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y, GLubyte mask[] );
+extern GLint
+gl_scissor_span( GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte mask[] );
-extern GLuint gl_scissor_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLubyte mask[] );
+extern GLuint
+gl_scissor_pixels( GLcontext *ctx, GLuint n, const GLint x[], const GLint y[],
+ GLubyte mask[] );
#endif
diff --git a/xc/extras/Mesa/src/shade.c b/xc/extras/Mesa/src/shade.c
index b853efd02..e08f1d321 100644
--- a/xc/extras/Mesa/src/shade.c
+++ b/xc/extras/Mesa/src/shade.c
@@ -1,8 +1,8 @@
-/* $Id: shade.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: shade.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -26,24 +26,17 @@
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <math.h>
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "light.h"
#include "macros.h"
#include "mmath.h"
-#include "shade.h"
#include "pipeline.h"
-#include "types.h"
+#include "shade.h"
#include "simple_list.h"
+#include "types.h"
#endif
@@ -373,4 +366,3 @@ void gl_shade_rastpos( GLcontext *ctx,
}
}
-
diff --git a/xc/extras/Mesa/src/shade.h b/xc/extras/Mesa/src/shade.h
index c5f4ddcdd..e761ab777 100644
--- a/xc/extras/Mesa/src/shade.h
+++ b/xc/extras/Mesa/src/shade.h
@@ -1,4 +1,4 @@
-/* $Id: shade.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: shade.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/shade_tmp.h b/xc/extras/Mesa/src/shade_tmp.h
index 62fba0f63..06e7d32a4 100644
--- a/xc/extras/Mesa/src/shade_tmp.h
+++ b/xc/extras/Mesa/src/shade_tmp.h
@@ -1,4 +1,4 @@
-/* $Id: shade_tmp.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: shade_tmp.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -135,7 +135,7 @@ static void TAG(shade_rgba_spec)( struct vertex_buffer *VB )
SUB_3V(VP, light->Position, vertex);
}
- d = LEN_3FV( VP );
+ d = (GLfloat) LEN_3FV( VP );
if (d > 1e-6) {
GLfloat invd = 1.0F / d;
@@ -157,7 +157,7 @@ static void TAG(shade_rgba_spec)( struct vertex_buffer *VB )
else {
double x = PV_dot_dir * (EXP_TABLE_SIZE-1);
int k = (int) x;
- GLfloat spot = (light->SpotExpTable[k][0]
+ GLfloat spot = (GLfloat) (light->SpotExpTable[k][0]
+ (x-k)*light->SpotExpTable[k][1]);
attenuation *= spot;
}
@@ -234,7 +234,7 @@ static void TAG(shade_rgba_spec)( struct vertex_buffer *VB )
}
if (n_dot_h>1.0) {
- spec_coef = pow( n_dot_h, tab->shininess );
+ spec_coef = (GLfloat) pow( n_dot_h, tab->shininess );
} else
GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec_coef );
@@ -554,7 +554,8 @@ static void TAG(shade_fast_rgba)( struct vertex_buffer *VB )
COPY_3V(sum[0], base[0]);
if (NR_SIDES == 2) COPY_3V(sum[1], base[1]);
- if (MESA_VERBOSE&VERBOSE_LIGHTING)
+ if (0)
+/* if (ctx->Light.ShadeModel == GL_SMOOTH) */
fprintf(stderr, "light normal %d/%d, %f %f %f\n",
j, VB->Start, normal[0], normal[1], normal[2]);
@@ -732,7 +733,7 @@ static void TAG(shade_ci)( struct vertex_buffer *VB )
SUB_3V(VP, light->Position, vertex);
}
- d = (GLfloat) LEN_3FV( VP );
+ d = LEN_3FV( VP );
if ( d > 1e-6) {
GLfloat invd = 1.0F / d;
SELF_SCALE_SCALAR_3V(VP, invd);
@@ -752,7 +753,7 @@ static void TAG(shade_ci)( struct vertex_buffer *VB )
else {
double x = PV_dot_dir * (EXP_TABLE_SIZE-1);
int k = (int) x;
- GLfloat spot = (GLfloat) (light->SpotExpTable[k][0]
+ GLfloat spot = (light->SpotExpTable[k][0]
+ (x-k)*light->SpotExpTable[k][1]);
attenuation *= spot;
}
@@ -815,7 +816,7 @@ static void TAG(shade_ci)( struct vertex_buffer *VB )
}
if (n_dot_h>1.0) {
- spec_coef = (GLfloat) pow( n_dot_h, tab->shininess );
+ spec_coef = pow( n_dot_h, tab->shininess );
} else {
GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec_coef);
}
diff --git a/xc/extras/Mesa/src/simple_list.h b/xc/extras/Mesa/src/simple_list.h
index 828853035..90587a476 100644
--- a/xc/extras/Mesa/src/simple_list.h
+++ b/xc/extras/Mesa/src/simple_list.h
@@ -1,4 +1,4 @@
-/* $Id: simple_list.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: simple_list.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/span.c b/xc/extras/Mesa/src/span.c
index ef10bb3a9..bf7910e81 100644
--- a/xc/extras/Mesa/src/span.c
+++ b/xc/extras/Mesa/src/span.c
@@ -1,8 +1,8 @@
-/* $Id: span.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: span.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,24 +25,16 @@
*/
-
-
-
/*
* pixel span rasterization:
- * These functions simulate the rasterization pipeline.
+ * These functions implement the rasterization pipeline.
*/
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "alpha.h"
#include "alphabuf.h"
#include "blend.h"
@@ -51,6 +43,7 @@
#include "logic.h"
#include "macros.h"
#include "masking.h"
+#include "mem.h"
#include "scissor.h"
#include "span.h"
#include "stencil.h"
@@ -96,27 +89,27 @@ static GLuint clip_span( GLcontext *ctx,
GLint i;
/* Clip to top and bottom */
- if (y<0 || y>=ctx->Buffer->Height) {
+ if (y < 0 || y >= ctx->DrawBuffer->Height) {
return 0;
}
/* Clip to left and right */
- if (x>=0 && x+n<=ctx->Buffer->Width) {
+ if (x >= 0 && x + n <= ctx->DrawBuffer->Width) {
/* no clipping needed */
return 1;
}
- else if (x+n<=0) {
+ else if (x + n <= 0) {
/* completely off left side */
return 0;
}
- else if (x>=ctx->Buffer->Width) {
+ else if (x >= ctx->DrawBuffer->Width) {
/* completely off right side */
return 0;
}
else {
/* clip-test each pixel, this could be done better */
for (i=0;i<n;i++) {
- if (x+i<0 || x+i>=ctx->Buffer->Width) {
+ if (x + i < 0 || x + i >= ctx->DrawBuffer->Width) {
mask[i] = 0;
}
}
@@ -145,13 +138,13 @@ static void multi_write_index_span( GLcontext *ctx, GLuint n,
ASSERT(n < MAX_WIDTH);
if (bufferBit == FRONT_LEFT_BIT)
- (*ctx->Driver.SetBuffer)( ctx, GL_FRONT_LEFT);
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_LEFT);
else if (bufferBit == FRONT_RIGHT_BIT)
- (*ctx->Driver.SetBuffer)( ctx, GL_FRONT_RIGHT);
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_RIGHT);
else if (bufferBit == BACK_LEFT_BIT)
- (*ctx->Driver.SetBuffer)( ctx, GL_BACK_LEFT);
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_LEFT);
else
- (*ctx->Driver.SetBuffer)( ctx, GL_BACK_RIGHT);
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT);
/* make copy of incoming indexes */
MEMCPY( indexTmp, indexes, n * sizeof(GLuint) );
@@ -166,7 +159,7 @@ static void multi_write_index_span( GLcontext *ctx, GLuint n,
}
/* restore default dest buffer */
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer);
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, ctx->Color.DriverDrawBuffer);
}
@@ -226,15 +219,13 @@ void gl_write_index_span( GLcontext *ctx,
if (ctx->Stencil.Enabled) {
/* first stencil test */
- if (gl_stencil_span( ctx, n, x, y, mask )==0) {
+ if (gl_stencil_and_depth_test_span(ctx, n, x, y, z, mask) == GL_FALSE) {
return;
}
- /* depth buffering w/ stencil */
- gl_depth_stencil_span( ctx, n, x, y, z, mask );
}
else if (ctx->Depth.Test) {
/* regular depth testing */
- if ((*ctx->Driver.DepthTestSpan)( ctx, n, x, y, z, mask )==0) return;
+ if (gl_depth_test_span( ctx, n, x, y, z, mask )==0) return;
}
if (ctx->RasterMask & MULTI_DRAW_BIT) {
@@ -288,15 +279,13 @@ void gl_write_monoindex_span( GLcontext *ctx,
if (ctx->Stencil.Enabled) {
/* first stencil test */
- if (gl_stencil_span( ctx, n, x, y, mask )==0) {
+ if (gl_stencil_and_depth_test_span(ctx, n, x, y, z, mask) == GL_FALSE) {
return;
}
- /* depth buffering w/ stencil */
- gl_depth_stencil_span( ctx, n, x, y, z, mask );
}
else if (ctx->Depth.Test) {
/* regular depth testing */
- if ((*ctx->Driver.DepthTestSpan)( ctx, n, x, y, z, mask )==0) return;
+ if (gl_depth_test_span( ctx, n, x, y, z, mask )==0) return;
}
if (ctx->Color.DrawBuffer == GL_NONE) {
@@ -378,20 +367,20 @@ static void multi_write_rgba_span( GLcontext *ctx, GLuint n,
ASSERT(n < MAX_WIDTH);
if (bufferBit == FRONT_LEFT_BIT) {
- (*ctx->Driver.SetBuffer)( ctx, GL_FRONT_LEFT);
- ctx->Buffer->Alpha = ctx->Buffer->FrontLeftAlpha;
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_LEFT);
+ ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontLeftAlpha;
}
else if (bufferBit == FRONT_RIGHT_BIT) {
- (*ctx->Driver.SetBuffer)( ctx, GL_FRONT_RIGHT);
- ctx->Buffer->Alpha = ctx->Buffer->FrontRightAlpha;
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_RIGHT);
+ ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontRightAlpha;
}
else if (bufferBit == BACK_LEFT_BIT) {
- (*ctx->Driver.SetBuffer)( ctx, GL_BACK_LEFT);
- ctx->Buffer->Alpha = ctx->Buffer->BackLeftAlpha;
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_LEFT);
+ ctx->DrawBuffer->Alpha = ctx->DrawBuffer->BackLeftAlpha;
}
else {
- (*ctx->Driver.SetBuffer)( ctx, GL_BACK_RIGHT);
- ctx->Buffer->Alpha = ctx->Buffer->BackRightAlpha;
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT);
+ ctx->DrawBuffer->Alpha = ctx->DrawBuffer->BackRightAlpha;
}
/* make copy of incoming colors */
@@ -417,7 +406,7 @@ static void multi_write_rgba_span( GLcontext *ctx, GLuint n,
}
/* restore default dest buffer */
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer );
+ (void) (*ctx->Driver.SetDrawBuffer)( ctx, ctx->Color.DriverDrawBuffer );
}
@@ -482,16 +471,14 @@ void gl_write_rgba_span( GLcontext *ctx,
if (ctx->Stencil.Enabled) {
/* first stencil test */
- if (gl_stencil_span( ctx, n, x, y, mask )==0) {
+ if (gl_stencil_and_depth_test_span(ctx, n, x, y, z, mask) == GL_FALSE) {
return;
}
- /* depth buffering w/ stencil */
- gl_depth_stencil_span( ctx, n, x, y, z, mask );
write_all = GL_FALSE;
}
else if (ctx->Depth.Test) {
/* regular depth testing */
- GLuint m = (*ctx->Driver.DepthTestSpan)( ctx, n, x, y, z, mask );
+ GLuint m = gl_depth_test_span( ctx, n, x, y, z, mask );
if (m==0) {
return;
}
@@ -594,16 +581,14 @@ void gl_write_monocolor_span( GLcontext *ctx,
if (ctx->Stencil.Enabled) {
/* first stencil test */
- if (gl_stencil_span( ctx, n, x, y, mask )==0) {
+ if (gl_stencil_and_depth_test_span(ctx, n, x, y, z, mask) == GL_FALSE) {
return;
}
- /* depth buffering w/ stencil */
- gl_depth_stencil_span( ctx, n, x, y, z, mask );
write_all = GL_FALSE;
}
else if (ctx->Depth.Test) {
/* regular depth testing */
- GLuint m = (*ctx->Driver.DepthTestSpan)( ctx, n, x, y, z, mask );
+ GLuint m = gl_depth_test_span( ctx, n, x, y, z, mask );
if (m==0) {
return;
}
@@ -785,16 +770,14 @@ void gl_write_texture_span( GLcontext *ctx,
if (ctx->Stencil.Enabled) {
/* first stencil test */
- if (gl_stencil_span( ctx, n, x, y, mask )==0) {
+ if (gl_stencil_and_depth_test_span(ctx, n, x, y, z, mask) == GL_FALSE) {
return;
}
- /* depth buffering w/ stencil */
- gl_depth_stencil_span( ctx, n, x, y, z, mask );
write_all = GL_FALSE;
}
else if (ctx->Depth.Test) {
/* regular depth testing */
- GLuint m = (*ctx->Driver.DepthTestSpan)( ctx, n, x, y, z, mask );
+ GLuint m = gl_depth_test_span( ctx, n, x, y, z, mask );
if (m==0) {
return;
}
@@ -912,16 +895,14 @@ void gl_write_multitexture_span( GLcontext *ctx, GLuint texUnits,
if (ctx->Stencil.Enabled) {
/* first stencil test */
- if (gl_stencil_span( ctx, n, x, y, mask )==0) {
+ if (gl_stencil_and_depth_test_span(ctx, n, x, y, z, mask) == GL_FALSE) {
return;
}
- /* depth buffering w/ stencil */
- gl_depth_stencil_span( ctx, n, x, y, z, mask );
write_all = GL_FALSE;
}
else if (ctx->Depth.Test) {
/* regular depth testing */
- GLuint m = (*ctx->Driver.DepthTestSpan)( ctx, n, x, y, z, mask );
+ GLuint m = gl_depth_test_span( ctx, n, x, y, z, mask );
if (m==0) {
return;
}
@@ -960,13 +941,15 @@ void gl_write_multitexture_span( GLcontext *ctx, GLuint texUnits,
* Read RGBA pixels from frame buffer. Clipping will be done to prevent
* reading ouside the buffer's boundaries.
*/
-void gl_read_rgba_span( GLcontext *ctx,
+void gl_read_rgba_span( GLcontext *ctx, GLframebuffer *buffer,
GLuint n, GLint x, GLint y,
GLubyte rgba[][4] )
{
- if (y<0 || y>=ctx->Buffer->Height || x>=ctx->Buffer->Width) {
+ if (y < 0 || y >= buffer->Height
+ || x + (GLint) n < 0 || x >= buffer->Width) {
/* completely above, below, or right */
- MEMSET( rgba, 0, 4 * n * sizeof(GLubyte)); /*XXX maybe leave undefined?*/
+ /* XXX maybe leave undefined? */
+ MEMSET( rgba, 0, 4 * n * sizeof(GLubyte));
}
else {
GLint skip, length;
@@ -978,14 +961,14 @@ void gl_read_rgba_span( GLcontext *ctx,
/* completely left of window */
return;
}
- if (length > ctx->Buffer->Width) {
- length = ctx->Buffer->Width;
+ if (length > buffer->Width) {
+ length = buffer->Width;
}
}
- else if ((GLint) (x + n) > ctx->Buffer->Width) {
+ else if ((GLint) (x + n) > buffer->Width) {
/* right edge clipping */
skip = 0;
- length = ctx->Buffer->Width - x;
+ length = buffer->Width - x;
if (length < 0) {
/* completely to right of window */
return;
@@ -1011,16 +994,13 @@ void gl_read_rgba_span( GLcontext *ctx,
* Read CI pixels from frame buffer. Clipping will be done to prevent
* reading ouside the buffer's boundaries.
*/
-void gl_read_index_span( GLcontext *ctx,
+void gl_read_index_span( GLcontext *ctx, GLframebuffer *buffer,
GLuint n, GLint x, GLint y, GLuint indx[] )
{
- register GLuint i;
-
- if (y<0 || y>=ctx->Buffer->Height || x>=ctx->Buffer->Width) {
+ if (y < 0 || y >= buffer->Height
+ || x + (GLint) n < 0 || x >= buffer->Width) {
/* completely above, below, or right */
- for (i=0;i<n;i++) {
- indx[i] = 0;
- }
+ MEMSET(indx, 0, n * sizeof(GLuint));
}
else {
GLint skip, length;
@@ -1032,14 +1012,14 @@ void gl_read_index_span( GLcontext *ctx,
/* completely left of window */
return;
}
- if (length > ctx->Buffer->Width) {
- length = ctx->Buffer->Width;
+ if (length > buffer->Width) {
+ length = buffer->Width;
}
}
- else if ((GLint) (x + n) > ctx->Buffer->Width) {
+ else if ((GLint) (x + n) > buffer->Width) {
/* right edge clipping */
skip = 0;
- length = ctx->Buffer->Width - x;
+ length = buffer->Width - x;
if (length < 0) {
/* completely to right of window */
return;
diff --git a/xc/extras/Mesa/src/span.h b/xc/extras/Mesa/src/span.h
index 9a6116f67..1df0b7983 100644
--- a/xc/extras/Mesa/src/span.h
+++ b/xc/extras/Mesa/src/span.h
@@ -1,4 +1,4 @@
-/* $Id: span.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: span.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -78,12 +78,12 @@ extern void gl_write_multitexture_span( GLcontext *ctx, GLuint texSets,
GLenum primitive );
-extern void gl_read_rgba_span( GLcontext *ctx,
+extern void gl_read_rgba_span( GLcontext *ctx, GLframebuffer *buffer,
GLuint n, GLint x, GLint y,
GLubyte rgba[][4] );
-extern void gl_read_index_span( GLcontext *ctx,
+extern void gl_read_index_span( GLcontext *ctx, GLframebuffer *buffer,
GLuint n, GLint x, GLint y, GLuint indx[] );
diff --git a/xc/extras/Mesa/src/stages.c b/xc/extras/Mesa/src/stages.c
index 04d51a187..d074d7477 100644
--- a/xc/extras/Mesa/src/stages.c
+++ b/xc/extras/Mesa/src/stages.c
@@ -1,8 +1,8 @@
-/* $Id: stages.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: stages.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,14 +25,10 @@
*/
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-#ifndef XFree86Server
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#ifdef PC_HEADER
+#include "all.h"
+#else
+#include "glheader.h"
#include "bbox.h"
#include "clip.h"
#include "context.h"
@@ -43,13 +39,14 @@
#include "pipeline.h"
#include "shade.h"
#include "stages.h"
-#include "types.h"
#include "translate.h"
+#include "types.h"
#include "vbcull.h"
#include "vbindirect.h"
#include "vbrender.h"
#include "vbxform.h"
#include "xform.h"
+#endif
static GLmatrix gl_identity_mat;
@@ -515,7 +512,7 @@ static void check_fog( GLcontext *ctx, struct gl_pipeline_stage *d )
{
d->type = 0;
- if (ctx->FogMode==FOG_VERTEX)
+ if (ctx->Fog.Enabled && ctx->FogMode==FOG_VERTEX)
{
GLuint flags;
@@ -709,7 +706,7 @@ CONST struct gl_pipeline_stage gl_default_pipeline[] = {
PIPE_OP_NORM_XFORM,
PIPE_PRECALC|PIPE_IMMEDIATE,
0,
- NEW_LIGHTING|NEW_FOG|NEW_TEXTURING|NEW_NORMAL_TRANSFORM, /* state change (recheck) */
+ NEW_LIGHTING|NEW_FOG|NEW_TEXTURING, /* state change (recheck) */
NEW_NORMAL_TRANSFORM, /* cva state change (recalc) */
0, 0,
DYN_STATE,
@@ -788,8 +785,8 @@ CONST struct gl_pipeline_stage gl_default_pipeline[] = {
PIPE_OP_RAST_SETUP_0|PIPE_OP_RAST_SETUP_1,
PIPE_PRECALC|PIPE_IMMEDIATE,
0,
- NEW_LIGHTING|NEW_TEXTURING|NEW_RASTER_OPS|NEW_POLYGON|NEW_TEXTURE_ENV,
- NEW_LIGHTING|NEW_TEXTURING|NEW_RASTER_OPS|NEW_POLYGON|NEW_TEXTURE_ENV,
+ NEW_LIGHTING|NEW_TEXTURING|NEW_RASTER_OPS|NEW_POLYGON,
+ NEW_LIGHTING|NEW_TEXTURING|NEW_RASTER_OPS|NEW_POLYGON,
0, 0,
DYN_STATE,
check_full_setup,
diff --git a/xc/extras/Mesa/src/stages.h b/xc/extras/Mesa/src/stages.h
index ca47647ac..178e29d13 100644
--- a/xc/extras/Mesa/src/stages.h
+++ b/xc/extras/Mesa/src/stages.h
@@ -1,8 +1,8 @@
-/* $Id: stages.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: stages.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
diff --git a/xc/extras/Mesa/src/stencil.c b/xc/extras/Mesa/src/stencil.c
index bf65801df..8f0aba952 100644
--- a/xc/extras/Mesa/src/stencil.c
+++ b/xc/extras/Mesa/src/stencil.c
@@ -1,8 +1,8 @@
-/* $Id: stencil.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: stencil.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,19 +25,13 @@
*/
-/* $XFree86: xc/lib/GL/mesa/src/stencil.c,v 1.3 1999/04/04 00:20:32 dawes Exp $ */
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <stdlib.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
-#include "macros.h"
+#include "depth.h"
+#include "mem.h"
#include "pb.h"
#include "stencil.h"
#include "types.h"
@@ -46,14 +40,11 @@
-/*
- * Return the address of a stencil buffer value given the window coords:
- */
-#define STENCIL_ADDRESS(X,Y) (ctx->Buffer->Stencil + ctx->Buffer->Width * (Y) + (X))
-
-void gl_ClearStencil( GLcontext *ctx, GLint s )
+void
+_mesa_ClearStencil( GLint s )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClearStencil");
ctx->Stencil.Clear = (GLstencil) s;
@@ -64,8 +55,10 @@ void gl_ClearStencil( GLcontext *ctx, GLint s )
-void gl_StencilFunc( GLcontext *ctx, GLenum func, GLint ref, GLuint mask )
+void
+_mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint maxref;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glStencilFunc");
@@ -97,8 +90,10 @@ void gl_StencilFunc( GLcontext *ctx, GLenum func, GLint ref, GLuint mask )
-void gl_StencilMask( GLcontext *ctx, GLuint mask )
+void
+_mesa_StencilMask( GLuint mask )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glStencilMask");
ctx->Stencil.WriteMask = (GLstencil) mask;
@@ -109,8 +104,10 @@ void gl_StencilMask( GLcontext *ctx, GLuint mask )
-void gl_StencilOp( GLcontext *ctx, GLenum fail, GLenum zfail, GLenum zpass )
+void
+_mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glStencilOp");
switch (fail) {
case GL_KEEP:
@@ -184,15 +181,25 @@ ENDIF
/*
+ * Return the address of a stencil buffer value given the window coords:
+ */
+#define STENCIL_ADDRESS(X,Y) \
+ (ctx->DrawBuffer->Stencil + ctx->DrawBuffer->Width * (Y) + (X))
+
+
+
+/*
* Apply the given stencil operator to the array of stencil values.
* Don't touch stencil[i] if mask[i] is zero.
- * Input: n - number of pixels in the span
+ * Input: n - size of stencil array
* oper - the stencil buffer operator
* stencil - array of stencil values
* mask - array [n] of flag: 1=apply operator, 0=don't apply operator
+ * Output: stencil - modified values
*/
-static void apply_stencil_op( GLcontext *ctx, GLenum oper,
- GLuint n, GLstencil stencil[], GLubyte mask[] )
+static void apply_stencil_op( const GLcontext *ctx, GLenum oper,
+ GLuint n, GLstencil stencil[],
+ const GLubyte mask[] )
{
const GLstencil ref = ctx->Stencil.Ref;
const GLstencil wrtmask = ctx->Stencil.WriteMask;
@@ -294,7 +301,7 @@ static void apply_stencil_op( GLcontext *ctx, GLenum oper,
for (i=0;i<n;i++) {
if (mask[i]) {
GLstencil s = stencil[i];
- stencil[i] = (GLstencil) ((invmask & s) | (wrtmask & (stencil[i]+1)));
+ stencil[i] = (GLstencil) ((invmask & s) | (wrtmask & (s+1)));
}
}
}
@@ -311,7 +318,7 @@ static void apply_stencil_op( GLcontext *ctx, GLenum oper,
for (i=0;i<n;i++) {
if (mask[i]) {
GLstencil s = stencil[i];
- stencil[i] = (GLstencil) ((invmask & s) | (wrtmask & (stencil[i]-1)));
+ stencil[i] = (GLstencil) ((invmask & s) | (wrtmask & (s-1)));
}
}
}
@@ -343,24 +350,25 @@ static void apply_stencil_op( GLcontext *ctx, GLenum oper,
/*
- * Apply stencil test to a span of pixels before depth buffering.
- * Input: n - number of pixels in the span
- * x, y - coordinate of left-most pixel in the span
+ * Apply stencil test to an array of stencil values (before depth buffering).
+ * Input: n - number of pixels in the array
+ * stencil - array of [n] stencil values
* mask - array [n] of flag: 0=skip the pixel, 1=stencil the pixel
* Output: mask - pixels which fail the stencil test will have their
* mask flag set to 0.
- * Return: 0 = all pixels failed, 1 = zero or more pixels passed.
+ * stencil - updated stencil values (where the test passed)
+ * Return: GL_FALSE = all pixels failed, GL_TRUE = zero or more pixels passed.
*/
-GLint gl_stencil_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y, GLubyte mask[] )
+static GLboolean
+do_stencil_test( GLcontext *ctx, GLuint n, GLstencil stencil[],
+ GLubyte mask[] )
{
- GLubyte fail[MAX_WIDTH];
- GLint allfail = 0;
+ GLubyte fail[PB_SIZE];
+ GLboolean allfail = GL_FALSE;
GLuint i;
GLstencil r, s;
- GLstencil *stencil;
- stencil = STENCIL_ADDRESS( x, y );
+ ASSERT(n <= PB_SIZE);
/*
* Perform stencil test. The results of this operation are stored
@@ -383,7 +391,7 @@ GLint gl_stencil_span( GLcontext *ctx,
fail[i] = 0;
}
}
- allfail = 1;
+ allfail = GL_TRUE;
break;
case GL_LESS:
r = (GLstencil) (ctx->Stencil.Ref & ctx->Stencil.ValueMask);
@@ -514,26 +522,47 @@ GLint gl_stencil_span( GLcontext *ctx,
apply_stencil_op( ctx, ctx->Stencil.FailFunc, n, stencil, fail );
}
- return (allfail) ? 0 : 1;
+ return !allfail;
}
/*
- * Apply the combination depth-buffer/stencil operator to a span of pixels.
+ * Apply stencil and depth testing to an array of pixels.
+ * Hardware or software stencil buffer acceptable.
* Input: n - number of pixels in the span
- * x, y - location of leftmost pixel in span
* z - array [n] of z values
- * Input: mask - array [n] of flags (1=test this pixel, 0=skip the pixel)
- * Output: mask - array [n] of flags (1=depth test passed, 0=failed)
+ * stencil - array [n] of stencil values
+ * mask - array [n] of flags (1=test this pixel, 0=skip the pixel)
+ * Output: stencil - modified stencil values
+ * mask - array [n] of flags (1=stencil and depth test passed)
+ * Return: GL_TRUE - all fragments failed the testing
+ * GL_FALSE - one or more fragments passed the testing
+ *
*/
-void gl_depth_stencil_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y, const GLdepth z[],
- GLubyte mask[] )
+static GLboolean
+stencil_and_depth_test_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
+ const GLdepth z[], GLstencil stencil[],
+ GLubyte mask[] )
{
- GLstencil *stencil = STENCIL_ADDRESS(x, y);
+ ASSERT(ctx->Stencil.Enabled);
+ ASSERT(n <= PB_SIZE);
+
+ /*
+ * Apply the stencil test to the fragments.
+ * failMask[i] is 1 if the stencil test failed.
+ */
+ if (do_stencil_test( ctx, n, stencil, mask ) == GL_FALSE) {
+ /* all fragments failed the stencil test, we're done. */
+ return GL_FALSE;
+ }
+
+ /*
+ * Some fragments passed the stencil test, apply depth test to them
+ * and apply Zpass and Zfail stencil ops.
+ */
if (ctx->Depth.Test==GL_FALSE) {
/*
* No depth buffer, just apply zpass stencil function to active pixels.
@@ -551,8 +580,7 @@ void gl_depth_stencil_span( GLcontext *ctx,
MEMCPY(oldmask, mask, n * sizeof(GLubyte));
/* apply the depth test */
- if (ctx->Driver.DepthTestSpan)
- (*ctx->Driver.DepthTestSpan)( ctx, n, x, y, z, mask );
+ gl_depth_test_span(ctx, n, x, y, z, mask);
/* Set the stencil pass/fail flags according to result of depth testing.
* if oldmask[i] == 0 then
@@ -578,6 +606,56 @@ void gl_depth_stencil_span( GLcontext *ctx,
apply_stencil_op( ctx, ctx->Stencil.ZPassFunc, n, stencil, passmask );
}
}
+
+ return GL_TRUE; /* one or more fragments passed both tests */
+}
+
+
+
+/*
+ * Apply stencil and depth testing to the span of pixels.
+ * Both software and hardware stencil buffers are acceptable.
+ * Input: n - number of pixels in the span
+ * x, y - location of leftmost pixel in span
+ * z - array [n] of z values
+ * mask - array [n] of flags (1=test this pixel, 0=skip the pixel)
+ * Output: mask - array [n] of flags (1=stencil and depth test passed)
+ * Return: GL_TRUE - all fragments failed the testing
+ * GL_FALSE - one or more fragments passed the testing
+ *
+ */
+GLboolean
+gl_stencil_and_depth_test_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
+ const GLdepth z[], GLubyte mask[] )
+{
+ GLstencil stencilRow[MAX_WIDTH];
+ GLstencil *stencil;
+ GLboolean result;
+
+ ASSERT(ctx->Stencil.Enabled);
+ ASSERT(n <= MAX_WIDTH);
+
+ /* Get initial stencil values */
+ if (ctx->Driver.WriteStencilSpan) {
+ ASSERT(ctx->Driver.ReadStencilSpan);
+ /* Get stencil values from the hardware stencil buffer */
+ (*ctx->Driver.ReadStencilSpan)(ctx, n, x, y, stencilRow);
+ stencil = stencilRow;
+ }
+ else {
+ /* software stencil buffer */
+ stencil = STENCIL_ADDRESS(x, y);
+ }
+
+ /* do all the stencil/depth testing/updating */
+ result = stencil_and_depth_test_span( ctx, n, x, y, z, stencil, mask );
+
+ if (ctx->Driver.WriteStencilSpan) {
+ /* Write updated stencil values into hardware stencil buffer */
+ (ctx->Driver.WriteStencilSpan)(ctx, n, x, y, stencil, mask );
+ }
+
+ return result;
}
@@ -585,25 +663,23 @@ void gl_depth_stencil_span( GLcontext *ctx,
/*
* Apply the given stencil operator for each pixel in the array whose
- * mask flag is set.
+ * mask flag is set. This is for software stencil buffers only.
* Input: n - number of pixels in the span
* x, y - array of [n] pixels
* operator - the stencil buffer operator
* mask - array [n] of flag: 1=apply operator, 0=don't apply operator
*/
-static void apply_stencil_op_to_pixels( GLcontext *ctx,
- GLuint n, const GLint x[],
- const GLint y[],
- GLenum oper, GLubyte mask[] )
+static void
+apply_stencil_op_to_pixels( const GLcontext *ctx,
+ GLuint n, const GLint x[], const GLint y[],
+ GLenum oper, const GLubyte mask[] )
{
+ const GLstencil ref = ctx->Stencil.Ref;
+ const GLstencil wrtmask = ctx->Stencil.WriteMask;
+ const GLstencil invmask = (GLstencil) (~ctx->Stencil.WriteMask);
GLuint i;
- GLstencil ref;
- GLstencil wrtmask, invmask;
-
- wrtmask = ctx->Stencil.WriteMask;
- invmask = (GLstencil) (~ctx->Stencil.WriteMask);
- ref = ctx->Stencil.Ref;
+ ASSERT(!ctx->Driver.WriteStencilSpan); /* software stencil buffer only! */
switch (oper) {
case GL_KEEP:
@@ -752,6 +828,7 @@ static void apply_stencil_op_to_pixels( GLcontext *ctx,
/*
* Apply stencil test to an array of pixels before depth buffering.
+ * Used for software stencil buffer only.
* Input: n - number of pixels in the span
* x, y - array of [n] pixels to stencil
* mask - array [n] of flag: 0=skip the pixel, 1=stencil the pixel
@@ -759,14 +836,16 @@ static void apply_stencil_op_to_pixels( GLcontext *ctx,
* mask flag set to 0.
* Return: 0 = all pixels failed, 1 = zero or more pixels passed.
*/
-GLint gl_stencil_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLubyte mask[] )
+static GLboolean
+stencil_test_pixels( GLcontext *ctx, GLuint n,
+ const GLint x[], const GLint y[], GLubyte mask[] )
{
GLubyte fail[PB_SIZE];
GLstencil r, s;
GLuint i;
- GLint allfail = 0;
+ GLboolean allfail = GL_FALSE;
+
+ ASSERT(!ctx->Driver.WriteStencilSpan); /* software stencil buffer only! */
/*
* Perform stencil test. The results of this operation are stored
@@ -790,7 +869,7 @@ GLint gl_stencil_pixels( GLcontext *ctx,
fail[i] = 0;
}
}
- allfail = 1;
+ allfail = GL_TRUE;
break;
case GL_LESS:
r = (GLstencil) (ctx->Stencil.Ref & ctx->Stencil.ValueMask);
@@ -923,91 +1002,152 @@ GLint gl_stencil_pixels( GLcontext *ctx,
return 0;
}
- apply_stencil_op_to_pixels( ctx, n, x, y, ctx->Stencil.FailFunc, fail );
+ if (ctx->Stencil.FailFunc != GL_KEEP) {
+ apply_stencil_op_to_pixels( ctx, n, x, y, ctx->Stencil.FailFunc, fail );
+ }
- return (allfail) ? 0 : 1;
+ return !allfail;
}
/*
- * Apply the combination depth-buffer/stencil operator to a span of pixels.
- * Input: n - number of pixels in the span
- * x, y - array of [n] pixels to stencil
+ * Apply stencil and depth testing to an array of pixels.
+ * This is used both for software and hardware stencil buffers.
+ *
+ * The comments in this function are a bit sparse but the code is
+ * almost identical to stencil_and_depth_test_span(), which is well
+ * commented.
+ *
+ * Input: n - number of pixels in the array
+ * x, y - array of [n] pixel positions
* z - array [n] of z values
- * Input: mask - array [n] of flags (1=test this pixel, 0=skip the pixel)
- * Output: mask - array [n] of flags (1=depth test passed, 0=failed)
+ * mask - array [n] of flags (1=test this pixel, 0=skip the pixel)
+ * Output: mask - array [n] of flags (1=stencil and depth test passed)
+ * Return: GL_TRUE - all fragments failed the testing
+ * GL_FALSE - one or more fragments passed the testing
*/
-void gl_depth_stencil_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- const GLdepth z[], GLubyte mask[] )
+GLboolean
+gl_stencil_and_depth_test_pixels( GLcontext *ctx,
+ GLuint n, const GLint x[], const GLint y[],
+ const GLdepth z[], GLubyte mask[] )
{
- if (ctx->Depth.Test==GL_FALSE) {
- /*
- * No depth buffer, just apply zpass stencil function to active pixels.
- */
- apply_stencil_op_to_pixels( ctx, n, x, y, ctx->Stencil.ZPassFunc, mask );
+ ASSERT(ctx->Stencil.Enabled);
+ ASSERT(n <= PB_SIZE);
+
+ if (ctx->Driver.WriteStencilPixels) {
+ /*** Hardware stencil buffer ***/
+ GLstencil stencil[PB_SIZE];
+ GLubyte mask[PB_SIZE];
+
+ ASSERT(ctx->Driver.ReadStencilPixels);
+ (*ctx->Driver.ReadStencilPixels)(ctx, n, x, y, stencil);
+
+
+ if (do_stencil_test( ctx, n, stencil, mask ) == GL_FALSE) {
+ /* all fragments failed the stencil test, we're done. */
+ return GL_FALSE;
+ }
+
+ if (ctx->Depth.Test == GL_FALSE) {
+ apply_stencil_op( ctx, ctx->Stencil.ZPassFunc, n, stencil, mask );
+ }
+ else {
+ GLubyte passmask[PB_SIZE], failmask[PB_SIZE], oldmask[PB_SIZE];
+ GLuint i;
+
+ MEMCPY(oldmask, mask, n * sizeof(GLubyte));
+
+ gl_depth_test_pixels(ctx, n, x, y, z, mask);
+
+ for (i=0;i<n;i++) {
+ ASSERT(mask[i] == 0 || mask[i] == 1);
+ passmask[i] = oldmask[i] & mask[i];
+ failmask[i] = oldmask[i] & (mask[i] ^ 1);
+ }
+
+ if (ctx->Stencil.ZFailFunc != GL_KEEP) {
+ apply_stencil_op( ctx, ctx->Stencil.ZFailFunc, n, stencil, failmask );
+ }
+ if (ctx->Stencil.ZPassFunc != GL_KEEP) {
+ apply_stencil_op( ctx, ctx->Stencil.ZPassFunc, n, stencil, passmask );
+ }
+ }
+
+ /* Write updated stencil values into hardware stencil buffer */
+ (ctx->Driver.WriteStencilPixels)(ctx, n, x, y, stencil, mask );
+
+ return GL_TRUE;
+
}
else {
- /*
- * Perform depth buffering, then apply zpass or zfail stencil function.
- */
- GLubyte passmask[PB_SIZE], failmask[PB_SIZE], oldmask[PB_SIZE];
- GLuint i;
+ /*** Software stencil buffer ***/
- /* save the current mask bits */
- MEMCPY(oldmask, mask, n * sizeof(GLubyte));
+ if (stencil_test_pixels(ctx, n, x, y, mask) == GL_FALSE) {
+ /* all fragments failed the stencil test, we're done. */
+ return GL_FALSE;
+ }
- /* apply the depth test */
- if (ctx->Driver.DepthTestPixels)
- (*ctx->Driver.DepthTestPixels)( ctx, n, x, y, z, mask );
- /* Set the stencil pass/fail flags according to result of depth testing.
- * if oldmask[i] == 0 then
- * Don't touch the stencil value
- * else if oldmask[i] and newmask[i] then
- * Depth test passed
- * else
- * assert(oldmask[i] && !newmask[i])
- * Depth test failed
- * endif
- */
- for (i=0;i<n;i++) {
- ASSERT(mask[i] == 0 || mask[i] == 1);
- passmask[i] = oldmask[i] & mask[i];
- failmask[i] = oldmask[i] & (mask[i] ^ 1);
+ if (ctx->Depth.Test==GL_FALSE) {
+ apply_stencil_op_to_pixels( ctx, n, x, y, ctx->Stencil.ZPassFunc, mask );
+ }
+ else {
+ GLubyte passmask[PB_SIZE], failmask[PB_SIZE], oldmask[PB_SIZE];
+ GLuint i;
+
+ MEMCPY(oldmask, mask, n * sizeof(GLubyte));
+
+ gl_depth_test_pixels(ctx, n, x, y, z, mask);
+
+ for (i=0;i<n;i++) {
+ ASSERT(mask[i] == 0 || mask[i] == 1);
+ passmask[i] = oldmask[i] & mask[i];
+ failmask[i] = oldmask[i] & (mask[i] ^ 1);
+ }
+
+ if (ctx->Stencil.ZFailFunc != GL_KEEP) {
+ apply_stencil_op_to_pixels( ctx, n, x, y,
+ ctx->Stencil.ZFailFunc, failmask );
+ }
+ if (ctx->Stencil.ZPassFunc != GL_KEEP) {
+ apply_stencil_op_to_pixels( ctx, n, x, y,
+ ctx->Stencil.ZPassFunc, passmask );
+ }
}
- /* apply the pass and fail operations */
- apply_stencil_op_to_pixels( ctx, n, x, y,
- ctx->Stencil.ZFailFunc, failmask );
- apply_stencil_op_to_pixels( ctx, n, x, y,
- ctx->Stencil.ZPassFunc, passmask );
+ return GL_TRUE; /* one or more fragments passed both tests */
}
-
}
/*
* Return a span of stencil values from the stencil buffer.
+ * Used for glRead/CopyPixels
* Input: n - how many pixels
* x,y - location of first pixel
* Output: stencil - the array of stencil values
*/
void gl_read_stencil_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y, GLstencil stencil[] )
+ GLint n, GLint x, GLint y, GLstencil stencil[] )
{
- if (ctx->Buffer->Stencil) {
- const GLstencil *s = STENCIL_ADDRESS( x, y );
+ ASSERT(n >= 0);
+ if (ctx->DrawBuffer->Stencil) {
+ if (ctx->Driver.ReadStencilSpan) {
+ (*ctx->Driver.ReadStencilSpan)( ctx, (GLuint) n, x, y, stencil );
+ }
+ else {
+ const GLstencil *s = STENCIL_ADDRESS( x, y );
#if STENCIL_BITS == 8
- MEMCPY( stencil, s, n * sizeof(GLstencil) );
+ MEMCPY( stencil, s, n * sizeof(GLstencil) );
#else
- GLuint i;
- for (i=0;i<n;i++)
- stencil[i] = s[i];
+ GLuint i;
+ for (i=0;i<n;i++)
+ stencil[i] = s[i];
#endif
+ }
}
}
@@ -1015,23 +1155,46 @@ void gl_read_stencil_span( GLcontext *ctx,
/*
* Write a span of stencil values to the stencil buffer.
+ * Used for glDraw/CopyPixels
* Input: n - how many pixels
- * x,y - location of first pixel
+ * x, y - location of first pixel
* stencil - the array of stencil values
*/
void gl_write_stencil_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y,
+ GLint n, GLint x, GLint y,
const GLstencil stencil[] )
{
- if (ctx->Buffer->Stencil) {
- GLstencil *s = STENCIL_ADDRESS( x, y );
+ ASSERT(n >= 0);
+ if (ctx->DrawBuffer->Stencil) {
+ /* do clipping */
+ if (y < ctx->DrawBuffer->Ymin || y > ctx->DrawBuffer->Ymax)
+ return;
+ if (x < ctx->DrawBuffer->Xmin) {
+ GLint diff = ctx->DrawBuffer->Xmin - x;
+ n -= diff;
+ stencil += diff;
+ x = ctx->DrawBuffer->Xmin;
+ }
+ if (x + n > ctx->DrawBuffer->Xmax) {
+ GLint diff = x + n - ctx->DrawBuffer->Xmax;
+ n -= diff;
+ }
+
+ ASSERT( n >= 0);
+
+ if (ctx->Driver.WriteStencilSpan) {
+ (*ctx->Driver.WriteStencilSpan)( ctx, n, x, y, stencil, NULL );
+ }
+ else {
+ GLstencil *s = STENCIL_ADDRESS( x, y );
#if STENCIL_BITS == 8
- MEMCPY( s, stencil, n * sizeof(GLstencil) );
+ MEMCPY( s, stencil, n * sizeof(GLstencil) );
#else
- GLuint i;
- for (i=0;i<n;i++)
- s[i] = stencil[i];
+ GLuint i;
+ for (i=0;i<n;i++)
+ s[i] = stencil[i];
#endif
+ }
}
}
@@ -1043,65 +1206,64 @@ void gl_write_stencil_span( GLcontext *ctx,
*/
void gl_alloc_stencil_buffer( GLcontext *ctx )
{
- GLuint buffersize = ctx->Buffer->Width * ctx->Buffer->Height;
+ GLuint buffersize = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height;
/* deallocate current stencil buffer if present */
- if (ctx->Buffer->Stencil) {
- FREE(ctx->Buffer->Stencil);
- ctx->Buffer->Stencil = NULL;
+ if (ctx->DrawBuffer->Stencil) {
+ FREE(ctx->DrawBuffer->Stencil);
+ ctx->DrawBuffer->Stencil = NULL;
}
/* allocate new stencil buffer */
- ctx->Buffer->Stencil = (GLstencil *) MALLOC(buffersize * sizeof(GLstencil));
- if (!ctx->Buffer->Stencil) {
+ ctx->DrawBuffer->Stencil = (GLstencil *) MALLOC(buffersize * sizeof(GLstencil));
+ if (!ctx->DrawBuffer->Stencil) {
/* out of memory */
- gl_set_enable( ctx, GL_STENCIL_TEST, GL_FALSE );
+ _mesa_set_enable( ctx, GL_STENCIL_TEST, GL_FALSE );
gl_error( ctx, GL_OUT_OF_MEMORY, "gl_alloc_stencil_buffer" );
}
}
-
/*
- * Clear the stencil buffer. If the stencil buffer doesn't exist yet we'll
- * allocate it now.
+ * Clear the software (malloc'd) stencil buffer.
*/
-void gl_clear_stencil_buffer( GLcontext *ctx )
+static void
+clear_software_stencil_buffer( GLcontext *ctx )
{
- if (ctx->Visual->StencilBits==0 || !ctx->Buffer->Stencil) {
+ if (ctx->Visual->StencilBits==0 || !ctx->DrawBuffer->Stencil) {
/* no stencil buffer */
return;
}
if (ctx->Scissor.Enabled) {
/* clear scissor region only */
- const GLint width = ctx->Buffer->Xmax - ctx->Buffer->Xmin + 1;
+ const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1;
if (ctx->Stencil.WriteMask != STENCIL_MAX) {
/* must apply mask to the clear */
GLint y;
- for (y=ctx->Buffer->Ymin; y<=ctx->Buffer->Ymax; y++) {
- GLstencil *ptr = STENCIL_ADDRESS( ctx->Buffer->Xmin, y );
- GLint x;
+ for (y = ctx->DrawBuffer->Ymin; y <= ctx->DrawBuffer->Ymax; y++) {
const GLstencil mask = ctx->Stencil.WriteMask;
const GLstencil invMask = ~mask;
const GLstencil clearVal = (ctx->Stencil.Clear & mask);
- for (x = 0; x < width; x++) {
- ptr[x] = (ptr[x] & invMask) | clearVal;
+ GLstencil *stencil = STENCIL_ADDRESS( ctx->DrawBuffer->Xmin, y );
+ GLint i;
+ for (i = 0; i < width; i++) {
+ stencil[i] = (stencil[i] & invMask) | clearVal;
}
}
}
else {
/* no masking */
GLint y;
- for (y=ctx->Buffer->Ymin; y<=ctx->Buffer->Ymax; y++) {
- GLstencil *ptr = STENCIL_ADDRESS( ctx->Buffer->Xmin, y );
+ for (y = ctx->DrawBuffer->Ymin; y <= ctx->DrawBuffer->Ymax; y++) {
+ GLstencil *stencil = STENCIL_ADDRESS( ctx->DrawBuffer->Xmin, y );
#if STENCIL_BITS==8
- MEMSET( ptr, ctx->Stencil.Clear, width * sizeof(GLstencil) );
+ MEMSET( stencil, ctx->Stencil.Clear, width * sizeof(GLstencil) );
#else
- GLint x;
- for (x = 0; x < width; x++)
- ptr[x] = ctx->Stencil.Clear;
+ GLint i;
+ for (i = 0; i < width; i++)
+ stencil[x] = ctx->Stencil.Clear;
#endif
}
}
@@ -1110,29 +1272,133 @@ void gl_clear_stencil_buffer( GLcontext *ctx )
/* clear whole stencil buffer */
if (ctx->Stencil.WriteMask != STENCIL_MAX) {
/* must apply mask to the clear */
- const GLuint n = ctx->Buffer->Width * ctx->Buffer->Height;
- GLstencil *buffer = ctx->Buffer->Stencil;
+ const GLuint n = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height;
+ GLstencil *stencil = ctx->DrawBuffer->Stencil;
const GLstencil mask = ctx->Stencil.WriteMask;
const GLstencil invMask = ~mask;
const GLstencil clearVal = (ctx->Stencil.Clear & mask);
GLuint i;
for (i = 0; i < n; i++) {
- buffer[i] = (buffer[i] & invMask) | clearVal;
+ stencil[i] = (stencil[i] & invMask) | clearVal;
}
}
else {
/* clear whole buffer without masking */
- const GLuint n = ctx->Buffer->Width * ctx->Buffer->Height;
- GLstencil *buffer = ctx->Buffer->Stencil;
+ const GLuint n = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height;
+ GLstencil *stencil = ctx->DrawBuffer->Stencil;
#if STENCIL_BITS==8
- MEMSET(buffer, ctx->Stencil.Clear, n * sizeof(GLstencil) );
+ MEMSET(stencil, ctx->Stencil.Clear, n * sizeof(GLstencil) );
#else
GLuint i;
for (i = 0; i < n; i++) {
- buffer[i] = ctx->Stencil.Clear;
+ stencil[i] = ctx->Stencil.Clear;
}
#endif
}
}
}
+
+
+
+/*
+ * Clear the hardware (in graphics card) stencil buffer.
+ * This is done with the Driver.WriteStencilSpan() and Driver.ReadStencilSpan()
+ * functions.
+ * Actually, if there is a hardware stencil buffer it really should have
+ * been cleared in Driver.Clear()! However, if the hardware does not
+ * support scissored clears or masked clears (i.e. glStencilMask) then
+ * we have to use the span-based functions.
+ */
+static void
+clear_hardware_stencil_buffer( GLcontext *ctx )
+{
+ ASSERT(ctx->Driver.WriteStencilSpan);
+ ASSERT(ctx->Driver.ReadStencilSpan);
+
+ if (ctx->Scissor.Enabled) {
+ /* clear scissor region only */
+ const GLint x = ctx->DrawBuffer->Xmin;
+ const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1;
+ if (ctx->Stencil.WriteMask != STENCIL_MAX) {
+ /* must apply mask to the clear */
+ GLint y;
+ for (y = ctx->DrawBuffer->Ymin; y <= ctx->DrawBuffer->Ymax; y++) {
+ const GLstencil mask = ctx->Stencil.WriteMask;
+ const GLstencil invMask = ~mask;
+ const GLstencil clearVal = (ctx->Stencil.Clear & mask);
+ GLstencil stencil[MAX_WIDTH];
+ GLint i;
+ (*ctx->Driver.ReadStencilSpan)(ctx, x, y, width, stencil);
+ for (i = 0; i < width; i++) {
+ stencil[i] = (stencil[i] & invMask) | clearVal;
+ }
+ (*ctx->Driver.WriteStencilSpan)(ctx, x, y, width, stencil, NULL);
+ }
+ }
+ else {
+ /* no masking */
+ GLstencil stencil[MAX_WIDTH];
+ GLint y, i;
+ for (i = 0; i < width; i++) {
+ stencil[i] = ctx->Stencil.Clear;
+ }
+ for (y = ctx->DrawBuffer->Ymin; y <= ctx->DrawBuffer->Ymax; y++) {
+ (*ctx->Driver.WriteStencilSpan)(ctx, x, y, width, stencil, NULL);
+ }
+ }
+ }
+ else {
+ /* clear whole stencil buffer */
+ if (ctx->Stencil.WriteMask != STENCIL_MAX) {
+ /* must apply mask to the clear */
+ const GLstencil mask = ctx->Stencil.WriteMask;
+ const GLstencil invMask = ~mask;
+ const GLstencil clearVal = (ctx->Stencil.Clear & mask);
+ const GLint width = ctx->DrawBuffer->Width;
+ const GLint height = ctx->DrawBuffer->Height;
+ const GLint x = ctx->DrawBuffer->Xmin;
+ GLint y;
+ for (y = 0; y < height; y++) {
+ GLstencil stencil[MAX_WIDTH];
+ GLuint i;
+ (*ctx->Driver.ReadStencilSpan)(ctx, x, y, width, stencil);
+ for (i = 0; i < width; i++) {
+ stencil[i] = (stencil[i] & invMask) | clearVal;
+ }
+ (*ctx->Driver.WriteStencilSpan)(ctx, x, y, width, stencil, NULL);
+ }
+ }
+ else {
+ /* clear whole buffer without masking */
+ const GLint width = ctx->DrawBuffer->Width;
+ const GLint height = ctx->DrawBuffer->Width;
+ const GLint x = ctx->DrawBuffer->Xmin;
+ GLstencil stencil[MAX_WIDTH];
+ GLint y, i;
+ for (i = 0; i < width; i++) {
+ stencil[i] = ctx->Stencil.Clear;
+ }
+ for (y = 0; y < height; y++) {
+ (*ctx->Driver.WriteStencilSpan)(ctx, x, y, width, stencil, NULL);
+ }
+ }
+ }
+}
+
+
+
+/*
+ * Clear the stencil buffer.
+ */
+void gl_clear_stencil_buffer( GLcontext *ctx )
+{
+ if (ctx->Driver.WriteStencilSpan) {
+ ASSERT(ctx->Driver.ReadStencilSpan);
+ clear_hardware_stencil_buffer(ctx);
+ }
+ else {
+ clear_software_stencil_buffer(ctx);
+ }
+}
+
diff --git a/xc/extras/Mesa/src/stencil.h b/xc/extras/Mesa/src/stencil.h
index 375a65723..400d6774f 100644
--- a/xc/extras/Mesa/src/stencil.h
+++ b/xc/extras/Mesa/src/stencil.h
@@ -1,8 +1,8 @@
-/* $Id: stencil.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: stencil.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef STENCIL_H
#define STENCIL_H
@@ -35,48 +32,45 @@
#include "types.h"
-extern void gl_ClearStencil( GLcontext *ctx, GLint s );
-
+extern void
+_mesa_ClearStencil( GLint s );
-extern void gl_StencilFunc( GLcontext *ctx, GLenum func,
- GLint ref, GLuint mask );
+extern void
+_mesa_StencilFunc( GLenum func, GLint ref, GLuint mask );
-extern void gl_StencilMask( GLcontext *ctx, GLuint mask );
+extern void
+_mesa_StencilMask( GLuint mask );
-extern void gl_StencilOp( GLcontext *ctx, GLenum fail,
- GLenum zfail, GLenum zpass );
+extern void
+_mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass );
-extern GLint gl_stencil_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y, GLubyte mask[] );
+extern GLboolean
+gl_stencil_and_depth_test_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
+ const GLdepth z[], GLubyte mask[] );
-extern void gl_depth_stencil_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], GLubyte mask[] );
-
-
-extern GLint gl_stencil_pixels( GLcontext *ctx,
- GLuint n, const GLint x[], const GLint y[],
- GLubyte mask[] );
-
+#ifdef VMS /* VMS allows externals of 31 characters maximum */
+#define gl_stencil_and_depth_test_pixels gl_stencil_and_depth_test_pixel
+#endif
+extern GLboolean
+gl_stencil_and_depth_test_pixels( GLcontext *ctx, GLuint n,
+ const GLint x[], const GLint y[],
+ const GLdepth z[], GLubyte mask[] );
-extern void gl_depth_stencil_pixels( GLcontext *ctx,
- GLuint n, const GLint x[],
- const GLint y[], const GLdepth z[],
- GLubyte mask[] );
-extern void gl_read_stencil_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y,
- GLstencil stencil[] );
+extern void
+gl_read_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y,
+ GLstencil stencil[] );
-extern void gl_write_stencil_span( GLcontext *ctx,
- GLuint n, GLint x, GLint y,
- const GLstencil stencil[] );
+extern void
+gl_write_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y,
+ const GLstencil stencil[] );
extern void gl_alloc_stencil_buffer( GLcontext *ctx );
diff --git a/xc/extras/Mesa/src/texgen_tmp.h b/xc/extras/Mesa/src/texgen_tmp.h
index fed7ce0b9..d99c1424a 100644
--- a/xc/extras/Mesa/src/texgen_tmp.h
+++ b/xc/extras/Mesa/src/texgen_tmp.h
@@ -1,4 +1,4 @@
-/* $Id: texgen_tmp.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: texgen_tmp.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -70,7 +70,7 @@ static void TAG(build_m3)(GLfloat f[][3],
fx = f[i][0] = u[0] - norm[0] * two_nu;
fy = f[i][1] = u[1] - norm[1] * two_nu;
fz = f[i][2] = u[2] - norm[2] * two_nu;
- m[i] = fx*fx + fy*fy + (fz + 1.0F) * (fz + 1.0F);
+ m[i] = fx * fx + fy * fy + (fz + 1.0F) * (fz + 1.0F);
if (m[i] != 0.0F) {
m[i] = 0.5F / (GLfloat) GL_SQRT(m[i]);
}
@@ -111,7 +111,7 @@ static void TAG(build_m2)(GLfloat f[][3],
fx = f[i][0] = u[0] - norm[0] * two_nu;
fy = f[i][1] = u[1] - norm[1] * two_nu;
fz = f[i][2] = u[2] - norm[2] * two_nu;
- m[i] = fx*fx + fy*fy + (fz + 1.0F) * (fz + 1.0F);
+ m[i] = fx * fx + fy * fy + (fz + 1.0F) * (fz + 1.0F);
if (m[i] != 0.0F) {
m[i] = 0.5F / (GLfloat) GL_SQRT(m[i]);
}
diff --git a/xc/extras/Mesa/src/teximage.c b/xc/extras/Mesa/src/teximage.c
index a1637b8e0..4ac2cc572 100644
--- a/xc/extras/Mesa/src/teximage.c
+++ b/xc/extras/Mesa/src/teximage.c
@@ -1,8 +1,8 @@
-/* $Id: teximage.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: teximage.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -28,17 +28,10 @@
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "image.h"
-#include "macros.h"
+#include "mem.h"
#include "mmath.h"
#include "span.h"
#include "teximage.h"
@@ -58,25 +51,13 @@
-static struct gl_pixelstore_attrib defaultPacking = {
- 1, /* Alignment */
- 0, /* RowLength */
- 0, /* SkipPixels */
- 0, /* SkipRows */
- 0, /* ImageHeight */
- 0, /* SkipImages */
- GL_FALSE, /* SwapBytes */
- GL_FALSE /* LsbFirst */
-};
-
-
-
/*
* Compute log base 2 of n.
* If n isn't an exact power of two return -1.
* If n<0 return -1.
*/
-static int logbase2( int n )
+static int
+logbase2( int n )
{
GLint i = 1;
GLint log2 = 0;
@@ -105,7 +86,8 @@ static int logbase2( int n )
* GL_LUMANCE_ALPHA, GL_INTENSITY, GL_RGB, or GL_RGBA.
* Return -1 if invalid enum.
*/
-static GLint decode_internal_format( GLint format )
+static GLint
+decode_internal_format( GLint format )
{
switch (format) {
case GL_ALPHA:
@@ -177,7 +159,8 @@ static GLint decode_internal_format( GLint format )
* GL_LUMANCE_ALPHA, GL_INTENSITY, GL_RGB, or GL_RGBA. Return the
* number of components for the format. Return -1 if invalid enum.
*/
-static GLint components_in_intformat( GLint format )
+static GLint
+components_in_intformat( GLint format )
{
switch (format) {
case GL_ALPHA:
@@ -243,14 +226,16 @@ static GLint components_in_intformat( GLint format )
-struct gl_texture_image *gl_alloc_texture_image( void )
+struct gl_texture_image *
+gl_alloc_texture_image( void )
{
return CALLOC_STRUCT(gl_texture_image);
}
-void gl_free_texture_image( struct gl_texture_image *teximage )
+void
+gl_free_texture_image( struct gl_texture_image *teximage )
{
if (teximage->Data) {
FREE( teximage->Data );
@@ -267,7 +252,8 @@ void gl_free_texture_image( struct gl_texture_image *teximage )
* These fields are set only here by core Mesa but device drivers may
* overwritting these fields to indicate true texel resolution.
*/
-static void set_teximage_component_sizes( struct gl_texture_image *texImage )
+static void
+set_teximage_component_sizes( struct gl_texture_image *texImage )
{
switch (texImage->Format) {
case GL_ALPHA:
@@ -762,7 +748,7 @@ texture_error_check( GLcontext *ctx, GLenum target,
* Return: GL_TRUE = an error was detected, GL_FALSE = no errors
*/
static GLboolean
-subtexture_error_check( GLcontext *ctx, GLint dimensions,
+subtexture_error_check( GLcontext *ctx, GLuint dimensions,
GLenum target, GLint level,
GLint xoffset, GLint yoffset, GLint zoffset,
GLint width, GLint height, GLint depth,
@@ -870,7 +856,7 @@ subtexture_error_check( GLcontext *ctx, GLint dimensions,
* Return: GL_TRUE = an error was detected, GL_FALSE = no errors
*/
static GLboolean
-copytexture_error_check( GLcontext *ctx, GLint dimensions,
+copytexture_error_check( GLcontext *ctx, GLuint dimensions,
GLenum target, GLint level, GLint internalFormat,
GLint width, GLint height, GLint border )
{
@@ -940,7 +926,7 @@ copytexture_error_check( GLcontext *ctx, GLint dimensions,
static GLboolean
-copytexsubimage_error_check( GLcontext *ctx, GLint dimensions,
+copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions,
GLenum target, GLint level,
GLint xoffset, GLint yoffset, GLint zoffset,
GLsizei width, GLsizei height )
@@ -981,7 +967,7 @@ copytexsubimage_error_check( GLcontext *ctx, GLint dimensions,
return GL_TRUE;
}
- teximage = texUnit->CurrentD[dimensions]->Image[level];
+ teximage = texUnit->CurrentD[3]->Image[level];
if (!teximage) {
char message[100];
sprintf(message, "glCopyTexSubImage%dD(undefined texture)", dimensions);
@@ -1042,11 +1028,12 @@ copytexsubimage_error_check( GLcontext *ctx, GLint dimensions,
/*
* Called from the API. Note that width includes the border.
*/
-void gl_TexImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalformat,
- GLsizei width, GLint border, GLenum format,
- GLenum type, const GLvoid *pixels )
+void
+_mesa_TexImage1D( GLenum target, GLint level, GLint internalformat,
+ GLsizei width, GLint border, GLenum format,
+ GLenum type, const GLvoid *pixels )
{
+ GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexImage1D");
@@ -1111,12 +1098,13 @@ void gl_TexImage1D( GLcontext *ctx, GLenum target, GLint level,
}
-void gl_TexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalformat,
- GLsizei width, GLsizei height, GLint border,
- GLenum format, GLenum type,
- const GLvoid *pixels )
+void
+_mesa_TexImage2D( GLenum target, GLint level, GLint internalformat,
+ GLsizei width, GLsizei height, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels )
{
+ GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexImage2D");
@@ -1186,16 +1174,17 @@ void gl_TexImage2D( GLcontext *ctx, GLenum target, GLint level,
* Called by the API or display list executor.
* Note that width and height include the border.
*/
-void gl_TexImage3D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalformat,
- GLsizei width, GLsizei height, GLsizei depth,
- GLint border, GLenum format, GLenum type,
- const GLvoid *pixels )
+void
+_mesa_TexImage3D( GLenum target, GLint level, GLint internalformat,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLint border, GLenum format, GLenum type,
+ const GLvoid *pixels )
{
+ GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexImage3D");
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexImage3DEXT");
- if (target==GL_TEXTURE_3D) {
+ if (target==GL_TEXTURE_3D_EXT) {
struct gl_texture_image *teximage;
if (texture_error_check( ctx, target, level, internalformat,
format, type, 3, width, height, depth,
@@ -1259,9 +1248,11 @@ void gl_TexImage3D( GLcontext *ctx, GLenum target, GLint level,
-void gl_GetTexImage( GLcontext *ctx, GLenum target, GLint level, GLenum format,
- GLenum type, GLvoid *pixels )
+void
+_mesa_GetTexImage( GLenum target, GLint level, GLenum format,
+ GLenum type, GLvoid *pixels )
{
+ GET_CURRENT_CONTEXT(ctx);
const struct gl_texture_object *texObj;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetTexImage");
@@ -1387,11 +1378,13 @@ void gl_GetTexImage( GLcontext *ctx, GLenum target, GLint level, GLenum format,
-void gl_TexSubImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels )
+void
+_mesa_TexSubImage1D( GLenum target, GLint level,
+ GLint xoffset, GLsizei width,
+ GLenum format, GLenum type,
+ const GLvoid *pixels )
{
+ GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
struct gl_texture_image *destTex;
@@ -1454,12 +1447,14 @@ void gl_TexSubImage1D( GLcontext *ctx, GLenum target, GLint level,
}
-void gl_TexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels )
+void
+_mesa_TexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels )
{
+ GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
struct gl_texture_image *destTex;
@@ -1535,12 +1530,14 @@ void gl_TexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
-void gl_TexSubImage3D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type,
- const GLvoid *pixels )
+void
+_mesa_TexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type,
+ const GLvoid *pixels )
{
+ GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
struct gl_texture_image *destTex;
@@ -1630,28 +1627,33 @@ read_color_image( GLcontext *ctx, GLint x, GLint y,
return NULL;
/* Select buffer to read from */
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.DriverReadBuffer );
+ (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
+ ctx->Pixel.DriverReadBuffer );
dst = image;
stride = width * 4 * sizeof(GLubyte);
for (i = 0; i < height; i++) {
- gl_read_rgba_span( ctx, width, x, y + i, (GLubyte (*)[4]) dst );
+ gl_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y + i,
+ (GLubyte (*)[4]) dst );
dst += stride;
}
- /* Restore drawing buffer */
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer );
+ /* Read from draw buffer (the default) */
+ (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
+ ctx->Color.DriverDrawBuffer );
return image;
}
-void gl_CopyTexImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y,
- GLsizei width, GLint border )
+void
+_mesa_CopyTexImage1D( GLenum target, GLint level,
+ GLenum internalFormat,
+ GLint x, GLint y,
+ GLsizei width, GLint border )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexImage1D");
if (!copytexture_error_check(ctx, 1, target, level, internalFormat,
@@ -1661,19 +1663,20 @@ void gl_CopyTexImage1D( GLcontext *ctx, GLenum target, GLint level,
gl_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D" );
return;
}
- (*ctx->Exec.TexImage1D)( ctx, target, level, internalFormat, width,
- border, GL_RGBA, GL_UNSIGNED_BYTE, image );
+ (*ctx->Exec.TexImage1D)( target, level, internalFormat, width,
+ border, GL_RGBA, GL_UNSIGNED_BYTE, image );
FREE(image);
}
}
-void gl_CopyTexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLint border )
+void
+_mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLint border )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexImage2D");
if (!copytexture_error_check(ctx, 2, target, level, internalFormat,
@@ -1683,13 +1686,8 @@ void gl_CopyTexImage2D( GLcontext *ctx, GLenum target, GLint level,
gl_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D" );
return;
}
- {
- struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = defaultPacking;
- (ctx->Exec.TexImage2D)( ctx, target, level, internalFormat, width,
+ (ctx->Exec.TexImage2D)( target, level, internalFormat, width,
height, border, GL_RGBA, GL_UNSIGNED_BYTE, image );
- ctx->Unpack = save; /* restore */
- }
FREE(image);
}
}
@@ -1732,28 +1730,32 @@ copy_tex_sub_image( GLcontext *ctx, struct gl_texture_image *dest,
components = components_in_intformat( format );
/* Select buffer to read from */
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.DriverReadBuffer );
+ (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
+ ctx->Pixel.DriverReadBuffer );
for (i = 0;i < height; i++) {
GLubyte rgba[MAX_WIDTH][4];
GLubyte *dst;
- gl_read_rgba_span( ctx, width, srcx, srcy + i, rgba );
+ gl_read_rgba_span( ctx, ctx->ReadBuffer, width, srcx, srcy + i, rgba );
dst = dest->Data + ( zoffset + (dsty+i) * texwidth + dstx) * components;
_mesa_unpack_ubyte_color_span(ctx, width, format, dst,
GL_RGBA, GL_UNSIGNED_BYTE, rgba,
&packing, GL_TRUE);
}
- /* Restore drawing buffer */
- (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer );
+ /* Read from draw buffer (the default) */
+ (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
+ ctx->Color.DriverDrawBuffer );
}
-void gl_CopyTexSubImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y, GLsizei width )
+void
+_mesa_CopyTexSubImage1D( GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y, GLsizei width )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexSubImage1D");
if (!copytexsubimage_error_check(ctx, 1, target, level,
@@ -1777,10 +1779,12 @@ void gl_CopyTexSubImage1D( GLcontext *ctx, GLenum target, GLint level,
-void gl_CopyTexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y, GLsizei width, GLsizei height )
+void
+_mesa_CopyTexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexSubImage2D");
if (!copytexsubimage_error_check(ctx, 2, target, level,
@@ -1805,10 +1809,12 @@ void gl_CopyTexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
-void gl_CopyTexSubImage3D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint x, GLint y, GLsizei width, GLsizei height )
+void
+_mesa_CopyTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexSubImage3D");
if (!copytexsubimage_error_check(ctx, 3, target, level,
diff --git a/xc/extras/Mesa/src/teximage.h b/xc/extras/Mesa/src/teximage.h
index c5cd58bbf..82facb9c5 100644
--- a/xc/extras/Mesa/src/teximage.h
+++ b/xc/extras/Mesa/src/teximage.h
@@ -1,8 +1,8 @@
-/* $Id: teximage.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: teximage.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -35,97 +35,90 @@
/*** Internal functions ***/
-extern struct gl_texture_image *gl_alloc_texture_image( void );
+extern struct gl_texture_image *
+gl_alloc_texture_image( void );
-extern void gl_free_texture_image( struct gl_texture_image *teximage );
+extern void
+gl_free_texture_image( struct gl_texture_image *teximage );
+/*** API entry point functions ***/
-/*** API entry points ***/
+extern void
+_mesa_TexImage1D( GLenum target, GLint level, GLint internalformat,
+ GLsizei width, GLint border,
+ GLenum format, GLenum type, const GLvoid *pixels );
-extern void gl_TexImage1D( GLcontext *ctx,
- GLenum target, GLint level, GLint internalformat,
- GLsizei width, GLint border, GLenum format,
- GLenum type, const GLvoid *pixels );
+extern void
+_mesa_TexImage2D( GLenum target, GLint level, GLint internalformat,
+ GLsizei width, GLsizei height, GLint border,
+ GLenum format, GLenum type, const GLvoid *pixels );
-extern void gl_TexImage2D( GLcontext *ctx,
- GLenum target, GLint level, GLint internalformat,
- GLsizei width, GLsizei height, GLint border,
- GLenum format, GLenum type,
- const GLvoid *pixels );
+extern void
+_mesa_TexImage3D( GLenum target, GLint level, GLint internalformat,
+ GLsizei width, GLsizei height, GLsizei depth, GLint border,
+ GLenum format, GLenum type, const GLvoid *pixels );
-extern void gl_TexImage3D( GLcontext *ctx,
- GLenum target, GLint level, GLint internalformat,
- GLsizei width, GLsizei height, GLsizei depth,
- GLint border, GLenum format, GLenum type,
- const GLvoid *pixels );
+extern void
+_mesa_GetTexImage( GLenum target, GLint level,
+ GLenum format, GLenum type, GLvoid *pixels );
-extern void gl_GetTexImage( GLcontext *ctx, GLenum target, GLint level,
- GLenum format, GLenum type, GLvoid *pixels );
+extern void
+_mesa_TexSubImage1D( GLenum target, GLint level, GLint xoffset,
+ GLsizei width,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
-extern void gl_TexSubImage1D( GLcontext *ctx,
- GLenum target, GLint level, GLint xoffset,
- GLsizei width, GLenum format, GLenum type,
- const GLvoid *pixels );
+extern void
+_mesa_TexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
-extern void gl_TexSubImage2D( GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels );
+extern void
+_mesa_TexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
-extern void gl_TexSubImage3D( GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type,
- const GLvoid *pixels );
+extern void
+_mesa_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat,
+ GLint x, GLint y, GLsizei width, GLint border );
-extern void gl_CopyTexImage1D( GLcontext *ctx,
- GLenum target, GLint level,
- GLenum internalformat,
- GLint x, GLint y,
- GLsizei width, GLint border );
+extern void
+_mesa_CopyTexImage2D( GLenum target, GLint level,
+ GLenum internalformat, GLint x, GLint y,
+ GLsizei width, GLsizei height, GLint border );
-extern void gl_CopyTexImage2D( GLcontext *ctx,
- GLenum target, GLint level,
- GLenum internalformat, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLint border );
+extern void
+_mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset,
+ GLint x, GLint y, GLsizei width );
-extern void gl_CopyTexSubImage1D( GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y,
- GLsizei width );
+extern void
+_mesa_CopyTexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height );
-extern void gl_CopyTexSubImage2D( GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y,
- GLsizei width, GLsizei height );
-
-
-extern void gl_CopyTexSubImage3D( GLcontext *ctx,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint zoffset,
- GLint x, GLint y,
- GLsizei width, GLsizei height );
+extern void
+_mesa_CopyTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height );
#endif
diff --git a/xc/extras/Mesa/src/texobj.c b/xc/extras/Mesa/src/texobj.c
index f9e9e6d2b..e30dfd13d 100644
--- a/xc/extras/Mesa/src/texobj.c
+++ b/xc/extras/Mesa/src/texobj.c
@@ -1,10 +1,10 @@
-/* $Id: texobj.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: texobj.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -23,25 +23,16 @@
* 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.
*/
-/* $XFree86: xc/lib/GL/mesa/src/texobj.c,v 1.3 1999/04/04 00:20:32 dawes Exp $ */
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "enums.h"
#include "hash.h"
-#include "macros.h"
+#include "mem.h"
#include "teximage.h"
#include "texstate.h"
#include "texobj.h"
@@ -67,8 +58,8 @@ gl_alloc_texture_object( struct gl_shared_state *shared, GLuint name,
ASSERT(dimensions <= 3);
- obj = (struct gl_texture_object *)
- calloc(1,sizeof(struct gl_texture_object));
+ obj = CALLOC_STRUCT(gl_texture_object);
+
if (obj) {
/* init the non-zero fields */
obj->RefCount = 1;
@@ -83,13 +74,13 @@ gl_alloc_texture_object( struct gl_shared_state *shared, GLuint name,
obj->BaseLevel = 0;
obj->MaxLevel = 1000;
obj->MinMagThresh = 0.0F;
- obj->Palette[0] = 255;
- obj->Palette[1] = 255;
- obj->Palette[2] = 255;
- obj->Palette[3] = 255;
- obj->PaletteSize = 1;
- obj->PaletteIntFormat = GL_RGBA;
- obj->PaletteFormat = GL_RGBA;
+ obj->Palette.Table[0] = 255;
+ obj->Palette.Table[1] = 255;
+ obj->Palette.Table[2] = 255;
+ obj->Palette.Table[3] = 255;
+ obj->Palette.Size = 1;
+ obj->Palette.IntFormat = GL_RGBA;
+ obj->Palette.Format = GL_RGBA;
/* insert into linked list */
if (shared) {
@@ -99,7 +90,7 @@ gl_alloc_texture_object( struct gl_shared_state *shared, GLuint name,
if (name > 0) {
/* insert into hash table */
- HashInsert(shared->TexObjects, name, obj);
+ _mesa_HashInsert(shared->TexObjects, name, obj);
}
}
return obj;
@@ -146,7 +137,7 @@ void gl_free_texture_object( struct gl_shared_state *shared,
if (t->Name) {
/* remove from hash table */
- HashRemove(shared->TexObjects, t->Name);
+ _mesa_HashRemove(shared->TexObjects, t->Name);
}
/* free texture image */
@@ -334,8 +325,10 @@ void gl_test_texture_object_completeness( const GLcontext *ctx, struct gl_textur
/*
* Execute glGenTextures
*/
-void gl_GenTextures( GLcontext *ctx, GLsizei n, GLuint *texName )
+void
+_mesa_GenTextures( GLsizei n, GLuint *texName )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint first;
GLint i;
@@ -345,7 +338,7 @@ void gl_GenTextures( GLcontext *ctx, GLsizei n, GLuint *texName )
return;
}
- first = HashFindFreeKeyBlock(ctx->Shared->TexObjects, n);
+ first = _mesa_HashFindFreeKeyBlock(ctx->Shared->TexObjects, n);
/* Return the texture names */
for (i=0;i<n;i++) {
@@ -365,8 +358,10 @@ void gl_GenTextures( GLcontext *ctx, GLsizei n, GLuint *texName )
/*
* Execute glDeleteTextures
*/
-void gl_DeleteTextures( GLcontext *ctx, GLsizei n, const GLuint *texName)
+void
+_mesa_DeleteTextures( GLsizei n, const GLuint *texName)
{
+ GET_CURRENT_CONTEXT(ctx);
GLint i;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDeleteTextures");
@@ -375,7 +370,7 @@ void gl_DeleteTextures( GLcontext *ctx, GLsizei n, const GLuint *texName)
struct gl_texture_object *t;
if (texName[i]>0) {
t = (struct gl_texture_object *)
- HashLookup(ctx->Shared->TexObjects, texName[i]);
+ _mesa_HashLookup(ctx->Shared->TexObjects, texName[i]);
if (t) {
GLuint u;
for (u=0; u<MAX_TEXTURE_UNITS; u++) {
@@ -409,8 +404,10 @@ void gl_DeleteTextures( GLcontext *ctx, GLsizei n, const GLuint *texName)
/*
* Execute glBindTexture
*/
-void gl_BindTexture( GLcontext *ctx, GLenum target, GLuint texName )
+void
+_mesa_BindTexture( GLenum target, GLuint texName )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint unit = ctx->Texture.CurrentUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
struct gl_texture_object *oldTexObj;
@@ -446,8 +443,8 @@ void gl_BindTexture( GLcontext *ctx, GLenum target, GLuint texName )
if (texName == 0)
newTexObj = ctx->Shared->DefaultD[dim];
else {
- struct HashTable *hash = ctx->Shared->TexObjects;
- newTexObj = (struct gl_texture_object *) HashLookup(hash, texName);
+ struct _mesa_HashTable *hash = ctx->Shared->TexObjects;
+ newTexObj = (struct gl_texture_object *) _mesa_HashLookup(hash, texName);
if (!newTexObj)
newTexObj = gl_alloc_texture_object(ctx->Shared, texName, dim);
@@ -509,10 +506,11 @@ void gl_BindTexture( GLcontext *ctx, GLenum target, GLuint texName )
/*
* Execute glPrioritizeTextures
*/
-void gl_PrioritizeTextures( GLcontext *ctx,
- GLsizei n, const GLuint *texName,
- const GLclampf *priorities )
+void
+_mesa_PrioritizeTextures( GLsizei n, const GLuint *texName,
+ const GLclampf *priorities )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint i;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPrioritizeTextures");
@@ -525,7 +523,7 @@ void gl_PrioritizeTextures( GLcontext *ctx,
struct gl_texture_object *t;
if (texName[i]>0) {
t = (struct gl_texture_object *)
- HashLookup(ctx->Shared->TexObjects, texName[i]);
+ _mesa_HashLookup(ctx->Shared->TexObjects, texName[i]);
if (t) {
t->Priority = CLAMP( priorities[i], 0.0F, 1.0F );
@@ -541,10 +539,11 @@ void gl_PrioritizeTextures( GLcontext *ctx,
/*
* Execute glAreTexturesResident
*/
-GLboolean gl_AreTexturesResident( GLcontext *ctx, GLsizei n,
- const GLuint *texName,
- GLboolean *residences )
+GLboolean
+_mesa_AreTexturesResident( GLsizei n, const GLuint *texName,
+ GLboolean *residences )
{
+ GET_CURRENT_CONTEXT(ctx);
GLboolean resident = GL_TRUE;
GLint i;
@@ -563,7 +562,7 @@ GLboolean gl_AreTexturesResident( GLcontext *ctx, GLsizei n,
return GL_FALSE;
}
t = (struct gl_texture_object *)
- HashLookup(ctx->Shared->TexObjects, texName[i]);
+ _mesa_HashLookup(ctx->Shared->TexObjects, texName[i]);
if (t) {
if (ctx->Driver.IsTextureResident)
residences[i] = ctx->Driver.IsTextureResident( ctx, t );
@@ -583,11 +582,13 @@ GLboolean gl_AreTexturesResident( GLcontext *ctx, GLsizei n,
/*
* Execute glIsTexture
*/
-GLboolean gl_IsTexture( GLcontext *ctx, GLuint texture )
+GLboolean
+_mesa_IsTexture( GLuint texture )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glIsTextures",
GL_FALSE);
- if (texture>0 && HashLookup(ctx->Shared->TexObjects, texture)) {
+ if (texture>0 && _mesa_HashLookup(ctx->Shared->TexObjects, texture)) {
return GL_TRUE;
}
else {
diff --git a/xc/extras/Mesa/src/texobj.h b/xc/extras/Mesa/src/texobj.h
index e06354a08..6b5fc55f9 100644
--- a/xc/extras/Mesa/src/texobj.h
+++ b/xc/extras/Mesa/src/texobj.h
@@ -1,8 +1,8 @@
-/* $Id: texobj.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: texobj.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef TEXTOBJ_H
#define TEXTOBJ_H
@@ -59,27 +56,30 @@ extern void gl_test_texture_object_completeness( const GLcontext *ctx, struct gl
* API functions
*/
-extern void gl_GenTextures( GLcontext *ctx, GLsizei n, GLuint *textures );
+extern void
+_mesa_GenTextures( GLsizei n, GLuint *textures );
-extern void gl_DeleteTextures( GLcontext *ctx,
- GLsizei n, const GLuint *textures);
+extern void
+_mesa_DeleteTextures( GLsizei n, const GLuint *textures );
-extern void gl_BindTexture( GLcontext *ctx, GLenum target, GLuint texture );
+extern void
+_mesa_BindTexture( GLenum target, GLuint texture );
-extern void gl_PrioritizeTextures( GLcontext *ctx,
- GLsizei n, const GLuint *textures,
- const GLclampf *priorities );
+extern void
+_mesa_PrioritizeTextures( GLsizei n, const GLuint *textures,
+ const GLclampf *priorities );
-extern GLboolean gl_AreTexturesResident( GLcontext *ctx, GLsizei n,
- const GLuint *textures,
- GLboolean *residences );
+extern GLboolean
+_mesa_AreTexturesResident( GLsizei n, const GLuint *textures,
+ GLboolean *residences );
-extern GLboolean gl_IsTexture( GLcontext *ctx, GLuint texture );
+extern GLboolean
+_mesa_IsTexture( GLuint texture );
#endif
diff --git a/xc/extras/Mesa/src/texstate.c b/xc/extras/Mesa/src/texstate.c
index 9369fae39..a6297f54d 100644
--- a/xc/extras/Mesa/src/texstate.c
+++ b/xc/extras/Mesa/src/texstate.c
@@ -1,8 +1,8 @@
-/* $Id: texstate.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: texstate.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,16 +25,10 @@
*/
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "enums.h"
#include "extensions.h"
@@ -67,9 +61,10 @@
/**********************************************************************/
-void gl_TexEnvfv( GLcontext *ctx,
- GLenum target, GLenum pname, const GLfloat *param )
+void
+_mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
{
+ GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexEnv");
@@ -90,12 +85,19 @@ void gl_TexEnvfv( GLcontext *ctx,
if (pname==GL_TEXTURE_ENV_MODE) {
GLenum mode = (GLenum) (GLint) *param;
switch (mode) {
- case GL_MODULATE:
- case GL_BLEND:
- case GL_DECAL:
- case GL_REPLACE:
+ case GL_ADD:
+ if (!gl_extension_is_enabled(ctx, "GL_EXT_texture_env_add")) {
+ gl_error(ctx, GL_INVALID_ENUM, "glTexEnv(param)");
+ return;
+ }
+ /* FALL-THROUGH */
+ case GL_MODULATE:
+ case GL_BLEND:
+ case GL_DECAL:
+ case GL_REPLACE:
+ /* A small optimization for drivers */
if (texUnit->EnvMode == mode)
- return; /* no change */
+ return;
if (MESA_VERBOSE & (VERBOSE_STATE|VERBOSE_TEXTURE))
fprintf(stderr, "glTexEnv: old mode %s, new mode %s\n",
@@ -128,12 +130,40 @@ void gl_TexEnvfv( GLcontext *ctx,
}
+void
+_mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param )
+{
+ _mesa_TexEnvfv( target, pname, &param );
+}
+
+
+
+void
+_mesa_TexEnvi( GLenum target, GLenum pname, GLint param )
+{
+ GLfloat p[4];
+ p[0] = (GLfloat) param;
+ p[1] = p[2] = p[3] = 0.0;
+ _mesa_TexEnvfv( target, pname, p );
+}
+
+void
+_mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param )
+{
+ GLfloat p[4];
+ p[0] = INT_TO_FLOAT( param[0] );
+ p[1] = INT_TO_FLOAT( param[1] );
+ p[2] = INT_TO_FLOAT( param[2] );
+ p[3] = INT_TO_FLOAT( param[3] );
+ _mesa_TexEnvfv( target, pname, p );
+}
-void gl_GetTexEnvfv( GLcontext *ctx,
- GLenum target, GLenum pname, GLfloat *params )
+void
+_mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
if (target!=GL_TEXTURE_ENV) {
gl_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" );
@@ -152,9 +182,10 @@ void gl_GetTexEnvfv( GLcontext *ctx,
}
-void gl_GetTexEnviv( GLcontext *ctx,
- GLenum target, GLenum pname, GLint *params )
+void
+_mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
{
+ GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
if (target!=GL_TEXTURE_ENV) {
gl_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" );
@@ -183,9 +214,17 @@ void gl_GetTexEnviv( GLcontext *ctx,
/**********************************************************************/
-void gl_TexParameterfv( GLcontext *ctx,
- GLenum target, GLenum pname, const GLfloat *params )
+void
+_mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param )
+{
+ _mesa_TexParameterfv(target, pname, &param);
+}
+
+
+void
+_mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
GLenum eparam = (GLenum) (GLint) params[0];
struct gl_texture_object *texObj;
@@ -330,20 +369,41 @@ void gl_TexParameterfv( GLcontext *ctx,
}
+void
+_mesa_TexParameteri( GLenum target, GLenum pname, const GLint param )
+{
+ GLfloat fparam[4];
+ fparam[0] = (GLfloat) param;
+ fparam[1] = fparam[2] = fparam[3] = 0.0;
+ _mesa_TexParameterfv(target, pname, fparam);
+}
+
+void
+_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params )
+{
+ GLfloat fparam[4];
+ fparam[0] = (GLfloat) params[0];
+ fparam[1] = fparam[2] = fparam[3] = 0.0;
+ _mesa_TexParameterfv(target, pname, fparam);
+}
+
-void gl_GetTexLevelParameterfv( GLcontext *ctx, GLenum target, GLint level,
- GLenum pname, GLfloat *params )
+void
+_mesa_GetTexLevelParameterfv( GLenum target, GLint level,
+ GLenum pname, GLfloat *params )
{
GLint iparam;
- gl_GetTexLevelParameteriv( ctx, target, level, pname, &iparam );
+ _mesa_GetTexLevelParameteriv( target, level, pname, &iparam );
*params = (GLfloat) iparam;
}
-void gl_GetTexLevelParameteriv( GLcontext *ctx, GLenum target, GLint level,
- GLenum pname, GLint *params )
+void
+_mesa_GetTexLevelParameteriv( GLenum target, GLint level,
+ GLenum pname, GLint *params )
{
+ GET_CURRENT_CONTEXT(ctx);
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
const struct gl_texture_image *img = NULL;
GLuint dimensions;
@@ -448,10 +508,10 @@ void gl_GetTexLevelParameteriv( GLcontext *ctx, GLenum target, GLint level,
-
-void gl_GetTexParameterfv( GLcontext *ctx,
- GLenum target, GLenum pname, GLfloat *params )
+void
+_mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
struct gl_texture_object *obj;
@@ -516,9 +576,10 @@ void gl_GetTexParameterfv( GLcontext *ctx,
}
-void gl_GetTexParameteriv( GLcontext *ctx,
- GLenum target, GLenum pname, GLint *params )
+void
+_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
{
+ GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
struct gl_texture_object *obj;
@@ -597,9 +658,10 @@ void gl_GetTexParameteriv( GLcontext *ctx,
/**********************************************************************/
-void gl_TexGenfv( GLcontext *ctx,
- GLenum coord, GLenum pname, const GLfloat *params )
+void
+_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint tUnit = ctx->Texture.CurrentTransformUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit];
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexGenfv");
@@ -610,7 +672,7 @@ void gl_TexGenfv( GLcontext *ctx,
gl_lookup_enum_by_nr(pname),
*(int *)params);
- switch( coord ) {
+ switch (coord) {
case GL_S:
if (pname==GL_TEXTURE_GEN_MODE) {
GLenum mode = (GLenum) (GLint) *params;
@@ -796,10 +858,57 @@ void gl_TexGenfv( GLcontext *ctx,
}
+void
+_mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params )
+{
+ GLfloat p[4];
+ p[0] = params[0];
+ p[1] = params[1];
+ p[2] = params[2];
+ p[3] = params[3];
+ _mesa_TexGenfv(coord, pname, p);
+}
+
+
+void
+_mesa_TexGend(GLenum coord, GLenum pname, GLdouble param )
+{
+ GLfloat p = (GLfloat) param;
+ _mesa_TexGenfv( coord, pname, &p );
+}
+
+
+void
+_mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params )
+{
+ GLfloat p[4];
+ p[0] = params[0];
+ p[1] = params[1];
+ p[2] = params[2];
+ p[3] = params[3];
+ _mesa_TexGenfv( coord, pname, p );
+}
+
+
+void
+_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param )
+{
+ _mesa_TexGenfv(coord, pname, &param);
+}
+
+
+void
+_mesa_TexGeni( GLenum coord, GLenum pname, GLint param )
+{
+ _mesa_TexGeniv( coord, pname, &param );
+}
+
-void gl_GetTexGendv( GLcontext *ctx,
- GLenum coord, GLenum pname, GLdouble *params )
+
+void
+_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint tUnit = ctx->Texture.CurrentTransformUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit];
@@ -874,9 +983,10 @@ void gl_GetTexGendv( GLcontext *ctx,
-void gl_GetTexGenfv( GLcontext *ctx,
- GLenum coord, GLenum pname, GLfloat *params )
+void
+_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint tUnit = ctx->Texture.CurrentTransformUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit];
@@ -951,9 +1061,10 @@ void gl_GetTexGenfv( GLcontext *ctx,
-void gl_GetTexGeniv( GLcontext *ctx,
- GLenum coord, GLenum pname, GLint *params )
+void
+_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params )
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint tUnit = ctx->Texture.CurrentTransformUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit];
@@ -983,7 +1094,7 @@ void gl_GetTexGeniv( GLcontext *ctx,
break;
case GL_T:
if (pname==GL_TEXTURE_GEN_MODE) {
- params[0] = (GLint) texUnit->GenModeT;
+ params[0] = texUnit->GenModeT;
}
else if (pname==GL_OBJECT_PLANE) {
params[0] = (GLint) texUnit->ObjectPlaneT[0];
@@ -1004,7 +1115,7 @@ void gl_GetTexGeniv( GLcontext *ctx,
break;
case GL_R:
if (pname==GL_TEXTURE_GEN_MODE) {
- params[0] = (GLint) texUnit->GenModeR;
+ params[0] = texUnit->GenModeR;
}
else if (pname==GL_OBJECT_PLANE) {
params[0] = (GLint) texUnit->ObjectPlaneR[0];
@@ -1025,7 +1136,7 @@ void gl_GetTexGeniv( GLcontext *ctx,
break;
case GL_Q:
if (pname==GL_TEXTURE_GEN_MODE) {
- params[0] = (GLint) texUnit->GenModeQ;
+ params[0] = texUnit->GenModeQ;
}
else if (pname==GL_OBJECT_PLANE) {
params[0] = (GLint) texUnit->ObjectPlaneQ[0];
@@ -1038,7 +1149,7 @@ void gl_GetTexGeniv( GLcontext *ctx,
params[1] = (GLint) texUnit->EyePlaneQ[1];
params[2] = (GLint) texUnit->EyePlaneQ[2];
params[3] = (GLint) texUnit->EyePlaneQ[3];
- }
+ }
else {
gl_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" );
return;
@@ -1052,8 +1163,10 @@ void gl_GetTexGeniv( GLcontext *ctx,
/* GL_ARB_multitexture */
-void gl_ActiveTexture( GLcontext *ctx, GLenum target )
+void
+_mesa_ActiveTextureARB( GLenum target )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint maxUnits = ctx->Const.MaxTextureUnits;
ASSERT_OUTSIDE_BEGIN_END( ctx, "glActiveTextureARB" );
@@ -1077,8 +1190,10 @@ void gl_ActiveTexture( GLcontext *ctx, GLenum target )
/* GL_ARB_multitexture */
-void gl_ClientActiveTexture( GLcontext *ctx, GLenum target )
+void
+_mesa_ClientActiveTextureARB( GLenum target )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint maxUnits = ctx->Const.MaxTextureUnits;
ASSERT_OUTSIDE_BEGIN_END( ctx, "glClientActiveTextureARB" );
diff --git a/xc/extras/Mesa/src/texstate.h b/xc/extras/Mesa/src/texstate.h
index 39c506e85..a88884c0f 100644
--- a/xc/extras/Mesa/src/texstate.h
+++ b/xc/extras/Mesa/src/texstate.h
@@ -1,4 +1,4 @@
-/* $Id: texstate.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: texstate.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -37,46 +37,80 @@
/*** Called from API ***/
-extern void gl_GetTexEnvfv( GLcontext *ctx,
- GLenum target, GLenum pname, GLfloat *params );
+extern void
+_mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params );
-extern void gl_GetTexEnviv( GLcontext *ctx,
- GLenum target, GLenum pname, GLint *params );
+extern void
+_mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params );
-extern void gl_GetTexGendv( GLcontext *ctx,
- GLenum coord, GLenum pname, GLdouble *params );
+extern void
+_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params );
-extern void gl_GetTexGenfv( GLcontext *ctx,
- GLenum coord, GLenum pname, GLfloat *params );
+extern void
+_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params );
-extern void gl_GetTexGeniv( GLcontext *ctx,
- GLenum coord, GLenum pname, GLint *params );
+extern void
+_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params );
-extern void gl_GetTexLevelParameterfv( GLcontext *ctx,
- GLenum target, GLint level,
- GLenum pname, GLfloat *params );
+extern void
+_mesa_GetTexLevelParameterfv( GLenum target, GLint level,
+ GLenum pname, GLfloat *params );
-extern void gl_GetTexLevelParameteriv( GLcontext *ctx,
- GLenum target, GLint level,
- GLenum pname, GLint *params );
+extern void
+_mesa_GetTexLevelParameteriv( GLenum target, GLint level,
+ GLenum pname, GLint *params );
-extern void gl_GetTexParameterfv( GLcontext *ctx, GLenum target,
- GLenum pname, GLfloat *params );
+extern void
+_mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params );
-extern void gl_GetTexParameteriv( GLcontext *ctx,
- GLenum target, GLenum pname, GLint *params );
+extern void
+_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params );
-extern void gl_TexEnvfv( GLcontext *ctx,
- GLenum target, GLenum pname, const GLfloat *param );
+extern void
+_mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param );
+extern void
+_mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param );
-extern void gl_TexParameterfv( GLcontext *ctx, GLenum target, GLenum pname,
- const GLfloat *params );
+extern void
+_mesa_TexEnvi( GLenum target, GLenum pname, GLint param );
+extern void
+_mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param );
-extern void gl_TexGenfv( GLcontext *ctx,
- GLenum coord, GLenum pname, const GLfloat *params );
+
+extern void
+_mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params );
+
+extern void
+_mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param );
+
+
+extern void
+_mesa_TexParameteri( GLenum target, GLenum pname, GLint param );
+
+extern void
+_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params );
+
+
+extern void
+_mesa_TexGend( GLenum coord, GLenum pname, GLdouble param );
+
+extern void
+_mesa_TexGendv( GLenum coord, GLenum pname, const GLdouble *params );
+
+extern void
+_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param );
+
+extern void
+_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
+
+extern void
+_mesa_TexGeni( GLenum coord, GLenum pname, GLint param );
+
+extern void
+_mesa_TexGeniv( GLenum coord, GLenum pname, const GLint *params );
@@ -86,9 +120,11 @@ extern void gl_SelectTextureTransform( GLcontext *ctx, GLenum target );
/*
* GL_ARB_multitexture
*/
-extern void gl_ActiveTexture( GLcontext *ctx, GLenum target );
+extern void
+_mesa_ActiveTextureARB( GLenum target );
-extern void gl_ClientActiveTexture( GLcontext *ctx, GLenum target );
+extern void
+_mesa_ClientActiveTextureARB( GLenum target );
diff --git a/xc/extras/Mesa/src/texture.c b/xc/extras/Mesa/src/texture.c
index a20e091b6..f8f4e8f18 100644
--- a/xc/extras/Mesa/src/texture.c
+++ b/xc/extras/Mesa/src/texture.c
@@ -1,8 +1,8 @@
-/* $Id: texture.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: texture.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -28,13 +28,7 @@
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <math.h>
-#include <stdlib.h>
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "macros.h"
#include "mmath.h"
@@ -44,6 +38,7 @@
#include "xform.h"
#endif
+
/***********************************************************************
* Automatic texture coordinate generation (texgen) code.
*/
@@ -250,15 +245,15 @@ static void palette_sample(const struct gl_texture_object *tObj,
const GLubyte *palette;
if (ctx->Texture.SharedPalette) {
- palette = ctx->Texture.Palette;
+ palette = ctx->Texture.Palette.Table;
}
else {
- palette = tObj->Palette;
+ palette = tObj->Palette.Table;
}
- switch (tObj->PaletteFormat) {
+ switch (tObj->Palette.Format) {
case GL_ALPHA:
- rgba[ACOMP] = tObj->Palette[index];
+ rgba[ACOMP] = palette[index];
return;
case GL_LUMINANCE:
case GL_INTENSITY:
@@ -543,19 +538,13 @@ static void sample_1d_linear( const struct gl_texture_object *tObj,
GLubyte t0[4], t1[4]; /* texels */
if (useBorderColor & I0BIT) {
- t0[RCOMP] = tObj->BorderColor[0];
- t0[GCOMP] = tObj->BorderColor[1];
- t0[BCOMP] = tObj->BorderColor[2];
- t0[ACOMP] = tObj->BorderColor[3];
+ COPY_4UBV(t0, tObj->BorderColor);
}
else {
get_1d_texel( tObj, img, i0, t0 );
}
if (useBorderColor & I1BIT) {
- t1[RCOMP] = tObj->BorderColor[0];
- t1[GCOMP] = tObj->BorderColor[1];
- t1[BCOMP] = tObj->BorderColor[2];
- t1[ACOMP] = tObj->BorderColor[3];
+ COPY_4UBV(t1, tObj->BorderColor);
}
else {
get_1d_texel( tObj, img, i1, t1 );
@@ -928,37 +917,25 @@ static void sample_2d_linear( const struct gl_texture_object *tObj,
GLubyte t11[4];
if (useBorderColor & (I0BIT | J0BIT)) {
- t00[RCOMP] = tObj->BorderColor[0];
- t00[GCOMP] = tObj->BorderColor[1];
- t00[BCOMP] = tObj->BorderColor[2];
- t00[ACOMP] = tObj->BorderColor[3];
+ COPY_4UBV(t00, tObj->BorderColor);
}
else {
get_2d_texel( tObj, img, i0, j0, t00 );
}
if (useBorderColor & (I1BIT | J0BIT)) {
- t10[RCOMP] = tObj->BorderColor[0];
- t10[GCOMP] = tObj->BorderColor[1];
- t10[BCOMP] = tObj->BorderColor[2];
- t10[ACOMP] = tObj->BorderColor[3];
+ COPY_4UBV(t10, tObj->BorderColor);
}
else {
get_2d_texel( tObj, img, i1, j0, t10 );
}
if (useBorderColor & (I0BIT | J1BIT)) {
- t01[RCOMP] = tObj->BorderColor[0];
- t01[GCOMP] = tObj->BorderColor[1];
- t01[BCOMP] = tObj->BorderColor[2];
- t01[ACOMP] = tObj->BorderColor[3];
+ COPY_4UBV(t01, tObj->BorderColor);
}
else {
get_2d_texel( tObj, img, i0, j1, t01 );
}
if (useBorderColor & (I1BIT | J1BIT)) {
- t11[RCOMP] = tObj->BorderColor[0];
- t11[GCOMP] = tObj->BorderColor[1];
- t11[BCOMP] = tObj->BorderColor[2];
- t11[ACOMP] = tObj->BorderColor[3];
+ COPY_4UBV(t11, tObj->BorderColor);
}
else {
get_2d_texel( tObj, img, i1, j1, t11 );
@@ -1423,74 +1400,50 @@ static void sample_3d_linear( const struct gl_texture_object *tObj,
GLubyte t100[4], t110[4], t101[4], t111[4];
if (useBorderColor & (I0BIT | J0BIT | K0BIT)) {
- t000[RCOMP] = tObj->BorderColor[0];
- t000[GCOMP] = tObj->BorderColor[1];
- t000[BCOMP] = tObj->BorderColor[2];
- t000[ACOMP] = tObj->BorderColor[3];
+ COPY_4UBV(t000, tObj->BorderColor);
}
else {
get_3d_texel( tObj, img, i0, j0, k0, t000 );
}
if (useBorderColor & (I1BIT | J0BIT | K0BIT)) {
- t100[RCOMP] = tObj->BorderColor[0];
- t100[GCOMP] = tObj->BorderColor[1];
- t100[BCOMP] = tObj->BorderColor[2];
- t100[ACOMP] = tObj->BorderColor[3];
+ COPY_4UBV(t100, tObj->BorderColor);
}
else {
get_3d_texel( tObj, img, i1, j0, k0, t100 );
}
if (useBorderColor & (I0BIT | J1BIT | K0BIT)) {
- t010[RCOMP] = tObj->BorderColor[0];
- t010[GCOMP] = tObj->BorderColor[1];
- t010[BCOMP] = tObj->BorderColor[2];
- t010[ACOMP] = tObj->BorderColor[3];
+ COPY_4UBV(t010, tObj->BorderColor);
}
else {
get_3d_texel( tObj, img, i0, j1, k0, t010 );
}
if (useBorderColor & (I1BIT | J1BIT | K0BIT)) {
- t110[RCOMP] = tObj->BorderColor[0];
- t110[GCOMP] = tObj->BorderColor[1];
- t110[BCOMP] = tObj->BorderColor[2];
- t110[ACOMP] = tObj->BorderColor[3];
+ COPY_4UBV(t110, tObj->BorderColor);
}
else {
get_3d_texel( tObj, img, i1, j1, k0, t110 );
}
if (useBorderColor & (I0BIT | J0BIT | K1BIT)) {
- t001[RCOMP] = tObj->BorderColor[0];
- t001[GCOMP] = tObj->BorderColor[1];
- t001[BCOMP] = tObj->BorderColor[2];
- t001[ACOMP] = tObj->BorderColor[3];
+ COPY_4UBV(t001, tObj->BorderColor);
}
else {
get_3d_texel( tObj, img, i0, j0, k1, t001 );
}
if (useBorderColor & (I1BIT | J0BIT | K1BIT)) {
- t101[RCOMP] = tObj->BorderColor[0];
- t101[GCOMP] = tObj->BorderColor[1];
- t101[BCOMP] = tObj->BorderColor[2];
- t101[ACOMP] = tObj->BorderColor[3];
+ COPY_4UBV(t101, tObj->BorderColor);
}
else {
get_3d_texel( tObj, img, i1, j0, k1, t101 );
}
if (useBorderColor & (I0BIT | J1BIT | K1BIT)) {
- t011[RCOMP] = tObj->BorderColor[0];
- t011[GCOMP] = tObj->BorderColor[1];
- t011[BCOMP] = tObj->BorderColor[2];
- t011[ACOMP] = tObj->BorderColor[3];
+ COPY_4UBV(t011, tObj->BorderColor);
}
else {
get_3d_texel( tObj, img, i0, j1, k1, t011 );
}
if (useBorderColor & (I1BIT | J1BIT | K1BIT)) {
- t111[RCOMP] = tObj->BorderColor[0];
- t111[GCOMP] = tObj->BorderColor[1];
- t111[BCOMP] = tObj->BorderColor[2];
- t111[ACOMP] = tObj->BorderColor[3];
+ COPY_4UBV(t111, tObj->BorderColor);
}
else {
get_3d_texel( tObj, img, i1, j1, k1, t111 );
@@ -1871,7 +1824,7 @@ static void apply_texture( const GLcontext *ctx,
}
break;
default:
- gl_problem(ctx, "Bad format in apply_texture");
+ gl_problem(ctx, "Bad format (GL_REPLACE) in apply_texture");
return;
}
break;
@@ -1937,7 +1890,7 @@ static void apply_texture( const GLcontext *ctx,
}
break;
default:
- gl_problem(ctx, "Bad format (2) in apply_texture");
+ gl_problem(ctx, "Bad format (GL_MODULATE) in apply_texture");
return;
}
break;
@@ -1970,7 +1923,7 @@ static void apply_texture( const GLcontext *ctx,
}
break;
default:
- gl_problem(ctx, "Bad format (3) in apply_texture");
+ gl_problem(ctx, "Bad format (GL_DECAL) in apply_texture");
return;
}
break;
@@ -2040,7 +1993,82 @@ static void apply_texture( const GLcontext *ctx,
}
break;
default:
- gl_problem(ctx, "Bad format (4) in apply_texture");
+ gl_problem(ctx, "Bad format (GL_BLEND) in apply_texture");
+ return;
+ }
+ break;
+
+ case GL_ADD: /* GL_EXT_texture_add_env */
+ switch (format) {
+ case GL_ALPHA:
+ for (i=0;i<n;i++) {
+ /* Rv = Rf */
+ /* Gv = Gf */
+ /* Bv = Bf */
+ rgba[i][ACOMP] = PROD(rgba[i][ACOMP], texel[i][ACOMP]);
+ }
+ break;
+ case GL_LUMINANCE:
+ for (i=0;i<n;i++) {
+ GLuint Lt = texel[i][RCOMP];
+ GLuint r = rgba[i][RCOMP] + Lt;
+ GLuint g = rgba[i][GCOMP] + Lt;
+ GLuint b = rgba[i][BCOMP] + Lt;
+ rgba[i][RCOMP] = r < 256 ? (GLubyte) r : 255;
+ rgba[i][GCOMP] = g < 256 ? (GLubyte) g : 255;
+ rgba[i][BCOMP] = b < 256 ? (GLubyte) b : 255;
+ /* Av = Af */
+ }
+ break;
+ case GL_LUMINANCE_ALPHA:
+ for (i=0;i<n;i++) {
+ GLuint Lt = texel[i][RCOMP];
+ GLuint r = rgba[i][RCOMP] + Lt;
+ GLuint g = rgba[i][GCOMP] + Lt;
+ GLuint b = rgba[i][BCOMP] + Lt;
+ rgba[i][RCOMP] = r < 256 ? (GLubyte) r : 255;
+ rgba[i][GCOMP] = g < 256 ? (GLubyte) g : 255;
+ rgba[i][BCOMP] = b < 256 ? (GLubyte) b : 255;
+ rgba[i][ACOMP] = PROD(rgba[i][ACOMP], texel[i][ACOMP]);
+ }
+ break;
+ case GL_INTENSITY:
+ for (i=0;i<n;i++) {
+ GLubyte It = texel[i][RCOMP];
+ GLuint r = rgba[i][RCOMP] + It;
+ GLuint g = rgba[i][GCOMP] + It;
+ GLuint b = rgba[i][BCOMP] + It;
+ GLuint a = rgba[i][ACOMP] + It;
+ rgba[i][RCOMP] = r < 256 ? (GLubyte) r : 255;
+ rgba[i][GCOMP] = g < 256 ? (GLubyte) g : 255;
+ rgba[i][BCOMP] = b < 256 ? (GLubyte) b : 255;
+ rgba[i][ACOMP] = a < 256 ? (GLubyte) a : 255;
+ }
+ break;
+ case GL_RGB:
+ for (i=0;i<n;i++) {
+ GLuint r = rgba[i][RCOMP] + texel[i][RCOMP];
+ GLuint g = rgba[i][GCOMP] + texel[i][GCOMP];
+ GLuint b = rgba[i][BCOMP] + texel[i][BCOMP];
+ rgba[i][RCOMP] = r < 256 ? (GLubyte) r : 255;
+ rgba[i][GCOMP] = g < 256 ? (GLubyte) g : 255;
+ rgba[i][BCOMP] = b < 256 ? (GLubyte) b : 255;
+ /* Av = Af */
+ }
+ break;
+ case GL_RGBA:
+ for (i=0;i<n;i++) {
+ GLuint r = rgba[i][RCOMP] + texel[i][RCOMP];
+ GLuint g = rgba[i][GCOMP] + texel[i][GCOMP];
+ GLuint b = rgba[i][BCOMP] + texel[i][BCOMP];
+ rgba[i][RCOMP] = r < 256 ? (GLubyte) r : 255;
+ rgba[i][GCOMP] = g < 256 ? (GLubyte) g : 255;
+ rgba[i][BCOMP] = b < 256 ? (GLubyte) b : 255;
+ rgba[i][ACOMP] = PROD(rgba[i][ACOMP], texel[i][ACOMP]);
+ }
+ break;
+ default:
+ gl_problem(ctx, "Bad format (GL_ADD) in apply_texture");
return;
}
break;
diff --git a/xc/extras/Mesa/src/texture.h b/xc/extras/Mesa/src/texture.h
index 25a1aa9d7..48d403730 100644
--- a/xc/extras/Mesa/src/texture.h
+++ b/xc/extras/Mesa/src/texture.h
@@ -1,4 +1,4 @@
-/* $Id: texture.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: texture.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/trans_tmp.h b/xc/extras/Mesa/src/trans_tmp.h
index 28a43c9d9..53b96b122 100644
--- a/xc/extras/Mesa/src/trans_tmp.h
+++ b/xc/extras/Mesa/src/trans_tmp.h
@@ -1,4 +1,4 @@
-/* $Id: trans_tmp.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: trans_tmp.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -152,21 +152,21 @@ static void INIT(void)
{
#ifdef DEST_1UI
ASSERT(SZ == 1);
- TAB(1ui)[SRC_IDX] = DEST_1UI;
+ TAB(_1ui)[SRC_IDX] = DEST_1UI;
#endif
#ifdef DEST_1UB
ASSERT(SZ == 1);
- TAB(1ub)[SRC_IDX] = DEST_1UB;
+ TAB(_1ub)[SRC_IDX] = DEST_1UB;
#endif
#ifdef DEST_3F
ASSERT(SZ == 3);
- TAB(3f)[SRC_IDX] = DEST_3F;
+ TAB(_3f)[SRC_IDX] = DEST_3F;
#endif
#ifdef DEST_4UB
- TAB(4ub)[SZ][SRC_IDX] = DEST_4UB;
+ TAB(_4ub)[SZ][SRC_IDX] = DEST_4UB;
#endif
#ifdef DEST_4F
- TAB(4f)[SZ][SRC_IDX] = DEST_4F;
+ TAB(_4f)[SZ][SRC_IDX] = DEST_4F;
#endif
}
diff --git a/xc/extras/Mesa/src/translate.c b/xc/extras/Mesa/src/translate.c
index 97b4f4ad4..c167ddb2b 100644
--- a/xc/extras/Mesa/src/translate.c
+++ b/xc/extras/Mesa/src/translate.c
@@ -1,8 +1,8 @@
-/* $Id: translate.c,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: translate.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -29,9 +29,19 @@
*/
-#include "types.h"
-#include "translate.h"
+#ifdef PC_HEADER
+#include "all.h"
+#else
+#include "glheader.h"
+#include "mem.h"
#include "mmath.h"
+#include "translate.h"
+#include "types.h"
+#endif
+
+/* This macro is used on other systems, so undefine it for this module */
+
+#undef CHECK
trans_1ui_func gl_trans_1ui_tab[MAX_TYPES];
trans_1ub_func gl_trans_1ub_tab[MAX_TYPES];
@@ -49,7 +59,7 @@ trans_elt_4f_func gl_trans_elt_4f_tab[5][MAX_TYPES];
#define PTR_ELT(ptr, elt) (((SRC *)ptr)[elt])
-#define TAB(x) gl_trans_##x##_tab
+#define TAB(x) gl_trans##x##_tab
#define ARGS GLuint start, GLuint n
#define SRC_START start
#define DST_START 0
@@ -412,13 +422,13 @@ static void trans_4_GLubyte_4ub_raw (GLubyte (*t)[4],
static void init_translate_raw(void)
{
- MEMSET( TAB(1ui), 0, sizeof(TAB(1ui)) );
- MEMSET( TAB(1ub), 0, sizeof(TAB(1ub)) );
- MEMSET( TAB(3f), 0, sizeof(TAB(3f)) );
- MEMSET( TAB(4ub), 0, sizeof(TAB(4ub)) );
- MEMSET( TAB(4f), 0, sizeof(TAB(4f)) );
+ MEMSET( TAB(_1ui), 0, sizeof(TAB(_1ui)) );
+ MEMSET( TAB(_1ub), 0, sizeof(TAB(_1ub)) );
+ MEMSET( TAB(_3f), 0, sizeof(TAB(_3f)) );
+ MEMSET( TAB(_4ub), 0, sizeof(TAB(_4ub)) );
+ MEMSET( TAB(_4f), 0, sizeof(TAB(_4f)) );
- TAB(4ub)[4][TYPE_IDX(GL_UNSIGNED_BYTE)] = trans_4_GLubyte_4ub_raw;
+ TAB(_4ub)[4][TYPE_IDX(GL_UNSIGNED_BYTE)] = trans_4_GLubyte_4ub_raw;
init_trans_4_GLbyte_raw();
init_trans_3_GLbyte_raw();
@@ -475,13 +485,13 @@ static void init_translate_raw(void)
*
* That the correct value for normal is used.
*/
-#define TAB(x) gl_trans_elt_##x##_tab
+#define TAB(x) gl_trans_elt##x##_tab
#define ARGS GLuint *flags, GLuint *elts, GLuint match, \
GLuint start, GLuint n
#define SRC_START 0
#define DST_START start
#define CHECK if ((flags[i]&match) == VERT_ELT)
-#define NEXT_F 1
+#define NEXT_F (void)1
#define NEXT_F2 f = first + elts[i] * stride;
@@ -842,13 +852,13 @@ static void trans_4_GLubyte_4ub(GLubyte (*t)[4],
static void init_translate_elt(void)
{
- MEMSET( TAB(1ui), 0, sizeof(TAB(1ui)) );
- MEMSET( TAB(1ub), 0, sizeof(TAB(1ub)) );
- MEMSET( TAB(3f), 0, sizeof(TAB(3f)) );
- MEMSET( TAB(4ub), 0, sizeof(TAB(4ub)) );
- MEMSET( TAB(4f), 0, sizeof(TAB(4f)) );
+ MEMSET( TAB(_1ui), 0, sizeof(TAB(_1ui)) );
+ MEMSET( TAB(_1ub), 0, sizeof(TAB(_1ub)) );
+ MEMSET( TAB(_3f), 0, sizeof(TAB(_3f)) );
+ MEMSET( TAB(_4ub), 0, sizeof(TAB(_4ub)) );
+ MEMSET( TAB(_4f), 0, sizeof(TAB(_4f)) );
- TAB(4ub)[4][TYPE_IDX(GL_UNSIGNED_BYTE)] = trans_4_GLubyte_4ub;
+ TAB(_4ub)[4][TYPE_IDX(GL_UNSIGNED_BYTE)] = trans_4_GLubyte_4ub;
init_trans_4_GLbyte_elt();
init_trans_3_GLbyte_elt();
diff --git a/xc/extras/Mesa/src/translate.h b/xc/extras/Mesa/src/translate.h
index 46df91afd..4c04009a4 100644
--- a/xc/extras/Mesa/src/translate.h
+++ b/xc/extras/Mesa/src/translate.h
@@ -1,4 +1,4 @@
-/* $Id: translate.h,v 1.3 1999/12/14 02:39:38 daryll Exp $ */
+/* $Id: translate.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/triangle.c b/xc/extras/Mesa/src/triangle.c
index 11f084929..717d0f689 100644
--- a/xc/extras/Mesa/src/triangle.c
+++ b/xc/extras/Mesa/src/triangle.c
@@ -1,8 +1,8 @@
-/* $Id: triangle.c,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: triangle.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,8 +25,6 @@
*/
-
-
/*
* Triangle rasterizers
* When the device driver doesn't implement triangle rasterization Mesa
@@ -37,17 +35,11 @@
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <math.h>
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "depth.h"
#include "feedback.h"
-#include "macros.h"
+#include "mem.h"
#include "mmath.h"
#include "span.h"
#include "texstate.h"
@@ -173,8 +165,8 @@ static void flat_rgba_triangle( GLcontext *ctx,
ffz += fdzdx; \
} \
gl_write_monocolor_span( ctx, n, LEFT, Y, zspan, \
- VB->ColorPtr->data[pv], \
- GL_POLYGON ); \
+ VB->ColorPtr->data[pv], \
+ GL_POLYGON ); \
} \
}
@@ -365,7 +357,7 @@ static void affine_textured_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
GLint comp, tbytesline, tsize; \
GLfixed er, eg, eb, ea; \
GLint tr, tg, tb, ta; \
- if (envmode == GL_BLEND || envmode == GL_ADD) { \
+ if (envmode == GL_BLEND) { \
/* potential off-by-one error here? (1.0f -> 2048 -> 0) */ \
er = FloatToFixed(unit->EnvColor[0]); \
eg = FloatToFixed(unit->EnvColor[1]); \
@@ -456,12 +448,6 @@ static void affine_textured_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
dest[2] = tb; \
dest[3] = ta
-#define ADD \
- dest[0] = ((ffr << 8) + (tr + 1) * er) >> (FIXED_SHIFT + 8); \
- dest[1] = ((ffg << 8) + (tg + 1) * eg) >> (FIXED_SHIFT + 8); \
- dest[2] = ((ffb << 8) + (tb + 1) * eb) >> (FIXED_SHIFT + 8); \
- dest[3] = ffa * (ta + 1) >> (FIXED_SHIFT + 8)
-
/* shortcuts */
#define NEAREST_RGB_REPLACE NEAREST_RGB;REPLACE
@@ -544,9 +530,8 @@ static void affine_textured_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
case GL_BLEND: \
SPAN1(NEAREST_RGB;BLEND,3); \
break; \
- case GL_ADD: \
- SPAN1(NEAREST_RGB;ADD,3); \
- break; \
+ default: /* unexpected env mode */ \
+ abort(); \
} \
break; \
case GL_RGBA: \
@@ -563,9 +548,8 @@ static void affine_textured_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
case GL_REPLACE: \
SPAN1(NEAREST_RGBA_REPLACE,4); \
break; \
- case GL_ADD: \
- SPAN1(NEAREST_RGBA;ADD,4); \
- break; \
+ default: /* unexpected env mode */ \
+ abort(); \
} \
break; \
} \
@@ -586,9 +570,8 @@ static void affine_textured_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
case GL_BLEND: \
SPAN2(LINEAR_RGB;BLEND,3); \
break; \
- case GL_ADD: \
- SPAN2(LINEAR_RGB;ADD,3); \
- break; \
+ default: /* unexpected env mode */ \
+ abort(); \
} \
break; \
case GL_RGBA: \
@@ -605,9 +588,8 @@ static void affine_textured_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
case GL_REPLACE: \
SPAN2(LINEAR_RGBA;REPLACE,4); \
break; \
- case GL_ADD: \
- SPAN2(LINEAR_RGBA;ADD,4); \
- break; \
+ default: /* unexpected env mode */ \
+ abort(); \
} \
break; \
} \
@@ -660,7 +642,7 @@ static void persp_textured_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
GLint comp, tbytesline, tsize; \
GLfixed er, eg, eb, ea; \
GLint tr, tg, tb, ta; \
- if (envmode == GL_BLEND || envmode == GL_ADD) { \
+ if (envmode == GL_BLEND) { \
er = FloatToFixed(unit->EnvColor[0]); \
eg = FloatToFixed(unit->EnvColor[1]); \
eb = FloatToFixed(unit->EnvColor[2]); \
@@ -781,9 +763,8 @@ static void persp_textured_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
case GL_BLEND: \
SPAN1(NEAREST_RGB;BLEND,3); \
break; \
- case GL_ADD: \
- SPAN1(NEAREST_RGB;ADD,3); \
- break; \
+ default: /* unexpected env mode */ \
+ abort(); \
} \
break; \
case GL_RGBA: \
@@ -800,9 +781,8 @@ static void persp_textured_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
case GL_REPLACE: \
SPAN1(NEAREST_RGBA_REPLACE,4); \
break; \
- case GL_ADD: \
- SPAN1(NEAREST_RGBA;ADD,4); \
- break; \
+ default: /* unexpected env mode */ \
+ abort(); \
} \
break; \
} \
@@ -823,9 +803,8 @@ static void persp_textured_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
case GL_BLEND: \
SPAN2(LINEAR_RGB;BLEND,3); \
break; \
- case GL_ADD: \
- SPAN2(LINEAR_RGB;ADD,3); \
- break; \
+ default: /* unexpected env mode */ \
+ abort(); \
} \
break; \
case GL_RGBA: \
@@ -842,9 +821,8 @@ static void persp_textured_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
case GL_REPLACE: \
SPAN2(LINEAR_RGBA;REPLACE,4); \
break; \
- case GL_ADD: \
- SPAN2(LINEAR_RGBA;ADD,4); \
- break; \
+ default: /* unexpected env mode */ \
+ abort(); \
} \
break; \
} \
@@ -1532,8 +1510,14 @@ void gl_set_triangle_function( GLcontext *ctx )
}
}
else {
- ctx->Driver.TriangleFunc = affine_textured_triangle;
- dputs("affine_textured_triangle");
+ if (ctx->Texture.Unit[0].EnvMode==GL_ADD) {
+ ctx->Driver.TriangleFunc = general_textured_triangle;
+ dputs("general_textured_triangle");
+ }
+ else {
+ ctx->Driver.TriangleFunc = affine_textured_triangle;
+ dputs("affine_textured_triangle");
+ }
}
}
else {
diff --git a/xc/extras/Mesa/src/triangle.h b/xc/extras/Mesa/src/triangle.h
index 19da2ceeb..baecbdb97 100644
--- a/xc/extras/Mesa/src/triangle.h
+++ b/xc/extras/Mesa/src/triangle.h
@@ -1,4 +1,4 @@
-/* $Id: triangle.h,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: triangle.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/tritemp.h b/xc/extras/Mesa/src/tritemp.h
index 4f46ba02f..714c74afb 100644
--- a/xc/extras/Mesa/src/tritemp.h
+++ b/xc/extras/Mesa/src/tritemp.h
@@ -1,10 +1,10 @@
-/* $Id: tritemp.h,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: tritemp.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -83,7 +83,7 @@
GLfixed fx0; /* fixed pt X of lower endpoint */
} EdgeT;
- struct vertex_buffer *VB = ctx->VB;
+ const struct vertex_buffer *VB = ctx->VB;
EdgeT eMaj, eTop, eBot;
GLfloat oneOverArea;
int vMin, vMid, vMax; /* vertex indexes: Y(vMin)<=Y(vMid)<=Y(vMax) */
@@ -134,16 +134,12 @@
/* compute oneOverArea */
{
- GLfloat area = eMaj.dx * eBot.dy - eBot.dx * eMaj.dy;
+ const GLfloat area = eMaj.dx * eBot.dy - eBot.dx * eMaj.dy;
/* Do backface culling */
- if (
- area * bf < 0 ||
- area * area < .0025
- )
- return;
+ if (area * bf < 0 || area * area < .0025)
+ return;
-
oneOverArea = 1.0F / area;
}
@@ -698,7 +694,7 @@
fdzOuter = (GLint) (dzdy + dxOuter * dzdx);
#endif
zRow = Z_ADDRESS( ctx, FixedToInt(fxLeftEdge), iy );
- dZRowOuter = (ctx->Buffer->Width + idxOuter) * sizeof(GLdepth);
+ dZRowOuter = (ctx->DrawBuffer->Width + idxOuter) * sizeof(GLdepth);
}
#endif
#if INTERP_RGB
diff --git a/xc/extras/Mesa/src/types.h b/xc/extras/Mesa/src/types.h
index 820a788ed..414147b26 100644
--- a/xc/extras/Mesa/src/types.h
+++ b/xc/extras/Mesa/src/types.h
@@ -1,11 +1,11 @@
/* -*- mode: C; tab-width:8; c-basic-offset:8 -*- */
-/* $Id: types.h,v 1.4 1999/12/18 16:51:05 daryll Exp $ */
+/* $Id: types.h,v 1.5 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -30,43 +30,15 @@
#define TYPES_H
-#include "GL/gl.h"
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
+#include "glheader.h"
#include "config.h"
-#include "macros.h"
-#include "fixed.h"
#include "extensions.h"
-#include "vector.h"
+#include "fixed.h"
+#include "glapitable.h"
+#include "macros.h"
#include "matrix.h"
#include "vb.h"
-
-/*
-#if !defined(MESA_MINOR_VERSION) || !defined(MESA_MAJOR_VERSION)
-#error "Compiling with non-Mesa GL.h"
-#endif
-
-#if (MESA_MINOR_VERSION != 1) || (MESA_MAJOR_VERSION != 3)
-#error "Compiling with GL.h from a different Mesa version"
-#endif
-*/
-
-/* This should rev. quite quickly - perhaps every time this file is
- * committed, to allow dependent projects to track changes to mesa's
- * internals.
- */
-#define MESA_BRANCH 0
-#define MESA_TINY_VERSION 2
-#define MESA_VERSION MESA_VER(MESA_MAJOR_VERSION, \
- MESA_MINOR_VERSION, \
- MESA_BRANCH, \
- MESA_TINY_VERSION)
-
-#define MESA_VER(x,y,z,w) ((x<<24)+(y<<16)+(z<<10)+w)
-
-
-#define GL_MAX_TEXTURES GL_MAX_TEXTURES_SGIS
+#include "vector.h"
/*
@@ -100,14 +72,13 @@
typedef GLubyte GLstencil;
# define STENCIL_MAX 0xff
#elif STENCIL_BITS==16
- typedef GLushort GLstencil
+ typedef GLushort GLstencil;
# define STENCIL_MAX 0xffff
#else
# error "illegal number of stencil bits"
#endif
-
/*
* Depth buffer data type:
*/
@@ -124,19 +95,17 @@
/*
* Some forward type declarations
*/
-struct HashTable;
+struct _mesa_HashTable;
typedef struct gl_visual GLvisual;
typedef struct gl_frame_buffer GLframebuffer;
-struct gl_pixelstore_attrib;
-
/*
* Functions for transformation of normals in the VB.
*/
-typedef void (*normal_func)( const GLmatrix *mat,
+typedef void (_NORMAPIP normal_func)( const GLmatrix *mat,
GLfloat scale,
const GLvector3f *in,
const GLfloat lengths[],
@@ -177,11 +146,24 @@ typedef void (*clip_interp_func)( struct vertex_buffer *VB, GLuint dst,
typedef void (*render_vb_func)( GLcontext *ctx );
+
+typedef void (*render_func)( struct vertex_buffer *VB,
+ GLuint start,
+ GLuint count,
+ GLuint parity );
+
+
/*
* Blending function
*/
+#ifdef USE_MMX_ASM
+typedef void (_ASMAPIP blend_func)( GLcontext *ctx, GLuint n,
+ const GLubyte mask[],
+ GLubyte src[][4], CONST GLubyte dst[][4] );
+#else
typedef void (*blend_func)( GLcontext *ctx, GLuint n, const GLubyte mask[],
GLubyte src[][4], CONST GLubyte dst[][4] );
+#endif
@@ -198,21 +180,6 @@ typedef void (*TextureSampleFunc)( const struct gl_texture_object *tObj,
-/* Generic internal image format */
-struct gl_image {
- GLint Width;
- GLint Height;
- GLint Depth; /* for 3-D texturing */
- GLint Components; /* 1, 2, 3 or 4 */
- GLenum Format; /* GL_COLOR_INDEX, GL_RED, GL_RGB, etc */
- GLenum Type; /* GL_UNSIGNED_BYTE or GL_FLOAT or GL_BITMAP */
- GLvoid *Data;
- GLboolean ErrorFlag;
- GLint RefCount;
-};
-
-
-
/* Texture image record */
struct gl_texture_image {
GLenum Format; /* GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA,
@@ -245,215 +212,16 @@ struct gl_texture_image {
};
-/*
- * All gl* API functions in api*.c jump through pointers in this struct.
- */
-struct gl_api_table {
- void (*Accum)( GLcontext *, GLenum, GLfloat );
- void (*AlphaFunc)( GLcontext *, GLenum, GLclampf );
- GLboolean (*AreTexturesResident)( GLcontext *, GLsizei,
- const GLuint *, GLboolean * );
- void (*BindTexture)( GLcontext *, GLenum, GLuint );
- void (*Bitmap)( GLcontext *, GLsizei, GLsizei, GLfloat, GLfloat,
- GLfloat, GLfloat, const GLubyte *,
- const struct gl_pixelstore_attrib *packing );
- void (*BlendColor)( GLcontext *, GLclampf, GLclampf, GLclampf, GLclampf);
- void (*BlendEquation)( GLcontext *, GLenum );
- void (*BlendFunc)( GLcontext *, GLenum, GLenum );
- void (*BlendFuncSeparate)( GLcontext *, GLenum, GLenum, GLenum, GLenum );
- void (*CallList)( GLcontext *, GLuint list );
- void (*CallLists)( GLcontext *, GLsizei, GLenum, const GLvoid * );
- void (*Clear)( GLcontext *, GLbitfield );
- void (*ClearAccum)( GLcontext *, GLfloat, GLfloat, GLfloat, GLfloat );
- void (*ClearColor)( GLcontext *, GLclampf, GLclampf, GLclampf, GLclampf );
- void (*ClearDepth)( GLcontext *, GLclampd );
- void (*ClearIndex)( GLcontext *, GLfloat );
- void (*ClearStencil)( GLcontext *, GLint );
- void (*ClipPlane)( GLcontext *, GLenum, const GLfloat * );
- void (*ColorMask)( GLcontext *,
- GLboolean, GLboolean, GLboolean, GLboolean );
- void (*ColorMaterial)( GLcontext *, GLenum, GLenum );
- void (*ColorTable)( GLcontext *, GLenum, GLenum, struct gl_image * );
- void (*ColorSubTable)( GLcontext *, GLenum, GLsizei, struct gl_image * );
- void (*CopyPixels)( GLcontext *, GLint, GLint, GLsizei, GLsizei, GLenum );
- void (*CopyTexImage1D)( GLcontext *, GLenum, GLint, GLenum,
- GLint, GLint, GLsizei, GLint );
- void (*CopyTexImage2D)( GLcontext *, GLenum, GLint, GLenum,
- GLint, GLint, GLsizei, GLsizei, GLint );
- void (*CopyTexSubImage1D)( GLcontext *, GLenum, GLint, GLint,
- GLint, GLint, GLsizei );
- void (*CopyTexSubImage2D)( GLcontext *, GLenum, GLint, GLint, GLint,
- GLint, GLint, GLsizei, GLsizei );
- void (*CopyTexSubImage3D)(GLcontext *, GLenum, GLint, GLint, GLint, GLint,
- GLint, GLint, GLsizei, GLsizei );
- void (*CullFace)( GLcontext *, GLenum );
- void (*DeleteLists)( GLcontext *, GLuint, GLsizei );
- void (*DeleteTextures)( GLcontext *, GLsizei, const GLuint *);
- void (*DepthFunc)( GLcontext *, GLenum );
- void (*DepthMask)( GLcontext *, GLboolean );
- void (*DepthRange)( GLcontext *, GLclampd, GLclampd );
- void (*Disable)( GLcontext *, GLenum );
- void (*DisableClientState)( GLcontext *, GLenum );
- void (*DrawBuffer)( GLcontext *, GLenum );
- void (*DrawPixels)( GLcontext *, struct gl_image *image );
- void (*Enable)( GLcontext *, GLenum );
- void (*Error)( GLcontext *, GLenum, const char * );
- void (*EnableClientState)( GLcontext *, GLenum );
- void (*EndList)( GLcontext * );
- void (*EvalMesh1)( GLcontext *, GLenum, GLint, GLint );
- void (*EvalMesh2)( GLcontext *, GLenum, GLint, GLint, GLint, GLint );
- void (*FeedbackBuffer)( GLcontext *, GLsizei, GLenum, GLfloat * );
- void (*Finish)( GLcontext * );
- void (*Flush)( GLcontext * );
- void (*Fogfv)( GLcontext *, GLenum, const GLfloat * );
- void (*FrontFace)( GLcontext *, GLenum );
- void (*Frustum)( GLcontext *, GLdouble, GLdouble, GLdouble, GLdouble,
- GLdouble, GLdouble );
- GLuint (*GenLists)( GLcontext *, GLsizei );
- void (*GenTextures)( GLcontext *, GLsizei, GLuint * );
- void (*GetBooleanv)( GLcontext *, GLenum, GLboolean * );
- void (*GetClipPlane)( GLcontext *, GLenum, GLdouble * );
- void (*GetColorTable)( GLcontext *, GLenum, GLenum, GLenum, GLvoid *);
- void (*GetColorTableParameteriv)( GLcontext *, GLenum, GLenum, GLint *);
- void (*GetDoublev)( GLcontext *, GLenum, GLdouble * );
- GLenum (*GetError)( GLcontext * );
- void (*GetFloatv)( GLcontext *, GLenum, GLfloat * );
- void (*GetIntegerv)( GLcontext *, GLenum, GLint * );
- const GLubyte* (*GetString)( GLcontext *, GLenum name );
- void (*GetLightfv)( GLcontext *, GLenum light, GLenum, GLfloat * );
- void (*GetLightiv)( GLcontext *, GLenum light, GLenum, GLint * );
- void (*GetMapdv)( GLcontext *, GLenum, GLenum, GLdouble * );
- void (*GetMapfv)( GLcontext *, GLenum, GLenum, GLfloat * );
- void (*GetMapiv)( GLcontext *, GLenum, GLenum, GLint * );
- void (*GetMaterialfv)( GLcontext *, GLenum, GLenum, GLfloat * );
- void (*GetMaterialiv)( GLcontext *, GLenum, GLenum, GLint * );
- void (*GetPixelMapfv)( GLcontext *, GLenum, GLfloat * );
- void (*GetPixelMapuiv)( GLcontext *, GLenum, GLuint * );
- void (*GetPixelMapusv)( GLcontext *, GLenum, GLushort * );
- void (*GetPointerv)( GLcontext *, GLenum, GLvoid ** );
- void (*GetPolygonStipple)( GLcontext *, GLubyte * );
- void (*PrioritizeTextures)( GLcontext *, GLsizei, const GLuint *,
- const GLclampf * );
- void (*GetTexEnvfv)( GLcontext *, GLenum, GLenum, GLfloat * );
- void (*GetTexEnviv)( GLcontext *, GLenum, GLenum, GLint * );
- void (*GetTexGendv)( GLcontext *, GLenum coord, GLenum, GLdouble * );
- void (*GetTexGenfv)( GLcontext *, GLenum coord, GLenum, GLfloat * );
- void (*GetTexGeniv)( GLcontext *, GLenum coord, GLenum, GLint * );
- void (*GetTexImage)( GLcontext *, GLenum, GLint level, GLenum, GLenum,
- GLvoid * );
- void (*GetTexLevelParameterfv)( GLcontext *,
- GLenum, GLint, GLenum, GLfloat * );
- void (*GetTexLevelParameteriv)( GLcontext *,
- GLenum, GLint, GLenum, GLint * );
- void (*GetTexParameterfv)( GLcontext *, GLenum, GLenum, GLfloat *);
- void (*GetTexParameteriv)( GLcontext *, GLenum, GLenum, GLint * );
- GLboolean (*Hint)( GLcontext *, GLenum, GLenum );
- void (*IndexMask)( GLcontext *, GLuint );
- void (*InitNames)( GLcontext * );
- GLboolean (*IsEnabled)( GLcontext *, GLenum );
- GLboolean (*IsList)( GLcontext *, GLuint );
- GLboolean (*IsTexture)( GLcontext *, GLuint );
- void (*LightModelfv)( GLcontext *, GLenum, const GLfloat * );
- void (*Lightfv)( GLcontext *, GLenum light, GLenum, const GLfloat *, GLint);
- void (*LineStipple)( GLcontext *, GLint factor, GLushort );
- void (*LineWidth)( GLcontext *, GLfloat );
- void (*ListBase)( GLcontext *, GLuint );
- void (*LoadIdentity)( GLcontext * );
- /* LoadMatrixd implemented with glLoadMatrixf */
- void (*LoadMatrixf)( GLcontext *, const GLfloat * );
- void (*LoadName)( GLcontext *, GLuint );
- void (*LogicOp)( GLcontext *, GLenum );
- void (*Map1f)( GLcontext *, GLenum, GLfloat, GLfloat, GLint, GLint,
- const GLfloat *, GLboolean );
- void (*Map2f)( GLcontext *, GLenum, GLfloat, GLfloat, GLint, GLint,
- GLfloat, GLfloat, GLint, GLint, const GLfloat *,
- GLboolean );
- void (*MapGrid1f)( GLcontext *, GLint, GLfloat, GLfloat );
- void (*MapGrid2f)( GLcontext *, GLint, GLfloat, GLfloat,
- GLint, GLfloat, GLfloat );
- void (*MatrixMode)( GLcontext *, GLenum );
- /* MultMatrixd implemented with glMultMatrixf */
- void (*MultMatrixf)( GLcontext *, const GLfloat * );
- void (*NewList)( GLcontext *, GLuint list, GLenum );
- void (*Ortho)( GLcontext *, GLdouble, GLdouble, GLdouble, GLdouble,
- GLdouble, GLdouble );
- void (*PassThrough)( GLcontext *, GLfloat );
- void (*PixelMapfv)( GLcontext *, GLenum, GLint, const GLfloat * );
- void (*PixelStorei)( GLcontext *, GLenum, GLint );
- void (*PixelTransferf)( GLcontext *, GLenum, GLfloat );
- void (*PixelZoom)( GLcontext *, GLfloat, GLfloat );
- void (*PointParameterfvEXT)( GLcontext *, GLenum, const GLfloat * );
- void (*PointSize)( GLcontext *, GLfloat );
- void (*PolygonMode)( GLcontext *, GLenum, GLenum );
- void (*PolygonOffset)( GLcontext *, GLfloat, GLfloat );
- void (*PolygonStipple)( GLcontext *, const GLuint * );
- void (*PopAttrib)( GLcontext * );
- void (*PopClientAttrib)( GLcontext * );
- void (*PopMatrix)( GLcontext * );
- void (*PopName)( GLcontext * );
- void (*PushAttrib)( GLcontext *, GLbitfield );
- void (*PushClientAttrib)( GLcontext *, GLbitfield );
- void (*PushMatrix)( GLcontext * );
- void (*PushName)( GLcontext *, GLuint );
- void (*RasterPos4f)( GLcontext *,
- GLfloat x, GLfloat y, GLfloat z, GLfloat w );
- void (*ReadBuffer)( GLcontext *, GLenum );
- void (*ReadPixels)( GLcontext *, GLint, GLint, GLsizei, GLsizei, GLenum,
- GLenum, GLvoid * );
- void (*Rectf)( GLcontext *, GLfloat, GLfloat, GLfloat, GLfloat );
- GLint (*RenderMode)( GLcontext *, GLenum );
- void (*Rotatef)( GLcontext *, GLfloat, GLfloat, GLfloat, GLfloat );
- void (*Scalef)( GLcontext *, GLfloat, GLfloat, GLfloat );
- void (*Scissor)( GLcontext *, GLint, GLint, GLsizei, GLsizei);
- void (*SelectBuffer)( GLcontext *, GLsizei, GLuint * );
- void (*ShadeModel)( GLcontext *, GLenum );
- void (*StencilFunc)( GLcontext *, GLenum, GLint, GLuint );
- void (*StencilMask)( GLcontext *, GLuint );
- void (*StencilOp)( GLcontext *, GLenum, GLenum, GLenum );
-
- void (*TexEnvfv)( GLcontext *, GLenum, GLenum, const GLfloat * );
- void (*TexGenfv)( GLcontext *, GLenum coord, GLenum, const GLfloat * );
- void (*TexImage1D)( GLcontext *, GLenum, GLint, GLint, GLsizei,
- GLint, GLenum, GLenum, const GLvoid * );
- void (*TexImage2D)( GLcontext *, GLenum, GLint, GLint, GLsizei, GLsizei,
- GLint, GLenum, GLenum, const GLvoid *);
- void (*TexSubImage1D)( GLcontext *, GLenum, GLint, GLint, GLsizei,
- GLenum, GLenum, const GLvoid * );
- void (*TexSubImage2D)( GLcontext *, GLenum, GLint, GLint, GLint,
- GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
- void (*TexImage3D)(GLcontext *, GLenum, GLint, GLint, GLsizei, GLsizei,
- GLsizei, GLint, GLenum, GLenum, const GLvoid *);
- void (*TexSubImage3D)(GLcontext *, GLenum, GLint, GLint, GLint, GLint,
- GLsizei, GLsizei, GLsizei, GLenum, GLenum,
- const GLvoid *);
- void (*TexParameterfv)( GLcontext *, GLenum, GLenum, const GLfloat * );
- /* Translated implemented by Translatef */
- void (*Translatef)( GLcontext *, GLfloat, GLfloat, GLfloat );
-
- void (*Viewport)( GLcontext *, GLint, GLint, GLsizei, GLsizei );
-
- /* GL_MESA_window_pos extension */
- void (*WindowPos4fMESA)( GLcontext *, GLfloat, GLfloat, GLfloat, GLfloat );
-
- /* GL_MESA_resize_buffers extension */
- void (*ResizeBuffersMESA)( GLcontext * );
-
- /* GL_ARB_multitexture */
- void (*ActiveTexture)( GLcontext *, GLenum );
- void (*ClientActiveTexture)( GLcontext *, GLenum );
+/* Data structure for color tables */
+struct gl_color_table {
+ GLubyte Table[4 * MAX_TEXTURE_PALETTE_SIZE];
+ GLuint Size; /* number of entries (rows) in table */
+ GLenum Format;
+ GLenum IntFormat;
};
-typedef void (*render_func)( struct vertex_buffer *VB,
- GLuint start,
- GLuint count,
- GLuint parity );
-
-
-
-
-
/* This has to included here. */
#include "dd.h"
@@ -597,7 +365,6 @@ struct gl_colorbuffer_attrib {
struct gl_current_attrib {
-
/* KW: These values valid only when the VB is flushed.
*/
GLuint Flag; /* Contains size information */
@@ -959,10 +726,7 @@ struct gl_texture_object {
struct gl_texture_image *Image[MAX_TEXTURE_LEVELS];
/* GL_EXT_paletted_texture */
- GLubyte Palette[MAX_TEXTURE_PALETTE_SIZE*4];
- GLuint PaletteSize;
- GLenum PaletteIntFormat;
- GLenum PaletteFormat;
+ struct gl_color_table Palette;
/* For device driver: */
GLboolean Dirty; /* Is this texture object in dirty list? */
@@ -1041,11 +805,8 @@ struct gl_texture_attrib {
struct gl_texture_object *Proxy3D;
/* GL_EXT_shared_texture_palette */
- GLboolean SharedPalette;
- GLubyte Palette[MAX_TEXTURE_PALETTE_SIZE*4];
- GLuint PaletteSize;
- GLenum PaletteIntFormat;
- GLenum PaletteFormat;
+ GLboolean SharedPalette;
+ struct gl_color_table Palette;
};
@@ -1352,7 +1113,6 @@ struct gl_1d_map {
GLuint Order; /* Number of control points */
GLfloat u1, u2, du; /* u1, u2, 1.0/(u2-u1) */
GLfloat *Points; /* Points to contiguous control points */
- GLboolean Retain; /* Reference counter */
};
@@ -1365,7 +1125,6 @@ struct gl_2d_map {
GLfloat u1, u2, du;
GLfloat v1, v2, dv;
GLfloat *Points; /* Points to contiguous control points */
- GLboolean Retain; /* Reference counter */
};
@@ -1403,8 +1162,8 @@ struct gl_evaluators {
*/
struct gl_shared_state {
GLint RefCount; /* Reference count */
- struct HashTable *DisplayList; /* Display lists hash table */
- struct HashTable *TexObjects; /* Texture objects hash table */
+ struct _mesa_HashTable *DisplayList; /* Display lists hash table */
+ struct _mesa_HashTable *TexObjects; /* Texture objects hash table */
struct gl_texture_object *TexObjectList;/* Linked list of texture objects */
struct gl_texture_object *DirtyTexObjList; /* List of dirty tex objects */
@@ -1449,18 +1208,23 @@ struct gl_visual {
struct gl_frame_buffer {
GLvisual *Visual; /* The corresponding visual */
- GLint Width; /* Width of frame buffer in pixels */
- GLint Height; /* Height of frame buffer in pixels */
+ GLint Width, Height; /* size of frame buffer in pixels */
+ GLboolean UseSoftwareDepthBuffer;
+ GLboolean UseSoftwareAccumBuffer;
+ GLboolean UseSoftwareStencilBuffer;
+ GLboolean UseSoftwareAlphaBuffers;
+
+ /* Software depth (aka Z) buffer */
GLdepth *Depth; /* array [Width*Height] of GLdepth values */
- /* Stencil buffer */
+ /* Software stencil buffer */
GLstencil *Stencil; /* array [Width*Height] of GLstencil values */
- /* Accumulation buffer */
+ /* Software accumulation buffer */
GLaccum *Accum; /* array [4*Width*Height] of GLaccum values */
- /* Software alpha planes: */
+ /* Software alpha planes */
GLubyte *FrontLeftAlpha; /* array [Width*Height] of GLubyte */
GLubyte *BackLeftAlpha; /* array [Width*Height] of GLubyte */
GLubyte *FrontRightAlpha; /* array [Width*Height] of GLubyte */
@@ -1564,7 +1328,6 @@ struct gl_extensions {
#define DD_TRI_CULL_FRONT_BACK 0x400000 /* not supported by most drivers */
#define DD_Z_NEVER 0x800000
#define DD_STENCIL 0x1000000
-#define DD_CLIP_FOG_COORD 0x2000000
#define DD_SW_SETUP (DD_TRI_CULL| \
DD_TRI_CULL_FRONT_BACK| \
@@ -1768,7 +1531,6 @@ typedef union node Node;
#define VERT_EVAL_P1 0x4000000 /* */
#define VERT_EVAL_P2 0x8000000 /* */
#define VERT_FLOAT_RGBA 0x10000000 /* allow partial support for this */
-#define VERT_FOG_COORD 0x20000000 /* internal use only, currently */
#define VERT_EYE VERT_BEGIN /* for pipeline management & cva */
#define VERT_WIN VERT_END /* some overlaps can be tolerated */
@@ -1819,7 +1581,7 @@ typedef union node Node;
#define VERT_DATA (VERT_TEX0_ANY|VERT_TEX1_ANY|VERT_RGBA| \
VERT_INDEX|VERT_EDGE|VERT_NORM| \
VERT_OBJ_ANY|VERT_MATERIAL|VERT_ELT| \
- VERT_EVAL_ANY|VERT_FOG_COORD)
+ VERT_EVAL_ANY)
#define VERT_TO_PIPE (~VERT_END_VB)
@@ -1858,12 +1620,13 @@ struct gl_context {
struct gl_shared_state *Shared;
/* API function pointer tables */
- struct gl_api_table API; /* For api.c */
- struct gl_api_table Save; /* Display list save funcs */
- struct gl_api_table Exec; /* Execute funcs */
+ struct _glapi_table Save; /* Display list save funcs */
+ struct _glapi_table Exec; /* Execute funcs */
+ struct _glapi_table *CurrentDispatch; /* == Save or Exec !! */
GLvisual *Visual;
- GLframebuffer *Buffer;
+ GLframebuffer *DrawBuffer; /* buffer for writing */
+ GLframebuffer *ReadBuffer; /* buffer for reading */
/* Driver function pointer table */
struct dd_function_table Driver;
@@ -2056,6 +1819,7 @@ struct gl_context {
GLdouble SwapTime; /* seconds spent in swap-buffers */
#endif
+
/* Should 3Dfx Glide driver catch signals? */
GLboolean CatchSignals;
@@ -2089,8 +1853,7 @@ enum _verbose {
VERBOSE_API = 0x40,
VERBOSE_TRIANGLE_CHECKS = 0x80,
VERBOSE_CULL = 0x100,
- VERBOSE_DISPLAY_LIST = 0x200,
- VERBOSE_LIGHTING = 0x400
+ VERBOSE_DISPLAY_LIST = 0x200
};
diff --git a/xc/extras/Mesa/src/varray.c b/xc/extras/Mesa/src/varray.c
index b73c89e61..68578a680 100644
--- a/xc/extras/Mesa/src/varray.c
+++ b/xc/extras/Mesa/src/varray.c
@@ -1,10 +1,10 @@
-/* $Id: varray.c,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: varray.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -27,15 +27,8 @@
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
-#include "api.h"
#include "cva.h"
#include "enable.h"
#include "enums.h"
@@ -54,24 +47,14 @@
#include "vbindirect.h"
#include "vbxform.h"
#include "xform.h"
-#ifdef XFree86Server
-#include "GL/xf86glx.h"
-#endif
#endif
-#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) && !defined(GLX_USE_DLOPEN)
-#define NEED_MESA_FUNCS_WRAPPED
-#include "mesa_api.h"
-#endif
-void GLAPIENTRY glVertexPointer(CTX_ARG GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr )
+void
+_mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
{
- GLcontext *ctx;
- GET_CONTEXT;
- CHECK_CONTEXT;
- ctx = CC;
+ GET_CURRENT_CONTEXT(ctx);
if (size<2 || size>4) {
gl_error( ctx, GL_INVALID_VALUE, "glVertexPointer(size)" );
@@ -120,13 +103,10 @@ void GLAPIENTRY glVertexPointer(CTX_ARG GLint size, GLenum type, GLsizei stride,
-void GLAPIENTRY glNormalPointer(CTX_ARG GLenum type, GLsizei stride,
- const GLvoid *ptr )
+void
+_mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr )
{
- GLcontext *ctx;
- GET_CONTEXT;
- CHECK_CONTEXT;
- ctx = CC;
+ GET_CURRENT_CONTEXT(ctx);
if (stride<0) {
gl_error( ctx, GL_INVALID_VALUE, "glNormalPointer(stride)" );
@@ -172,13 +152,11 @@ void GLAPIENTRY glNormalPointer(CTX_ARG GLenum type, GLsizei stride,
-void GLAPIENTRY glColorPointer(CTX_ARG GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr )
+void
+_mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
{
- GLcontext *ctx;
- GET_CONTEXT;
- CHECK_CONTEXT;
- ctx = CC;
+ GET_CURRENT_CONTEXT(ctx);
+
if (size<3 || size>4) {
gl_error( ctx, GL_INVALID_VALUE, "glColorPointer(size)" );
return;
@@ -237,13 +215,10 @@ void GLAPIENTRY glColorPointer(CTX_ARG GLint size, GLenum type, GLsizei stride,
-void GLAPIENTRY glIndexPointer(CTX_ARG GLenum type, GLsizei stride,
- const GLvoid *ptr )
+void
+_mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
{
- GLcontext *ctx;
- GET_CONTEXT;
- CHECK_CONTEXT;
- ctx = CC;
+ GET_CURRENT_CONTEXT(ctx);
if (stride<0) {
gl_error( ctx, GL_INVALID_VALUE, "glIndexPointer(stride)" );
@@ -284,16 +259,12 @@ void GLAPIENTRY glIndexPointer(CTX_ARG GLenum type, GLsizei stride,
-void GLAPIENTRY glTexCoordPointer(CTX_ARG GLint size, GLenum type,
- GLsizei stride, const GLvoid *ptr )
+void
+_mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
{
+ GET_CURRENT_CONTEXT(ctx);
GLuint texUnit;
- GLcontext *ctx;
- GET_CONTEXT;
- CHECK_CONTEXT;
- ctx = CC;
-
texUnit = ctx->Array.ActiveTexture;
if (size<1 || size>4) {
@@ -346,14 +317,11 @@ void GLAPIENTRY glTexCoordPointer(CTX_ARG GLint size, GLenum type,
-void GLAPIENTRY glEdgeFlagPointer(CTX_ARG GLsizei stride, const void *vptr )
+void
+_mesa_EdgeFlagPointer(GLsizei stride, const void *vptr)
{
+ GET_CURRENT_CONTEXT(ctx);
const GLboolean *ptr = (GLboolean *)vptr;
-
- GLcontext *ctx;
- GET_CONTEXT;
- CHECK_CONTEXT;
- ctx = CC;
if (stride<0) {
gl_error( ctx, GL_INVALID_VALUE, "glEdgeFlagPointer(stride)" );
@@ -373,9 +341,10 @@ void GLAPIENTRY glEdgeFlagPointer(CTX_ARG GLsizei stride, const void *vptr )
}
+#if 0
/* Called only from gl_DrawElements
*/
-void gl_CVAEltPointer( GLcontext *ctx, GLenum type, const GLvoid *ptr )
+static void gl_CVAEltPointer( GLcontext *ctx, GLenum type, const GLvoid *ptr )
{
switch (type) {
case GL_UNSIGNED_BYTE:
@@ -397,7 +366,7 @@ void gl_CVAEltPointer( GLcontext *ctx, GLenum type, const GLvoid *ptr )
ctx->CVA.EltFunc = gl_trans_1ui_tab[TYPE_IDX(type)];
ctx->Array.NewArrayState |= VERT_ELT; /* ??? */
}
-
+#endif
/* KW: Batch function to exec all the array elements in the input
@@ -470,8 +439,43 @@ void gl_exec_array_elements( GLcontext *ctx, struct immediate *IM,
-void gl_DrawArrays( GLcontext *ctx, GLenum mode, GLint start, GLsizei count )
+/* Enough funny business going on in here it might be quicker to use a
+ * function pointer.
+ */
+#define ARRAY_ELT( IM, i ) \
+{ \
+ GLuint count = IM->Count; \
+ IM->Elt[count] = i; \
+ IM->Flag[count] = ((IM->Flag[count] & IM->ArrayAndFlags) | \
+ VERT_ELT); \
+ IM->FlushElt |= IM->ArrayEltFlush; \
+ IM->Count = count += IM->ArrayIncr; \
+ if (count == VB_MAX) \
+ IM->maybe_transform_vb( IM ); \
+}
+
+
+void
+_mesa_ArrayElement( GLint i )
+{
+ GET_IMMEDIATE;
+ ARRAY_ELT( IM, i );
+}
+
+
+static void
+gl_ArrayElement( GLcontext *CC, GLint i )
+{
+ struct immediate *im = CC->input;
+ ARRAY_ELT( im, i );
+}
+
+
+
+void
+_mesa_DrawArrays(GLenum mode, GLint start, GLsizei count)
{
+ GET_CURRENT_CONTEXT(ctx);
struct vertex_buffer *VB = ctx->VB;
GLint i;
@@ -519,7 +523,7 @@ void gl_DrawArrays( GLcontext *ctx, GLenum mode, GLint start, GLsizei count )
* just ensures that type and stride come out right.
*/
IM->v.Obj.size = ctx->Array.Vertex.Size;
-
+
if (required & VERT_RGBA)
{
Color = &ctx->Array.Color;
@@ -592,7 +596,7 @@ void gl_DrawArrays( GLcontext *ctx, GLenum mode, GLint start, GLsizei count )
VB->NextPrimitive = IM->NextPrimitive;
VB->MaterialMask = IM->MaterialMask;
VB->Material = IM->Material;
- VB->BoundsPtr = 0;
+ VB->BoundsPtr = 0;
while (remaining > 0) {
GLint vbspace = VB_MAX - VB_START;
@@ -676,7 +680,6 @@ void gl_DrawArrays( GLcontext *ctx, GLenum mode, GLint start, GLsizei count )
VB->NextPrimitive[VB->CopyStart] = VB->Count;
VB->Primitive[VB->CopyStart] = mode;
- ctx->Array.Flag[count] |= VERT_END_VB;
/* Transform and render.
*/
@@ -796,16 +799,13 @@ static GLuint natural_stride[0x10] =
0 /* f */
};
-void GLAPIENTRY glDrawElements(CTX_ARG GLenum mode, GLsizei count,
- GLenum type, const GLvoid *indices )
+
+void
+_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{
- GLcontext *ctx;
+ GET_CURRENT_CONTEXT(ctx);
struct gl_cva *cva;
- GET_CONTEXT;
- CHECK_CONTEXT;
- ctx = CC;
-
cva = &ctx->CVA;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDrawElements");
@@ -815,7 +815,7 @@ void GLAPIENTRY glDrawElements(CTX_ARG GLenum mode, GLsizei count,
return;
}
- if (mode < 0 || mode > GL_POLYGON) {
+ if (mode > GL_POLYGON) {
gl_error( ctx, GL_INVALID_ENUM, "glDrawArrays(mode)" );
return;
}
@@ -915,10 +915,10 @@ void GLAPIENTRY glDrawElements(CTX_ARG GLenum mode, GLsizei count,
-void GLAPIENTRY glInterleavedArrays(CTX_ARG GLenum format, GLsizei stride,
- const GLvoid *pointer )
+void
+_mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer)
{
- GLcontext *ctx;
+ GET_CURRENT_CONTEXT(ctx);
GLboolean tflag, cflag, nflag; /* enable/disable flags */
GLint tcomps, ccomps, vcomps; /* components per texcoord, color, vertex */
@@ -928,11 +928,6 @@ void GLAPIENTRY glInterleavedArrays(CTX_ARG GLenum format, GLsizei stride,
GLint c, f;
GLint coordUnitSave;
- GET_CONTEXT;
- CHECK_CONTEXT;
- ctx = CC;
-
-
f = sizeof(GLfloat);
c = f * ((4*sizeof(GLubyte) + (f-1)) / f);
@@ -1056,8 +1051,8 @@ void GLAPIENTRY glInterleavedArrays(CTX_ARG GLenum format, GLsizei stride,
stride = defstride;
}
- gl_DisableClientState( ctx, GL_EDGE_FLAG_ARRAY );
- gl_DisableClientState( ctx, GL_INDEX_ARRAY );
+ _mesa_DisableClientState( GL_EDGE_FLAG_ARRAY );
+ _mesa_DisableClientState( GL_INDEX_ARRAY );
/* Texcoords */
coordUnitSave = ctx->Array.ActiveTexture;
@@ -1065,63 +1060,61 @@ void GLAPIENTRY glInterleavedArrays(CTX_ARG GLenum format, GLsizei stride,
GLint i;
GLint factor = ctx->Array.TexCoordInterleaveFactor;
for (i = 0; i < factor; i++) {
- gl_ClientActiveTexture( ctx, (GLenum) (GL_TEXTURE0_ARB + i) );
- gl_EnableClientState( ctx, GL_TEXTURE_COORD_ARRAY );
- glTexCoordPointer(CTX_PRM tcomps, GL_FLOAT, stride,
+ _mesa_ClientActiveTextureARB( (GLenum) (GL_TEXTURE0_ARB + i) );
+ _mesa_EnableClientState( GL_TEXTURE_COORD_ARRAY );
+ glTexCoordPointer( tcomps, GL_FLOAT, stride,
(GLubyte *) pointer + i * coffset );
}
for (i = factor; i < ctx->Const.MaxTextureUnits; i++) {
- gl_ClientActiveTexture( ctx, (GLenum) (GL_TEXTURE0_ARB + i) );
- gl_DisableClientState( ctx, GL_TEXTURE_COORD_ARRAY );
+ _mesa_ClientActiveTextureARB( (GLenum) (GL_TEXTURE0_ARB + i) );
+ _mesa_DisableClientState( GL_TEXTURE_COORD_ARRAY );
}
}
else {
GLint i;
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
- gl_ClientActiveTexture( ctx, (GLenum) (GL_TEXTURE0_ARB + i) );
- gl_DisableClientState( ctx, GL_TEXTURE_COORD_ARRAY );
+ _mesa_ClientActiveTextureARB( (GLenum) (GL_TEXTURE0_ARB + i) );
+ _mesa_DisableClientState( GL_TEXTURE_COORD_ARRAY );
}
}
/* Restore texture coordinate unit index */
- gl_ClientActiveTexture( ctx, (GLenum) (GL_TEXTURE0_ARB + coordUnitSave) );
+ _mesa_ClientActiveTextureARB( (GLenum) (GL_TEXTURE0_ARB + coordUnitSave) );
/* Color */
if (cflag) {
- gl_EnableClientState( ctx, GL_COLOR_ARRAY );
- glColorPointer(CTX_PRM ccomps, ctype, stride,
+ _mesa_EnableClientState( GL_COLOR_ARRAY );
+ glColorPointer( ccomps, ctype, stride,
(GLubyte*) pointer + coffset );
}
else {
- gl_DisableClientState( ctx, GL_COLOR_ARRAY );
+ _mesa_DisableClientState( GL_COLOR_ARRAY );
}
/* Normals */
if (nflag) {
- gl_EnableClientState( ctx, GL_NORMAL_ARRAY );
- glNormalPointer(CTX_PRM GL_FLOAT, stride,
+ _mesa_EnableClientState( GL_NORMAL_ARRAY );
+ glNormalPointer( GL_FLOAT, stride,
(GLubyte*) pointer + noffset );
}
else {
- gl_DisableClientState( ctx, GL_NORMAL_ARRAY );
+ _mesa_DisableClientState( GL_NORMAL_ARRAY );
}
- gl_EnableClientState( ctx, GL_VERTEX_ARRAY );
- glVertexPointer(CTX_PRM vcomps, GL_FLOAT, stride,
+ _mesa_EnableClientState( GL_VERTEX_ARRAY );
+ glVertexPointer( vcomps, GL_FLOAT, stride,
(GLubyte *) pointer + voffset );
}
-void GLAPIENTRY glDrawRangeElements(CTX_ARG GLenum mode, GLuint start,
- GLuint end, GLsizei count,
- GLenum type, const GLvoid *indices )
+void
+_mesa_DrawRangeElements(GLenum mode, GLuint start,
+ GLuint end, GLsizei count,
+ GLenum type, const GLvoid *indices)
{
- GLcontext *ctx;
- GET_CONTEXT;
- CHECK_CONTEXT;
- ctx = CC;
+ GET_CURRENT_CONTEXT(ctx);
if (end < start) {
gl_error(ctx, GL_INVALID_VALUE, "glDrawRangeElements( end < start )");
@@ -1129,11 +1122,11 @@ void GLAPIENTRY glDrawRangeElements(CTX_ARG GLenum mode, GLuint start,
}
if (!ctx->Array.LockCount && 2*count > (GLint) 3*(end-start)) {
- glLockArraysEXT(CTX_PRM start, end );
- glDrawElements(CTX_PRM mode, count, type, indices );
- glUnlockArraysEXT(CTX_VPRM );
+ glLockArraysEXT( start, end );
+ glDrawElements( mode, count, type, indices );
+ glUnlockArraysEXT();
} else {
- glDrawElements(CTX_PRM mode, count, type, indices );
+ glDrawElements( mode, count, type, indices );
}
}
diff --git a/xc/extras/Mesa/src/varray.h b/xc/extras/Mesa/src/varray.h
index a04adb309..755b4fee2 100644
--- a/xc/extras/Mesa/src/varray.h
+++ b/xc/extras/Mesa/src/varray.h
@@ -1,10 +1,10 @@
-/* $Id: varray.h,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: varray.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -32,70 +32,71 @@
#include "types.h"
-extern void gl_VertexPointer( GLcontext *ctx,
- GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr );
+extern void
+_mesa_VertexPointer(GLint size, GLenum type, GLsizei stride,
+ const GLvoid *ptr);
-extern void gl_NormalPointer( GLcontext *ctx,
- GLenum type, GLsizei stride, const GLvoid *ptr );
+extern void
+_mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr);
-extern void gl_ColorPointer( GLcontext *ctx,
- GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr );
+extern void
+_mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
-extern void gl_IndexPointer( GLcontext *ctx,
- GLenum type, GLsizei stride,
- const GLvoid *ptr );
+extern void
+_mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr);
-extern void gl_TexCoordPointer( GLcontext *ctx,
- GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr );
+extern void
+_mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
+ const GLvoid *ptr);
-extern void gl_EdgeFlagPointer( GLcontext *ctx,
- GLsizei stride, const GLboolean *ptr );
+extern void
+_mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr);
-extern void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params );
+extern void
+_mesa_ArrayElement( GLint );
+extern void
+_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count);
-extern void gl_DrawArrays( GLcontext *ctx,
- GLenum mode, GLint first, GLsizei count );
-extern void gl_save_DrawArrays( GLcontext *ctx,
- GLenum mode, GLint first, GLsizei count );
+extern void
+_mesa_save_DrawArrays(GLenum mode, GLint first, GLsizei count);
-extern void gl_DrawElements( GLcontext *ctx,
- GLenum mode, GLsizei count,
- GLenum type, const GLvoid *indices );
+extern void
+_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices);
+
-extern void gl_save_DrawElements( GLcontext *ctx,
- GLenum mode, GLsizei count,
- GLenum type, const GLvoid *indices );
+extern void
+_mesa_save_DrawElements(GLenum mode, GLsizei count,
+ GLenum type, const GLvoid *indices);
-extern void gl_InterleavedArrays( GLcontext *ctx,
- GLenum format, GLsizei stride,
- const GLvoid *pointer );
+extern void
+_mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer);
-extern void gl_save_InterleavedArrays( GLcontext *ctx,
- GLenum format, GLsizei stride,
- const GLvoid *pointer );
+extern void
+_mesa_save_InterleavedArrays(GLenum format, GLsizei stride,
+ const GLvoid *pointer);
-extern void gl_DrawRangeElements( GLcontext *ctx, GLenum mode, GLuint start,
- GLuint end, GLsizei count, GLenum type,
- const GLvoid *indices );
+extern void
+_mesa_DrawRangeElements(GLenum mode, GLuint start,
+ GLuint end, GLsizei count, GLenum type,
+ const GLvoid *indices);
-extern void gl_save_DrawRangeElements( GLcontext *ctx, GLenum mode,
- GLuint start, GLuint end, GLsizei count,
- GLenum type, const GLvoid *indices );
+extern void
+_mesa_save_DrawRangeElements(GLenum mode,
+ GLuint start, GLuint end, GLsizei count,
+ GLenum type, const GLvoid *indices );
extern void gl_exec_array_elements( GLcontext *ctx,
@@ -105,4 +106,5 @@ extern void gl_exec_array_elements( GLcontext *ctx,
extern void gl_update_client_state( GLcontext *ctx );
+
#endif
diff --git a/xc/extras/Mesa/src/vb.c b/xc/extras/Mesa/src/vb.c
index 932bcf243..a18b6c907 100644
--- a/xc/extras/Mesa/src/vb.c
+++ b/xc/extras/Mesa/src/vb.c
@@ -1,8 +1,8 @@
-/* $Id: vb.c,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: vb.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,18 +25,11 @@
*/
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <stdlib.h>
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
+#include "mem.h"
#include "types.h"
#include "vb.h"
#include "vbxform.h"
@@ -262,8 +255,9 @@ struct immediate *gl_immediate_alloc( GLcontext *ctx )
return IM;
}
- IM= (struct immediate *) MALLOC(sizeof(*IM));
- if (!IM) return 0;
+ IM = MALLOC_STRUCT(immediate);
+ if (!IM)
+ return 0;
IM->id = id++;
IM->ref_count = 1;
diff --git a/xc/extras/Mesa/src/vb.h b/xc/extras/Mesa/src/vb.h
index f7d73d4d7..3783a370a 100644
--- a/xc/extras/Mesa/src/vb.h
+++ b/xc/extras/Mesa/src/vb.h
@@ -1,8 +1,8 @@
-/* $Id: vb.h,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: vb.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -26,8 +26,6 @@
-
-
/* OVERVIEW:
*
* The vertices between glBegin() and glEnd() are accumulated in the
@@ -45,15 +43,12 @@
* described above.
*/
+
#ifndef VB_H
#define VB_H
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-#include "GL/gl.h"
+#include "glheader.h"
#include "vector.h"
#include "matrix.h"
#include "config.h"
diff --git a/xc/extras/Mesa/src/vbcull.c b/xc/extras/Mesa/src/vbcull.c
index 605dbf8f2..4d5544893 100644
--- a/xc/extras/Mesa/src/vbcull.c
+++ b/xc/extras/Mesa/src/vbcull.c
@@ -1,8 +1,8 @@
-/* $Id: vbcull.c,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: vbcull.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -32,13 +32,10 @@
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "macros.h"
+#include "mem.h"
#include "types.h"
#include "vb.h"
#include "vbcull.h"
diff --git a/xc/extras/Mesa/src/vbcull.h b/xc/extras/Mesa/src/vbcull.h
index 0ac1e00c3..3baa3ec77 100644
--- a/xc/extras/Mesa/src/vbcull.h
+++ b/xc/extras/Mesa/src/vbcull.h
@@ -1,4 +1,4 @@
-/* $Id: vbcull.h,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: vbcull.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/vbfill.c b/xc/extras/Mesa/src/vbfill.c
index af8801b4d..5928a462d 100644
--- a/xc/extras/Mesa/src/vbfill.c
+++ b/xc/extras/Mesa/src/vbfill.c
@@ -1,8 +1,8 @@
-/* $Id: vbfill.c,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: vbfill.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,17 +25,10 @@
*/
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <math.h>
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "enums.h"
#include "light.h"
@@ -63,17 +56,27 @@
*/
+void
+_mesa_Begin(GLenum mode )
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (mode > GL_POLYGON) {
+ gl_compile_error( ctx, GL_INVALID_ENUM, "glBegin" );
+ return;
+ }
+
+ gl_Begin(ctx, mode);
+}
+
+
void gl_Begin( GLcontext *ctx, GLenum p )
{
struct immediate *IM = ctx->input;
GLuint inflags, state;
- if (MESA_VERBOSE&VERBOSE_API) {
- if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
- fprintf(stderr, "glBegin(IM %d) %s\n", IM->id, gl_lookup_enum_by_nr(p));
- else
- fprintf(stderr, "<");
- }
+ if (MESA_VERBOSE&VERBOSE_API)
+ fprintf(stderr, "glBegin(IM %d) %s\n", IM->id, gl_lookup_enum_by_nr(p));
if (ctx->NewState)
gl_update_state( ctx ); /* should already be flushed */
@@ -121,3 +124,1559 @@ void gl_Begin( GLcontext *ctx, GLenum p )
+/* KW: Both streams now go to the outside-begin-end state. Raise
+ * errors for either stream if it was not in the inside state.
+ */
+void
+_mesa_End(void)
+{
+ GLuint state;
+ GLuint inflags;
+ GET_IMMEDIATE;
+
+
+ state = IM->BeginState;
+ inflags = (~state) & (VERT_BEGIN_0|VERT_BEGIN_1);
+ state |= inflags << 2; /* errors */
+
+ if (MESA_VERBOSE&VERBOSE_API)
+ fprintf(stderr, "glEnd(IM %d), BeginState is %x, errors %x\n",
+ IM->id, state,
+ inflags<<2);
+
+
+ if (inflags != (VERT_BEGIN_0|VERT_BEGIN_1))
+ {
+ GLuint count = IM->Count;
+ GLuint last = IM->LastPrimitive;
+
+ state &= ~(VERT_BEGIN_0|VERT_BEGIN_1); /* update state */
+ IM->Flag[count] |= VERT_END;
+ IM->NextPrimitive[IM->LastPrimitive] = count;
+ IM->LastPrimitive = count;
+ IM->Primitive[count] = GL_POLYGON+1;
+
+ if (IM->FlushElt) {
+ gl_exec_array_elements( IM->backref, IM, last, count );
+ IM->FlushElt = 0;
+ }
+ }
+
+ if (MESA_VERBOSE&VERBOSE_API)
+ fprintf(stderr, "in glEnd final state %x\n", state);
+
+ IM->BeginState = state;
+
+ if ((MESA_DEBUG_FLAGS&DEBUG_ALWAYS_FLUSH))
+ IM->maybe_transform_vb( IM );
+}
+
+
+void gl_End( GLcontext *ctx )
+{
+ struct immediate *IM = ctx->input;
+ GLuint state = IM->BeginState;
+ GLuint inflags = (~state) & (VERT_BEGIN_0|VERT_BEGIN_1);
+
+ state |= inflags << 2; /* errors */
+
+ if (inflags != (VERT_BEGIN_0|VERT_BEGIN_1))
+ {
+ GLuint count = IM->Count;
+ GLuint last = IM->LastPrimitive;
+
+ state &= ~(VERT_BEGIN_0|VERT_BEGIN_1); /* update state */
+ IM->Flag[count] |= VERT_END;
+ IM->NextPrimitive[IM->LastPrimitive] = count;
+ IM->LastPrimitive = count;
+ IM->Primitive[count] = GL_POLYGON+1;
+
+ if (IM->FlushElt) {
+ gl_exec_array_elements( ctx, IM, last, count );
+ IM->FlushElt = 0;
+ }
+ }
+
+ IM->BeginState = state;
+
+ /* You can set this flag to get the old 'flush vb on glEnd()'
+ * behaviour.
+ */
+ if ((MESA_DEBUG_FLAGS&DEBUG_ALWAYS_FLUSH))
+ IM->maybe_transform_vb( IM );
+}
+
+
+
+
+
+/* KW: Again, a stateless implementation of these functions. The big
+ * news here is the impact on color material. This was previously
+ * handled by swaping the function pointers that these API's used to
+ * call. This is no longer possible, and we have to pick up the
+ * pieces later on and make them work with either color-color, or
+ * color-material.
+ *
+ * But in truth, this is not a bad thing, because it was necessary
+ * to implement that mechanism to get good performance from
+ * color-material and vertex arrays.
+ */
+#define COLOR( IM, r,g,b,a ) \
+{ \
+ GLuint count = IM->Count; \
+ IM->Flag[count] |= VERT_RGBA; \
+ IM->Color[count][0] = r; \
+ IM->Color[count][1] = g; \
+ IM->Color[count][2] = b; \
+ IM->Color[count][3] = a; \
+}
+
+#if 0
+#define COLOR4F( IM, r,g,b,a ) \
+{ \
+ GLuint count = IM->Count; \
+ IM->Flag[count] |= VERT_RGBA | VERT_FLOAT_RGBA; \
+ IM->FloatColor[count][0] = r; \
+ IM->FloatColor[count][1] = g; \
+ IM->FloatColor[count][2] = b; \
+ IM->FloatColor[count][3] = a; \
+}
+#else
+#define COLOR4F(IM, r, g, b, a) \
+{ \
+ GLubyte col[4]; \
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[0], r); \
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[1], g); \
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[2], b); \
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[3], a); \
+ COLORV( IM, col ); \
+}
+#endif
+
+#define COLORV( IM, v ) \
+{ \
+ GLuint count = IM->Count; \
+ IM->Flag[count] |= VERT_RGBA; \
+ COPY_4UBV(IM->Color[count], v); \
+}
+
+
+void
+_mesa_Color3b(GLbyte red, GLbyte green, GLbyte blue )
+{
+ GET_IMMEDIATE;
+ COLOR( IM,
+ BYTE_TO_UBYTE(red),
+ BYTE_TO_UBYTE(green),
+ BYTE_TO_UBYTE(blue),
+ 255 );
+}
+
+
+void
+_mesa_Color3d(GLdouble red, GLdouble green, GLdouble blue )
+{
+ GLubyte col[4];
+ GLfloat r = red;
+ GLfloat g = green;
+ GLfloat b = blue;
+ GET_IMMEDIATE;
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[0], r);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[1], g);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[2], b);
+ col[3] = 255;
+ COLORV( IM, col );
+
+/* COLOR4F( IM, red, green, blue, 1.0 ); */
+}
+
+
+void
+_mesa_Color3f(GLfloat red, GLfloat green, GLfloat blue )
+{
+ GLubyte col[4];
+ GET_IMMEDIATE;
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[0], red);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[1], green);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[2], blue);
+ col[3] = 255;
+ COLORV( IM, col );
+
+/* COLOR4F( IM, red, green, blue, 1.0 ); */
+}
+
+
+void
+_mesa_Color3i(GLint red, GLint green, GLint blue )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, INT_TO_UBYTE(red),
+ INT_TO_UBYTE(green),
+ INT_TO_UBYTE(blue),
+ 255);
+}
+
+
+void
+_mesa_Color3s(GLshort red, GLshort green, GLshort blue )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, SHORT_TO_UBYTE(red),
+ SHORT_TO_UBYTE(green),
+ SHORT_TO_UBYTE(blue),
+ 255);
+}
+
+
+void
+_mesa_Color3ub(GLubyte red, GLubyte green, GLubyte blue )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, red, green, blue, 255 );
+}
+
+
+void
+_mesa_Color3ui(GLuint red, GLuint green, GLuint blue )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, UINT_TO_UBYTE(red),
+ UINT_TO_UBYTE(green),
+ UINT_TO_UBYTE(blue),
+ 255 );
+}
+
+
+void
+_mesa_Color3us(GLushort red, GLushort green, GLushort blue )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, USHORT_TO_UBYTE(red), USHORT_TO_UBYTE(green),
+ USHORT_TO_UBYTE(blue),
+ 255 );
+}
+
+
+void
+_mesa_Color4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, BYTE_TO_UBYTE(red), BYTE_TO_UBYTE(green),
+ BYTE_TO_UBYTE(blue), BYTE_TO_UBYTE(alpha) );
+}
+
+
+void
+_mesa_Color4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha )
+{
+ GLubyte col[4];
+ GLfloat r = red;
+ GLfloat g = green;
+ GLfloat b = blue;
+ GLfloat a = alpha;
+ GET_IMMEDIATE;
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[0], r);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[1], g);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[2], b);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[3], a);
+ COLORV( IM, col );
+
+/* COLOR4F( IM, red, green, blue, alpha ); */
+}
+
+
+void
+_mesa_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
+{
+ GLubyte col[4];
+ GET_IMMEDIATE;
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[0], red);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[1], green);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[2], blue);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[3], alpha);
+ COLORV( IM, col );
+
+/* COLOR4F( IM, red, green, blue, alpha ); */
+}
+
+
+void
+_mesa_Color4i(GLint red, GLint green, GLint blue, GLint alpha )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, INT_TO_UBYTE(red), INT_TO_UBYTE(green),
+ INT_TO_UBYTE(blue), INT_TO_UBYTE(alpha) );
+}
+
+
+void
+_mesa_Color4s(GLshort red, GLshort green, GLshort blue, GLshort alpha )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, SHORT_TO_UBYTE(red), SHORT_TO_UBYTE(green),
+ SHORT_TO_UBYTE(blue), SHORT_TO_UBYTE(alpha) );
+}
+
+void
+_mesa_Color4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, red, green, blue, alpha );
+}
+
+void
+_mesa_Color4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, UINT_TO_UBYTE(red), UINT_TO_UBYTE(green),
+ UINT_TO_UBYTE(blue), UINT_TO_UBYTE(alpha) );
+}
+
+void
+_mesa_Color4us(GLushort red, GLushort green, GLushort blue, GLushort alpha )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, USHORT_TO_UBYTE(red), USHORT_TO_UBYTE(green),
+ USHORT_TO_UBYTE(blue), USHORT_TO_UBYTE(alpha) );
+}
+
+
+void
+_mesa_Color3bv(const GLbyte *v )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, BYTE_TO_UBYTE(v[0]), BYTE_TO_UBYTE(v[1]),
+ BYTE_TO_UBYTE(v[2]), 255 );
+}
+
+
+void
+_mesa_Color3dv(const GLdouble *v )
+{
+ GLubyte col[4];
+ GLfloat r = v[0];
+ GLfloat g = v[1];
+ GLfloat b = v[2];
+ GET_IMMEDIATE;
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[0], r);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[1], g);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[2], b);
+ col[3]= 255;
+ COLORV( IM, col );
+
+/* COLOR4F( IM, v[0], v[1], v[2], v[3] ); */
+}
+
+
+void
+_mesa_Color3fv(const GLfloat *v )
+{
+ GLubyte col[4];
+ GET_IMMEDIATE;
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[0], v[0]);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[1], v[1]);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[2], v[2]);
+ col[3] = 255;
+ COLORV( IM, col );
+
+/* COLOR4F( IM, v[0], v[1], v[2], v[3] ); */
+}
+
+
+void
+_mesa_Color3iv(const GLint *v )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, INT_TO_UBYTE(v[0]), INT_TO_UBYTE(v[1]),
+ INT_TO_UBYTE(v[2]), 255 );
+}
+
+
+void
+_mesa_Color3sv(const GLshort *v )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, SHORT_TO_UBYTE(v[0]), SHORT_TO_UBYTE(v[1]),
+ SHORT_TO_UBYTE(v[2]), 255 );
+}
+
+
+void
+_mesa_Color3ubv(const GLubyte *v )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, v[0], v[1], v[2], 255 );
+}
+
+
+void
+_mesa_Color3uiv(const GLuint *v )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, UINT_TO_UBYTE(v[0]), UINT_TO_UBYTE(v[1]),
+ UINT_TO_UBYTE(v[2]), 255 );
+}
+
+
+void
+_mesa_Color3usv(const GLushort *v )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, USHORT_TO_UBYTE(v[0]), USHORT_TO_UBYTE(v[1]),
+ USHORT_TO_UBYTE(v[2]), 255 );
+
+}
+
+
+void
+_mesa_Color4bv(const GLbyte *v )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, BYTE_TO_UBYTE(v[0]), BYTE_TO_UBYTE(v[1]),
+ BYTE_TO_UBYTE(v[2]), BYTE_TO_UBYTE(v[3]) );
+}
+
+
+void
+_mesa_Color4dv(const GLdouble *v )
+{
+ GLubyte col[4];
+ GLfloat r = v[0];
+ GLfloat g = v[1];
+ GLfloat b = v[2];
+ GLfloat a = v[3];
+ GET_IMMEDIATE;
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[0], r);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[1], g);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[2], b);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[3], a);
+ COLORV( IM, col );
+
+/* COLOR4F( IM, v[0], v[1], v[2], v[3] ); */
+}
+
+
+void
+_mesa_Color4fv(const GLfloat *v )
+{
+ GLubyte col[4];
+ GET_IMMEDIATE;
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[0], v[0]);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[1], v[1]);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[2], v[2]);
+ FLOAT_COLOR_TO_UBYTE_COLOR(col[3], v[3]);
+ COLORV( IM, col );
+
+/* COLOR4F( IM, v[0], v[1], v[2], v[3] ); */
+}
+
+
+void
+_mesa_Color4iv(const GLint *v )
+{
+ GET_IMMEDIATE;
+ COLOR( IM, INT_TO_UBYTE(v[0]), INT_TO_UBYTE(v[1]),
+ INT_TO_UBYTE(v[2]), INT_TO_UBYTE(v[3]) );
+}
+
+
+void
+_mesa_Color4sv(const GLshort *v)
+{
+ GET_IMMEDIATE;
+ COLOR( IM, SHORT_TO_UBYTE(v[0]), SHORT_TO_UBYTE(v[1]),
+ SHORT_TO_UBYTE(v[2]), SHORT_TO_UBYTE(v[3]) );
+}
+
+
+void
+_mesa_Color4ubv(const GLubyte *v)
+{
+ GET_IMMEDIATE;
+ COLORV( IM, v );
+}
+
+
+void
+_mesa_Color4uiv(const GLuint *v)
+{
+ GET_IMMEDIATE;
+ COLOR( IM, UINT_TO_UBYTE(v[0]), UINT_TO_UBYTE(v[1]),
+ UINT_TO_UBYTE(v[2]), UINT_TO_UBYTE(v[3]) );
+}
+
+
+void
+_mesa_Color4usv(const GLushort *v)
+{
+ GET_IMMEDIATE;
+ COLOR( IM, USHORT_TO_UBYTE(v[0]), USHORT_TO_UBYTE(v[1]),
+ USHORT_TO_UBYTE(v[2]), USHORT_TO_UBYTE(v[3]) );
+}
+
+
+
+
+void
+_mesa_EdgeFlag( GLboolean flag )
+{
+ GLuint count;
+ GET_IMMEDIATE;
+ count = IM->Count;
+ IM->EdgeFlag[count] = flag;
+ IM->Flag[count] |= VERT_EDGE;
+}
+
+
+void
+_mesa_EdgeFlagv( const GLboolean *flag )
+{
+ GLuint count;
+ GET_IMMEDIATE;
+ count = IM->Count;
+ IM->EdgeFlag[count] = *flag;
+ IM->Flag[count] |= VERT_EDGE;
+}
+
+
+
+#define INDEX( c ) \
+{ \
+ GLuint count; \
+ GET_IMMEDIATE; \
+ count = IM->Count; \
+ IM->Index[count] = c; \
+ IM->Flag[count] |= VERT_INDEX; \
+}
+
+
+void
+_mesa_Indexd( GLdouble c )
+{
+ INDEX( (GLuint) (GLint) c );
+}
+
+
+void
+_mesa_Indexf( GLfloat c )
+{
+ INDEX( (GLuint) (GLint) c );
+}
+
+
+void
+_mesa_Indexi( GLint c )
+{
+ INDEX( (GLuint) c );
+}
+
+
+void
+_mesa_Indexs( GLshort c )
+{
+ INDEX( (GLuint) c );
+}
+
+
+void
+_mesa_Indexub( GLubyte c )
+{
+ INDEX( (GLuint) c );
+}
+
+
+void
+_mesa_Indexdv( const GLdouble *c )
+{
+ INDEX( (GLuint) (GLint) *c );
+}
+
+
+void
+_mesa_Indexfv( const GLfloat *c )
+{
+ INDEX( (GLuint) (GLint) *c );
+}
+
+
+void
+_mesa_Indexiv( const GLint *c )
+{
+ INDEX( *c );
+}
+
+
+void
+_mesa_Indexsv( const GLshort *c )
+{
+ INDEX( (GLuint) (GLint) *c );
+}
+
+
+void
+_mesa_Indexubv( const GLubyte *c )
+{
+ INDEX( (GLuint) *c );
+}
+
+
+
+
+
+/* KW: Now that we build buffers for display lists the same way we
+ * fill the vb, we can do the work here without a second function
+ * call. The Flag member allows the identification of missing
+ * (ie shared) normals.
+ */
+#define NORMAL( x,y,z ) \
+{ \
+ GLuint count; \
+ GLfloat *normal; \
+ GET_IMMEDIATE; \
+ count = IM->Count; \
+ IM->Flag[count] |= VERT_NORM; \
+ normal = IM->Normal[count]; \
+ ASSIGN_3V(normal, x,y,z); \
+}
+
+
+void
+_mesa_Normal3b( GLbyte nx, GLbyte ny, GLbyte nz )
+{
+ NORMAL( BYTE_TO_FLOAT(nx), BYTE_TO_FLOAT(ny), BYTE_TO_FLOAT(nz) );
+}
+
+
+void
+_mesa_Normal3d( GLdouble nx, GLdouble ny, GLdouble nz )
+{
+ NORMAL(nx, ny, nz);
+}
+
+
+void
+_mesa_Normal3f( GLfloat nx, GLfloat ny, GLfloat nz )
+{
+ NORMAL(nx, ny, nz);
+}
+
+
+void
+_mesa_Normal3i( GLint nx, GLint ny, GLint nz )
+{
+ NORMAL( INT_TO_FLOAT(nx), INT_TO_FLOAT(ny), INT_TO_FLOAT(nz) );
+}
+
+
+void
+_mesa_Normal3s( GLshort nx, GLshort ny, GLshort nz )
+{
+ NORMAL( SHORT_TO_FLOAT(nx), SHORT_TO_FLOAT(ny), SHORT_TO_FLOAT(nz) );
+}
+
+
+void
+_mesa_Normal3bv( const GLbyte *v )
+{
+ NORMAL( BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]), BYTE_TO_FLOAT(v[2]) );
+}
+
+
+void
+_mesa_Normal3dv( const GLdouble *v )
+{
+ NORMAL( v[0], v[1], v[2] );
+}
+
+
+void
+_mesa_Normal3fv( const GLfloat *v )
+{
+ NORMAL( v[0], v[1], v[2] );
+}
+
+
+void
+_mesa_Normal3iv( const GLint *v )
+{
+ NORMAL( INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]), INT_TO_FLOAT(v[2]) );
+}
+
+
+void
+_mesa_Normal3sv( const GLshort *v )
+{
+ NORMAL( SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]), SHORT_TO_FLOAT(v[2]) );
+}
+
+
+
+
+
+#define TEXCOORD1(s) \
+{ \
+ GLuint count; \
+ GLfloat *tc; \
+ GET_IMMEDIATE; \
+ count = IM->Count; \
+ IM->Flag[count] |= VERT_TEX0_1; \
+ tc = IM->TexCoord[0][count]; \
+ ASSIGN_4V(tc,s,0,0,1); \
+}
+
+#define TEXCOORD2(s,t) \
+{ \
+ GLuint count; \
+ GLfloat *tc; \
+ GET_IMMEDIATE; \
+ count = IM->Count; \
+ IM->Flag[count] |= VERT_TEX0_12; \
+ tc = IM->TexCoord[0][count]; \
+ ASSIGN_4V(tc, s,t,0,1); \
+}
+
+#define TEXCOORD3(s,t,u) \
+{ \
+ GLuint count; \
+ GLfloat *tc; \
+ GET_IMMEDIATE; \
+ count = IM->Count; \
+ IM->Flag[count] |= VERT_TEX0_123; \
+ tc = IM->TexCoord[0][count]; \
+ ASSIGN_4V(tc, s,t,u,1); \
+}
+
+#define TEXCOORD4(s,t,u,v) \
+{ \
+ GLuint count; \
+ GLfloat *tc; \
+ GET_IMMEDIATE; \
+ count = IM->Count; \
+ IM->Flag[count] |= VERT_TEX0_1234; \
+ tc = IM->TexCoord[0][count]; \
+ ASSIGN_4V(tc, s,t,u,v); \
+}
+
+
+void
+_mesa_TexCoord1d( GLdouble s )
+{
+ TEXCOORD1(s);
+}
+
+
+void
+_mesa_TexCoord1f( GLfloat s )
+{
+ TEXCOORD1(s);
+}
+
+
+void
+_mesa_TexCoord1i( GLint s )
+{
+ TEXCOORD1(s);
+}
+
+
+void
+_mesa_TexCoord1s( GLshort s )
+{
+ TEXCOORD1(s);
+}
+
+
+void
+_mesa_TexCoord2d( GLdouble s, GLdouble t )
+{
+ TEXCOORD2(s,t);
+}
+
+
+void
+_mesa_TexCoord2f( GLfloat s, GLfloat t )
+{
+ TEXCOORD2(*(&s),*&t);
+}
+
+
+void
+_mesa_TexCoord2s( GLshort s, GLshort t )
+{
+ TEXCOORD2(s,t);
+}
+
+
+void
+_mesa_TexCoord2i( GLint s, GLint t )
+{
+ TEXCOORD2(s,t);
+}
+
+
+void
+_mesa_TexCoord3d( GLdouble s, GLdouble t, GLdouble r )
+{
+ TEXCOORD3(s,t,r);
+}
+
+
+void
+_mesa_TexCoord3f( GLfloat s, GLfloat t, GLfloat r )
+{
+ TEXCOORD3(s,t,r);
+}
+
+
+void
+_mesa_TexCoord3i( GLint s, GLint t, GLint r )
+{
+ TEXCOORD3(s,t,r);
+}
+
+
+void
+_mesa_TexCoord3s( GLshort s, GLshort t, GLshort r )
+{
+ TEXCOORD3(s,t,r);
+}
+
+
+void
+_mesa_TexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q )
+{
+ TEXCOORD4(s,t,r,q)
+}
+
+
+void
+_mesa_TexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q )
+{
+ TEXCOORD4(s,t,r,q)
+}
+
+
+void
+_mesa_TexCoord4i( GLint s, GLint t, GLint r, GLint q )
+{
+ TEXCOORD4(s,t,r,q)
+}
+
+
+void
+_mesa_TexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q )
+{
+ TEXCOORD4(s,t,r,q)
+}
+
+
+void
+_mesa_TexCoord1dv( const GLdouble *v )
+{
+ TEXCOORD1(v[0]);
+}
+
+
+void
+_mesa_TexCoord1fv( const GLfloat *v )
+{
+ TEXCOORD1(v[0]);
+}
+
+
+void
+_mesa_TexCoord1iv( const GLint *v )
+{
+ TEXCOORD1(v[0]);
+}
+
+
+void
+_mesa_TexCoord1sv( const GLshort *v )
+{
+ TEXCOORD1(v[0]);
+}
+
+
+void
+_mesa_TexCoord2dv( const GLdouble *v )
+{
+ TEXCOORD2(v[0],v[1]);
+}
+
+
+void
+_mesa_TexCoord2fv( const GLfloat *v )
+{
+ TEXCOORD2(v[0],v[1]);
+}
+
+
+void
+_mesa_TexCoord2iv( const GLint *v )
+{
+ TEXCOORD2(v[0],v[1]);
+}
+
+
+void
+_mesa_TexCoord2sv( const GLshort *v )
+{
+ TEXCOORD2(v[0],v[1]);
+}
+
+
+void
+_mesa_TexCoord3dv( const GLdouble *v )
+{
+ TEXCOORD2(v[0],v[1]);
+}
+
+
+void
+_mesa_TexCoord3fv( const GLfloat *v )
+{
+ TEXCOORD3(v[0],v[1],v[2]);
+}
+
+
+void
+_mesa_TexCoord3iv( const GLint *v )
+{
+ TEXCOORD3(v[0],v[1],v[2]);
+}
+
+
+void
+_mesa_TexCoord3sv( const GLshort *v )
+{
+ TEXCOORD3(v[0],v[1],v[2]);
+}
+
+
+void
+_mesa_TexCoord4dv( const GLdouble *v )
+{
+ TEXCOORD4(v[0],v[1],v[2],v[3]);
+}
+
+
+void
+_mesa_TexCoord4fv( const GLfloat *v )
+{
+ TEXCOORD4(v[0],v[1],v[2],v[3]);
+}
+
+
+void
+_mesa_TexCoord4iv( const GLint *v )
+{
+ TEXCOORD4(v[0],v[1],v[2],v[3]);
+}
+
+
+void
+_mesa_TexCoord4sv( const GLshort *v )
+{
+ TEXCOORD4(v[0],v[1],v[2],v[3]);
+}
+
+
+
+
+
+/* KW: Run into bad problems in reset_vb/fixup_input if we don't fully pad
+ * the incoming vertices.
+ */
+#define VERTEX2(IM, x,y) \
+{ \
+ GLuint count = IM->Count++; \
+ GLfloat *dest = IM->Obj[count]; \
+ IM->Flag[count] |= VERT_OBJ_2; \
+ ASSIGN_4V(dest, x, y, 0, 1); \
+ if (dest == IM->Obj[VB_MAX-1]) \
+ IM->maybe_transform_vb( IM ); \
+}
+
+#define VERTEX3(IM,x,y,z) \
+{ \
+ GLuint count = IM->Count++; \
+ GLfloat *dest = IM->Obj[count]; \
+ IM->Flag[count] |= VERT_OBJ_23; \
+ ASSIGN_4V(dest, x, y, z, 1); \
+ if (dest == IM->Obj[VB_MAX-1]) \
+ IM->maybe_transform_vb( IM ); \
+}
+
+#define VERTEX4(IM, x,y,z,w) \
+{ \
+ GLuint count = IM->Count++; \
+ GLfloat *dest = IM->Obj[count]; \
+ IM->Flag[count] |= VERT_OBJ_234; \
+ ASSIGN_4V(dest, x, y, z, w); \
+ if (dest == IM->Obj[VB_MAX-1]) \
+ IM->maybe_transform_vb( IM ); \
+}
+
+
+void
+_mesa_Vertex2d( GLdouble x, GLdouble y )
+{
+ GET_IMMEDIATE;
+ VERTEX2( IM, (GLfloat) x, (GLfloat) y );
+}
+
+
+void
+_mesa_Vertex2f( GLfloat x, GLfloat y )
+{
+ GET_IMMEDIATE;
+ VERTEX2( IM, *(&x), *(&y) );
+}
+
+
+/* Internal use:
+ */
+void gl_Vertex2f( GLcontext *ctx, GLfloat x, GLfloat y )
+{
+ struct immediate *im = ctx->input;
+ VERTEX2( im, x, y );
+}
+
+
+void
+_mesa_Vertex2i( GLint x, GLint y )
+{
+ GET_IMMEDIATE;
+ VERTEX2( IM, (GLfloat) x, (GLfloat) y );
+}
+
+
+void
+_mesa_Vertex2s( GLshort x, GLshort y )
+{
+ GET_IMMEDIATE;
+ VERTEX2( IM, (GLfloat) x, (GLfloat) y );
+}
+
+
+void
+_mesa_Vertex3d( GLdouble x, GLdouble y, GLdouble z )
+{
+ GET_IMMEDIATE;
+ VERTEX3( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z );
+}
+
+
+void
+_mesa_Vertex3f( GLfloat x, GLfloat y, GLfloat z )
+{
+ GET_IMMEDIATE;
+ VERTEX3( IM, *(&x), *(&y), *(&z) );
+}
+
+
+void
+_mesa_Vertex3i( GLint x, GLint y, GLint z )
+{
+ GET_IMMEDIATE;
+ VERTEX3( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z );
+}
+
+
+void
+_mesa_Vertex3s( GLshort x, GLshort y, GLshort z )
+{
+ GET_IMMEDIATE;
+ VERTEX3( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z );
+}
+
+
+void
+_mesa_Vertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w )
+{
+ GET_IMMEDIATE;
+ VERTEX4( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
+}
+
+
+void
+_mesa_Vertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+{
+ GET_IMMEDIATE;
+ VERTEX4( IM, *(&x), *(&y), *(&z), *(&w) );
+}
+
+
+void
+_mesa_Vertex4i( GLint x, GLint y, GLint z, GLint w )
+{
+ GET_IMMEDIATE;
+ VERTEX4( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
+}
+
+
+void
+_mesa_Vertex4s( GLshort x, GLshort y, GLshort z, GLshort w )
+{
+ GET_IMMEDIATE;
+ VERTEX4( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
+}
+
+
+void
+_mesa_Vertex2dv( const GLdouble *v )
+{
+ GET_IMMEDIATE;
+ VERTEX2( IM, (GLfloat) v[0], (GLfloat) v[1] );
+}
+
+
+void
+_mesa_Vertex2fv( const GLfloat *v )
+{
+ GET_IMMEDIATE;
+ VERTEX2( IM, v[0], v[1] );
+}
+
+
+void
+_mesa_Vertex2iv( const GLint *v )
+{
+ GET_IMMEDIATE;
+ VERTEX2( IM, (GLfloat) v[0], (GLfloat) v[1] );
+}
+
+
+void
+_mesa_Vertex2sv( const GLshort *v )
+{
+ GET_IMMEDIATE;
+ VERTEX2( IM, (GLfloat) v[0], (GLfloat) v[1] );
+}
+
+
+void
+_mesa_Vertex3dv( const GLdouble *v )
+{
+ GET_IMMEDIATE;
+ VERTEX3( IM, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
+}
+
+
+void
+_mesa_Vertex3fv( const GLfloat *v )
+{
+ GET_IMMEDIATE;
+ VERTEX3( IM, v[0], v[1], v[2] );
+}
+
+
+void
+_mesa_Vertex3iv( const GLint *v )
+{
+ GET_IMMEDIATE;
+ VERTEX3( IM, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
+}
+
+
+void
+_mesa_Vertex3sv( const GLshort *v )
+{
+ GET_IMMEDIATE;
+ VERTEX3( IM, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
+}
+
+
+void
+_mesa_Vertex4dv( const GLdouble *v )
+{
+ GET_IMMEDIATE;
+ VERTEX4( IM,
+ (GLfloat) v[0], (GLfloat) v[1],
+ (GLfloat) v[2], (GLfloat) v[3] );
+}
+
+
+void
+_mesa_Vertex4fv( const GLfloat *v )
+{
+ GET_IMMEDIATE;
+ VERTEX4( IM, v[0], v[1], v[2], v[3] );
+}
+
+
+void
+_mesa_Vertex4iv( const GLint *v )
+{
+ GET_IMMEDIATE;
+ VERTEX4( IM,
+ (GLfloat) v[0], (GLfloat) v[1],
+ (GLfloat) v[2], (GLfloat) v[3] );
+}
+
+
+void
+_mesa_Vertex4sv( const GLshort *v )
+{
+ GET_IMMEDIATE;
+ VERTEX4( IM,
+ (GLfloat) v[0], (GLfloat) v[1],
+ (GLfloat) v[2], (GLfloat) v[3] );
+}
+
+
+
+
+/* KW: Do the check here so that we only have to do a single range
+ * test. The possible compliance problem with this is that
+ * we will throw out error-producing calls when compiling
+ * display lists. There are ways around this if need be.
+ */
+
+
+/*
+ * GL_ARB_multitexture
+ */
+
+#define CHECK_ARB \
+ if (target >= GL_TEXTURE0_ARB && target <= GL_TEXTURE1_ARB) { \
+ texSet = target - GL_TEXTURE0_ARB; \
+ } \
+ else { \
+ gl_error(IM->backref, GL_INVALID_ENUM, "glMultiTexCoord(target)"); \
+ return; \
+ }
+
+
+#define MULTI_TEXCOORD1(s) \
+{ \
+ GLuint count; \
+ GLfloat *tc; \
+ count = IM->Count; \
+ IM->Flag[count] |= IM->TF1[texSet]; \
+ tc = IM->TexCoordPtr[texSet][count]; \
+ ASSIGN_4V(tc, s,0,0,1); \
+}
+
+
+#define MULTI_TEXCOORD2(s,t) \
+{ \
+ GLuint count; \
+ GLfloat *tc; \
+ count = IM->Count; \
+ IM->Flag[count] |= IM->TF2[texSet]; \
+ tc = IM->TexCoordPtr[texSet][count]; \
+ ASSIGN_4V(tc, s,t,0,1); \
+}
+
+#define MULTI_TEXCOORD3(s,t,u) \
+{ \
+ GLuint count; \
+ GLfloat *tc; \
+ count = IM->Count; \
+ IM->Flag[count] |= IM->TF3[texSet]; \
+ tc = IM->TexCoordPtr[texSet][count]; \
+ ASSIGN_4V(tc, s,t,u,1); \
+}
+
+#define MULTI_TEXCOORD4(s,t,u,v) \
+{ \
+ GLuint count; \
+ GLfloat *tc; \
+ count = IM->Count; \
+ IM->Flag[count] |= IM->TF4[texSet]; \
+ tc = IM->TexCoordPtr[texSet][count]; \
+ ASSIGN_4V(tc, s,t,u,v); \
+}
+
+
+void
+_mesa_MultiTexCoord1dARB(GLenum target, GLdouble s)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD1( s );
+}
+
+void
+_mesa_MultiTexCoord1dvARB(GLenum target, const GLdouble *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD1( v[0] );
+}
+
+void
+_mesa_MultiTexCoord1fARB(GLenum target, GLfloat s)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD1( s );
+}
+
+void
+_mesa_MultiTexCoord1fvARB(GLenum target, const GLfloat *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD1( v[0] );
+}
+
+void
+_mesa_MultiTexCoord1iARB(GLenum target, GLint s)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD1( s );
+}
+
+void
+_mesa_MultiTexCoord1ivARB(GLenum target, const GLint *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD1( v[0] );
+}
+
+void
+_mesa_MultiTexCoord1sARB(GLenum target, GLshort s)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD1( s );
+}
+
+void
+_mesa_MultiTexCoord1svARB(GLenum target, const GLshort *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD1( v[0] );
+}
+
+void
+_mesa_MultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD2( s, t );
+}
+
+void
+_mesa_MultiTexCoord2dvARB(GLenum target, const GLdouble *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD2( v[0], v[1] );
+}
+
+void
+_mesa_MultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD2( s, t );
+}
+
+void
+_mesa_MultiTexCoord2fvARB(GLenum target, const GLfloat *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD2( v[0], v[1] );
+}
+
+void
+_mesa_MultiTexCoord2iARB(GLenum target, GLint s, GLint t)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD2( s, t );
+}
+
+void
+_mesa_MultiTexCoord2ivARB(GLenum target, const GLint *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD2( v[0], v[1] );
+}
+
+void
+_mesa_MultiTexCoord2sARB(GLenum target, GLshort s, GLshort t)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD2( s, t );
+}
+
+void
+_mesa_MultiTexCoord2svARB(GLenum target, const GLshort *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD2( v[0], v[1] );
+}
+
+void
+_mesa_MultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD3( s, t, r );
+}
+
+void
+_mesa_MultiTexCoord3dvARB(GLenum target, const GLdouble *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD3( v[0], v[1], v[2] );
+}
+
+void
+_mesa_MultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD3( s, t, r );
+}
+
+void
+_mesa_MultiTexCoord3fvARB(GLenum target, const GLfloat *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD3( v[0], v[1], v[2] );
+}
+
+void
+_mesa_MultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD3( s, t, r );
+}
+
+void
+_mesa_MultiTexCoord3ivARB(GLenum target, const GLint *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD3( v[0], v[1], v[2] );
+}
+
+void
+_mesa_MultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD3( s, t, r );
+}
+
+void
+_mesa_MultiTexCoord3svARB(GLenum target, const GLshort *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD3( v[0], v[1], v[2] );
+}
+
+void
+_mesa_MultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD4( s, t, r, q );
+}
+
+void
+_mesa_MultiTexCoord4dvARB(GLenum target, const GLdouble *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD4( v[0], v[1], v[2], v[3] );
+}
+
+void
+_mesa_MultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD4( s, t, r, q );
+}
+
+
+void
+_mesa_MultiTexCoord4fvARB(GLenum target, const GLfloat *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD4( v[0], v[1], v[2], v[3] );
+}
+
+void
+_mesa_MultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD4( s, t, r, q );
+}
+
+void
+_mesa_MultiTexCoord4ivARB(GLenum target, const GLint *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD4( v[0], v[1], v[2], v[3] );
+}
+
+void
+_mesa_MultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD4( s, t, r, q );
+}
+
+void
+_mesa_MultiTexCoord4svARB(GLenum target, const GLshort *v)
+{
+ GLint texSet;
+ GET_IMMEDIATE;
+ CHECK_ARB
+ MULTI_TEXCOORD4( v[0], v[1], v[2], v[3] );
+}
+
diff --git a/xc/extras/Mesa/src/vbfill.h b/xc/extras/Mesa/src/vbfill.h
index 0b837eaf6..dcbe6a5f3 100644
--- a/xc/extras/Mesa/src/vbfill.h
+++ b/xc/extras/Mesa/src/vbfill.h
@@ -1,8 +1,8 @@
-/* $Id: vbfill.h,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: vbfill.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,9 +25,6 @@
*/
-
-
-
#ifndef VBFILL_H
#define VBFILL_H
@@ -35,16 +32,314 @@
#include "types.h"
-/* Small number of API equivalent functions provided for internal
- * use:
- */
extern void gl_Begin( GLcontext *ctx, GLenum p );
-extern void gl_Vertex2f( GLcontext *ctx, GLfloat, GLfloat );
-extern void gl_ArrayElement( GLcontext *ctx, GLint );
-extern void gl_EvalCoord1f( GLcontext *ctx, GLfloat );
-extern void gl_EvalCoord2f( GLcontext *ctx, GLfloat, GLfloat );
extern void gl_End( GLcontext *ctx );
+extern void gl_Vertex2f( GLcontext *ctx, GLfloat x, GLfloat y );
-#endif
+extern void
+_mesa_Begin( GLenum p );
+
+extern void
+_mesa_End( void );
+
+
+
+extern void _mesa_Color3b(GLbyte red, GLbyte green, GLbyte blue);
+
+extern void _mesa_Color3d(GLdouble red, GLdouble green, GLdouble blue);
+
+extern void _mesa_Color3f(GLfloat red, GLfloat green, GLfloat blue);
+
+extern void _mesa_Color3i(GLint red, GLint green, GLint blue);
+
+extern void _mesa_Color3s(GLshort red, GLshort green, GLshort blue);
+
+extern void _mesa_Color3ub(GLubyte red, GLubyte green, GLubyte blue);
+
+extern void _mesa_Color3ui(GLuint red, GLuint green, GLuint blue);
+
+extern void _mesa_Color3us(GLushort red, GLushort green, GLushort blue);
+
+extern void _mesa_Color4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
+
+extern void _mesa_Color4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
+
+extern void _mesa_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+
+extern void _mesa_Color4i(GLint red, GLint green, GLint blue, GLint alpha);
+
+extern void _mesa_Color4s(GLshort red, GLshort green, GLshort blue, GLshort alpha);
+
+extern void _mesa_Color4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+
+extern void _mesa_Color4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha);
+
+extern void _mesa_Color4us(GLushort red, GLushort green, GLushort blue, GLushort alpha);
+
+extern void _mesa_Color3bv(const GLbyte *v);
+
+extern void _mesa_Color3dv(const GLdouble *v);
+
+extern void _mesa_Color3fv(const GLfloat *v);
+
+extern void _mesa_Color3iv(const GLint *v);
+
+extern void _mesa_Color3sv(const GLshort *v);
+
+extern void _mesa_Color3ubv(const GLubyte *v);
+
+extern void _mesa_Color3uiv(const GLuint *v);
+
+extern void _mesa_Color3usv(const GLushort *v);
+
+extern void _mesa_Color4bv(const GLbyte *v);
+
+extern void _mesa_Color4dv(const GLdouble *v);
+
+extern void _mesa_Color4fv(const GLfloat *v);
+
+extern void _mesa_Color4iv(const GLint *v);
+
+extern void _mesa_Color4sv(const GLshort *v);
+
+extern void _mesa_Color4ubv(const GLubyte *v);
+
+extern void _mesa_Color4uiv(const GLuint *v);
+
+extern void _mesa_Color4usv(const GLushort *v);
+
+
+
+extern void _mesa_EdgeFlag( GLboolean flag );
+
+extern void _mesa_EdgeFlagv( const GLboolean *flag );
+
+
+
+extern void _mesa_Indexd(GLdouble c);
+
+extern void _mesa_Indexdv(const GLdouble *c);
+
+extern void _mesa_Indexf(GLfloat c);
+
+extern void _mesa_Indexfv(const GLfloat *c);
+
+extern void _mesa_Indexi(GLint c);
+
+extern void _mesa_Indexiv(const GLint *c);
+
+extern void _mesa_Indexs(GLshort c);
+
+extern void _mesa_Indexsv(const GLshort *c);
+
+extern void _mesa_Indexub(GLubyte b);
+
+extern void _mesa_Indexubv(const GLubyte *b);
+
+
+
+extern void _mesa_Normal3b(GLbyte nx, GLbyte ny, GLbyte nz);
+
+extern void _mesa_Normal3bv(const GLbyte *v);
+
+extern void _mesa_Normal3d(GLdouble nx, GLdouble ny, GLdouble nz);
+
+extern void _mesa_Normal3dv(const GLdouble *v);
+
+extern void _mesa_Normal3f(GLfloat nx, GLfloat ny, GLfloat nz);
+
+extern void _mesa_Normal3fv(const GLfloat *v);
+
+extern void _mesa_Normal3i(GLint nx, GLint ny, GLint nz);
+
+extern void _mesa_Normal3iv(const GLint *v);
+
+extern void _mesa_Normal3s(GLshort nx, GLshort ny, GLshort nz);
+
+extern void _mesa_Normal3sv(const GLshort *v);
+
+
+
+extern void _mesa_TexCoord1d(GLdouble s);
+
+extern void _mesa_TexCoord1dv(const GLdouble *v);
+
+extern void _mesa_TexCoord1f(GLfloat s);
+
+extern void _mesa_TexCoord1fv(const GLfloat *v);
+
+extern void _mesa_TexCoord1i(GLint s);
+
+extern void _mesa_TexCoord1iv(const GLint *v);
+
+extern void _mesa_TexCoord1s(GLshort s);
+
+extern void _mesa_TexCoord1sv(const GLshort *v);
+
+extern void _mesa_TexCoord2d(GLdouble s, GLdouble t);
+
+extern void _mesa_TexCoord2dv(const GLdouble *v);
+
+extern void _mesa_TexCoord2f(GLfloat s, GLfloat t);
+
+extern void _mesa_TexCoord2fv(const GLfloat *v);
+extern void _mesa_TexCoord2s(GLshort s, GLshort t);
+
+extern void _mesa_TexCoord2sv(const GLshort *v);
+
+extern void _mesa_TexCoord2i(GLint s, GLint t);
+
+extern void _mesa_TexCoord2iv(const GLint *v);
+
+extern void _mesa_TexCoord3d(GLdouble s, GLdouble t, GLdouble r);
+
+extern void _mesa_TexCoord3dv(const GLdouble *v);
+
+extern void _mesa_TexCoord3f(GLfloat s, GLfloat t, GLfloat r);
+
+extern void _mesa_TexCoord3fv(const GLfloat *v);
+
+extern void _mesa_TexCoord3i(GLint s, GLint t, GLint r);
+
+extern void _mesa_TexCoord3iv(const GLint *v);
+
+extern void _mesa_TexCoord3s(GLshort s, GLshort t, GLshort r);
+
+extern void _mesa_TexCoord3sv(const GLshort *v);
+
+extern void _mesa_TexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+
+extern void _mesa_TexCoord4dv(const GLdouble *v);
+
+extern void _mesa_TexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+
+extern void _mesa_TexCoord4fv(const GLfloat *v);
+
+extern void _mesa_TexCoord4i(GLint s, GLint t, GLint r, GLint q);
+
+extern void _mesa_TexCoord4iv(const GLint *v);
+
+extern void _mesa_TexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q);
+
+extern void _mesa_TexCoord4sv(const GLshort *v);
+
+
+
+extern void _mesa_Vertex2d(GLdouble x, GLdouble y);
+
+extern void _mesa_Vertex2dv(const GLdouble *v);
+
+extern void _mesa_Vertex2f(GLfloat x, GLfloat y);
+
+extern void _mesa_Vertex2fv(const GLfloat *v);
+
+extern void _mesa_Vertex2i(GLint x, GLint y);
+
+extern void _mesa_Vertex2iv(const GLint *v);
+
+extern void _mesa_Vertex2s(GLshort x, GLshort y);
+
+extern void _mesa_Vertex2sv(const GLshort *v);
+
+extern void _mesa_Vertex3d(GLdouble x, GLdouble y, GLdouble z);
+
+extern void _mesa_Vertex3dv(const GLdouble *v);
+
+extern void _mesa_Vertex3f(GLfloat x, GLfloat y, GLfloat z);
+
+extern void _mesa_Vertex3fv(const GLfloat *v);
+
+extern void _mesa_Vertex3i(GLint x, GLint y, GLint z);
+
+extern void _mesa_Vertex3iv(const GLint *v);
+
+extern void _mesa_Vertex3s(GLshort x, GLshort y, GLshort z);
+
+extern void _mesa_Vertex3sv(const GLshort *v);
+
+extern void _mesa_Vertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+
+extern void _mesa_Vertex4dv(const GLdouble *v);
+
+extern void _mesa_Vertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+
+extern void _mesa_Vertex4fv(const GLfloat *v);
+
+extern void _mesa_Vertex4i(GLint x, GLint y, GLint z, GLint w);
+
+extern void _mesa_Vertex4iv(const GLint *v);
+
+extern void _mesa_Vertex4s(GLshort x, GLshort y, GLshort z, GLshort w);
+
+extern void _mesa_Vertex4sv(const GLshort *v);
+
+
+
+extern void _mesa_MultiTexCoord1dARB(GLenum target, GLdouble s);
+
+extern void _mesa_MultiTexCoord1dvARB(GLenum target, const GLdouble *v);
+
+extern void _mesa_MultiTexCoord1fARB(GLenum target, GLfloat s);
+
+extern void _mesa_MultiTexCoord1fvARB(GLenum target, const GLfloat *v);
+
+extern void _mesa_MultiTexCoord1iARB(GLenum target, GLint s);
+
+extern void _mesa_MultiTexCoord1ivARB(GLenum target, const GLint *v);
+
+extern void _mesa_MultiTexCoord1sARB(GLenum target, GLshort s);
+
+extern void _mesa_MultiTexCoord1svARB(GLenum target, const GLshort *v);
+
+extern void _mesa_MultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t);
+
+extern void _mesa_MultiTexCoord2dvARB(GLenum target, const GLdouble *v);
+
+extern void _mesa_MultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);
+
+extern void _mesa_MultiTexCoord2fvARB(GLenum target, const GLfloat *v);
+
+extern void _mesa_MultiTexCoord2iARB(GLenum target, GLint s, GLint t);
+
+extern void _mesa_MultiTexCoord2ivARB(GLenum target, const GLint *v);
+
+extern void _mesa_MultiTexCoord2sARB(GLenum target, GLshort s, GLshort t);
+
+extern void _mesa_MultiTexCoord2svARB(GLenum target, const GLshort *v);
+
+extern void _mesa_MultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r);
+
+extern void _mesa_MultiTexCoord3dvARB(GLenum target, const GLdouble *v);
+
+extern void _mesa_MultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r);
+
+extern void _mesa_MultiTexCoord3fvARB(GLenum target, const GLfloat *v);
+
+extern void _mesa_MultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r);
+
+extern void _mesa_MultiTexCoord3ivARB(GLenum target, const GLint *v);
+
+extern void _mesa_MultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r);
+
+extern void _mesa_MultiTexCoord3svARB(GLenum target, const GLshort *v);
+
+extern void _mesa_MultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+
+extern void _mesa_MultiTexCoord4dvARB(GLenum target, const GLdouble *v);
+
+extern void _mesa_MultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+
+extern void _mesa_MultiTexCoord4fvARB(GLenum target, const GLfloat *v);
+
+extern void _mesa_MultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q);
+
+extern void _mesa_MultiTexCoord4ivARB(GLenum target, const GLint *v);
+
+extern void _mesa_MultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+
+extern void _mesa_MultiTexCoord4svARB(GLenum target, const GLshort *v);
+
+
+#endif
diff --git a/xc/extras/Mesa/src/vbindirect.c b/xc/extras/Mesa/src/vbindirect.c
index f0f693946..5a1ec2034 100644
--- a/xc/extras/Mesa/src/vbindirect.c
+++ b/xc/extras/Mesa/src/vbindirect.c
@@ -1,10 +1,10 @@
-/* $Id: vbindirect.c,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: vbindirect.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -29,13 +29,21 @@
*/
+#ifdef PC_HEADER
+#include "all.h"
+#else
+#include "glheader.h"
+#include "pb.h"
+#include "pipeline.h"
+#include "stages.h"
+#include "types.h"
#include "vb.h"
#include "vbcull.h"
+#include "vbindirect.h"
#include "vbrender.h"
-#include "pipeline.h"
-#include "pb.h"
-#include "types.h"
-#include "stages.h"
+#endif
+
+
static struct gl_prim_state next_lines[3] = {
{ 1, 2, 0, 0, &next_lines[1] },
diff --git a/xc/extras/Mesa/src/vbindirect.h b/xc/extras/Mesa/src/vbindirect.h
index c361c1091..2c2f009c0 100644
--- a/xc/extras/Mesa/src/vbindirect.h
+++ b/xc/extras/Mesa/src/vbindirect.h
@@ -1,4 +1,4 @@
-/* $Id: vbindirect.h,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: vbindirect.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/vbrender.c b/xc/extras/Mesa/src/vbrender.c
index 07475b4d5..d611e6920 100644
--- a/xc/extras/Mesa/src/vbrender.c
+++ b/xc/extras/Mesa/src/vbrender.c
@@ -1,10 +1,10 @@
-/* $Id: vbrender.c,v 1.4 1999/12/18 16:51:05 daryll Exp $ */
+/* $Id: vbrender.c,v 1.5 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 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"),
@@ -41,11 +41,7 @@
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "clip.h"
#include "context.h"
#include "light.h"
@@ -161,6 +157,7 @@ static void unfilled_polygon( GLcontext *ctx,
}
else if (mode==GL_LINE) {
GLuint i, j0, j1;
+ ctx->StippleCounter = 0;
/* draw the edges */
for (i=0;i<n-1;i++) {
@@ -293,6 +290,11 @@ static void render_triangle( GLcontext *ctx,
}
+static void null_triangle( GLcontext *ctx,
+ GLuint v0, GLuint v1, GLuint v2, GLuint pv )
+{
+}
+
/* Implements triangle_rendering when (IndirectTriangles & DD_SW_SETUP)
* is non-zero.
@@ -348,7 +350,10 @@ static void render_quad( GLcontext *ctx, GLuint v0, GLuint v1,
}
-
+static void null_quad( GLcontext *ctx, GLuint v0, GLuint v1,
+ GLuint v2, GLuint v3, GLuint pv )
+{
+}
extern const char *gl_prim_name[];
@@ -367,7 +372,9 @@ extern const char *gl_prim_name[];
#define EDGEFLAG_TRI( i2, i1, i, pv, parity) \
do { \
- eflag[i2] = eflag[i1] = 1; eflag[i] = 2; \
+ GLuint e1=i1, e0=i; \
+ if (parity) { GLuint t=e1; e1=e0; e0=t; } \
+ eflag[i2] = eflag[e1] = 1; eflag[e0] = 2; \
} while (0)
#define EDGEFLAG_QUAD( i3, i2, i1, i, pv) \
@@ -447,12 +454,10 @@ do { \
const GLubyte *cullmask = VB->CullMask; \
GLuint vlist[VB_SIZE]; \
GLubyte *eflag = VB->EdgeFlagPtr->data; \
- GLuint *stipplecounter = &VB->ctx->StippleCounter; \
- (void) vlist; (void) eflag; (void) stipplecounter;
+ (void) vlist; (void) eflag;
#define TAG(x) x##_cull
#define INIT(x) FLUSH_PRIM(x)
-#define RESET_STIPPLE *stipplecounter = 0
#include "render_tmp.h"
@@ -486,11 +491,9 @@ do { \
#define LOCAL_VARS \
GLcontext *ctx = VB->ctx; \
GLubyte *eflag = VB->EdgeFlagPtr->data; \
- GLuint *stipplecounter = &VB->ctx->StippleCounter; \
- (void) eflag; (void) stipplecounter;
+ (void) eflag;
#define INIT(x) FLUSH_PRIM(x);
-#define RESET_STIPPLE *stipplecounter = 0
#include "render_tmp.h"
@@ -506,9 +509,9 @@ do { \
#define RENDER_TRI( i2, i1, i, pv, parity) \
do { \
- GLuint e2=i2, e1=i1; \
- if (parity) { GLuint t=e2; e2=e1; e1=t; } \
- gl_render_clipped_triangle2(ctx,e2,e1,i,pv); \
+ GLuint e1=i1, e0=i; \
+ if (parity) { GLuint t=e1; e1=e0; e0=t; } \
+ gl_render_clipped_triangle2(ctx,i2,e1,e0,pv); \
} while (0)
#define RENDER_QUAD( i3, i2, i1, i, pv) \
@@ -517,20 +520,13 @@ do { \
gl_render_clipped_triangle2(ctx,i3,i1,i,pv); \
} while (0)
-/* gl_render_clipped_triangle2(ctx,i3,i2,i,pv); */
-/* gl_render_clipped_triangle2(ctx,i2,i1,i,pv); */
-
#define LOCAL_VARS \
GLcontext *ctx = VB->ctx; \
GLubyte *eflag = VB->EdgeFlagPtr->data; \
- GLuint *stipplecounter = &VB->ctx->StippleCounter; \
- (void) eflag; (void) stipplecounter;
-
+ (void) eflag;
#define INIT(x) FLUSH_PRIM(x);
#define TAG(x) x##_clipped
-#define RESET_STIPPLE *stipplecounter = 0
-
#include "render_tmp.h"
/* Bits:
@@ -554,11 +550,12 @@ do { \
*
* Keith.
*/
-void gl_setup_edgeflag( struct vertex_buffer *VB,
- GLenum prim,
- GLuint start,
- GLuint count,
- GLuint parity )
+static void
+setup_edgeflag( struct vertex_buffer *VB,
+ GLenum prim,
+ GLuint start,
+ GLuint count,
+ GLuint parity )
{
GLubyte *flag = VB->EdgeFlagPtr->data + start;
GLuint n = count - start;
@@ -641,7 +638,7 @@ void gl_render_vb( struct vertex_buffer *VB )
next = VB->NextPrimitive[i];
if (ctx->TriangleCaps & DD_TRI_UNFILLED)
- gl_setup_edgeflag(VB, prim, i, next, parity);
+ setup_edgeflag(VB, prim, i, next, parity);
tab[prim]( VB, i, next, parity );
@@ -671,13 +668,10 @@ void gl_reduced_prim_change( GLcontext *ctx, GLenum prim )
ctx->PB->count = 0;
ctx->PB->mono = GL_FALSE;
-
- if (ctx->PB->primitive != prim) {
- ctx->PB->primitive = prim;
+ ctx->PB->primitive = prim;
- if (ctx->Driver.ReducedPrimitiveChange)
- ctx->Driver.ReducedPrimitiveChange( ctx, prim );
- }
+ if (ctx->Driver.ReducedPrimitiveChange)
+ ctx->Driver.ReducedPrimitiveChange( ctx, prim );
}
@@ -692,22 +686,25 @@ void gl_set_render_vb_function( GLcontext *ctx )
if (ctx->Driver.RenderVBRawTab == 0)
ctx->Driver.RenderVBRawTab = render_tab_raw;
- /* Culling will be done earlier by gl_cull_vb().
- */
- if (ctx->IndirectTriangles & (DD_SW_SETUP & ~DD_TRI_CULL)) {
- ctx->TriangleFunc = render_triangle;
- ctx->QuadFunc = render_quad;
- } else {
- ctx->TriangleFunc = ctx->Driver.TriangleFunc;
- ctx->QuadFunc = ctx->Driver.QuadFunc;
- }
+ ctx->TriangleFunc = ctx->Driver.TriangleFunc;
+ ctx->QuadFunc = ctx->Driver.QuadFunc;
+ ctx->ClippedTriangleFunc = ctx->TriangleFunc;
+
+ if (ctx->IndirectTriangles & DD_SW_SETUP) {
- if (ctx->IndirectTriangles & (DD_SW_SETUP)) {
ctx->ClippedTriangleFunc = render_triangle;
- } else {
- ctx->ClippedTriangleFunc = ctx->TriangleFunc;
- }
+ if (ctx->IndirectTriangles & (DD_SW_SETUP & ~DD_TRI_CULL)) {
+ if (ctx->IndirectTriangles & DD_TRI_CULL_FRONT_BACK) {
+ ctx->TriangleFunc = null_triangle;
+ ctx->QuadFunc = render_quad;
+ ctx->ClippedTriangleFunc = null_triangle;
+ } else {
+ ctx->TriangleFunc = render_triangle;
+ ctx->QuadFunc = render_quad;
+ }
+ }
+ }
}
void gl_init_vbrender( void )
diff --git a/xc/extras/Mesa/src/vbrender.h b/xc/extras/Mesa/src/vbrender.h
index 37f9297d4..b2cc1ed50 100644
--- a/xc/extras/Mesa/src/vbrender.h
+++ b/xc/extras/Mesa/src/vbrender.h
@@ -1,4 +1,4 @@
-/* $Id: vbrender.h,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: vbrender.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/vbxform.c b/xc/extras/Mesa/src/vbxform.c
index 6bd11e5f5..f8a4ac613 100644
--- a/xc/extras/Mesa/src/vbxform.c
+++ b/xc/extras/Mesa/src/vbxform.c
@@ -1,4 +1,4 @@
-/* $Id: vbxform.c,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: vbxform.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -29,13 +29,7 @@
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <math.h>
-#include <stdlib.h>
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "cva.h"
#include "clip.h"
@@ -46,6 +40,7 @@
#include "light.h"
#include "macros.h"
#include "matrix.h"
+#include "mem.h"
#include "mmath.h"
#include "pipeline.h"
#include "shade.h"
@@ -466,6 +461,9 @@ void gl_compute_orflag( struct immediate *IM )
IM->LastData = count-1;
+/* fprintf(stderr, "In gl_compute_orflag, start %d count %d\n", IM->Start, IM->Count); */
+/* gl_print_vert_flags("initial andflag", andflag); */
+
/* Compute the flags for the whole buffer, even if
*/
for (i = IM->Start ; i < count ; i++) {
@@ -475,10 +473,12 @@ void gl_compute_orflag( struct immediate *IM )
if (IM->Flag[i] & VERT_DATA) {
IM->LastData++;
-/* andflag &= IM->Flag[i]; */ /* possibly incorrect (norm_bug.c) */
+/* andflag &= IM->Flag[i]; */
orflag |= IM->Flag[i];
}
+/* gl_print_vert_flags("final andflag", andflag); */
+
IM->Flag[IM->LastData+1] |= VERT_END_VB;
IM->AndFlag = andflag;
IM->OrFlag = orflag;
@@ -537,10 +537,7 @@ void gl_fixup_input( GLcontext *ctx, struct immediate *IM )
if (ctx->ExecuteFlag && (fixup & ~IM->Flag[start])) {
GLuint copy = fixup & ~IM->Flag[start];
- if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
- gl_print_vert_flags("copy from current", copy);
-
- if (copy & VERT_NORM)
+ if (copy & VERT_NORM)
COPY_3V( IM->Normal[start], ctx->Current.Normal );
if (copy & VERT_RGBA)
@@ -602,17 +599,10 @@ void gl_fixup_input( GLcontext *ctx, struct immediate *IM )
}
if (fixup & VERT_NORM) {
- /* Only eval cannot use the Flag member to find valid normals:
- */
if (IM->OrFlag & VERT_EVAL_ANY)
fixup_3f( IM->Normal, IM->Flag, start, VERT_NORM );
- else {
- /* Copy-to-current requires a valid normal in the last slot:
- */
- if ((IM->OrFlag & VERT_NORM) &&
- !(IM->Flag[IM->LastData] & VERT_NORM))
- find_last_3f( IM->Normal, IM->Flag, VERT_NORM, IM->LastData );
- }
+ else if (!(IM->Flag[IM->LastData] & VERT_NORM))
+ find_last_3f( IM->Normal, IM->Flag, VERT_NORM, IM->LastData );
}
}
diff --git a/xc/extras/Mesa/src/vbxform.h b/xc/extras/Mesa/src/vbxform.h
index d69f9f7ce..559ce8b21 100644
--- a/xc/extras/Mesa/src/vbxform.h
+++ b/xc/extras/Mesa/src/vbxform.h
@@ -1,4 +1,4 @@
-/* $Id: vbxform.h,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: vbxform.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
diff --git a/xc/extras/Mesa/src/vector.c b/xc/extras/Mesa/src/vector.c
index 9edbe37b7..265d1ede7 100644
--- a/xc/extras/Mesa/src/vector.c
+++ b/xc/extras/Mesa/src/vector.c
@@ -1,8 +1,8 @@
-/* $Id: vector.c,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: vector.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -29,15 +29,17 @@
*/
-#ifndef XFree86Server
-#include <stdlib.h>
-#include <stdio.h>
+#ifdef PC_HEADER
+#include "all.h"
#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "config.h"
#include "macros.h"
+#include "mem.h"
#include "vector.h"
+#endif
+
+
static const GLubyte elem_bits[4] = {
VEC_DIRTY_0,
diff --git a/xc/extras/Mesa/src/vector.h b/xc/extras/Mesa/src/vector.h
index 4b0dc0171..8986e57da 100644
--- a/xc/extras/Mesa/src/vector.h
+++ b/xc/extras/Mesa/src/vector.h
@@ -1,8 +1,8 @@
-/* $Id: vector.h,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: vector.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -32,7 +32,8 @@
#ifndef _VECTOR_H_
#define _VECTOR_H_
-#include "GL/gl.h"
+#include "glheader.h"
+
/* Wrap all the information about vertices up in a struct. Has
* additional fields compared to the other vectors to help us track of
diff --git a/xc/extras/Mesa/src/vertices.c b/xc/extras/Mesa/src/vertices.c
index 45786b658..178151e94 100644
--- a/xc/extras/Mesa/src/vertices.c
+++ b/xc/extras/Mesa/src/vertices.c
@@ -1,8 +1,8 @@
-/* $Id: vertices.c,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: vertices.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -24,18 +24,21 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifndef XFree86Server
-#include <stdio.h>
+
+#ifdef PC_HEADER
+#include "all.h"
#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "types.h"
#include "vertices.h"
+#endif
+
#if defined(USE_X86_ASM)
#include "X86/common_x86asm.h"
#endif
+
/* The start of a bunch of vertex oriented geometry routines. These
* are expected to support the production of driver-specific fast paths
* for CVA and eventually normal processing.
@@ -67,7 +70,7 @@
#endif
-static void transform_v16(GLfloat *f,
+static void _PROJAPI transform_v16(GLfloat *f,
const GLfloat *m,
const GLfloat *obj,
GLuint obj_stride,
@@ -88,7 +91,7 @@ static void transform_v16(GLfloat *f,
/* Project all vertices upto but not including last. Guarenteed to be
* at least one such vertex.
*/
-static void project_verts(GLfloat *first,
+static void _PROJAPI project_verts(GLfloat *first,
GLfloat *last,
const GLfloat *m,
GLuint stride )
@@ -107,7 +110,7 @@ static void project_verts(GLfloat *first,
}
}
-static void project_clipped_verts(GLfloat *first,
+static void _PROJAPI project_clipped_verts(GLfloat *first,
GLfloat *last,
const GLfloat *m,
GLuint stride,
@@ -132,7 +135,7 @@ static void project_clipped_verts(GLfloat *first,
-static void cliptest_v16( GLfloat *first,
+static void _PROJAPI cliptest_v16( GLfloat *first,
GLfloat *last,
GLubyte *p_clipOr,
GLubyte *p_clipAnd,
@@ -191,12 +194,3 @@ gl_project_func gl_project_v16 = project_verts;
void gl_init_vertices()
{
}
-
-
-
-
-
-
-
-
-
diff --git a/xc/extras/Mesa/src/vertices.h b/xc/extras/Mesa/src/vertices.h
index 8c1299393..7fb26fbbd 100644
--- a/xc/extras/Mesa/src/vertices.h
+++ b/xc/extras/Mesa/src/vertices.h
@@ -1,8 +1,8 @@
-/* $Id: vertices.h,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: vertices.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -28,26 +28,33 @@
#ifndef VERTICES_H_
#define VERTICES_H_
+#ifdef USE_X86_ASM
+#define _PROJAPI _ASMAPI
+#define _PROJAPIP _ASMAPIP
+#else
+#define _PROJAPI
+#define _PROJAPIP *
+#endif
-typedef void (*gl_transform_func)( GLfloat *first_vert,
+typedef void (_PROJAPIP gl_transform_func)( GLfloat *first_vert,
const GLfloat *m,
const GLfloat *src,
GLuint src_stride,
GLuint count );
-typedef void (*gl_cliptest_func)( GLfloat *first_vert,
+typedef void (_PROJAPIP gl_cliptest_func)( GLfloat *first_vert,
GLfloat *last_vert, /* use count instead? */
GLubyte *or_mask,
GLubyte *and_mask,
GLubyte *clip_mask );
-typedef void (*gl_project_clipped_func)( GLfloat *first,
+typedef void (_PROJAPIP gl_project_clipped_func)( GLfloat *first,
GLfloat *last,
const GLfloat *m,
GLuint stride,
const GLubyte *clipmask );
-typedef void (*gl_project_func)( GLfloat *first,
+typedef void (_PROJAPIP gl_project_func)( GLfloat *first,
GLfloat *last,
const GLfloat *m,
GLuint stride );
diff --git a/xc/extras/Mesa/src/winpos.c b/xc/extras/Mesa/src/winpos.c
index 4a3d7b62f..b2baad6df 100644
--- a/xc/extras/Mesa/src/winpos.c
+++ b/xc/extras/Mesa/src/winpos.c
@@ -1,8 +1,8 @@
-/* $Id: winpos.c,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: winpos.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -23,10 +23,6 @@
* 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.
*/
-/* $XFree86: xc/lib/GL/mesa/src/winpos.c,v 1.2 1999/04/04 00:20:36 dawes Exp $ */
-
-
-
/*
@@ -49,38 +45,89 @@
*/
-
#ifdef PC_HEADER
#include "all.h"
#else
-#include "GL/gl.h"
-#endif
-
-#ifdef GL_MESA_window_pos
-
-
-#ifndef PC_HEADER
-#ifdef XFree86Server
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
+#include "context.h"
+#include "feedback.h"
+#include "mmath.h"
#include "rastpos.h"
#include "winpos.h"
#endif
-
/*
- * Mesa implementation of glWindowPos*MESA()
+ * This is a MESA extension function. Pretty much just like glRasterPos
+ * except we don't apply the modelview or projection matrices; specify a
+ * window coordinate directly.
+ * Caller: context->API.WindowPos4fMESA pointer.
*/
-void gl_WindowPos4fMESA( GLcontext *ctx,
- GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+void
+_mesa_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
- gl_windowpos( ctx, x, y, z, w );
+ /* KW: Assume that like rasterpos, this must be outside begin/end.
+ */
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "glWindowPosMESA" );
+
+ /* set raster position */
+ ctx->Current.RasterPos[0] = x;
+ ctx->Current.RasterPos[1] = y;
+ ctx->Current.RasterPos[2] = CLAMP( z, 0.0F, 1.0F );
+ ctx->Current.RasterPos[3] = w;
+
+ ctx->Current.RasterPosValid = GL_TRUE;
+
+ /* raster color */
+ if (0 && ctx->Light.Enabled) {
+
+ /* KW: I don't see how this can work - would have to take the
+ * inverse of the projection matrix or the combined
+ * modelProjection matrix, transform point and normal, and
+ * do the lighting. Those inverses are not used for
+ * anything else. This is not an object-space lighting
+ * issue - what this is trying to do is something like
+ * clip-space or window-space lighting...
+ *
+ * Anyway, since the implementation was never correct, I'm
+ * not fixing it now - just use the unlit color.
+ */
+
+ /* KW: As a reprise, we now *do* keep the inverse of the projection
+ * matrix, so it is not infeasible to try to swim up stream
+ * in this manner. I still don't want to implement it,
+ * however.
+ */
+ }
+ else {
+ /* use current color or index */
+ if (ctx->Visual->RGBAflag) {
+ UBYTE_RGBA_TO_FLOAT_RGBA(ctx->Current.RasterColor,
+ ctx->Current.ByteColor);
+ }
+ else {
+ ctx->Current.RasterIndex = ctx->Current.Index;
+ }
+ }
+
+ ctx->Current.RasterDistance = 0.0;
+
+ {
+ GLuint texSet;
+ for (texSet=0; texSet<MAX_TEXTURE_UNITS; texSet++) {
+ COPY_4FV( ctx->Current.RasterMultiTexCoord[texSet],
+ ctx->Current.Texcoord[texSet] );
+ }
+ }
+
+ if (ctx->RenderMode==GL_SELECT) {
+ gl_update_hitflag( ctx, ctx->Current.RasterPos[2] );
+ }
}
-#else
-
+#ifndef GL_MESA_window_pos
/*
* OpenGL implementation of glWindowPos*MESA()
@@ -116,8 +163,4 @@ void glWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
glPopAttrib();
}
-
#endif
-
-
-
diff --git a/xc/extras/Mesa/src/winpos.h b/xc/extras/Mesa/src/winpos.h
index d9293511b..663504be3 100644
--- a/xc/extras/Mesa/src/winpos.h
+++ b/xc/extras/Mesa/src/winpos.h
@@ -1,8 +1,8 @@
-/* $Id: winpos.h,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: winpos.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,15 +25,16 @@
*/
+#ifndef WINPOS_H
+#define WINPOS_H
+#include "glheader.h"
-#ifndef WINPOS_H
-#define WINPOS_H
-
+extern void
+_mesa_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
-#include "types.h"
#ifndef GL_MESA_window_pos
@@ -65,9 +66,4 @@ extern void glWindowPos4dvMESA( const GLdouble *p );
#endif
-
-extern void gl_WindowPos4fMESA( GLcontext *ctx,
- GLfloat x, GLfloat y, GLfloat z, GLfloat w );
-
-
#endif
diff --git a/xc/extras/Mesa/src/xform.c b/xc/extras/Mesa/src/xform.c
index 83328db0b..5ea3150fb 100644
--- a/xc/extras/Mesa/src/xform.c
+++ b/xc/extras/Mesa/src/xform.c
@@ -1,8 +1,8 @@
-/* $Id: xform.c,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: xform.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,8 +25,6 @@
*/
-/* $XFree86: xc/lib/GL/mesa/src/xform.c,v 1.4 1999/04/04 00:20:36 dawes Exp $ */
-
/*
* Matrix/vertex/vector transformation stuff
*
@@ -41,14 +39,7 @@
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#else
-#include "GL/xf86glx.h"
-#endif
-#include "vb.h"
+#include "glheader.h"
#include "context.h"
#include "mmath.h"
#include "types.h"
@@ -56,6 +47,7 @@
#include "xform.h"
#endif
+
#ifdef DEBUG
#include "debug_xform.h"
#endif
diff --git a/xc/extras/Mesa/src/xform.h b/xc/extras/Mesa/src/xform.h
index 3e74e2826..08b4e6518 100644
--- a/xc/extras/Mesa/src/xform.h
+++ b/xc/extras/Mesa/src/xform.h
@@ -1,8 +1,8 @@
-/* $Id: xform.h,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: xform.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -34,6 +34,13 @@
#include "types.h"
+#ifdef USE_X86_ASM
+#define _XFORMAPI _ASMAPI
+#define _XFORMAPIP _ASMAPIP
+#else
+#define _XFORMAPI
+#define _XFORMAPIP *
+#endif
/*
* Transform a point (column vector) by a matrix: Q = M * P
@@ -103,13 +110,12 @@ extern void gl_init_transformation( void );
* into a straight-forward matrix transformation, with asm acceleration
* automatically available.
*/
-typedef GLvector4f *(*clip_func)( GLvector4f *vClip,
+typedef GLvector4f * (_XFORMAPIP clip_func)( GLvector4f *vClip,
GLvector4f *vProj,
GLubyte clipMask[],
GLubyte *orMask,
GLubyte *andMask );
-
typedef void (*dotprod_func)( GLvector4f *out_vec,
GLuint elt,
const GLvector4f *coord_vec,
@@ -128,7 +134,7 @@ typedef void (*vec_copy_func)( GLvector4f *to,
* when the mask byte is zero. This is always present as a
* parameter, to allow a unified interface.
*/
-typedef void (*transform_func)( GLvector4f *to_vec,
+typedef void (_XFORMAPIP transform_func)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *clipmask,
diff --git a/xc/extras/Mesa/src/xform_tmp.h b/xc/extras/Mesa/src/xform_tmp.h
index 57d9f9345..b2b2f8820 100644
--- a/xc/extras/Mesa/src/xform_tmp.h
+++ b/xc/extras/Mesa/src/xform_tmp.h
@@ -1,4 +1,4 @@
-/* $Id: xform_tmp.h,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: xform_tmp.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -65,7 +65,7 @@
* cliped and/or culled vertices.
*/
-static void TAG(transform_points1_general)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points1_general)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -98,7 +98,7 @@ static void TAG(transform_points1_general)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points1_identity)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points1_identity)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -125,7 +125,7 @@ static void TAG(transform_points1_identity)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points1_2d)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points1_2d)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -154,7 +154,7 @@ static void TAG(transform_points1_2d)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points1_2d_no_rot)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points1_2d_no_rot)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -183,7 +183,7 @@ static void TAG(transform_points1_2d_no_rot)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points1_3d)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points1_3d)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -214,7 +214,7 @@ static void TAG(transform_points1_3d)( GLvector4f *to_vec,
}
-static void TAG(transform_points1_3d_no_rot)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points1_3d_no_rot)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -244,7 +244,7 @@ static void TAG(transform_points1_3d_no_rot)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points1_perspective)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points1_perspective)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -281,7 +281,7 @@ static void TAG(transform_points1_perspective)( GLvector4f *to_vec,
* present early in the geometry pipeline and throughout the
* texture pipeline.
*/
-static void TAG(transform_points2_general)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points2_general)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -313,7 +313,7 @@ static void TAG(transform_points2_general)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points2_identity)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points2_identity)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -340,7 +340,7 @@ static void TAG(transform_points2_identity)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points2_2d)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points2_2d)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -370,7 +370,7 @@ static void TAG(transform_points2_2d)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points2_2d_no_rot)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points2_2d_no_rot)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -399,7 +399,7 @@ static void TAG(transform_points2_2d_no_rot)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points2_3d)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points2_3d)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -433,7 +433,7 @@ static void TAG(transform_points2_3d)( GLvector4f *to_vec,
/* I would actually say this was a fairly important function, from
* a texture transformation point of view.
*/
-static void TAG(transform_points2_3d_no_rot)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points2_3d_no_rot)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -472,7 +472,7 @@ static void TAG(transform_points2_3d_no_rot)( GLvector4f *to_vec,
* code. It's also hard to remove any of these functions if you are
* attached to the assertions that have appeared in them.
*/
-static void TAG(transform_points2_perspective)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points2_perspective)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -504,7 +504,7 @@ static void TAG(transform_points2_perspective)( GLvector4f *to_vec,
-static void TAG(transform_points3_general)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points3_general)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -537,7 +537,7 @@ static void TAG(transform_points3_general)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points3_identity)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points3_identity)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -565,7 +565,7 @@ static void TAG(transform_points3_identity)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points3_2d)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points3_2d)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -595,7 +595,7 @@ static void TAG(transform_points3_2d)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points3_2d_no_rot)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points3_2d_no_rot)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -624,7 +624,7 @@ static void TAG(transform_points3_2d_no_rot)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points3_3d)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points3_3d)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -657,7 +657,7 @@ static void TAG(transform_points3_3d)( GLvector4f *to_vec,
/* previously known as ortho...
*/
-static void TAG(transform_points3_3d_no_rot)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points3_3d_no_rot)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -687,7 +687,7 @@ static void TAG(transform_points3_3d_no_rot)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points3_perspective)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points3_perspective)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -720,7 +720,7 @@ static void TAG(transform_points3_perspective)( GLvector4f *to_vec,
-static void TAG(transform_points4_general)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points4_general)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -753,7 +753,7 @@ static void TAG(transform_points4_general)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points4_identity)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points4_identity)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -782,7 +782,7 @@ static void TAG(transform_points4_identity)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points4_2d)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points4_2d)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -813,7 +813,7 @@ static void TAG(transform_points4_2d)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points4_2d_no_rot)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points4_2d_no_rot)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -843,7 +843,7 @@ static void TAG(transform_points4_2d_no_rot)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points4_3d)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points4_3d)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -875,7 +875,7 @@ static void TAG(transform_points4_3d)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points4_3d_no_rot)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points4_3d_no_rot)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -906,7 +906,7 @@ static void TAG(transform_points4_3d_no_rot)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static void TAG(transform_points4_perspective)( GLvector4f *to_vec,
+static void _XFORMAPI TAG(transform_points4_perspective)( GLvector4f *to_vec,
const GLmatrix *mat,
const GLvector4f *from_vec,
const GLubyte *mask,
@@ -938,16 +938,16 @@ static void TAG(transform_points4_perspective)( GLvector4f *to_vec,
to_vec->count = from_vec->count;
}
-static transform_func TAG(transform_tab_1)[7];
-static transform_func TAG(transform_tab_2)[7];
-static transform_func TAG(transform_tab_3)[7];
-static transform_func TAG(transform_tab_4)[7];
+static transform_func _XFORMAPI TAG(transform_tab_1)[7];
+static transform_func _XFORMAPI TAG(transform_tab_2)[7];
+static transform_func _XFORMAPI TAG(transform_tab_3)[7];
+static transform_func _XFORMAPI TAG(transform_tab_4)[7];
/* Similar functions could be called several times, with more highly
* optimized routines overwriting the arrays. This only occurs during
* startup.
*/
-static void TAG(init_c_transformations)( void )
+static void _XFORMAPI TAG(init_c_transformations)( void )
{
#define TAG_TAB gl_transform_tab[IDX]
#define TAG_TAB_1 TAG(transform_tab_1)
diff --git a/xc/extras/Mesa/src/zoom.c b/xc/extras/Mesa/src/zoom.c
index ea732e215..f8a8c8a87 100644
--- a/xc/extras/Mesa/src/zoom.c
+++ b/xc/extras/Mesa/src/zoom.c
@@ -1,8 +1,8 @@
-/* $Id: zoom.c,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
+/* $Id: zoom.c,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,17 +25,10 @@
*/
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "macros.h"
#include "span.h"
#include "stencil.h"
@@ -63,7 +56,7 @@ gl_write_zoomed_rgba_span( GLcontext *ctx,
GLint i, j, skipcol;
GLubyte zrgba[MAX_WIDTH][4]; /* zoomed pixel colors */
GLdepth zdepth[MAX_WIDTH]; /* zoomed depth values */
- GLint maxwidth = MIN2( ctx->Buffer->Width, MAX_WIDTH );
+ GLint maxwidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
const GLuint *srcRGBA32 = (const GLuint *) rgba;
GLuint *dstRGBA32 = (GLuint *) zrgba;
@@ -95,7 +88,7 @@ gl_write_zoomed_rgba_span( GLcontext *ctx,
/* below window */
return;
}
- if (r0>=ctx->Buffer->Height && r1>=ctx->Buffer->Height) {
+ if (r0>=ctx->DrawBuffer->Height && r1>=ctx->DrawBuffer->Height) {
/* above window */
return;
}
@@ -153,7 +146,7 @@ gl_write_zoomed_rgb_span( GLcontext *ctx,
GLint i, j, skipcol;
GLubyte zrgba[MAX_WIDTH][4]; /* zoomed pixel colors */
GLdepth zdepth[MAX_WIDTH]; /* zoomed depth values */
- GLint maxwidth = MIN2( ctx->Buffer->Width, MAX_WIDTH );
+ GLint maxwidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
/* compute width of output row */
m = (GLint) ABSF( n * ctx->Pixel.ZoomX );
@@ -183,7 +176,7 @@ gl_write_zoomed_rgb_span( GLcontext *ctx,
/* below window */
return;
}
- if (r0>=ctx->Buffer->Height && r1>=ctx->Buffer->Height) {
+ if (r0>=ctx->DrawBuffer->Height && r1>=ctx->DrawBuffer->Height) {
/* above window */
return;
}
@@ -250,7 +243,7 @@ gl_write_zoomed_index_span( GLcontext *ctx,
GLint i, j, skipcol;
GLuint zindexes[MAX_WIDTH]; /* zoomed color indexes */
GLdepth zdepth[MAX_WIDTH]; /* zoomed depth values */
- GLint maxwidth = MIN2( ctx->Buffer->Width, MAX_WIDTH );
+ GLint maxwidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
/* compute width of output row */
m = (GLint) ABSF( n * ctx->Pixel.ZoomX );
@@ -280,7 +273,7 @@ gl_write_zoomed_index_span( GLcontext *ctx,
/* below window */
return;
}
- if (r0>=ctx->Buffer->Height && r1>=ctx->Buffer->Height) {
+ if (r0>=ctx->DrawBuffer->Height && r1>=ctx->DrawBuffer->Height) {
/* above window */
return;
}
@@ -340,7 +333,7 @@ gl_write_zoomed_stencil_span( GLcontext *ctx,
GLint r0, r1, row, r;
GLint i, j, skipcol;
GLstencil zstencil[MAX_WIDTH]; /* zoomed stencil values */
- GLint maxwidth = MIN2( ctx->Buffer->Width, MAX_WIDTH );
+ GLint maxwidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
/* compute width of output row */
m = (GLint) ABSF( n * ctx->Pixel.ZoomX );
@@ -370,7 +363,7 @@ gl_write_zoomed_stencil_span( GLcontext *ctx,
/* below window */
return;
}
- if (r0>=ctx->Buffer->Height && r1>=ctx->Buffer->Height) {
+ if (r0>=ctx->DrawBuffer->Height && r1>=ctx->DrawBuffer->Height) {
/* above window */
return;
}
diff --git a/xc/extras/Mesa/src/zoom.h b/xc/extras/Mesa/src/zoom.h
index bb6761481..294de97c3 100644
--- a/xc/extras/Mesa/src/zoom.h
+++ b/xc/extras/Mesa/src/zoom.h
@@ -1,9 +1,8 @@
-/* $Id: zoom.h,v 1.3 1999/12/14 02:39:39 daryll Exp $ */
-
+/* $Id: zoom.h,v 1.4 2000/01/30 00:27:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -26,8 +25,6 @@
*/
-
-
#ifndef ZOOM_H
#define ZOOM_H
diff --git a/xc/include/GL/gl.h b/xc/include/GL/gl.h
index 8b7a7e2e8..0efbe646d 100644
--- a/xc/include/GL/gl.h
+++ b/xc/include/GL/gl.h
@@ -5,7 +5,7 @@
extern "C" {
#endif
-/* $XFree86: xc/include/GL/gl.h,v 1.3 1999/12/14 01:32:21 robin Exp $ */
+/* $XFree86: xc/include/GL/gl.h,v 1.2 1999/06/14 07:23:27 dawes Exp $ */
/*
** The contents of this file are subject to the GLX Public License Version 1.0
** (the "License"). You may not use this file except in compliance with the
@@ -1552,6 +1552,8 @@ extern void glArrayElementEXT (GLint i);
extern void glBegin (GLenum mode);
extern void glBindTexture (GLenum target, GLuint texture);
extern void glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
+extern void glBlendColorEXT (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+extern void glBlendEquationEXT (GLenum mode);
extern void glBlendFunc (GLenum sfactor, GLenum dfactor);
extern void glCallList (GLuint list);
extern void glCallLists (GLsizei n, GLenum type, const GLvoid *lists);
@@ -1603,6 +1605,7 @@ extern void glCopyTexImage1D (GLenum target, GLint level, GLenum internalformat,
extern void glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
extern void glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
extern void glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+extern void glCopyTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height );
extern void glCullFace (GLenum mode);
extern void glDeleteLists (GLuint list, GLsizei range);
extern void glDeleteTextures (GLsizei n, const GLuint *textures);
@@ -1615,6 +1618,7 @@ extern void glDrawArrays (GLenum mode, GLint first, GLsizei count);
extern void glDrawBuffer (GLenum mode);
extern void glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
extern void glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+extern void glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
extern void glEdgeFlag (GLboolean flag);
extern void glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer);
extern void glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer);
@@ -1854,12 +1858,14 @@ extern void glTexGeni (GLenum coord, GLenum pname, GLint param);
extern void glTexGeniv (GLenum coord, GLenum pname, const GLint *params);
extern void glTexImage1D (GLenum target, GLint level, GLint components, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
extern void glTexImage2D (GLenum target, GLint level, GLint components, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+extern void glTexImage3D (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
extern void glTexParameterf (GLenum target, GLenum pname, GLfloat param);
extern void glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
extern void glTexParameteri (GLenum target, GLenum pname, GLint param);
extern void glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
extern void glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
extern void glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+extern void glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
extern void glTranslated (GLdouble x, GLdouble y, GLdouble z);
extern void glTranslatef (GLfloat x, GLfloat y, GLfloat z);
extern void glUnlockArraysEXT (void);
diff --git a/xc/lib/GL/Imakefile b/xc/lib/GL/Imakefile
index c3f656516..2c154b2a1 100644
--- a/xc/lib/GL/Imakefile
+++ b/xc/lib/GL/Imakefile
@@ -12,7 +12,7 @@ XCOMM $PI: xc/lib/GL/Imakefile,v 1.11 1999/06/14 21:10:34 faith Exp $
#if BuildXF86DRI
DRIDIRS = dri
-MESADIRS = mesa/include/GL mesa/src
+MESADIRS = mesa/dri mesa/include/GL mesa/src
#endif
SUBDIRS = glx $(DRIDIRS) $(MESADIRS)
@@ -33,17 +33,12 @@ DependSubdirs($(SUBDIRS))
GLXDONES = glx/DONE
#if BuildXF86DRI
- DRIOBJS = dri/?*.o
- DRIUOBJS = dri/unshared/?*.o
- DRIDOBJS = dri/debugger/?*.o
- DRIPOBJS = dri/profiled/?*.o
+ DRIOBJS = dri/XF86dri.o dri/dri_glx.o
+ DRIUOBJS = dri/unshared/XF86dri.o dri/unshared/dri_glx.o
+ DRIDOBJS = dri/debugger/XF86dri.o dri/debugger/dri_glx.o
+ DRIPOBJS = dri/profiled/XF86dri.o dri/profiled/dri_glx.o
DRIDONES = dri/DONE
- DRMOBJS = dri/drm/?*.o
- DRMUOBJS = dri/drm/unshared/?*.o
- DRMDOBJS = dri/drm/debugger/?*.o
- DRMPOBJS = dri/drm/profiled/?*.o
- DRMDONES = dri/drm/DONE
#if !GlxUseSGISI
#if GlxBuiltInGamma
DRVOBJS = mesa/src/drv/gamma/?*.o
@@ -52,22 +47,37 @@ DependSubdirs($(SUBDIRS))
DRVPOBJS = mesa/src/drv/gamma/profiled/?*.o
DRVDONES = mesa/src/drv/gamma/DONE
#elif GlxBuiltInTdfx
+ DRMOBJS = dri/drm/?*.o
+ DRMUOBJS = dri/drm/unshared/?*.o
+ DRMDOBJS = dri/drm/debugger/?*.o
+ DRMPOBJS = dri/drm/profiled/?*.o
+ DRMDONES = dri/drm/DONE
+
TDFXOBJS = mesa/src/drv/tdfx/?*.o
TDFXUOBJS = mesa/src/drv/tdfx/unshared/?*.o
TDFXDOBJS = mesa/src/drv/tdfx/debugger/?*.o
TDFXPOBJS = mesa/src/drv/tdfx/profiled/?*.o
TDFXDONES = mesa/src/drv/tdfx/DONE
+
MESAOBJS = mesa/src/?*.o mesa/src/X86/?*.o
MESAUOBJS = mesa/src/unshared/?*.o mesa/src/X86/unshared/?*.o
MESADOBJS = mesa/src/debugger/?*.o mesa/src/X86/debugger/?*.o
MESAPOBJS = mesa/src/profiled/?*.o mesa/src/X86/profiled/?*.o
MESADONES = mesa/src/DONE mesa/src/X86/DONE
- DRVOBJS = $(TDFXOBJS) $(MESAOBJS)
- DRVUOBJS = $(TDFXUOBJS) $(MESAUOBJS)
- DRVDOBJS = $(TDFXDOBJS) $(MESADOBJS)
- DRVPOBJS = $(TDFXPOBJS) $(MESAPOBJS)
- DRVDONES = $(TDFXDONES) $(MESADONES)
-REQUIREDLIBS += -lglide3x
+
+ DRIMESAOBJS = mesa/dri/?*.o
+DRIMESAUOBJS = mesa/dri/unshared/?*.o
+DRIMESADOBJS = mesa/dri/debugger/?*.o
+DRIMESAPOBJS = mesa/dri/profiled/?*.o
+DRIMESADONES = mesa/dri/DONE
+
+ DRVOBJS = $(TDFXOBJS) $(MESAOBJS) $(DRIMESAOBJS) $(DRMOBJS)
+ DRVUOBJS = $(TDFXUOBJS) $(MESAUOBJS) $(DRIMESAUOBJS) $(DRMUOBJS)
+ DRVDOBJS = $(TDFXDOBJS) $(MESADOBJS) $(DRIMESADOBJS) $(DRMDOBJS)
+ DRVPOBJS = $(TDFXPOBJS) $(MESAPOBJS) $(DRIMESAPOBJS) $(DRMPOBJS)
+ DRVDONES = $(TDFXDONES) $(MESADONES) $(DRIMESADONES) $(DRMDONES)
+
+ REQUIREDLIBS += -lglide3x
#elif GlxBuiltInMesa
#ifndef GlxDriverUsesMesa
DRVOBJS = mesa/src/?*.o mesa/src/X/?*.o
@@ -83,16 +93,16 @@ REQUIREDLIBS += -lglide3x
#ifdef OS2Architecture
OBJS = $(LIBNAME).a
#else
- OBJS = $(GLXOBJS) $(DRIOBJS) $(DRMOBJS) $(DRVOBJS)
+ OBJS = $(GLXOBJS) $(DRIOBJS) $(DRVOBJS)
#endif
#if HasSharedLibraries
- UOBJS = $(GLXUOBJS) $(DRIUOBJS) $(DRMUOBJS) $(DRVUOBJS)
+ UOBJS = $(GLXUOBJS) $(DRIUOBJS) $(DRVUOBJS)
#else
UOBJS = $(OBJS)
#endif
- DOBJS = $(GLXDOBJS) $(DRIDOBJS) $(DRMDOBJS) $(DRVDOBJS)
- POBJS = $(GLXPOBJS) $(DRIPOBJS) $(DRMPOBJS) $(DRVPOBJS)
- DONES = $(GLXDONES) $(DRIDONES) $(DRMDONES) $(DRVDONES)
+ DOBJS = $(GLXDOBJS) $(DRIDOBJS) $(DRVDOBJS)
+ POBJS = $(GLXPOBJS) $(DRIPOBJS) $(DRVPOBJS)
+ DONES = $(GLXDONES) $(DRIDONES) $(DRVDONES)
#include <Library.tmpl>
@@ -115,3 +125,4 @@ InstallLibrary($(LIBNAME)_d,$(USRLIBDIR))
ProfiledDepLibraryTarget($(LIBNAME),$(SUBDIRS) $(DONES),$(POBJS))
InstallLibrary($(LIBNAME)_p,$(USRLIBDIR))
#endif
+
diff --git a/xc/lib/GL/dri/Imakefile b/xc/lib/GL/dri/Imakefile
index 11218523d..b2918d61a 100644
--- a/xc/lib/GL/dri/Imakefile
+++ b/xc/lib/GL/dri/Imakefile
@@ -12,8 +12,8 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
#endif
#if !GlxUseSGISI
- DRI_SRCS = dri_mesa.c dri_mesa_init.c
- DRI_OBJS = dri_mesa.o dri_mesa_init.o
+ DRI_SRCS = dri_glx.c
+ DRI_OBJS = dri_glx.o
DRI_INCS = -I. -I../glx -I$(TOP)/include -I$(TOP)/include/GL \
-I$(SERVERSRC)/GL/dri \
-I../mesa/include -I../mesa/src -I../mesa/src/drv/gamma
@@ -23,7 +23,11 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
TDFX_DEFS = -DUSE_TDFX
#endif
- DEFINES = $(ALLOC_DEFINES) GlxDefines $(TDFX_DEFS)
+#if GlxUseBuiltInDRIDriver
+ GLX_DEFS = -DBUILT_IN_DRI_DRIVER
+#endif
+
+ DEFINES = $(ALLOC_DEFINES) GlxDefines $(TDFX_DEFS) $(GLX_DEFS)
INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) -I$(XF86OSSRC) $(DRI_INCS)
SRCS = XF86dri.c dri_tmm.c $(DRI_SRCS)
OBJS = XF86dri.o dri_tmm.o $(DRI_OBJS)
diff --git a/xc/lib/GL/dri/dri_glx.c b/xc/lib/GL/dri/dri_glx.c
new file mode 100644
index 000000000..078a9a2dc
--- /dev/null
+++ b/xc/lib/GL/dri/dri_glx.c
@@ -0,0 +1,252 @@
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, 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 PRECISION INSIGHT 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.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <kevin@precisioninsight.com>
+ * Brian Paul <brian@precisioninsight.com>
+ *
+ */
+
+#ifdef GLX_DIRECT_RENDERING
+
+#include <unistd.h>
+#include <Xlibint.h>
+#include <Xext.h>
+#include <extutil.h>
+#include "glxclient.h"
+#include "xf86dri.h"
+#include "sarea.h"
+#include <stdio.h>
+#include <dlfcn.h>
+#include "dri_glx.h"
+#include <sys/types.h>
+
+
+typedef void *(*CreateScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc,
+ int numConfigs, __GLXvisualConfig *config);
+
+
+
+#ifdef BUILT_IN_DRI_DRIVER
+
+extern void *driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
+ int numConfigs, __GLXvisualConfig *config);
+
+
+#else /* BUILT_IN_DRI_DRIVER */
+
+
+#define DEFAULT_LIB_DIR "/usr/X11R6/lib/modules/dri"
+
+
+static void ErrorMessage(const char *msg)
+{
+ if (getenv("LIBGL_DEBUG")) {
+ fprintf(stderr, "libGL error: %s\n", msg);
+ }
+}
+
+
+/*
+ * We'll save a pointer to this function when we couldn't find a
+ * direct rendering driver for a given screen.
+ */
+static void *DummyCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
+ int numConfigs, __GLXvisualConfig *config)
+{
+ (void) dpy;
+ (void) scrn;
+ (void) psc;
+ (void) numConfigs;
+ (void) config;
+ return NULL;
+}
+
+
+/*
+ * Initialize two arrays: an array of createScreen function pointers
+ * and an array of dlopen library handles. Arrays are indexed by
+ * screen number.
+ * We use the DRI in order to find the driCreateScreen function
+ * exported by each screen on a display.
+ */
+static void Find_CreateScreenFuncs(Display *dpy,
+ CreateScreenFunc *createFuncs,
+ void **libraryHandles)
+{
+ const int numScreens = ScreenCount(dpy);
+ int scrn;
+
+ for (scrn = 0; scrn < numScreens; scrn++) {
+ int directCapable;
+ Bool b;
+ int driverMajor, driverMinor, driverPatch;
+ char *driverName = NULL;
+
+ /* defaults */
+ createFuncs[scrn] = DummyCreateScreen;
+ libraryHandles[scrn] = NULL;
+
+ if (!XF86DRIQueryDirectRenderingCapable(dpy, scrn, &directCapable)) {
+ continue;
+ }
+ if (!directCapable) {
+ continue;
+ }
+
+ /*
+ * Use DRI to find the device driver for use on screen number 'scrn'.
+ */
+ b = XF86DRIGetClientDriverName(dpy, scrn, &driverMajor, &driverMinor,
+ &driverPatch, &driverName);
+ if (!b) {
+ char message[1000];
+ snprintf(message, 1000, "Cannot determine driver name for screen %d", scrn);
+ ErrorMessage(message);
+ continue;
+ }
+
+
+ /*
+ * dlopen the driver module and call its driCreateScreen function.
+ */
+ {
+ char realDriverName[100];
+ void *handle;
+ CreateScreenFunc createScreenFunc;
+ char *libDir = NULL;
+
+ if (geteuid() == getuid()) {
+ /* don't allow setuid apps to use DRI_MODULES_DIR */
+ libDir = getenv("DRI_MODULES_DIR");
+ }
+ if (!libDir)
+ libDir = DEFAULT_LIB_DIR;
+
+ sprintf(realDriverName, "%s/%s_dri.so", libDir, driverName);
+ /*printf("OPEN %s\n", realDriverName);*/
+ handle = dlopen(realDriverName, RTLD_LAZY);
+ if (!handle) {
+ char message[1000];
+ snprintf(message, 1000, "dlopen failed: %s", dlerror());
+ ErrorMessage(message);
+ continue;
+ }
+
+ createScreenFunc = (CreateScreenFunc) dlsym(handle, "driCreateScreen");
+ if (createScreenFunc) {
+ /* success! */
+ createFuncs[scrn] = createScreenFunc;
+ libraryHandles[scrn] = handle;
+ }
+ else {
+ char message[1000];
+ snprintf(message, 1000, "driCreateScreen() not defined in %s", realDriverName);
+ ErrorMessage(message);
+ dlclose(handle);
+ }
+ }
+ }
+}
+
+#endif /* BUILT_IN_DRI_DRIVER */
+
+
+static void driDestroyDisplay(Display *dpy, void *private)
+{
+ __DRIdisplayPrivate *pdpyp = (__DRIdisplayPrivate *)private;
+
+ if (pdpyp) {
+ const int numScreens = ScreenCount(dpy);
+ int i;
+ for (i = 0; i < numScreens; i++) {
+ if (pdpyp->libraryHandles[i])
+ dlclose(pdpyp->libraryHandles[i]);
+ }
+ Xfree(pdpyp->libraryHandles);
+ Xfree(pdpyp);
+ }
+}
+
+
+void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp)
+{
+ const int numScreens = ScreenCount(dpy);
+ __DRIdisplayPrivate *pdpyp;
+ int eventBase, errorBase;
+ int major, minor, patch;
+
+ if (!XF86DRIQueryExtension(dpy, &eventBase, &errorBase)) {
+ return NULL;
+ }
+
+ if (!XF86DRIQueryVersion(dpy, &major, &minor, &patch)) {
+ return NULL;
+ }
+
+ pdpyp = (__DRIdisplayPrivate *)Xmalloc(sizeof(__DRIdisplayPrivate));
+ if (!pdpyp) {
+ return NULL;
+ }
+
+ pdpyp->major = major;
+ pdpyp->minor = minor;
+ pdpyp->patch = patch;
+
+ pdisp->destroyDisplay = driDestroyDisplay;
+
+ /* allocate array of pointers to createScreen funcs */
+ pdisp->createScreen = (CreateScreenFunc *) Xmalloc(numScreens * sizeof(void *));
+ if (!pdisp->createScreen)
+ return NULL;
+
+ /* allocate array of library handles */
+ pdpyp->libraryHandles = (void **) Xmalloc(numScreens * sizeof(void*));
+ if (!pdpyp->libraryHandles) {
+ Xfree(pdisp->createScreen);
+ return NULL;
+ }
+
+#ifdef BUILT_IN_DRI_DRIVER
+ /* we'll statically bind to the driCreateScreen function */
+ {
+ int i;
+ for (i = 0; i < numScreens; i++) {
+ pdisp->createScreen[i] = driCreateScreen;
+ pdpyp->libraryHandles[i] = NULL;
+ }
+ }
+#else
+ Find_CreateScreenFuncs(dpy, pdisp->createScreen, pdpyp->libraryHandles);
+#endif
+
+ return (void *)pdpyp;
+}
+
+
+#endif /* GLX_DIRECT_RENDERING */
diff --git a/xc/lib/GL/dri/dri_mesa_init.h b/xc/lib/GL/dri/dri_glx.h
index 459581825..21fe733bc 100644
--- a/xc/lib/GL/dri/dri_mesa_init.h
+++ b/xc/lib/GL/dri/dri_glx.h
@@ -1,4 +1,3 @@
-/* $XFree86: xc/lib/GL/dri/dri_mesa_init.h,v 1.1 1999/06/14 07:23:32 dawes Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -29,20 +28,34 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/*
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
+ * Brian Paul <brian@precisioninsight.com>
*
- * $PI: xc/lib/GL/dri/dri_mesa_init.h,v 1.2 1999/04/05 05:24:31 martin Exp $
*/
-#ifndef _DRI_MESA_INIT_H_
-#define _DRI_MESA_INIT_H_
+#ifndef _DRI_GLX_H_
+#define _DRI_GLX_H_
#ifdef GLX_DIRECT_RENDERING
-#include "dri_glapi.h"
-#include "dri_xmesaapi.h"
-
-extern void *driMesaInitAPI(char *name, __XMESAapi *xmesa, __GLapi *gl);
-extern void driMesaDestroyAPI(void *handle);
+struct __DRIdisplayPrivateRec {
+ /*
+ ** XFree86-DRI version information
+ */
+ int major;
+ int minor;
+ int patch;
+
+ /*
+ ** Array of library handles [indexed by screen number]
+ */
+ void **libraryHandles;
+};
+
+typedef struct __DRIdisplayPrivateRec __DRIdisplayPrivate;
+typedef struct __DRIscreenPrivateRec __DRIscreenPrivate;
+typedef struct __DRIvisualPrivateRec __DRIvisualPrivate;
+typedef struct __DRIcontextPrivateRec __DRIcontextPrivate;
+typedef struct __DRIdrawablePrivateRec __DRIdrawablePrivate;
#endif
-#endif /* _DRI_MESA_INIT_H_ */
+#endif /* _DRI_GLX_H_ */
diff --git a/xc/lib/GL/glx/Imakefile b/xc/lib/GL/glx/Imakefile
index d4c4297aa..21c837814 100644
--- a/xc/lib/GL/glx/Imakefile
+++ b/xc/lib/GL/glx/Imakefile
@@ -29,56 +29,85 @@ XCOMM SUBDIRS = \
XCOMM glu \
XCOMM glw
-SRCS = \
- dri_glapi.c \
- clientattrib.c \
- compsize.c \
- eval.c \
- g_render.c \
- g_single.c \
- g_vendpriv.c \
- glxcmds.c \
- glxext.c \
- indirect_init.c \
- pixel.c \
- pixelstore.c \
- render2.c \
- renderpix.c \
- single2.c \
- singlepix.c \
- vertarr.c \
- xfont.c
+LinkSourceFile(glapi.c, ../../../extras/Mesa/src)
+LinkSourceFile(glapi.h, ../../../extras/Mesa/src)
+LinkSourceFile(glapinoop.c, ../../../extras/Mesa/src)
+LinkSourceFile(glapinoop.h, ../../../extras/Mesa/src)
+LinkSourceFile(glapioffsets.h, ../../../extras/Mesa/src)
+LinkSourceFile(glapitable.h, ../../../extras/Mesa/src)
+LinkSourceFile(glapitemp.h, ../../../extras/Mesa/src)
+LinkSourceFile(glthread.c, ../../../extras/Mesa/src)
+LinkSourceFile(glthread.h, ../../../extras/Mesa/src)
+LinkSourceFile(glapi_x86.S, ../../../extras/Mesa/src/X86)
+LinkSourceFile(assyntax.h, ../../../extras/Mesa/src/X86)
-OBJS = \
- dri_glapi.o \
- clientattrib.o \
- compsize.o \
- eval.o \
- g_render.o \
- g_single.o \
- g_vendpriv.o \
- glxcmds.o \
- glxext.o \
- indirect_init.o \
- pixel.o \
- pixelstore.o \
- render2.o \
- renderpix.o \
- single2.o \
- singlepix.o \
- vertarr.o \
- xfont.o
+ GLX_SRCS = \
+ clientattrib.c \
+ compsize.c \
+ dispatch.c \
+ eval.c \
+ g_render.c \
+ g_single.c \
+ g_vendpriv.c \
+ glapi.c \
+ glapinoop.c \
+ glthread.c \
+ glxcmds.c \
+ glxext.c \
+ indirect_init.c \
+ pixel.c \
+ pixelstore.c \
+ render2.c \
+ renderpix.c \
+ single2.c \
+ singlepix.c \
+ vertarr.c \
+ xfont.c
+
+ GLX_OBJS = \
+ clientattrib.o \
+ compsize.o \
+ dispatch.o \
+ eval.o \
+ g_render.o \
+ g_single.o \
+ g_vendpriv.o \
+ glapi.o \
+ glapinoop.o \
+ glthread.o \
+ glxcmds.o \
+ glxext.o \
+ indirect_init.o \
+ pixel.o \
+ pixelstore.o \
+ render2.o \
+ renderpix.o \
+ single2.o \
+ singlepix.o \
+ vertarr.o \
+ xfont.o
#if BuildXF86DRI
-DEFINES = GlxDefines
-DRI_INCS = -I../dri
+ GLX_DEFS = GlxDefines
+ DRI_INCS = -I../dri
+#endif
+
+#ifdef i386Architecture
+ ASM_SRCS = glapi_x86.S
+ ASM_OBJS = glapi_x86.o
+ ASM_DEFS = -DUSE_X86_ASM
#endif
-INCLUDES = -I$(TOP)/include \
- -I$(TOP)/include/extensions \
- -I$(TOP)/include/GL \
- -I$(INCLUDESRC) \
- $(DRI_INCS)
+ SRCS = $(GLX_SRCS) $(ASM_SRCS)
+ OBJS = $(GLX_OBJS) $(ASM_OBJS)
+ DEFINES = $(GLX_DEFS) $(ASM_DEFS)
+
+ INCLUDES = -I$(TOP)/include \
+ -I$(TOP)/include/extensions \
+ -I$(TOP)/include/GL \
+ -I$(INCLUDESRC) \
+ -I../mesa/src \
+ $(DRI_INCS)
#include <Library.tmpl>
diff --git a/xc/lib/GL/glx/dispatch.c b/xc/lib/GL/glx/dispatch.c
new file mode 100644
index 000000000..b1f83abaa
--- /dev/null
+++ b/xc/lib/GL/glx/dispatch.c
@@ -0,0 +1,62 @@
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, 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 PRECISION INSIGHT 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.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Brian Paul <brian@precisioninsight.com>
+ *
+ */
+
+
+#include <GL/gl.h>
+#include "glapi.h"
+#include "glapitable.h"
+
+
+#define KEYWORD1
+
+#define KEYWORD2
+
+#if defined(USE_X86_ASM)
+#define NAME(func) _glapi_fallback_##func
+#else
+#define NAME(func) gl##func
+#endif
+
+#define DISPATCH(func, args, msg) \
+ const struct _glapi_table *dispatch; \
+ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
+ (dispatch->func) args
+
+#define RETURN_DISPATCH(func, args, msg) \
+ const struct _glapi_table *dispatch; \
+ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
+ return (dispatch->func) args
+
+
+#include "glapitemp.h"
+
diff --git a/xc/lib/GL/glx/dri_glapi.h b/xc/lib/GL/glx/dri_glapi.h
index 3d5f986d4..e02b489d5 100644
--- a/xc/lib/GL/glx/dri_glapi.h
+++ b/xc/lib/GL/glx/dri_glapi.h
@@ -40,348 +40,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <GL/gl.h>
-/* NOTE: This file could be automatically generated */
+typedef struct _glapi_table __GLapi;
-typedef struct __GLapiRec __GLapi;
-
-struct __GLapiRec {
- void (*Accum)(GLenum op, GLfloat value);
- void (*AlphaFunc)(GLenum func, GLclampf ref);
- GLboolean (*AreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences);
- void (*ArrayElement)(GLint i);
- void (*Begin)(GLenum mode);
- void (*BindTexture)(GLenum target, GLuint texture);
- void (*Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
- void (*BlendFunc)(GLenum sfactor, GLenum dfactor);
- void (*CallList)(GLuint list);
- void (*CallLists)(GLsizei n, GLenum type, const GLvoid *lists);
- void (*Clear)(GLbitfield mask);
- void (*ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
- void (*ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
- void (*ClearDepth)(GLclampd depth);
- void (*ClearIndex)(GLfloat c);
- void (*ClearStencil)(GLint s);
- void (*ClipPlane)(GLenum plane, const GLdouble *equation);
- void (*Color3b)(GLbyte red, GLbyte green, GLbyte blue);
- void (*Color3bv)(const GLbyte *v);
- void (*Color3d)(GLdouble red, GLdouble green, GLdouble blue);
- void (*Color3dv)(const GLdouble *v);
- void (*Color3f)(GLfloat red, GLfloat green, GLfloat blue);
- void (*Color3fv)(const GLfloat *v);
- void (*Color3i)(GLint red, GLint green, GLint blue);
- void (*Color3iv)(const GLint *v);
- void (*Color3s)(GLshort red, GLshort green, GLshort blue);
- void (*Color3sv)(const GLshort *v);
- void (*Color3ub)(GLubyte red, GLubyte green, GLubyte blue);
- void (*Color3ubv)(const GLubyte *v);
- void (*Color3ui)(GLuint red, GLuint green, GLuint blue);
- void (*Color3uiv)(const GLuint *v);
- void (*Color3us)(GLushort red, GLushort green, GLushort blue);
- void (*Color3usv)(const GLushort *v);
- void (*Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
- void (*Color4bv)(const GLbyte *v);
- void (*Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
- void (*Color4dv)(const GLdouble *v);
- void (*Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
- void (*Color4fv)(const GLfloat *v);
- void (*Color4i)(GLint red, GLint green, GLint blue, GLint alpha);
- void (*Color4iv)(const GLint *v);
- void (*Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha);
- void (*Color4sv)(const GLshort *v);
- void (*Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
- void (*Color4ubv)(const GLubyte *v);
- void (*Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha);
- void (*Color4uiv)(const GLuint *v);
- void (*Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha);
- void (*Color4usv)(const GLushort *v);
- void (*ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
- void (*ColorMaterial)(GLenum face, GLenum mode);
- void (*ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
- void (*CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
- void (*CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
- void (*CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
- void (*CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
- void (*CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
- void (*CullFace)(GLenum mode);
- void (*DeleteLists)(GLuint list, GLsizei range);
- void (*DeleteTextures)(GLsizei n, const GLuint *textures);
- void (*DepthFunc)(GLenum func);
- void (*DepthMask)(GLboolean flag);
- void (*DepthRange)(GLclampd zNear, GLclampd zFar);
- void (*Disable)(GLenum cap);
- void (*DisableClientState)(GLenum array);
- void (*DrawArrays)(GLenum mode, GLint first, GLsizei count);
- void (*DrawBuffer)(GLenum mode);
- void (*DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
- void (*DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
- void (*EdgeFlag)(GLboolean flag);
- void (*EdgeFlagPointer)(GLsizei stride, const GLvoid *pointer);
- void (*EdgeFlagv)(const GLboolean *flag);
- void (*Enable)(GLenum cap);
- void (*EnableClientState)(GLenum array);
- void (*End)(void);
- void (*EndList)(void);
- void (*EvalCoord1d)(GLdouble u);
- void (*EvalCoord1dv)(const GLdouble *u);
- void (*EvalCoord1f)(GLfloat u);
- void (*EvalCoord1fv)(const GLfloat *u);
- void (*EvalCoord2d)(GLdouble u, GLdouble v);
- void (*EvalCoord2dv)(const GLdouble *u);
- void (*EvalCoord2f)(GLfloat u, GLfloat v);
- void (*EvalCoord2fv)(const GLfloat *u);
- void (*EvalMesh1)(GLenum mode, GLint i1, GLint i2);
- void (*EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
- void (*EvalPoint1)(GLint i);
- void (*EvalPoint2)(GLint i, GLint j);
- void (*FeedbackBuffer)(GLsizei size, GLenum type, GLfloat *buffer);
- void (*Finish)(void);
- void (*Flush)(void);
- void (*Fogf)(GLenum pname, GLfloat param);
- void (*Fogfv)(GLenum pname, const GLfloat *params);
- void (*Fogi)(GLenum pname, GLint param);
- void (*Fogiv)(GLenum pname, const GLint *params);
- void (*FrontFace)(GLenum mode);
- void (*Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
- GLuint (*GenLists)(GLsizei range);
- void (*GenTextures)(GLsizei n, GLuint *textures);
- void (*GetBooleanv)(GLenum val, GLboolean *b);
- void (*GetClipPlane)(GLenum plane, GLdouble *equation);
- void (*GetDoublev)(GLenum val, GLdouble *d);
- GLenum (*GetError)(void);
- void (*GetFloatv)(GLenum val, GLfloat *f);
- void (*GetIntegerv)(GLenum val, GLint *i);
- void (*GetLightfv)(GLenum light, GLenum pname, GLfloat *params);
- void (*GetLightiv)(GLenum light, GLenum pname, GLint *params);
- void (*GetMapdv)(GLenum target, GLenum query, GLdouble *v);
- void (*GetMapfv)(GLenum target, GLenum query, GLfloat *v);
- void (*GetMapiv)(GLenum target, GLenum query, GLint *v);
- void (*GetMaterialfv)(GLenum face, GLenum pname, GLfloat *params);
- void (*GetMaterialiv)(GLenum face, GLenum pname, GLint *params);
- void (*GetPixelMapfv)(GLenum map, GLfloat *values);
- void (*GetPixelMapuiv)(GLenum map, GLuint *values);
- void (*GetPixelMapusv)(GLenum map, GLushort *values);
- void (*GetPointerv)(GLenum pname, void **params);
- void (*GetPolygonStipple)(GLubyte *mask);
- const GLubyte *(*GetString)(GLenum name);
- void (*GetTexEnvfv)(GLenum target, GLenum pname, GLfloat *params);
- void (*GetTexEnviv)(GLenum target, GLenum pname, GLint *params);
- void (*GetTexGendv)(GLenum coord, GLenum pname, GLdouble *params);
- void (*GetTexGenfv)(GLenum coord, GLenum pname, GLfloat *params);
- void (*GetTexGeniv)(GLenum coord, GLenum pname, GLint *params);
- void (*GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *texels);
- void (*GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params);
- void (*GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params);
- void (*GetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params);
- void (*GetTexParameteriv)(GLenum target, GLenum pname, GLint *params);
- void (*Hint)(GLenum target, GLenum mode);
- void (*IndexMask)(GLuint mask);
- void (*IndexPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
- void (*Indexd)(GLdouble c);
- void (*Indexdv)(const GLdouble *c);
- void (*Indexf)(GLfloat c);
- void (*Indexfv)(const GLfloat *c);
- void (*Indexi)(GLint c);
- void (*Indexiv)(const GLint *c);
- void (*Indexs)(GLshort c);
- void (*Indexsv)(const GLshort *c);
- void (*Indexub)(GLubyte c);
- void (*Indexubv)(const GLubyte *c);
- void (*InitNames)(void);
- void (*InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid *pointer);
- GLboolean (*IsEnabled)(GLenum cap);
- GLboolean (*IsList)(GLuint list);
- GLboolean (*IsTexture)(GLuint texture);
- void (*LightModelf)(GLenum pname, GLfloat param);
- void (*LightModelfv)(GLenum pname, const GLfloat *params);
- void (*LightModeli)(GLenum pname, GLint param);
- void (*LightModeliv)(GLenum pname, const GLint *params);
- void (*Lightf)(GLenum light, GLenum pname, GLfloat param);
- void (*Lightfv)(GLenum light, GLenum pname, const GLfloat *params);
- void (*Lighti)(GLenum light, GLenum pname, GLint param);
- void (*Lightiv)(GLenum light, GLenum pname, const GLint *params);
- void (*LineStipple)(GLint factor, GLushort pattern);
- void (*LineWidth)(GLfloat width);
- void (*ListBase)(GLuint base);
- void (*LoadIdentity)(void);
- void (*LoadMatrixd)(const GLdouble *m);
- void (*LoadMatrixf)(const GLfloat *m);
- void (*LoadName)(GLuint name);
- void (*LogicOp)(GLenum opcode);
- void (*Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *pnts);
- void (*Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *pnts);
- void (*Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustr, GLint uord, GLdouble v1, GLdouble v2, GLint vstr, GLint vord, const GLdouble *pnts);
- void (*Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustr, GLint uord, GLfloat v1, GLfloat v2, GLint vstr, GLint vord, const GLfloat *pnts);
- void (*MapGrid1d)(GLint un, GLdouble u1, GLdouble u2);
- void (*MapGrid1f)(GLint un, GLfloat u1, GLfloat u2);
- void (*MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
- void (*MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
- void (*Materialf)(GLenum face, GLenum pname, GLfloat param);
- void (*Materialfv)(GLenum face, GLenum pname, const GLfloat *params);
- void (*Materiali)(GLenum face, GLenum pname, GLint param);
- void (*Materialiv)(GLenum face, GLenum pname, const GLint *params);
- void (*MatrixMode)(GLenum mode);
- void (*MultMatrixd)(const GLdouble *m);
- void (*MultMatrixf)(const GLfloat *m);
- void (*NewList)(GLuint list, GLenum mode);
- void (*Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz);
- void (*Normal3bv)(const GLbyte *v);
- void (*Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz);
- void (*Normal3dv)(const GLdouble *v);
- void (*Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz);
- void (*Normal3fv)(const GLfloat *v);
- void (*Normal3i)(GLint nx, GLint ny, GLint nz);
- void (*Normal3iv)(const GLint *v);
- void (*Normal3s)(GLshort nx, GLshort ny, GLshort nz);
- void (*Normal3sv)(const GLshort *v);
- void (*NormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
- void (*Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
- void (*PassThrough)(GLfloat token);
- void (*PixelMapfv)(GLenum map, GLint mapsize, const GLfloat *values);
- void (*PixelMapuiv)(GLenum map, GLint mapsize, const GLuint *values);
- void (*PixelMapusv)(GLenum map, GLint mapsize, const GLushort *values);
- void (*PixelStoref)(GLenum pname, GLfloat param);
- void (*PixelStorei)(GLenum pname, GLint param);
- void (*PixelTransferf)(GLenum pname, GLfloat param);
- void (*PixelTransferi)(GLenum pname, GLint param);
- void (*PixelZoom)(GLfloat xfactor, GLfloat yfactor);
- void (*PointSize)(GLfloat size);
- void (*PolygonMode)(GLenum face, GLenum mode);
- void (*PolygonOffset)(GLfloat factor, GLfloat units);
- void (*PolygonStipple)(const GLubyte *mask);
- void (*PopAttrib)(void);
- void (*PopClientAttrib)(void);
- void (*PopMatrix)(void);
- void (*PopName)(void);
- void (*PrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities);
- void (*PushAttrib)(GLbitfield mask);
- void (*PushClientAttrib)(GLuint mask);
- void (*PushMatrix)(void);
- void (*PushName)(GLuint name);
- void (*RasterPos2d)(GLdouble x, GLdouble y);
- void (*RasterPos2dv)(const GLdouble *v);
- void (*RasterPos2f)(GLfloat x, GLfloat y);
- void (*RasterPos2fv)(const GLfloat *v);
- void (*RasterPos2i)(GLint x, GLint y);
- void (*RasterPos2iv)(const GLint *v);
- void (*RasterPos2s)(GLshort x, GLshort y);
- void (*RasterPos2sv)(const GLshort *v);
- void (*RasterPos3d)(GLdouble x, GLdouble y, GLdouble z);
- void (*RasterPos3dv)(const GLdouble *v);
- void (*RasterPos3f)(GLfloat x, GLfloat y, GLfloat z);
- void (*RasterPos3fv)(const GLfloat *v);
- void (*RasterPos3i)(GLint x, GLint y, GLint z);
- void (*RasterPos3iv)(const GLint *v);
- void (*RasterPos3s)(GLshort x, GLshort y, GLshort z);
- void (*RasterPos3sv)(const GLshort *v);
- void (*RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
- void (*RasterPos4dv)(const GLdouble *v);
- void (*RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
- void (*RasterPos4fv)(const GLfloat *v);
- void (*RasterPos4i)(GLint x, GLint y, GLint z, GLint w);
- void (*RasterPos4iv)(const GLint *v);
- void (*RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w);
- void (*RasterPos4sv)(const GLshort *v);
- void (*ReadBuffer)(GLenum mode);
- void (*ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
- void (*Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
- void (*Rectdv)(const GLdouble *v1, const GLdouble *v2);
- void (*Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
- void (*Rectfv)(const GLfloat *v1, const GLfloat *v2);
- void (*Recti)(GLint x1, GLint y1, GLint x2, GLint y2);
- void (*Rectiv)(const GLint *v1, const GLint *v2);
- void (*Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
- void (*Rectsv)(const GLshort *v1, const GLshort *v2);
- GLint (*RenderMode)(GLenum mode);
- void (*Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
- void (*Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
- void (*Scaled)(GLdouble x, GLdouble y, GLdouble z);
- void (*Scalef)(GLfloat x, GLfloat y, GLfloat z);
- void (*Scissor)(GLint x, GLint y, GLsizei width, GLsizei height);
- void (*SelectBuffer)(GLsizei numnames, GLuint *buffer);
- void (*ShadeModel)(GLenum mode);
- void (*StencilFunc)(GLenum func, GLint ref, GLuint mask);
- void (*StencilMask)(GLuint mask);
- void (*StencilOp)(GLenum fail, GLenum zfail, GLenum zpass);
- void (*TexCoord1d)(GLdouble s);
- void (*TexCoord1dv)(const GLdouble *v);
- void (*TexCoord1f)(GLfloat s);
- void (*TexCoord1fv)(const GLfloat *v);
- void (*TexCoord1i)(GLint s);
- void (*TexCoord1iv)(const GLint *v);
- void (*TexCoord1s)(GLshort s);
- void (*TexCoord1sv)(const GLshort *v);
- void (*TexCoord2d)(GLdouble s, GLdouble t);
- void (*TexCoord2dv)(const GLdouble *v);
- void (*TexCoord2f)(GLfloat s, GLfloat t);
- void (*TexCoord2fv)(const GLfloat *v);
- void (*TexCoord2i)(GLint s, GLint t);
- void (*TexCoord2iv)(const GLint *v);
- void (*TexCoord2s)(GLshort s, GLshort t);
- void (*TexCoord2sv)(const GLshort *v);
- void (*TexCoord3d)(GLdouble s, GLdouble t, GLdouble r);
- void (*TexCoord3dv)(const GLdouble *v);
- void (*TexCoord3f)(GLfloat s, GLfloat t, GLfloat r);
- void (*TexCoord3fv)(const GLfloat *v);
- void (*TexCoord3i)(GLint s, GLint t, GLint r);
- void (*TexCoord3iv)(const GLint *v);
- void (*TexCoord3s)(GLshort s, GLshort t, GLshort r);
- void (*TexCoord3sv)(const GLshort *v);
- void (*TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
- void (*TexCoord4dv)(const GLdouble *v);
- void (*TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
- void (*TexCoord4fv)(const GLfloat *v);
- void (*TexCoord4i)(GLint s, GLint t, GLint r, GLint q);
- void (*TexCoord4iv)(const GLint *v);
- void (*TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q);
- void (*TexCoord4sv)(const GLshort *v);
- void (*TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
- void (*TexEnvf)(GLenum target, GLenum pname, GLfloat param);
- void (*TexEnvfv)(GLenum target, GLenum pname, const GLfloat *params);
- void (*TexEnvi)(GLenum target, GLenum pname, GLint param);
- void (*TexEnviv)(GLenum target, GLenum pname, const GLint *params);
- void (*TexGend)(GLenum coord, GLenum pname, GLdouble param);
- void (*TexGendv)(GLenum coord, GLenum pname, const GLdouble *params);
- void (*TexGenf)(GLenum coord, GLenum pname, GLfloat param);
- void (*TexGenfv)(GLenum coord, GLenum pname, const GLfloat *params);
- void (*TexGeni)(GLenum coord, GLenum pname, GLint param);
- void (*TexGeniv)(GLenum coord, GLenum pname, const GLint *params);
- void (*TexImage1D)(GLenum target, GLint level, GLint components, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *image);
- void (*TexImage2D)(GLenum target, GLint level, GLint components, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *image);
- void (*TexParameterf)(GLenum target, GLenum pname, GLfloat param);
- void (*TexParameterfv)(GLenum target, GLenum pname, const GLfloat *params);
- void (*TexParameteri)(GLenum target, GLenum pname, GLint param);
- void (*TexParameteriv)(GLenum target, GLenum pname, const GLint *params);
- void (*TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
- void (*TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
- void (*Translated)(GLdouble x, GLdouble y, GLdouble z);
- void (*Translatef)(GLfloat x, GLfloat y, GLfloat z);
- void (*Vertex2d)(GLdouble x, GLdouble y);
- void (*Vertex2dv)(const GLdouble *v);
- void (*Vertex2f)(GLfloat x, GLfloat y);
- void (*Vertex2fv)(const GLfloat *v);
- void (*Vertex2i)(GLint x, GLint y);
- void (*Vertex2iv)(const GLint *v);
- void (*Vertex2s)(GLshort x, GLshort y);
- void (*Vertex2sv)(const GLshort *v);
- void (*Vertex3d)(GLdouble x, GLdouble y, GLdouble z);
- void (*Vertex3dv)(const GLdouble *v);
- void (*Vertex3f)(GLfloat x, GLfloat y, GLfloat z);
- void (*Vertex3fv)(const GLfloat *v);
- void (*Vertex3i)(GLint x, GLint y, GLint z);
- void (*Vertex3iv)(const GLint *v);
- void (*Vertex3s)(GLshort x, GLshort y, GLshort z);
- void (*Vertex3sv)(const GLshort *v);
- void (*Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
- void (*Vertex4dv)(const GLdouble *v);
- void (*Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
- void (*Vertex4fv)(const GLfloat *v);
- void (*Vertex4i)(GLint x, GLint y, GLint z, GLint w);
- void (*Vertex4iv)(const GLint *v);
- void (*Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w);
- void (*Vertex4sv)(const GLshort *v);
- void (*VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
- void (*Viewport)(GLint x, GLint y, GLsizei width, GLsizei height);
-};
+#include "glapitable.h"
#endif
#endif /* _DRI_GLAPI_H_ */
diff --git a/xc/lib/GL/glx/glxclient.h b/xc/lib/GL/glx/glxclient.h
index 497c7eb98..810570b90 100644
--- a/xc/lib/GL/glx/glxclient.h
+++ b/xc/lib/GL/glx/glxclient.h
@@ -1,7 +1,6 @@
#ifndef _GLX_client_h_
#define _GLX_client_h_
-/* $XFree86: xc/lib/GL/glx/glxclient.h,v 1.2 1999/06/14 07:23:36 dawes Exp $ */
/*
** The contents of this file are subject to the GLX Public License Version 1.0
** (the "License"). You may not use this file except in compliance with the
@@ -20,7 +19,6 @@
** Those portions of the Subject Software created by Silicon Graphics, Inc.
** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved.
**
-** $SGI$
*/
/*
@@ -29,7 +27,6 @@
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
*
- * $PI: xc/lib/GL/glx/glxclient.h,v 1.7 1999/04/05 05:24:32 martin Exp $
*/
#define NEED_REPLIES
@@ -41,9 +38,6 @@
#include <X11/Xlibint.h>
#include <string.h>
#include <stdlib.h>
-#ifdef GLX_DIRECT_RENDERING
-#include "dri_glapi.h"
-#endif
#define GLX_MAJOR_VERSION 1 /* current version numbers */
#define GLX_MINOR_VERSION 2
@@ -64,6 +58,7 @@ typedef struct __GLXdisplayPrivateRec __GLXdisplayPrivate;
** #define NEED_WRAP_GL_FUNCS in the appropriate source files.
*/
#include "indirect.h"
+#include "dri_glapi.h"
/*
** The following structures define the interface between the GLX client
@@ -87,10 +82,11 @@ struct __DRIdisplayRec {
void (*destroyDisplay)(Display *dpy, void *private);
/*
- ** Method to create the private DRI screen data and initialize the
+ ** Methods to create the private DRI screen data and initialize the
** screen dependent methods.
+ ** This is an array [indexed by screen number] of function pointers.
*/
- void *(*createScreen)(Display *dpy, int scrn, __DRIscreen *psc,
+ void *(**createScreen)(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config);
/*
@@ -200,6 +196,8 @@ struct __DRIdrawableRec {
*/
extern void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp);
+extern void DRI_glXUseXFont( Font font, int first, int count, int listbase );
+
#endif
/************************************************************************/
@@ -429,12 +427,6 @@ struct __GLXcontextRec {
#ifdef GLX_DIRECT_RENDERING
/*
- ** API function pointers for this context. The function pointers
- ** can be changed by the DRI library.
- */
- __GLapi glAPI;
-
- /*
** Per context direct rendering interface functions and data.
*/
__DRIcontext driContext;
@@ -556,6 +548,7 @@ extern __GLXcontext *__glXcurrentContext;
#define __glXGetCurrentContext() __glXcurrentContext
#define __glXSetCurrentContext(gc) __glXcurrentContext = gc
+
/*
** Global lock for all threads in this address space using the GLX
** extension
diff --git a/xc/lib/GL/glx/glxcmds.c b/xc/lib/GL/glx/glxcmds.c
index 3877dfd81..51bd9b9e2 100644
--- a/xc/lib/GL/glx/glxcmds.c
+++ b/xc/lib/GL/glx/glxcmds.c
@@ -157,15 +157,6 @@ GLXContext CreateContext(Display *dpy, XVisualInfo *vis,
}
}
}
-
- /*
- ** Initialize the function pointer array to use the indirect
- ** rendering routines. If direct rendering is available for
- ** this context, then glAPI is initialized when the context is
- ** made current.
- */
- if (!gc->isDirect)
- glInitIndirectAPI(&gc->glAPI);
#endif
/* Send the glXCreateContext request */
@@ -595,9 +586,7 @@ int glXGetConfig(Display *dpy, XVisualInfo *vis, int attribute,
__GLXvisualConfig *pConfig;
__GLXscreenConfigs *psc;
__GLXdisplayPrivate *priv;
- GLint i, items;
- XVisualInfo* vi;
- XVisualInfo template;
+ GLint i;
/* Initialize the extension, if needed */
priv = __glXInitialize(dpy);
@@ -1382,7 +1371,6 @@ static int __glXQueryContextInfo(Display *dpy, GLXContext ctx)
xGLXQueryContextInfoEXTReq *req;
xGLXQueryContextInfoEXTReply reply;
CARD8 opcode;
- GLXContext gc = __glXGetCurrentContext();
GLuint numValues;
if (ctx == NULL) {
@@ -1476,9 +1464,6 @@ GLXContextID glXGetContextIDEXT(const GLXContext ctx)
GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID)
{
- VisualID vid;
- int screen;
- GLXContextID shareListID;
GLXContext ctx;
if (contextID == None) {
diff --git a/xc/lib/GL/glx/glxext.c b/xc/lib/GL/glx/glxext.c
index d1389b52e..ecb4688fa 100644
--- a/xc/lib/GL/glx/glxext.c
+++ b/xc/lib/GL/glx/glxext.c
@@ -1,4 +1,5 @@
/* $XFree86: xc/lib/GL/glx/glxext.c,v 1.3 1999/12/14 01:32:24 robin Exp $ */
+
/*
** The contents of this file are subject to the GLX Public License Version 1.0
** (the "License"). You may not use this file except in compliance with the
@@ -17,7 +18,6 @@
** Those portions of the Subject Software created by Silicon Graphics, Inc.
** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved.
**
-** $SGI$
*/
/*
@@ -26,13 +26,17 @@
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
*
- * $PI: xc/lib/GL/glx/glxext.c,v 1.6 1999/05/10 07:37:17 martin Exp $
*/
#include "packrender.h"
#include <stdio.h>
#include <Xext.h>
#include <extutil.h>
+#ifdef GLX_DIRECT_RENDERING
+#include "indirect_init.h"
+#include "glapi.h"
+#include <assert.h>
+#endif
#ifdef DEBUG
void __glXDumpDrawBuffer(__GLXcontext *ctx);
@@ -59,8 +63,18 @@ static __GLXcontext dummyContext = {
sizeof(dummyBuffer),
};
+
+#ifdef GLX_DIRECT_RENDERING
+/*
+** All indirect rendering contexts will share the same indirect dispatch table.
+*/
+static __GLapi *IndirectAPI = NULL;
+#endif
+
+
__GLXcontext *__glXcurrentContext = &dummyContext;
+
/*
** You can set this cell to 1 to force the gl drawing stuff to be
** one command per packet
@@ -98,6 +112,9 @@ int __glXCloseDisplay(Display *dpy, XExtCodes *codes)
gc = __glXGetCurrentContext();
if (dpy == gc->currentDpy) {
__glXSetCurrentContext(&dummyContext);
+#ifdef GLX_DIRECT_RENDERING
+ _glapi_set_dispatch(NULL); /* no-op functions */
+#endif
__glXFreeContext(gc);
}
@@ -188,6 +205,10 @@ static int __glXFreeDisplayPrivate(XExtData *extension)
priv->driDisplay.private = NULL;
#endif
+#ifdef GLX_DIRECT_RENDERING
+ XFree(priv->driDisplay.createScreen);
+#endif
+
Xfree((char*) priv);
return 0;
}
@@ -390,6 +411,14 @@ __GLXdisplayPrivate *__glXInitialize(Display* dpy)
XEDataObject dataObj;
int major, minor;
+#ifdef GLX_DIRECT_RENDERING
+ /*
+ **Initialize the indirect GLX dispatch table. It'll never change and
+ ** can be used by all indirect contexts.
+ */
+ IndirectAPI = __glXNewIndirectAPI();
+#endif
+
/* The one and only long long lock */
__glXLock();
@@ -459,7 +488,7 @@ __GLXdisplayPrivate *__glXInitialize(Display* dpy)
Xfree((char*) private);
return 0;
}
-
+
/*
** Fill in the private structure. This is the actual structure that
** hangs off of the Display structure. Our private structure is
@@ -865,6 +894,12 @@ Bool glXMakeCurrent(Display *dpy, GLXDrawable draw, GLXContext gc)
}
if (gc) {
__glXSetCurrentContext(gc);
+#ifdef GLX_DIRECT_RENDERING
+ if (!gc->isDirect) {
+ assert(IndirectAPI);
+ _glapi_set_dispatch(IndirectAPI);
+ }
+#endif
gc->currentDpy = dpy;
gc->currentDrawable = draw;
#ifdef GLX_DIRECT_RENDERING
@@ -873,6 +908,9 @@ Bool glXMakeCurrent(Display *dpy, GLXDrawable draw, GLXContext gc)
gc->currentContextTag = reply.contextTag;
} else {
__glXSetCurrentContext(&dummyContext);
+#ifdef GLX_DIRECT_RENDERING
+ _glapi_set_dispatch(NULL); /* no-op functions */
+#endif
}
}
__glXUnlock();
diff --git a/xc/lib/GL/glx/indirect_init.c b/xc/lib/GL/glx/indirect_init.c
index 78ac91f9c..99b6994c9 100644
--- a/xc/lib/GL/glx/indirect_init.c
+++ b/xc/lib/GL/glx/indirect_init.c
@@ -37,10 +37,44 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "indirect_init.h"
#include "indirect.h"
-#include "dri_glapi.h"
+#include "glapi.h"
-void glInitIndirectAPI(__GLapi *glAPI)
+
+/*
+** No-op function
+*/
+static int NoOp(void)
+{
+ return 0;
+}
+
+
+/*
+** Initialize the given dispatch table to all no-op functions.
+*/
+static void InitNoOpAPI(__GLapi *glAPI)
+{
+ const int entries = sizeof(__GLapi) / sizeof(void *);
+ int i;
+ void **dispatch = (void **) glAPI;
+
+ for (i = 0; i < entries; i++) {
+ dispatch[i] = (void *) NoOp;
+ }
+}
+
+
+__GLapi *__glXNewIndirectAPI(void)
{
+ __GLapi *glAPI;
+ const GLuint entries = _glapi_get_dispatch_table_size();
+
+ glAPI = (__GLapi *) Xmalloc(entries * sizeof(void *));
+
+ /* first, set all entries to point to no-op functions */
+ InitNoOpAPI(glAPI);
+
+ /* now, initialize the entries we understand */
glAPI->Accum = __indirect_glAccum;
glAPI->AlphaFunc = __indirect_glAlphaFunc;
glAPI->AreTexturesResident = __indirect_glAreTexturesResident;
@@ -377,6 +411,8 @@ void glInitIndirectAPI(__GLapi *glAPI)
glAPI->Vertex4sv = __indirect_glVertex4sv;
glAPI->VertexPointer = __indirect_glVertexPointer;
glAPI->Viewport = __indirect_glViewport;
+
+ return glAPI;
}
#endif
diff --git a/xc/lib/GL/glx/indirect_init.h b/xc/lib/GL/glx/indirect_init.h
index 215f6fc8c..cc6396bab 100644
--- a/xc/lib/GL/glx/indirect_init.h
+++ b/xc/lib/GL/glx/indirect_init.h
@@ -38,9 +38,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifdef GLX_DIRECT_RENDERING
-#include "dri_glapi.h"
+#include "glxclient.h"
-extern void glInitIndirectAPI(__GLapi *glAPI);
+extern __GLapi *__glXNewIndirectAPI(void);
#endif
#endif /* _INDIRECT_INIT_H_ */
diff --git a/xc/lib/GL/glx/indirect_wrap.h b/xc/lib/GL/glx/indirect_wrap.h
index 30cf0f331..e0f1258af 100644
--- a/xc/lib/GL/glx/indirect_wrap.h
+++ b/xc/lib/GL/glx/indirect_wrap.h
@@ -377,5 +377,264 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define glVertexPointer __indirect_glVertexPointer
#define glViewport __indirect_glViewport
+/* 1.2 */
+#define glCopyTexSubImage3D __indirect_glCopyTexSubImage3D
+#define glDrawRangeElements __indirect_glDrawRangeElements
+#define glTexImage3D __indirect_glTexImage3D
+#define glTexSubImage3D __indirect_glTexSubImage3D
+
+/* GL_ARB_imaging */
+#define glBlendColor __indirect_glBlendColor
+#define glBlendEquation __indirect_glBlendEquation
+#define glColorSubTable __indirect_glColorSubTable
+#define glColorTable __indirect_glColorTable
+#define glColorTableParameterfv __indirect_glColorTableParameterfv
+#define glColorTableParameteriv __indirect_glColorTableParameteriv
+#define glConvolutionFilter1D __indirect_glConvolutionFilter1D
+#define glConvolutionFilter2D __indirect_glConvolutionFilter2D
+#define glConvolutionParameterf __indirect_glConvolutionParameterf
+#define glConvolutionParameterfv __indirect_glConvolutionParameterfv
+#define glConvolutionParameteri __indirect_glConvolutionParameteri
+#define glConvolutionParameteriv __indirect_glConvolutionParameteriv
+#define glCopyColorSubTable __indirect_glCopyColorSubTable
+#define glCopyColorTable __indirect_glCopyColorTable
+#define glCopyConvolutionFilter1D __indirect_glCopyConvolutionFilter1D
+#define glCopyConvolutionFilter2D __indirect_glCopyConvolutionFilter2D
+#define glGetColorTable __indirect_glGetColorTable
+#define glGetColorTableParameterfv __indirect_glGetColorTableParameterfv
+#define glGetColorTableParameteriv __indirect_glGetColorTableParameteriv
+#define glGetConvolutionFilter __indirect_glGetConvolutionFilter
+#define glGetConvolutionParameterfv __indirect_glGetConvolutionParameterfv
+#define glGetConvolutionParameteriv __indirect_glGetConvolutionParameteriv
+#define glGetHistogram __indirect_glGetHistogram
+#define glGetHistogramParameterfv __indirect_glGetHistogramParameterfv
+#define glGetHistogramParameteriv __indirect_glGetHistogramParameteriv
+#define glGetMinmax __indirect_glGetMinmax
+#define glGetMinmaxParameterfv __indirect_glGetMinmaxParameterfv
+#define glGetMinmaxParameteriv __indirect_glGetMinmaxParameteriv
+#define glGetSeparableFilter __indirect_glGetSeparableFilter
+#define glHistogram __indirect_glHistogram
+#define glMinmax __indirect_glMinmax
+#define glResetHistogram __indirect_glResetHistogram
+#define glResetMinmax __indirect_glResetMinmax
+#define glSeparableFilter2D __indirect_glSeparableFilter2D
+
+/* GL_ARB_multitexture */
+#define glActiveTextureARB __indirect_glActiveTextureARB
+#define glClientActiveTextureARB __indirect_glClientActiveTextureARB
+#define glMultiTexCoord1dARB __indirect_glMultiTexCoord1dARB
+#define glMultiTexCoord1dvARB __indirect_glMultiTexCoord1dvARB
+#define glMultiTexCoord1fARB __indirect_glMultiTexCoord1fARB
+#define glMultiTexCoord1fvARB __indirect_glMultiTexCoord1fvARB
+#define glMultiTexCoord1iARB __indirect_glMultiTexCoord1iARB
+#define glMultiTexCoord1ivARB __indirect_glMultiTexCoord1ivARB
+#define glMultiTexCoord1sARB __indirect_glMultiTexCoord1sARB
+#define glMultiTexCoord1svARB __indirect_glMultiTexCoord1svARB
+#define glMultiTexCoord2dARB __indirect_glMultiTexCoord2dARB
+#define glMultiTexCoord2dvARB __indirect_glMultiTexCoord2dvARB
+#define glMultiTexCoord2fARB __indirect_glMultiTexCoord2fARB
+#define glMultiTexCoord2fvARB __indirect_glMultiTexCoord2fvARB
+#define glMultiTexCoord2iARB __indirect_glMultiTexCoord2iARB
+#define glMultiTexCoord2ivARB __indirect_glMultiTexCoord2ivARB
+#define glMultiTexCoord2sARB __indirect_glMultiTexCoord2sARB
+#define glMultiTexCoord2svARB __indirect_glMultiTexCoord2svARB
+#define glMultiTexCoord3dARB __indirect_glMultiTexCoord3dARB
+#define glMultiTexCoord3dvARB __indirect_glMultiTexCoord3dvARB
+#define glMultiTexCoord3fARB __indirect_glMultiTexCoord3fARB
+#define glMultiTexCoord3fvARB __indirect_glMultiTexCoord3fvARB
+#define glMultiTexCoord3iARB __indirect_glMultiTexCoord3iARB
+#define glMultiTexCoord3ivARB __indirect_glMultiTexCoord3ivARB
+#define glMultiTexCoord3sARB __indirect_glMultiTexCoord3sARB
+#define glMultiTexCoord3svARB __indirect_glMultiTexCoord3svARB
+#define glMultiTexCoord4dARB __indirect_glMultiTexCoord4dARB
+#define glMultiTexCoord4dvARB __indirect_glMultiTexCoord4dvARB
+#define glMultiTexCoord4fARB __indirect_glMultiTexCoord4fARB
+#define glMultiTexCoord4fvARB __indirect_glMultiTexCoord4fvARB
+#define glMultiTexCoord4iARB __indirect_glMultiTexCoord4iARB
+#define glMultiTexCoord4ivARB __indirect_glMultiTexCoord4ivARB
+#define glMultiTexCoord4sARB __indirect_glMultiTexCoord4sARB
+#define glMultiTexCoord4svARB __indirect_glMultiTexCoord4svARB
+
+/*
+ * Extensions
+ */
+
+#define glBlendColorEXT __indirect_glBlendColorEXT
+
+#define glPolygonOffsetEXT __indirect_glPolygonOffsetEXT
+
+#define glCopyTexSubImage3DEXT __indirect_glCopyTexSubImage3DEXT
+#define glTexImage3DEXT __indirect_glTexImage3DEXT
+#define glTexSubImage3DEXT __indirect_glTexSubImage3DEXT
+
+#define glGetTexFilterFuncSGIS __indirect_glGetTexFilterFuncSGIS
+#define glTexFilterFuncSGIS __indirect_glTexFilterFuncSGIS
+
+#define glTexSubImage1DEXT __indirect_glTexSubImage1DEXT
+#define glTexSubImage2DEXT __indirect_glTexSubImage2DEXT
+
+#define glCopyTexImage1DEXT __indirect_glCopyTexImage1DEXT
+#define glCopyTexImage2DEXT __indirect_glCopyTexImage2DEXT
+#define glCopyTexSubImage1DEXT __indirect_glCopyTexSubImage1DEXT
+#define glCopyTexSubImage2DEXT __indirect_glCopyTexSubImage2DEXT
+
+#define glGetHistogramEXT __indirect_glGetHistogramEXT
+#define glGetHistogramParameterfvEXT __indirect_glGetHistogramParameterfvEXT
+#define glGetHistogramParameterivEXT __indirect_glGetHistogramParameterivEXT
+#define glGetMinmaxEXT __indirect_glGetMinmaxEXT
+#define glGetMinmaxParameterfvEXT __indirect_glGetMinmaxParameterfvEXT
+#define glGetMinmaxParameterivEXT __indirect_glGetMinmaxParameterivEXT
+#define glHistogramEXT __indirect_glHistogramEXT
+#define glMinmaxEXT __indirect_glMinmaxEXT
+#define glResetHistogramEXT __indirect_glResetHistogramEXT
+#define glResetMinmaxEXT __indirect_glResetMinmaxEXT
+
+#define glConvolutionFilter1DEXT __indirect_glConvolutionFilter1DEXT
+#define glConvolutionFilter2DEXT __indirect_glConvolutionFilter2DEXT
+#define glConvolutionParameterfEXT __indirect_glConvolutionParameterfEXT
+#define glConvolutionParameterfvEXT __indirect_glConvolutionParameterfvEXT
+#define glConvolutionParameteriEXT __indirect_glConvolutionParameteriEXT
+#define glConvolutionParameterivEXT __indirect_glConvolutionParameterivEXT
+#define glCopyConvolutionFilter1DEXT __indirect_glCopyConvolutionFilter1DEXT
+#define glCopyConvolutionFilter2DEXT __indirect_glCopyConvolutionFilter2DEXT
+#define glGetConvolutionFilterEXT __indirect_glGetConvolutionFilterEXT
+#define glGetConvolutionParameterfvEXT __indirect_glGetConvolutionParameterfvEXT
+#define glGetConvolutionParameterivEXT __indirect_glGetConvolutionParameterivEXT
+#define glGetSeparableFilterEXT __indirect_glGetSeparableFilterEXT
+#define glSeparableFilter2DEXT __indirect_glSeparableFilter2DEXT
+
+#define glColorTableSGI __indirect_glColorTableSGI
+#define glColorTableParameterfvSGI __indirect_glColorTableParameterfvSGI
+#define glColorTableParameterivSGI __indirect_glColorTableParameterivSGI
+#define glCopyColorTableSGI __indirect_glCopyColorTableSGI
+#define glGetColorTableSGI __indirect_glGetColorTableSGI
+#define glGetColorTableParameterfvSGI __indirect_glGetColorTableParameterfvSGI
+#define glGetColorTableParameterivSGI __indirect_glGetColorTableParameterivSGI
+
+#define glPixelTexGenParameterfSGIS __indirect_glPixelTexGenParameterfSGIS
+#define glPixelTexGenParameteriSGIS __indirect_glPixelTexGenParameteriSGIS
+#define glGetPixelTexGenParameterfvSGIS __indirect_glGetPixelTexGenParameterfvSGIS
+#define glGetPixelTexGenParameterivSGIS __indirect_glGetPixelTexGenParameterivSGIS
+
+#define glTexImage4DSGIS __indirect_glTexImage4DSGIS
+#define glTexSubImage4DSGIS __indirect_glTexSubImage4DSGIS
+
+#define glAreTexturesResidentEXT __indirect_glAreTexturesResidentEXT
+#define glBindTextureEXT __indirect_glBindTextureEXT
+#define glDeleteTexturesEXT __indirect_glDeleteTexturesEXT
+#define glGenTexturesEXT __indirect_glGenTexturesEXT
+#define glIsTextureEXT __indirect_glIsTextureEXT
+#define glPrioritizeTexturesEXT __indirect_glPrioritizeTexturesEXT
+
+#define glDetailTexFuncSGIS __indirect_glDetailTexFuncSGIS
+#define glGetDetailTexFuncSGIS __indirect_glGetDetailTexFuncSGIS
+
+#define glGetSharpenTexFuncSGIS __indirect_glGetSharpenTexFuncSGIS
+#define glSharpenTexFuncSGIS __indirect_glSharpenTexFuncSGIS
+
+#define glSampleMaskSGIS __indirect_glSampleMaskSGIS
+#define glSamplePatternSGIS __indirect_glSamplePatternSGIS
+
+#define glArrayElementEXT __indirect_glArrayElementEXT
+#define glColorPointerEXT __indirect_glColorPointerEXT
+#define glDrawArraysEXT __indirect_glDrawArraysEXT
+#define glEdgeFlagPointerEXT __indirect_glEdgeFlagPointerEXT
+#define glGetPointervEXT __indirect_glGetPointervEXT
+#define glIndexPointerEXT __indirect_glIndexPointerEXT
+#define glNormalPointerEXT __indirect_glNormalPointerEXT
+#define glTexCoordPointerEXT __indirect_glTexCoordPointerEXT
+#define glVertexPointerEXT __indirect_glVertexPointerEXT
+
+#define glBlendEquationEXT __indirect_glBlendEquationEXT
+
+#define glSpriteParameterfSGIX __indirect_glSpriteParameterfSGIX
+#define glSpriteParameterfvSGIX __indirect_glSpriteParameterfvSGIX
+#define glSpriteParameteriSGIX __indirect_glSpriteParameteriSGIX
+#define glSpriteParameterivSGIX __indirect_glSpriteParameterivSGIX
+
+#define glPointParameterfEXT __indirect_glPointParameterfEXT
+#define glPointParameterfvEXT __indirect_glPointParameterfvEXT
+
+#define glGetInstrumentsSGIX __indirect_glGetInstrumentsSGIX
+#define glInstrumentsBufferSGIX __indirect_glInstrumentsBufferSGIX
+#define glPollInstrumentsSGIX __indirect_glPollInstrumentsSGIX
+#define glReadInstrumentsSGIX __indirect_glReadInstrumentsSGIX
+#define glStartInstrumentsSGIX __indirect_glStartInstrumentsSGIX
+#define glStopInstrumentsSGIX __indirect_glStopInstrumentsSGIX
+
+#define glFrameZoomSGIX __indirect_glFrameZoomSGIX
+
+#define glReferencePlaneSGIX __indirect_glReferencePlaneSGIX
+
+#define glFlushRasterSGIX __indirect_glFlushRasterSGIX
+
+#define glGetImageTransformParameterfvHP __indirect_glGetImageTransformParameterfvHP
+#define glGetImageTransformParameterivHP __indirect_glGetImageTransformParameterivHP
+#define glImageTransformParameterfHP __indirect_glImageTransformParameterfHP
+#define glImageTransformParameterfvHP __indirect_glImageTransformParameterfvHP
+#define glImageTransformParameteriHP __indirect_glImageTransformParameteriHP
+#define glImageTransformParameterivHP __indirect_glImageTransformParameterivHP
+
+#define glColorSubTableEXT __indirect_glColorSubTableEXT
+#define glCopyColorSubTableEXT __indirect_glCopyColorSubTableEXT
+
+#define glHintPGI __indirect_glHintPGI
+
+#define glColorTableEXT __indirect_glColorTableEXT
+#define glGetColorTableEXT __indirect_glGetColorTableEXT
+#define glGetColorTableParameterfvEXT __indirect_glGetColorTableParameterfvEXT
+#define glGetColorTableParameterivEXT __indirect_glGetColorTableParameterivEXT
+
+#define glGetListParameterfvSGIX __indirect_glGetListParameterfvSGIX
+#define glGetListParameterivSGIX __indirect_glGetListParameterivSGIX
+#define glListParameterfSGIX __indirect_glListParameterfSGIX
+#define glListParameterfvSGIX __indirect_glListParameterfvSGIX
+#define glListParameteriSGIX __indirect_glListParameteriSGIX
+#define glListParameterivSGIX __indirect_glListParameterivSGIX
+
+#define glIndexMaterialEXT __indirect_glIndexMaterialEXT
+
+#define glIndexFuncEXT __indirect_glIndexFuncEXT
+
+#define glLockArraysEXT __indirect_glLockArraysEXT
+#define glUnlockArraysEXT __indirect_glUnlockArraysEXT
+
+#define glCullParameterfvEXT __indirect_glCullParameterfvEXT
+#define glCullParameterdvEXT __indirect_glCullParameterdvEXT
+
+#define glBlendFuncSeparateINGR __indirect_glBlendFuncSeparateINGR
+
+#define glWindowPos2iMESA __indirect_WindowPos2iMESA
+#define glWindowPos2sMESA __indirect_WindowPos2sMESA
+#define glWindowPos2fMESA __indirect_WindowPos2fMESA
+#define glWindowPos2dMESA __indirect_WindowPos2dMESA
+#define glWindowPos2ivMESA __indirect_WindowPos2ivMESA
+#define glWindowPos2svMESA __indirect_WindowPos2svMESA
+#define glWindowPos2fvMESA __indirect_WindowPos2fvMESA
+#define glWindowPos2dvMESA __indirect_WindowPos2dvMESA
+#define glWindowPos3iMESA __indirect_WindowPos3iMESA
+#define glWindowPos3sMESA __indirect_WindowPos3sMESA
+#define glWindowPos3fMESA __indirect_WindowPos3fMESA
+#define glWindowPos3dMESA __indirect_WindowPos3dMESA
+#define glWindowPos3ivMESA __indirect_WindowPos3ivMESA
+#define glWindowPos3svMESA __indirect_WindowPos3svMESA
+#define glWindowPos3fvMESA __indirect_WindowPos3fvMESA
+#define glWindowPos3dvMESA __indirect_WindowPos3dvMESA
+#define glWindowPos4iMESA __indirect_WindowPos4iMESA
+#define glWindowPos4sMESA __indirect_WindowPos4sMESA
+#define glWindowPos4fMESA __indirect_WindowPos4fMESA
+#define glWindowPos4dMESA __indirect_WindowPos4dMESA
+#define glWindowPos4ivMESA __indirect_WindowPos4ivMESA
+#define glWindowPos4svMESA __indirect_WindowPos4svMESA
+#define glWindowPos4fvMESA __indirect_WindowPos4fvMESA
+#define glWindowPos4dvMESA __indirect_WindowPos4dvMESA
+
+#define glResizeBuffersMESA __indirect_glResizeBuffersMESA
+
+#define glLoadTransposeMatrixdARB __indirect_glLoadTransposeMatrixdARB
+#define glLoadTransposeMatrixfARB __indirect_glLoadTransposeMatrixfARB
+#define glMultTransposeMatrixdARB __indirect_glMultTransposeMatrixdARB
+#define glMultTransposeMatrixfARB __indirect_glMultTransposeMatrixfARB
+
#endif
#endif /* _INDIRECT_WRAP_H_ */
diff --git a/xc/lib/GL/glx/packrender.h b/xc/lib/GL/glx/packrender.h
index ed95a2aeb..66beb0510 100644
--- a/xc/lib/GL/glx/packrender.h
+++ b/xc/lib/GL/glx/packrender.h
@@ -53,7 +53,10 @@
#define __GLX_LOAD_VARIABLES() \
gc = __glXGetCurrentContext(); \
- pc = gc->pc
+ pc = gc->pc; \
+ (void) pixelHeaderPC; \
+ (void) compsize; \
+ (void) cmdlen
/*
** Variable sized command support macro. This macro is used by calls
diff --git a/xc/lib/GL/glx/packsingle.h b/xc/lib/GL/glx/packsingle.h
index 949172248..d774db7f2 100644
--- a/xc/lib/GL/glx/packsingle.h
+++ b/xc/lib/GL/glx/packsingle.h
@@ -48,7 +48,10 @@
xGLXSingleReq *req
#define __GLX_SINGLE_LOAD_VARIABLES() \
- pc = gc->pc
+ pc = gc->pc; \
+ (void) pixelHeaderPC; \
+ (void) compsize; \
+ (void) cmdlen
/* Start a single command */
#define __GLX_SINGLE_BEGIN(opcode,bytes) \
diff --git a/xc/lib/GL/glx/packvendpriv.h b/xc/lib/GL/glx/packvendpriv.h
index 740632746..74bd6d82b 100644
--- a/xc/lib/GL/glx/packvendpriv.h
+++ b/xc/lib/GL/glx/packvendpriv.h
@@ -48,7 +48,10 @@
xGLXVendorPrivateReq *req
#define __GLX_VENDPRIV_LOAD_VARIABLES() \
- pc = gc->pc
+ pc = gc->pc; \
+ (void) pixelHeaderPC; \
+ (void) compsize; \
+ (void) cmdlen
/* Start a vendor private command */
#define __GLX_VENDPRIV_BEGIN(glxcode, opcode,bytes) \
diff --git a/xc/lib/GL/glx/pixel.c b/xc/lib/GL/glx/pixel.c
index cbe494882..5f6a2f0ec 100644
--- a/xc/lib/GL/glx/pixel.c
+++ b/xc/lib/GL/glx/pixel.c
@@ -421,7 +421,7 @@ void __glEmptyImage(__GLXcontext *gc, GLint width, GLint height, GLenum format,
GLint skipPixels = gc->state.storePack.skipPixels;
GLint skipRows = gc->state.storePack.skipRows;
GLint components, elementSize, rowSize, padding, groupsPerRow, groupSize;
- GLint elementsPerRow, sourceRowSize, sourcePadding, i, j, k;
+ GLint elementsPerRow, sourceRowSize, sourcePadding, i;
GLubyte *start, *iter;
if (type == GL_BITMAP) {
diff --git a/xc/lib/GL/mesa/dri/Imakefile b/xc/lib/GL/mesa/dri/Imakefile
new file mode 100644
index 000000000..511e83faa
--- /dev/null
+++ b/xc/lib/GL/mesa/dri/Imakefile
@@ -0,0 +1,42 @@
+XCOMM $XFree86$
+XCOMM $PI$
+
+#define DoNormalLib NormalLibGlx
+#define DoSharedLib SharedLibGlx
+#define DoExtraLib SharedLibGlx
+#define DoDebugLib DebugLibGlx
+#define DoProfileLib ProfileLibGlx
+
+#if Malloc0ReturnsNull
+ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
+#endif
+
+#if BuildXF86DRI
+ DRI_DEFINES = GlxDefines
+ DRI_INCLUDES = -I../../glx -I../../dri \
+ -I$(TOP)/include -I$(TOP)/include/GL \
+ -I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri
+#endif
+
+MESA_INCLUDES = -I. -I.. -I../include
+
+ DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES)
+ INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) $(DRI_INCLUDES) $(MESA_INCLUDES)
+ SRCS = dri_mesa.c
+ OBJS = dri_mesa.o
+
+#if !GlxUseBuiltInDRIDriver
+#undef DoNormalLib NormalLibGlx
+#undef DoExtraLib SharedLibGlx
+#undef DoDebugLib DebugLibGlx
+#undef DoProfileLib ProfileLibGlx
+#endif
+
+#include <Library.tmpl>
+
+LibraryObjectRule()
+
+SubdirLibraryRule($(OBJS))
+NormalLintTarget($(SRCS))
+
+DependTarget()
diff --git a/xc/lib/GL/mesa/dri/dri_mesa.c b/xc/lib/GL/mesa/dri/dri_mesa.c
new file mode 100644
index 000000000..6160a3435
--- /dev/null
+++ b/xc/lib/GL/mesa/dri/dri_mesa.c
@@ -0,0 +1,742 @@
+/* $XFree86: xc/lib/GL/dri/dri_mesa.c,v 1.3 1999/09/25 14:36:37 dawes Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, 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 PRECISION INSIGHT 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.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <kevin@precisioninsight.com>
+ *
+ * $PI: xc/lib/GL/dri/dri_mesa.c,v 1.18 1999/08/04 18:13:27 faith Exp $
+ */
+
+#ifdef GLX_DIRECT_RENDERING
+
+#include <unistd.h>
+#include <Xlibint.h>
+#include <Xext.h>
+#include <extutil.h>
+#include "glxclient.h"
+#include "GL/xmesa.h"
+#include "xf86dri.h"
+#include "sarea.h"
+#include "dri_mesaint.h"
+#include "dri_xmesaapi.h"
+#ifdef BRIAN
+#include <dlfcn.h>
+#endif
+
+
+#if XMESA_MAJOR_VERSION != 3 || XMESA_MINOR_VERSION != 3
+#error using wrong version of Mesa (need 3.3)
+#endif
+
+
+/* Context binding */
+static Bool driMesaBindContext(Display *dpy, int scrn,
+ GLXDrawable draw, GLXContext gc);
+static Bool driMesaUnbindContext(Display *dpy, int scrn,
+ GLXDrawable draw, GLXContext gc);
+
+/* Drawable methods */
+static void *driMesaCreateDrawable(Display *dpy, int scrn, GLXDrawable draw,
+ VisualID vid, __DRIdrawable *pdraw);
+static __DRIdrawable *driMesaGetDrawable(Display *dpy, GLXDrawable draw);
+static void driMesaSwapBuffers(Display *dpy, void *private);
+static void driMesaDestroyDrawable(Display *dpy, void *private);
+
+/* Context methods */
+static void *driMesaCreateContext(Display *dpy, XVisualInfo *vis, void *shared,
+ __DRIcontext *pctx);
+static void driMesaDestroyContext(Display *dpy, int scrn, void *private);
+
+/* Screen methods */
+static void *driMesaCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
+ int numConfigs, __GLXvisualConfig *config);
+static void driMesaDestroyScreen(Display *dpy, int scrn, void *private);
+
+
+/*****************************************************************/
+
+/* Maintain a list of drawables */
+
+void *drawHash = NULL; /* Hash table to hold DRI drawables */
+
+static Bool __driMesaAddDrawable(__DRIdrawable *pdraw)
+{
+ __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)pdraw->private;
+
+ /* Create the hash table */
+ if (!drawHash) drawHash = drmHashCreate();
+
+ if (drmHashInsert(drawHash, pdp->draw, pdraw))
+ return GL_FALSE;
+
+ return GL_TRUE;
+}
+
+static __DRIdrawable *__driMesaFindDrawable(GLXDrawable draw)
+{
+ int retcode;
+ __DRIdrawable *pdraw;
+
+ /* Create the hash table */
+ if (!drawHash) drawHash = drmHashCreate();
+
+ retcode = drmHashLookup(drawHash, draw, (void **)&pdraw);
+ if (retcode)
+ return NULL;
+
+ return pdraw;
+}
+
+static void __driMesaRemoveDrawable(__DRIdrawable *pdraw)
+{
+ int retcode;
+ __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)pdraw->private;
+
+ /* Create the hash table */
+ if (!drawHash) drawHash = drmHashCreate();
+
+ retcode = drmHashLookup(drawHash, pdp->draw, (void **)&pdraw);
+ if (!retcode) { /* Found */
+ drmHashDelete(drawHash, pdp->draw);
+ }
+}
+
+/*****************************************************************/
+
+static void driMesaInitAPI(__XMESAapi *XMesaAPI)
+{
+ XMesaAPI->InitDriver = XMesaInitDriver;
+ XMesaAPI->ResetDriver = XMesaResetDriver;
+ XMesaAPI->CreateVisual = XMesaCreateVisual;
+ XMesaAPI->DestroyVisual = XMesaDestroyVisual;
+ XMesaAPI->CreateContext = XMesaCreateContext;
+ XMesaAPI->DestroyContext = XMesaDestroyContext;
+ XMesaAPI->CreateWindowBuffer = XMesaCreateWindowBuffer;
+ XMesaAPI->CreatePixmapBuffer = XMesaCreatePixmapBuffer;
+ XMesaAPI->DestroyBuffer = XMesaDestroyBuffer;
+ XMesaAPI->SwapBuffers = XMesaSwapBuffers;
+ XMesaAPI->MakeCurrent = XMesaMakeCurrent;
+}
+
+/*****************************************************************/
+
+static Bool driMesaUnbindContext(Display *dpy, int scrn,
+ GLXDrawable draw, GLXContext gc)
+{
+ __DRIdrawable *pdraw;
+ __DRIcontextPrivate *pcp;
+ __DRIscreenPrivate *psp;
+ __DRIdrawablePrivate *pdp;
+
+ /*
+ ** Assume error checking is done properly in glXMakeCurrent before
+ ** calling driMesaUnbindContext.
+ */
+
+ if (gc == NULL || draw == None) {
+ /* ERROR!!! */
+ return GL_FALSE;
+ }
+
+ pdraw = __driMesaFindDrawable(draw);
+ if (!pdraw) {
+ /* ERROR!!! */
+ return GL_FALSE;
+ }
+
+ pdp = (__DRIdrawablePrivate *)pdraw->private;
+ if (pdp->refcount == 0) {
+ /* ERROR!!! */
+ return GL_FALSE;
+ } else if (--pdp->refcount == 0) {
+#if 0
+ /*
+ ** NOT_DONE: When a drawable is unbound from one direct
+ ** rendering context and then bound to another, we do not want
+ ** to destroy the drawable data structure each time only to
+ ** recreate it immediatly afterwards when binding to the next
+ ** context. This also causes conflicts with caching of the
+ ** drawable stamp.
+ **
+ ** When GLX 1.3 is integrated, the create and destroy drawable
+ ** functions will have user level counterparts and the memory
+ ** will be able to be recovered.
+ */
+
+ /* Delete drawable if no longer referenced by any contexts */
+ (*pdraw->destroyDrawable)(dpy, pdraw->private);
+ __driMesaRemoveDrawable(pdraw);
+ Xfree(pdraw);
+#endif
+ }
+
+ psp = pdp->driScreenPriv;
+ if (!psp) {
+ /* ERROR!!! */
+ return GL_FALSE;
+ }
+
+ /* Unbind the drawable */
+ pcp = (__DRIcontextPrivate *)gc->driContext.private;
+ pcp->driDrawablePriv = NULL;
+ pdp->driContextPriv = &psp->dummyContextPriv;
+
+ return GL_TRUE;
+}
+
+static Bool driMesaBindContext(Display *dpy, int scrn,
+ GLXDrawable draw, GLXContext gc)
+{
+ __DRIdrawable *pdraw;
+ __DRIdrawablePrivate *pdp;
+ __DRIscreenPrivate *psp;
+ __DRIcontextPrivate *pcp;
+
+ /*
+ ** Assume error checking is done properly in glXMakeCurrent before
+ ** calling driMesaBindContext.
+ */
+
+ if (gc == NULL || draw == None) {
+ /* ERROR!!! */
+ return GL_FALSE;
+ }
+
+ pdraw = __driMesaFindDrawable(draw);
+ if (!pdraw) {
+ /* Allocate a new drawable */
+ pdraw = (__DRIdrawable *)Xmalloc(sizeof(__DRIdrawable));
+ if (!pdraw) {
+ /* ERROR!!! */
+ return GL_FALSE;
+ }
+
+ /* Create a new drawable */
+ pdraw->private = driMesaCreateDrawable(dpy, scrn, draw, gc->vid,
+ pdraw);
+ if (!pdraw->private) {
+ /* ERROR!!! */
+ Xfree(pdraw);
+ return GL_FALSE;
+ }
+
+ /* Add pdraw to drawable list */
+ if (!__driMesaAddDrawable(pdraw)) {
+ /* ERROR!!! */
+ (*pdraw->destroyDrawable)(dpy, pdraw->private);
+ Xfree(pdraw);
+ return GL_FALSE;
+ }
+ }
+
+ pdp = (__DRIdrawablePrivate *)pdraw->private;
+ psp = pdp->driScreenPriv;
+ if (!psp) {
+ /* ERROR!!! */
+ return GL_FALSE;
+ }
+
+ /* Bind the drawable to the context */
+ pcp = (__DRIcontextPrivate *)gc->driContext.private;
+ pcp->driDrawablePriv = pdp;
+ pdp->driContextPriv = pcp;
+ pdp->refcount++;
+
+ /*
+ ** Now that we have a context associated with this drawable, we can
+ ** initialize the drawable information if has not been done before.
+ */
+ if (!pdp->pStamp) {
+ DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
+ driMesaUpdateDrawableInfo(dpy, scrn, pdp);
+ DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
+ }
+
+ /* Bind Mesa's drawable to Mesa's context */
+ (*psp->XMesaAPI.MakeCurrent)(pcp->xm_ctx, pdp->xm_buf);
+
+ return GL_TRUE;
+}
+
+/*****************************************************************/
+
+void driMesaUpdateDrawableInfo(Display *dpy, int scrn,
+ __DRIdrawablePrivate *pdp)
+{
+ __DRIscreenPrivate *psp;
+ __DRIcontextPrivate *pcp = pdp->driContextPriv;
+
+ if (!pcp || (pdp != pcp->driDrawablePriv)) {
+ /* ERROR!!! */
+ return;
+ }
+
+ psp = pdp->driScreenPriv;
+ if (!psp) {
+ /* ERROR!!! */
+ return;
+ }
+
+ if (pdp->pClipRects) {
+ Xfree(pdp->pClipRects);
+ }
+
+ DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
+
+ if (!XF86DRIGetDrawableInfo(dpy, scrn, pdp->draw,
+ &pdp->index, &pdp->lastStamp,
+ &pdp->x, &pdp->y, &pdp->w, &pdp->h,
+ &pdp->numClipRects, &pdp->pClipRects)) {
+ pdp->numClipRects = 0;
+ pdp->pClipRects = NULL;
+ /* ERROR!!! */
+ }
+
+ DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
+
+ pdp->pStamp = &(psp->pSAREA->drawableTable[pdp->index].stamp);
+}
+
+/*****************************************************************/
+
+static void *driMesaCreateDrawable(Display *dpy, int scrn, GLXDrawable draw,
+ VisualID vid, __DRIdrawable *pdraw)
+{
+ __DRIscreen *pDRIScreen;
+ __DRIscreenPrivate *psp;
+ __DRIdrawablePrivate *pdp;
+ int i;
+ XMesaVisual xm_vis = NULL;
+
+ pdp = (__DRIdrawablePrivate *)Xmalloc(sizeof(__DRIdrawablePrivate));
+ if (!pdp) {
+ return NULL;
+ }
+
+ if (!XF86DRICreateDrawable(dpy, scrn, draw, &pdp->hHWDrawable)) {
+ Xfree(pdp);
+ return NULL;
+ }
+
+ pdp->draw = draw;
+ pdp->refcount = 0;
+ pdp->pStamp = NULL;
+ pdp->lastStamp = 0;
+ pdp->index = 0;
+ pdp->x = 0;
+ pdp->y = 0;
+ pdp->w = 0;
+ pdp->h = 0;
+ pdp->numClipRects = 0;
+ pdp->pClipRects = NULL;
+
+ pDRIScreen = __glXFindDRIScreen(dpy, scrn);
+ pdp->driScreenPriv = psp = (__DRIscreenPrivate *)pDRIScreen->private;
+
+ pdp->driContextPriv = &psp->dummyContextPriv;
+
+ for (i = 0; i < psp->numVisuals; i++) {
+ if (vid == psp->visuals[i].vid) {
+ xm_vis = psp->visuals[i].xm_vis;
+ break;
+ }
+ }
+
+ if (1 /* NOT_DONE: Determine if it is a pixmap or not */) {
+ pdp->xm_buf = (*psp->XMesaAPI.CreateWindowBuffer)(xm_vis, draw, pdp);
+ } else {
+ XMesaVisual xm_vis = NULL;
+ XMesaColormap cmap = 0;
+ pdp->xm_buf = (*psp->XMesaAPI.CreatePixmapBuffer)(xm_vis, draw, cmap,
+ pdp);
+ }
+ if (!pdp->xm_buf) {
+ (void)XF86DRIDestroyDrawable(dpy, scrn, pdp->draw);
+ Xfree(pdp);
+ return NULL;
+ }
+
+ pdraw->destroyDrawable = driMesaDestroyDrawable;
+ pdraw->swapBuffers = driMesaSwapBuffers;
+
+ return (void *)pdp;
+}
+
+static __DRIdrawable *driMesaGetDrawable(Display *dpy, GLXDrawable draw)
+{
+ /*
+ ** Make sure this routine returns NULL if the drawable is not bound
+ ** to a direct rendering context!
+ */
+ return __driMesaFindDrawable(draw);
+}
+
+static void driMesaSwapBuffers(Display *dpy, void *private)
+{
+ __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)private;
+ __DRIscreenPrivate *psp = pdp->driScreenPriv;
+
+ (*psp->XMesaAPI.SwapBuffers)(pdp->xm_buf);
+}
+
+static void driMesaDestroyDrawable(Display *dpy, void *private)
+{
+ __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)private;
+ __DRIscreenPrivate *psp = pdp->driScreenPriv;
+ int scrn = psp->myNum;
+
+ if (pdp) {
+ (*psp->XMesaAPI.DestroyBuffer)(pdp->xm_buf);
+ (void)XF86DRIDestroyDrawable(dpy, scrn, pdp->draw);
+ if (pdp->pClipRects)
+ Xfree(pdp->pClipRects);
+ Xfree(pdp);
+ }
+}
+
+/*****************************************************************/
+
+static void *driMesaCreateContext(Display *dpy, XVisualInfo *vis, void *shared,
+ __DRIcontext *pctx)
+{
+ __DRIcontextPrivate *pcp;
+ __DRIcontextPrivate *pshare = (__DRIcontextPrivate *)shared;
+ XMesaContext shared_xm_ctx = (pshare ?
+ pshare->xm_ctx : (XMesaContext)NULL);
+ __DRIscreenPrivate *psp;
+ __DRIscreen *pDRIScreen;
+ int i;
+
+ pDRIScreen = __glXFindDRIScreen(dpy, vis->screen);
+ psp = (__DRIscreenPrivate *)pDRIScreen->private;
+
+ if (!psp->dummyContextPriv.driScreenPriv) {
+ if (!XF86DRICreateContext(dpy, vis->screen, vis->visual,
+ &psp->dummyContextPriv.contextID,
+ &psp->dummyContextPriv.hHWContext)) {
+ return NULL;
+ }
+ psp->dummyContextPriv.driScreenPriv = psp;
+ psp->dummyContextPriv.xm_ctx = NULL;
+ psp->dummyContextPriv.driDrawablePriv = NULL;
+ /* No other fields should be used! */
+ }
+
+ pcp = (__DRIcontextPrivate *)Xmalloc(sizeof(__DRIcontextPrivate));
+ if (!pcp) {
+ return NULL;
+ }
+
+ pcp->driScreenPriv = psp;
+ pcp->xm_ctx = NULL;
+ pcp->driDrawablePriv = NULL;
+
+ if (!XF86DRICreateContext(dpy, vis->screen, vis->visual,
+ &pcp->contextID, &pcp->hHWContext)) {
+ Xfree(pcp);
+ return NULL;
+ }
+
+ for (i = 0; i < psp->numVisuals; i++)
+ if (psp->visuals[i].vid == vis->visualid)
+ pcp->xm_ctx = (*psp->XMesaAPI.CreateContext)
+ (psp->visuals[i].xm_vis, shared_xm_ctx, pcp);
+
+ if (!pcp->xm_ctx) {
+ (void)XF86DRIDestroyContext(dpy, vis->screen, pcp->contextID);
+ Xfree(pcp);
+ return NULL;
+ }
+
+ pctx->destroyContext = driMesaDestroyContext;
+ pctx->bindContext = driMesaBindContext;
+ pctx->unbindContext = driMesaUnbindContext;
+
+ return pcp;
+}
+
+static void driMesaDestroyContext(Display *dpy, int scrn, void *private)
+{
+ __DRIcontextPrivate *pcp = (__DRIcontextPrivate *)private;
+
+ if (pcp) {
+ (void)XF86DRIDestroyContext(dpy, scrn, pcp->contextID);
+ (*pcp->driScreenPriv->XMesaAPI.DestroyContext)(pcp->xm_ctx);
+ Xfree(pcp);
+ }
+}
+
+/*****************************************************************/
+
+static void *driMesaCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
+ int numConfigs, __GLXvisualConfig *config)
+{
+ int directCapable, i, n;
+ __DRIscreenPrivate *psp;
+ XVisualInfo visTmpl, *visinfo;
+ drmHandle hFB, hSAREA;
+ char *BusID, *driverName;
+ drmMagic magic;
+
+ if (!XF86DRIQueryDirectRenderingCapable(dpy, scrn, &directCapable)) {
+ return NULL;
+ }
+
+ if (!directCapable) {
+ return NULL;
+ }
+
+ psp = (__DRIscreenPrivate *)Xmalloc(sizeof(__DRIscreenPrivate));
+ if (!psp) {
+ return NULL;
+ }
+
+ psp->myNum = scrn;
+
+ if (!XF86DRIOpenConnection(dpy, scrn, &hSAREA, &BusID)) {
+ Xfree(psp);
+ return NULL;
+ }
+
+ /*
+ ** NOT_DONE: This is used by the X server to detect when the client
+ ** has died while holding the drawable lock. The client sets the
+ ** drawable lock to this value.
+ */
+ psp->drawLockID = 1;
+
+ psp->fd = drmOpen(NULL,BusID);
+ if (!psp->fd) {
+ Xfree(BusID);
+ Xfree(psp);
+ (void)XF86DRICloseConnection(dpy, scrn);
+ return NULL;
+ }
+ Xfree(BusID); /* No longer needed */
+
+ if (drmGetMagic(psp->fd, &magic)) {
+ (void)drmClose(psp->fd);
+ Xfree(psp);
+ (void)XF86DRICloseConnection(dpy, scrn);
+ return NULL;
+ }
+
+ if (!XF86DRIAuthConnection(dpy, scrn, magic)) {
+ (void)drmClose(psp->fd);
+ Xfree(psp);
+ (void)XF86DRICloseConnection(dpy, scrn);
+ return NULL;
+ }
+
+ if (!XF86DRIGetClientDriverName(dpy, scrn,
+ &psp->major,
+ &psp->minor,
+ &psp->patch,
+ &driverName)) {
+ (void)drmClose(psp->fd);
+ Xfree(psp);
+ (void)XF86DRICloseConnection(dpy, scrn);
+ return NULL;
+ }
+
+ driMesaInitAPI(&psp->XMesaAPI);
+
+ if (!XF86DRIGetDeviceInfo(dpy, scrn,
+ &hFB,
+ &psp->fbOrigin,
+ &psp->fbSize,
+ &psp->fbStride,
+ &psp->devPrivSize,
+ &psp->pDevPriv)) {
+ (void)drmClose(psp->fd);
+ Xfree(psp);
+ (void)XF86DRICloseConnection(dpy, scrn);
+ return NULL;
+ }
+ psp->fbWidth = DisplayWidth(dpy, scrn);
+ psp->fbHeight = DisplayHeight(dpy, scrn);
+ psp->fbBPP = 32; /* NOT_DONE: Get this from X server */
+
+ if (drmMap(psp->fd, hFB, psp->fbSize, (drmAddressPtr)&psp->pFB)) {
+ Xfree(psp->pDevPriv);
+ (void)drmClose(psp->fd);
+ Xfree(psp);
+ (void)XF86DRICloseConnection(dpy, scrn);
+ return NULL;
+ }
+
+ if (drmMap(psp->fd, hSAREA, SAREA_MAX, (drmAddressPtr)&psp->pSAREA)) {
+ (void)drmUnmap((drmAddress)psp->pFB, psp->fbSize);
+ Xfree(psp->pDevPriv);
+ (void)drmClose(psp->fd);
+ Xfree(psp);
+ (void)XF86DRICloseConnection(dpy, scrn);
+ return NULL;
+ }
+
+ psp->numVisuals = numConfigs;
+ psp->visuals = (__DRIvisualPrivate *)Xmalloc(numConfigs *
+ sizeof(__DRIvisualPrivate));
+ if (!psp->visuals) {
+ (void)drmUnmap((drmAddress)psp->pSAREA, SAREA_MAX);
+ (void)drmUnmap((drmAddress)psp->pFB, psp->fbSize);
+ Xfree(psp->pDevPriv);
+ (void)drmClose(psp->fd);
+ Xfree(psp);
+ (void)XF86DRICloseConnection(dpy, scrn);
+ return NULL;
+ }
+
+ visTmpl.screen = scrn;
+ visinfo = XGetVisualInfo(dpy, VisualScreenMask, &visTmpl, &n);
+ if (n != numConfigs) {
+ (void)drmUnmap((drmAddress)psp->pSAREA, SAREA_MAX);
+ (void)drmUnmap((drmAddress)psp->pFB, psp->fbSize);
+ Xfree(psp->pDevPriv);
+ (void)drmClose(psp->fd);
+ Xfree(psp);
+ (void)XF86DRICloseConnection(dpy, scrn);
+ return NULL;
+ }
+
+ for (i = 0; i < numConfigs; i++, config++) {
+ psp->visuals[i].vid = visinfo[i].visualid;
+ psp->visuals[i].xm_vis =
+ (*psp->XMesaAPI.CreateVisual)(dpy,
+ &visinfo[i],
+ config->rgba,
+ (config->alphaSize > 0),
+ config->doubleBuffer,
+ config->stereo,
+ GL_TRUE, /* ximage_flag */
+ config->depthSize,
+ config->stencilSize,
+ config->accumRedSize,
+ config->level);
+ if (!psp->visuals[i].xm_vis) {
+ /* Free the visuals so far created */
+ while (--i >= 0) {
+ (*psp->XMesaAPI.DestroyVisual)(psp->visuals[i].xm_vis);
+ }
+ Xfree(psp->visuals);
+ XFree(visinfo);
+ (void)drmUnmap((drmAddress)psp->pSAREA, SAREA_MAX);
+ (void)drmUnmap((drmAddress)psp->pFB, psp->fbSize);
+ Xfree(psp->pDevPriv);
+ (void)drmClose(psp->fd);
+ Xfree(psp);
+ (void)XF86DRICloseConnection(dpy, scrn);
+ return NULL;
+ }
+ }
+ XFree(visinfo);
+
+ /* Initialize the screen specific GLX driver */
+ if (psp->XMesaAPI.InitDriver) {
+ if (!(*psp->XMesaAPI.InitDriver)(psp)) {
+ while (--psp->numVisuals >= 0) {
+ (*psp->XMesaAPI.DestroyVisual)
+ (psp->visuals[psp->numVisuals].xm_vis);
+ }
+ Xfree(psp->visuals);
+ (void)drmUnmap((drmAddress)psp->pSAREA, SAREA_MAX);
+ (void)drmUnmap((drmAddress)psp->pFB, psp->fbSize);
+ Xfree(psp->pDevPriv);
+ (void)drmClose(psp->fd);
+ Xfree(psp);
+ (void)XF86DRICloseConnection(dpy, scrn);
+ return NULL;
+ }
+ }
+
+ /*
+ ** Do not init dummy context here; actual initialization will be
+ ** done when the first DRI context is created. Init screen priv ptr
+ ** to NULL to let CreateContext routine that it needs to be inited.
+ */
+ psp->dummyContextPriv.driScreenPriv = NULL;
+
+ psc->destroyScreen = driMesaDestroyScreen;
+ psc->createContext = driMesaCreateContext;
+ psc->createDrawable = driMesaCreateDrawable;
+ psc->getDrawable = driMesaGetDrawable;
+
+ return (void *)psp;
+}
+
+static void driMesaDestroyScreen(Display *dpy, int scrn, void *private)
+{
+ __DRIscreenPrivate *psp = (__DRIscreenPrivate *)private;
+
+ if (psp) {
+ if (psp->dummyContextPriv.driScreenPriv) {
+ (void)XF86DRIDestroyContext(dpy, scrn,
+ psp->dummyContextPriv.contextID);
+ }
+ if (psp->XMesaAPI.ResetDriver)
+ (*psp->XMesaAPI.ResetDriver)(psp);
+ while (--psp->numVisuals >= 0) {
+ (*psp->XMesaAPI.DestroyVisual)
+ (psp->visuals[psp->numVisuals].xm_vis);
+ }
+ Xfree(psp->visuals);
+ (void)drmUnmap((drmAddress)psp->pSAREA, SAREA_MAX);
+ (void)drmUnmap((drmAddress)psp->pFB, psp->fbSize);
+ Xfree(psp->pDevPriv);
+ (void)drmClose(psp->fd);
+ Xfree(psp);
+
+#if 0
+ /*
+ ** NOT_DONE: Normally, we would call XF86DRICloseConnection()
+ ** here, but since this routine is called after the
+ ** XCloseDisplay() function has already shut down the connection
+ ** to the Display, there is no protocol stream open to the X
+ ** server anymore. Luckily, XF86DRICloseConnection() does not
+ ** really do anything (for now).
+ */
+ (void)XF86DRICloseConnection(dpy, scrn);
+#endif
+ }
+}
+
+
+/*
+ * This is the entrypoint into the driver.
+ * The driCreateScreen name is the symbol that libGL.so fetches.
+ */
+void *driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
+ int numConfigs, __GLXvisualConfig *config)
+{
+ return driMesaCreateScreen(dpy, scrn, psc, numConfigs, config);
+}
+
+
+
+#endif
diff --git a/xc/lib/GL/dri/dri_mesa.h b/xc/lib/GL/mesa/dri/dri_mesa.h
index 0f8fd58fc..0f8fd58fc 100644
--- a/xc/lib/GL/dri/dri_mesa.h
+++ b/xc/lib/GL/mesa/dri/dri_mesa.h
diff --git a/xc/lib/GL/dri/dri_mesaint.h b/xc/lib/GL/mesa/dri/dri_mesaint.h
index c9d4a62f3..368625593 100644
--- a/xc/lib/GL/dri/dri_mesaint.h
+++ b/xc/lib/GL/mesa/dri/dri_mesaint.h
@@ -41,7 +41,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <GL/glx.h>
#include "xf86dri.h"
#include "sarea.h"
-#include "dri_glapi.h"
#include "GL/xmesa.h"
#include "dri_mesa.h"
#include "dri_xmesaapi.h"
@@ -169,12 +168,8 @@ struct __DRIscreenPrivateRec {
int numVisuals;
/*
- ** Function pointers associated with the core rendering library's GL
- ** and GLX functions. The handle to the library is saved so that it
- ** can be closed when it is no longer needed.
+ ** Function pointers associated with Mesa's GLX functions.
*/
- void *hLibrary;
- __GLapi glAPI;
__XMESAapi XMesaAPI;
/*
@@ -243,14 +238,6 @@ struct __DRIscreenPrivateRec {
void *private;
};
-struct __DRIdisplayPrivateRec {
- /*
- ** XFree86-DRI version information
- */
- int major;
- int minor;
- int patch;
-};
extern void driMesaUpdateDrawableInfo(Display *dpy, int scrn,
__DRIdrawablePrivate *pdp);
diff --git a/xc/lib/GL/dri/dri_xmesaapi.h b/xc/lib/GL/mesa/dri/dri_xmesaapi.h
index ace3fd3b5..ace3fd3b5 100644
--- a/xc/lib/GL/dri/dri_xmesaapi.h
+++ b/xc/lib/GL/mesa/dri/dri_xmesaapi.h
diff --git a/xc/lib/GL/mesa/src/Imakefile b/xc/lib/GL/mesa/src/Imakefile
index be1de5f3e..41b1a1e0b 100644
--- a/xc/lib/GL/mesa/src/Imakefile
+++ b/xc/lib/GL/mesa/src/Imakefile
@@ -22,10 +22,6 @@ LinkSourceFile(alpha.c, ../../../../extras/Mesa/src)
LinkSourceFile(alpha.h, ../../../../extras/Mesa/src)
LinkSourceFile(alphabuf.c, ../../../../extras/Mesa/src)
LinkSourceFile(alphabuf.h, ../../../../extras/Mesa/src)
-LinkSourceFile(api.h, ../../../../extras/Mesa/src)
-LinkSourceFile(api1.c, ../../../../extras/Mesa/src)
-LinkSourceFile(api2.c, ../../../../extras/Mesa/src)
-LinkSourceFile(apiext.c, ../../../../extras/Mesa/src)
LinkSourceFile(attrib.c, ../../../../extras/Mesa/src)
LinkSourceFile(attrib.h, ../../../../extras/Mesa/src)
LinkSourceFile(bbox.c, ../../../../extras/Mesa/src)
@@ -55,6 +51,8 @@ LinkSourceFile(debug_xform.c, ../../../../extras/Mesa/src)
LinkSourceFile(debug_xform.h, ../../../../extras/Mesa/src)
LinkSourceFile(depth.c, ../../../../extras/Mesa/src)
LinkSourceFile(depth.h, ../../../../extras/Mesa/src)
+LinkSourceFile(dispatch.c, ../../../../extras/Mesa/src)
+LinkSourceFile(dispatch.h, ../../../../extras/Mesa/src)
LinkSourceFile(dlist.c, ../../../../extras/Mesa/src)
LinkSourceFile(dlist.h, ../../../../extras/Mesa/src)
LinkSourceFile(dotprod_tmp.h, ../../../../extras/Mesa/src)
@@ -77,12 +75,24 @@ LinkSourceFile(fog_tmp.h, ../../../../extras/Mesa/src)
LinkSourceFile(general_clip.h, ../../../../extras/Mesa/src)
LinkSourceFile(get.c, ../../../../extras/Mesa/src)
LinkSourceFile(get.h, ../../../../extras/Mesa/src)
+LinkSourceFile(glapi.c, ../../../../extras/Mesa/src)
+LinkSourceFile(glapi.h, ../../../../extras/Mesa/src)
+LinkSourceFile(glapinoop.c, ../../../../extras/Mesa/src)
+LinkSourceFile(glapinoop.h, ../../../../extras/Mesa/src)
+LinkSourceFile(glapioffsets.h, ../../../../extras/Mesa/src)
+LinkSourceFile(glapitable.h, ../../../../extras/Mesa/src)
+LinkSourceFile(glapitemp.h, ../../../../extras/Mesa/src)
+LinkSourceFile(glheader.h, ../../../../extras/Mesa/src)
LinkSourceFile(glmisc.c, ../../../../extras/Mesa/src)
LinkSourceFile(glmisc.h, ../../../../extras/Mesa/src)
+LinkSourceFile(glthread.c, ../../../../extras/Mesa/src)
+LinkSourceFile(glthread.h, ../../../../extras/Mesa/src)
LinkSourceFile(hash.c, ../../../../extras/Mesa/src)
LinkSourceFile(hash.h, ../../../../extras/Mesa/src)
LinkSourceFile(image.c, ../../../../extras/Mesa/src)
LinkSourceFile(image.h, ../../../../extras/Mesa/src)
+LinkSourceFile(imaging.c, ../../../../extras/Mesa/src)
+LinkSourceFile(imaging.h, ../../../../extras/Mesa/src)
LinkSourceFile(indirect_tmp.h, ../../../../extras/Mesa/src)
LinkSourceFile(interp_tmp.h, ../../../../extras/Mesa/src)
LinkSourceFile(light.c, ../../../../extras/Mesa/src)
@@ -98,10 +108,10 @@ LinkSourceFile(masking.c, ../../../../extras/Mesa/src)
LinkSourceFile(masking.h, ../../../../extras/Mesa/src)
LinkSourceFile(matrix.c, ../../../../extras/Mesa/src)
LinkSourceFile(matrix.h, ../../../../extras/Mesa/src)
+LinkSourceFile(mem.c, ../../../../extras/Mesa/src)
+LinkSourceFile(mem.h, ../../../../extras/Mesa/src)
LinkSourceFile(mmath.c, ../../../../extras/Mesa/src)
LinkSourceFile(mmath.h, ../../../../extras/Mesa/src)
-LinkSourceFile(mthreads.c, ../../../../extras/Mesa/src)
-LinkSourceFile(mthreads.h, ../../../../extras/Mesa/src)
LinkSourceFile(norm_tmp.h, ../../../../extras/Mesa/src)
LinkSourceFile(pb.c, ../../../../extras/Mesa/src)
LinkSourceFile(pb.h, ../../../../extras/Mesa/src)
@@ -109,8 +119,6 @@ LinkSourceFile(pipeline.c, ../../../../extras/Mesa/src)
LinkSourceFile(pipeline.h, ../../../../extras/Mesa/src)
LinkSourceFile(pixel.c, ../../../../extras/Mesa/src)
LinkSourceFile(pixel.h, ../../../../extras/Mesa/src)
-LinkSourceFile(pointers.c, ../../../../extras/Mesa/src)
-LinkSourceFile(pointers.h, ../../../../extras/Mesa/src)
LinkSourceFile(points.c, ../../../../extras/Mesa/src)
LinkSourceFile(points.h, ../../../../extras/Mesa/src)
LinkSourceFile(polygon.c, ../../../../extras/Mesa/src)
@@ -178,41 +186,155 @@ LinkSourceFile(xform_tmp.h, ../../../../extras/Mesa/src)
LinkSourceFile(zoom.c, ../../../../extras/Mesa/src)
LinkSourceFile(zoom.h, ../../../../extras/Mesa/src)
- CORE_SRCS = accum.c alpha.c alphabuf.c api1.c api2.c apiext.c \
- attrib.c bitmap.c blend.c clip.c colortab.c context.c \
- copypix.c depth.c dlist.c drawpix.c enable.c eval.c \
- feedback.c fog.c get.c hash.c image.c light.c lines.c \
- logic.c masking.c matrix.c glmisc.c mmath.c mthreads.c \
- pb.c pixel.c points.c pointers.c polygon.c quads.c \
- rastpos.c readpix.c rect.c scissor.c shade.c span.c \
- stencil.c teximage.c texobj.c texstate.c texture.c \
- triangle.c varray.c winpos.c vb.c vbfill.c vbrender.c \
- vbxform.c xform.c zoom.c stages.c \
- bbox.c config.c cva.c enums.c extensions.c \
- pipeline.c translate.c vbcull.c vbindirect.c vector.c \
- vertices.c
+ CORE_SRCS = accum.c \
+ alpha.c \
+ alphabuf.c \
+ attrib.c \
+ bbox.c \
+ bitmap.c \
+ blend.c \
+ clip.c \
+ colortab.c \
+ config.c \
+ context.c \
+ copypix.c \
+ cva.c \
+ debug_xform.c \
+ depth.c \
+ dispatch.c \
+ dlist.c \
+ drawpix.c \
+ enable.c \
+ enums.c \
+ eval.c \
+ extensions.c \
+ feedback.c \
+ fog.c \
+ get.c \
+ glapi.c \
+ glapinoop.c \
+ glmisc.c \
+ glthread.c \
+ hash.c \
+ image.c \
+ imaging.o \
+ light.c \
+ lines.c \
+ logic.c \
+ masking.c \
+ matrix.c \
+ mem.c \
+ mmath.c \
+ pb.c \
+ pipeline.c \
+ pixel.c \
+ points.c \
+ polygon.c \
+ quads.c \
+ rastpos.c \
+ readpix.c \
+ rect.c \
+ scissor.c \
+ shade.c \
+ span.c \
+ stages.c \
+ stencil.c \
+ teximage.c \
+ texobj.c \
+ texstate.c \
+ texture.c \
+ translate.c \
+ triangle.c \
+ varray.c \
+ vb.c \
+ vbcull.c \
+ vbfill.c \
+ vbindirect.c \
+ vbrender.c \
+ vbxform.c \
+ vector.c \
+ vertices.c \
+ winpos.c \
+ xform.c \
+ zoom.c
- CORE_OBJS = accum.o alpha.o alphabuf.o api1.o api2.o apiext.o \
- attrib.o bitmap.o blend.o clip.o colortab.o context.o \
- copypix.o depth.o dlist.o drawpix.o enable.o eval.o \
- feedback.o fog.o get.o hash.o image.o light.o lines.o \
- logic.o masking.o matrix.o glmisc.o mmath.o mthreads.o \
- pb.o pixel.o points.o pointers.o polygon.o quads.o \
- rastpos.o readpix.o rect.o scissor.o shade.o span.o \
- stencil.o teximage.o texobj.o texstate.o texture.o \
- triangle.o varray.o winpos.o vb.o vbfill.o vbrender.o \
- vbxform.o xform.o zoom.o stages.o \
- bbox.o config.o cva.o enums.o extensions.o \
- pipeline.o translate.o vbcull.o vbindirect.o vector.o \
- vertices.o
+ CORE_OBJS = accum.o \
+ alpha.o \
+ alphabuf.o \
+ attrib.o \
+ bbox.o \
+ bitmap.o \
+ blend.o \
+ clip.o \
+ colortab.o \
+ config.o \
+ context.o \
+ copypix.o \
+ cva.o \
+ debug_xform.o \
+ depth.o \
+ dispatch.o \
+ dlist.o \
+ drawpix.o \
+ enable.o \
+ enums.o \
+ eval.o \
+ extensions.o \
+ feedback.o \
+ fog.o \
+ get.o \
+ glmisc.o \
+ hash.o \
+ image.o \
+ imaging.o \
+ light.o \
+ lines.o \
+ logic.o \
+ masking.o \
+ matrix.o \
+ mem.o \
+ mmath.o \
+ pb.o \
+ pipeline.o \
+ pixel.o \
+ points.o \
+ polygon.o \
+ quads.o \
+ rastpos.o \
+ readpix.o \
+ rect.o \
+ scissor.o \
+ shade.o \
+ span.o \
+ stages.o \
+ stencil.o \
+ teximage.o \
+ texobj.o \
+ texstate.o \
+ texture.o \
+ translate.o \
+ triangle.o \
+ varray.o \
+ vb.o \
+ vbcull.o \
+ vbfill.o \
+ vbindirect.o \
+ vbrender.o \
+ vbxform.o \
+ vector.o \
+ vertices.o \
+ winpos.o \
+ xform.o \
+ zoom.o
+#ifdef i386Architecture
ASM_SRCS =
ASM_OBJS =
- ASM_DEFS = -DUSE_MMX_ASM -DUSE_X86_ASM
-# -DUSE_3DNOW_ASM
+ ASM_DEFS = -DUSE_MMX_ASM -DUSE_X86_ASM -DUSE_3DNOW_ASM
+#endif
DEFINES = $(ALLOC_DEFINES) GlxDefines $(TDFX_DEFS) $(ASM_DEFS)
- INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) -I../include -I../../dri
+ INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) -I../include -I../../dri -I.
SRCS = $(CORE_SRCS) $(ASM_SRCS)
OBJS = $(CORE_OBJS) $(ASM_OBJS)
diff --git a/xc/lib/GL/mesa/src/X/Imakefile b/xc/lib/GL/mesa/src/X/Imakefile
index bf0671c0b..ef7e1bfc2 100644
--- a/xc/lib/GL/mesa/src/X/Imakefile
+++ b/xc/lib/GL/mesa/src/X/Imakefile
@@ -11,6 +11,8 @@ LinkSourceFile(xmesa1.c, ../../../../../extras/Mesa/src/X)
LinkSourceFile(xmesa2.c, ../../../../../extras/Mesa/src/X)
LinkSourceFile(xmesa3.c, ../../../../../extras/Mesa/src/X)
LinkSourceFile(xmesa4.c, ../../../../../extras/Mesa/src/X)
+LinkSourceFile(xmesaP.h, ../../../../../extras/Mesa/src/X)
+LinkSourceFile(glxheader.h, ../../../../../extras/Mesa/src/X)
#if Malloc0ReturnsNull
@@ -19,17 +21,11 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
#if BuildXF86DRI
DRI_DEFINES = GlxDefines
- DRI_INCLUDES = -I../../../dri -I../../../glx \
+ DRI_INCLUDES = -I../../../dri -I../../../glx -I../../dri \
-I$(TOP)/include -I$(TOP)/include/GL \
-I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri
#endif
-LinkSourceFile(xmesa1.c, ../../../../../extras/Mesa/src/X)
-LinkSourceFile(xmesa2.c, ../../../../../extras/Mesa/src/X)
-LinkSourceFile(xmesa3.c, ../../../../../extras/Mesa/src/X)
-LinkSourceFile(xmesa4.c, ../../../../../extras/Mesa/src/X)
-LinkSourceFile(xmesaP.h, ../../../../../extras/Mesa/src/X)
-
MESA_INCLUDES = -I. -I.. -I../../include
DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES)
diff --git a/xc/lib/GL/mesa/src/X86/Imakefile b/xc/lib/GL/mesa/src/X86/Imakefile
index 6224c4ff5..6ce7f2451 100644
--- a/xc/lib/GL/mesa/src/X86/Imakefile
+++ b/xc/lib/GL/mesa/src/X86/Imakefile
@@ -7,8 +7,20 @@ XCOMM $PI: xc/lib/GL/mesa/src/Imakefile,v 1.5 1999/06/21 05:13:55 martin Exp $
#define DoDebugLib DebugLibGlx
#define DoProfileLib ProfileLibGlx
-#define HAVE_3DNOW 1
-#define HAVE_MMX_ 1
+LinkSourceFile(assyntax.h, ../../../../../extras/Mesa/src/X86)
+LinkSourceFile(common_x86.c, ../../../../../extras/Mesa/src/X86)
+LinkSourceFile(common_x86asm.S, ../../../../../extras/Mesa/src/X86)
+LinkSourceFile(common_x86asm.h, ../../../../../extras/Mesa/src/X86)
+LinkSourceFile(glapi_x86.S, ../../../../../extras/Mesa/src/X86)
+LinkSourceFile(x86.c, ../../../../../extras/Mesa/src/X86)
+LinkSourceFile(x86.h, ../../../../../extras/Mesa/src/X86)
+LinkSourceFile(x86a.S, ../../../../../extras/Mesa/src/X86)
+LinkSourceFile(vertex.S, ../../../../../extras/Mesa/src/X86)
+LinkSourceFile(x86flatregs.m4, ../../../../../extras/Mesa/src/X86)
+LinkSourceFile(x86a.S.m4, ../../../../../extras/Mesa/src/X86)
+
+LinkSourceFile(mmx.h, ../../../../../extras/Mesa/src/X86)
+LinkSourceFile(mmx_blend.S, ../../../../../extras/Mesa/src/X86)
LinkSourceFile(3dnow.c, ../../../../../extras/Mesa/src/X86)
LinkSourceFile(3dnow.h, ../../../../../extras/Mesa/src/X86)
@@ -23,26 +35,28 @@ LinkSourceFile(3dnow_xform_raw3.S, ../../../../../extras/Mesa/src/X86)
LinkSourceFile(3dnow_xform_raw4.S, ../../../../../extras/Mesa/src/X86)
LinkSourceFile(vertex_3dnow.S, ../../../../../extras/Mesa/src/X86)
-LinkSourceFile(mmx.h, ../../../../../extras/Mesa/src/X86)
-LinkSourceFile(mmx_blend.S, ../../../../../extras/Mesa/src/X86)
-
-LinkSourceFile(x86a.S, ../../../../../extras/Mesa/src/X86)
-LinkSourceFile(assyntax.h, ../../../../../extras/Mesa/src/X86)
-LinkSourceFile(common_x86.c, ../../../../../extras/Mesa/src/X86)
-LinkSourceFile(common_x86asm.S, ../../../../../extras/Mesa/src/X86)
-LinkSourceFile(common_x86asm.h, ../../../../../extras/Mesa/src/X86)
-LinkSourceFile(x86.c, ../../../../../extras/Mesa/src/X86)
-LinkSourceFile(x86.h, ../../../../../extras/Mesa/src/X86)
-LinkSourceFile(vertex.S, ../../../../../extras/Mesa/src/X86)
-
-LinkSourceFile(x86flatregs.m4, ../../../../../extras/Mesa/src/X86)
-LinkSourceFile(x86a.S.m4, ../../../../../extras/Mesa/src/X86)
+LinkSourceFile(glapioffsets.h, ../../../../../extras/Mesa/src)
#if Malloc0ReturnsNull
ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
#endif
-#if HAVE_3DNOW
+#ifdef i386Architecture
+XCOMM We'll learn at runtime whether 3dNow, MMX, etc are really present.
+ X86_SRCS = x86a.S common_x86.c common_x86asm.S glapi_x86.S x86.c vertex.S
+
+ X86_OBJS = x86a.o common_x86.o common_x86asm.o glapi_x86.o x86.o vertex.o
+
+ X86_DEFS = -DUSE_X86_ASM
+
+
+ MMX_SRCS = mmx_blend.S
+
+ MMX_OBJS = mmx_blend.o
+
+ MMX_DEFS = -DUSE_MMX_ASM
+
+
3DNOW_SRCS = 3dnow.c 3dnow_norm_raw.S 3dnow_xform_masked1.S \
3dnow_xform_masked2.S 3dnow_xform_masked3.S \
3dnow_xform_masked4.S 3dnow_xform_raw1.S \
@@ -56,28 +70,13 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
vertex_3dnow.o
3DNOW_DEFS = -DUSE_3DNOW_ASM
-#endif
-#if HAVE_MMX_
- MMX_SRCS = mmx_blend.S
-
- MMX_OBJS = mmx_blend.o
-
- MMX_DEFS = -DUSE_MMX_ASM
#endif
- X86_SRCS = x86a.S common_x86.c common_x86asm.S x86.c vertex.S \
- $(MMX_SRCS) $(3DNOW_SRCS)
-
- X86_OBJS = x86a.o common_x86.o common_x86asm.o x86.o vertex.o \
- $(MMX_OBJS) $(3DNOW_OBJS)
-
- X86_DEFS = -DUSE_X86_ASM $(MXX_DEFS) $(3DNOW_DEFS)
-
- DEFINES = $(ALLOC_DEFINES) GlxDefines -DFX $(X86_DEFS) $(3DNOW_DEFS) $(MMX_DEFS)
+ DEFINES = $(ALLOC_DEFINES) GlxDefines -DFX $(X86_DEFS) $(MMX_DEFS) $(3DNOW_DEFS)
INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) -I../include -I../../dri -I..
- SRCS = $(X86_SRCS) $(3DNOW_SRCS) $(MMX_SRCS)
- OBJS = $(X86_OBJS) $(3DNOW_OBJS) $(MMX_OBJS)
+ SRCS = $(X86_SRCS) $(MMX_SRCS) $(3DNOW_SRCS)
+ OBJS = $(X86_OBJS) $(MMX_OBJS) $(3DNOW_OBJS)
#if !GlxUseBuiltInDRIDriver
#undef DoNormalLib NormalLibGlx
diff --git a/xc/lib/GL/mesa/src/drv/gamma/Imakefile b/xc/lib/GL/mesa/src/drv/gamma/Imakefile
index 68313f826..52290c325 100644
--- a/xc/lib/GL/mesa/src/drv/gamma/Imakefile
+++ b/xc/lib/GL/mesa/src/drv/gamma/Imakefile
@@ -14,6 +14,7 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
#if BuildXF86DRI
DRI_DEFINES = GlxDefines
DRI_INCLUDES = -I../../../../dri -I../../../../glx \
+ -I../../../dri \
-I$(TOP)/include -I$(TOP)/include/GL \
-I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri \
-I$(XF86DRIVERSRC)/glint \
@@ -24,11 +25,33 @@ MESA_INCLUDES = -I. -I.. -I../../include
DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES)
INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) $(MESA_INCLUDES) $(DRI_INCLUDES)
- SRCS = gamma_gl.c gamma_xmesa.c gamma_init.c gamma_matrix.c \
+
+ DRISRCS = ../../../dri/dri_mesa.c \
+ ../../../../dri/dri_tmm.c
+
+ DRIOBJS = ../../../dri/dri_mesa.o \
+ ../../../../dri/dri_tmm.o
+
+ DRMSRCS = ../../../../dri/drm/xf86drm.c \
+ ../../../../dri/drm/xf86drmHash.c \
+ ../../../../dri/drm/xf86drmRandom.c \
+ ../../../../dri/drm/xf86drmSL.c
+
+ DRMOBJS = ../../../../dri/drm/xf86drm.o \
+ ../../../../dri/drm/xf86drmHash.o \
+ ../../../../dri/drm/xf86drmRandom.o \
+ ../../../../dri/drm/xf86drmSL.o
+
+ GAMMASRCS = gamma_gl.c gamma_xmesa.c gamma_init.c gamma_matrix.c \
gamma_inithw.c gamma_texture.c
- OBJS = gamma_gl.o gamma_xmesa.o gamma_init.o gamma_matrix.o \
+
+ GAMMAOBJS = gamma_gl.o gamma_xmesa.o gamma_init.o gamma_matrix.o \
gamma_inithw.o gamma_texture.o
+ SRCS = $(DRISRCS) $(DRMSRCS) $(GAMMASRCS)
+ OBJS = $(DRIOBJS) $(DRMOBJS) $(GAMMAOBJS)
+
+
#if !GlxUseBuiltInDRIDriver
#undef DoNormalLib NormalLibGlx
#undef DoExtraLib SharedLibGlx
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/Imakefile b/xc/lib/GL/mesa/src/drv/tdfx/Imakefile
index dc940bab3..6023bf615 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/Imakefile
+++ b/xc/lib/GL/mesa/src/drv/tdfx/Imakefile
@@ -1,4 +1,3 @@
-XCOMM $PI:$
#define DoNormalLib NormalLibGlx
#define DoSharedLib SharedLibGlx
@@ -13,6 +12,7 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
#if BuildXF86DRI
DRI_DEFINES = GlxDefines -DFX -DFX_GLIDE3 -DGLIDE3 -DDRIVERTS
DRI_INCLUDES = -I../../../../dri -I../../../../glx \
+ -I../../../dri \
-I$(TOP)/include -I$(TOP)/include/GL \
-I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri \
-I$(XF86DRIVERSRC)/tdfx \
@@ -50,17 +50,224 @@ LinkSourceFile(fxvs_tmp.h, ../../../../../../extras/Mesa/src/FX)
DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES)
INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) $(MESA_INCLUDES) $(DRI_INCLUDES) \
-I/usr/include/glide
- DRISRCS = tdfx_xmesa.c tdfx_init.c tdfx_inithw.c
- DRIOBJS = tdfx_xmesa.o tdfx_init.o tdfx_inithw.o
- MESASRCS = fxclip.c fxcva.c fxdd.c fxddspan.c fxddtex.c fxfastpath.c \
+
+ DRISRCS = ../../../dri/dri_mesa.c \
+ ../../../../dri/dri_tmm.c
+
+ DRIOBJS = ../../../dri/dri_mesa.o \
+ ../../../../dri/dri_tmm.o
+
+ DRMSRCS = ../../../../dri/drm/xf86drm.c \
+ ../../../../dri/drm/xf86drmHash.c \
+ ../../../../dri/drm/xf86drmRandom.c \
+ ../../../../dri/drm/xf86drmSL.c
+
+ DRMOBJS = ../../../../dri/drm/xf86drm.o \
+ ../../../../dri/drm/xf86drmHash.o \
+ ../../../../dri/drm/xf86drmRandom.o \
+ ../../../../dri/drm/xf86drmSL.o
+
+ TDFXSRCS = tdfx_xmesa.c tdfx_init.c tdfx_inithw.c \
+ fxclip.c fxcva.c fxdd.c fxddspan.c fxddtex.c fxfastpath.c \
fxglidew.c fxpipeline.c fxrender.c fxsanity.c fxsetup.c \
fxtexman.c fxtrifuncs.c fxvsetup.c
- MESAOBJS = fxclip.o fxcva.o fxdd.o fxddspan.o fxddtex.o fxfastpath.o \
+
+ TDFXOBJS = tdfx_xmesa.o tdfx_init.o tdfx_inithw.o \
+ fxclip.o fxcva.o fxdd.o fxddspan.o fxddtex.o fxfastpath.o \
fxglidew.o fxpipeline.o fxrender.o fxsanity.o fxsetup.o \
fxtexman.o fxtrifuncs.o fxvsetup.o
- SRCS = $(DRISRCS) $(MESASRCS)
- OBJS = $(DRIOBJS) $(MESAOBJS)
+ MESASRCS = ../../accum.c \
+ ../../alpha.c \
+ ../../alphabuf.c \
+ ../../attrib.c \
+ ../../bbox.c \
+ ../../bitmap.c \
+ ../../blend.c \
+ ../../clip.c \
+ ../../colortab.c \
+ ../../config.c \
+ ../../context.c \
+ ../../copypix.c \
+ ../../cva.c \
+ ../../debug_xform.c \
+ ../../depth.c \
+ ../../dispatch.c \
+ ../../dlist.c \
+ ../../drawpix.c \
+ ../../enable.c \
+ ../../enums.c \
+ ../../eval.c \
+ ../../extensions.c \
+ ../../feedback.c \
+ ../../fog.c \
+ ../../get.c \
+ ../../glapi.c \
+ ../../glapinoop.c \
+ ../../glmisc.c \
+ ../../glthread.c \
+ ../../hash.c \
+ ../../image.c \
+ ../../imaging.o \
+ ../../light.c \
+ ../../lines.c \
+ ../../logic.c \
+ ../../masking.c \
+ ../../matrix.c \
+ ../../mem.c \
+ ../../mmath.c \
+ ../../pb.c \
+ ../../pipeline.c \
+ ../../pixel.c \
+ ../../points.c \
+ ../../polygon.c \
+ ../../quads.c \
+ ../../rastpos.c \
+ ../../readpix.c \
+ ../../rect.c \
+ ../../scissor.c \
+ ../../shade.c \
+ ../../span.c \
+ ../../stages.c \
+ ../../stencil.c \
+ ../../teximage.c \
+ ../../texobj.c \
+ ../../texstate.c \
+ ../../texture.c \
+ ../../translate.c \
+ ../../triangle.c \
+ ../../varray.c \
+ ../../vb.c \
+ ../../vbcull.c \
+ ../../vbfill.c \
+ ../../vbindirect.c \
+ ../../vbrender.c \
+ ../../vbxform.c \
+ ../../vector.c \
+ ../../vertices.c \
+ ../../winpos.c \
+ ../../xform.c \
+ ../../zoom.c \
+ ../../X86/common_x86.c
+
+ MESAOBJS = ../../accum.o \
+ ../../alpha.o \
+ ../../alphabuf.o \
+ ../../attrib.o \
+ ../../bbox.o \
+ ../../bitmap.o \
+ ../../blend.o \
+ ../../clip.o \
+ ../../colortab.o \
+ ../../config.o \
+ ../../context.o \
+ ../../copypix.o \
+ ../../cva.o \
+ ../../debug_xform.o \
+ ../../depth.o \
+ ../../dispatch.o \
+ ../../dlist.o \
+ ../../drawpix.o \
+ ../../enable.o \
+ ../../enums.o \
+ ../../eval.o \
+ ../../extensions.o \
+ ../../feedback.o \
+ ../../fog.o \
+ ../../get.o \
+ ../../glmisc.o \
+ ../../hash.o \
+ ../../image.o \
+ ../../imaging.o \
+ ../../light.o \
+ ../../lines.o \
+ ../../logic.o \
+ ../../masking.o \
+ ../../matrix.o \
+ ../../mem.o \
+ ../../mmath.o \
+ ../../pb.o \
+ ../../pipeline.o \
+ ../../pixel.o \
+ ../../points.o \
+ ../../polygon.o \
+ ../../quads.o \
+ ../../rastpos.o \
+ ../../readpix.o \
+ ../../rect.o \
+ ../../scissor.o \
+ ../../shade.o \
+ ../../span.o \
+ ../../stages.o \
+ ../../stencil.o \
+ ../../teximage.o \
+ ../../texobj.o \
+ ../../texstate.o \
+ ../../texture.o \
+ ../../translate.o \
+ ../../triangle.o \
+ ../../varray.o \
+ ../../vb.o \
+ ../../vbcull.o \
+ ../../vbfill.o \
+ ../../vbindirect.o \
+ ../../vbrender.o \
+ ../../vbxform.o \
+ ../../vector.o \
+ ../../vertices.o \
+ ../../winpos.o \
+ ../../xform.o \
+ ../../zoom.o
+
+#ifdef i386Architecture
+ X86_SRCS = ../../X86/x86.c \
+ ../../X86/x86a.S \
+ ../../X86/common_x86.c \
+ ../../X86/common_x86asm.S \
+ ../../X86/vertex.S
+
+ X86_OBJS = ../../X86/x86.o \
+ ../../X86/x86a.o \
+ ../../X86/common_x86.o \
+ ../../X86/common_x86asm.o \
+ ../../X86/vertex.o
+
+ MMX_SRCS = ../../X86/mmx_blend.S
+
+ MMX_OBJS = ../../X86/mmx_blend.o
+
+ 3DNOW_SRCS = ../../X86/3dnow.c \
+ ../../X86/3dnow_norm_raw.S \
+ ../../X86/3dnow_xform_masked1.S \
+ ../../X86/3dnow_xform_masked2.S \
+ ../../X86/3dnow_xform_masked3.S \
+ ../../X86/3dnow_xform_masked4.S \
+ ../../X86/3dnow_xform_raw1.S \
+ ../../X86/3dnow_xform_raw2.S \
+ ../../X86/3dnow_xform_raw3.S \
+ ../../X86/3dnow_xform_raw4.S \
+ ../../X86/vertex_3dnow.S
+
+ 3DNOW_OBJS = ../../X86/3dnow.o \
+ ../../X86/3dnow_norm_raw.o \
+ ../../X86/3dnow_xform_masked1.o \
+ ../../X86/3dnow_xform_masked2.o \
+ ../../X86/3dnow_xform_masked3.o \
+ ../../X86/3dnow_xform_masked4.o \
+ ../../X86/3dnow_xform_raw1.o \
+ ../../X86/3dnow_xform_raw2.o \
+ ../../X86/3dnow_xform_raw3.o \
+ ../../X86/3dnow_xform_raw4.o \
+ ../../X86/vertex_3dnow.o
+#endif
+
+ ASMSRCS = $(X86_SRCS) $(MMX_SRCS) $(3DNOW_SRCS)
+ ASMOBJS = $(X86_OBJS) $(MMX_OBJS) $(3DNOW_OBJS)
+
+ SRCS = $(DRISRCS) $(DRMSRCS) $(TDFXSRCS) $(MESASRCS) $(ASMSRCS)
+ OBJS = $(DRIOBJS) $(DRMOBJS) $(TDFXOBJS) $(MESAOBJS) $(ASMOBJS)
+
+REQUIREDLIBS += -lglide3x
#if !GlxUseBuiltInDRIDriver
#undef DoNormalLib NormalLibGlx
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_xmesa.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_xmesa.c
index b57d97a58..95e811d44 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_xmesa.c
@@ -172,7 +172,13 @@ XMesaContext XMesaCreateContext(XMesaVisual v, XMesaContext share_list,
c->private = (void *)cPriv;
cPriv->glVis=v->gl_visual;
- cPriv->glBuffer=gl_create_framebuffer(v->gl_visual);
+ cPriv->glBuffer=gl_create_framebuffer(v->gl_visual,
+ GL_FALSE, /* software depth buffer? */
+ v->gl_visual->StencilBits > 0,
+ v->gl_visual->AccumBits > 0,
+ v->gl_visual->AlphaBits > 0
+ );
+
cPriv->screen_width=sPriv->width;
cPriv->screen_height=sPriv->height;
diff --git a/xc/lib/GL/mesa/src/mesa_api.h b/xc/lib/GL/mesa/src/mesa_api.h
deleted file mode 100644
index 78574a1a7..000000000
--- a/xc/lib/GL/mesa/src/mesa_api.h
+++ /dev/null
@@ -1,384 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/mesa_api.h,v 1.2 1999/06/27 14:07:26 dawes Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, 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 PRECISION INSIGHT 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.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <kevin@precisioninsight.com>
- *
- * $PI: xc/lib/GL/mesa/src/mesa_api.h,v 1.3 1999/06/14 21:10:40 faith Exp $
- */
-
-#ifndef _MESA_API_H_
-#define _MESA_API_H_
-
-#ifdef GLX_DIRECT_RENDERING
-
-#include <GL/gl.h>
-#include "mesa_api_wrap.h"
-
-/* NOTE: This file could be automatically generated */
-
-void __glAccum(GLenum op, GLfloat value);
-void __glAlphaFunc(GLenum func, GLclampf ref);
-GLboolean __glAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences);
-void __glArrayElement(GLint i);
-void __glBegin(GLenum mode);
-void __glBindTexture(GLenum target, GLuint texture);
-void __glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
-void __glBlendFunc(GLenum sfactor, GLenum dfactor);
-void __glCallList(GLuint list);
-void __glCallLists(GLsizei n, GLenum type, const GLvoid *lists);
-void __glClear(GLbitfield mask);
-void __glClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-void __glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-void __glClearDepth(GLclampd depth);
-void __glClearIndex(GLfloat c);
-void __glClearStencil(GLint s);
-void __glClipPlane(GLenum plane, const GLdouble *equation);
-void __glColor3b(GLbyte red, GLbyte green, GLbyte blue);
-void __glColor3bv(const GLbyte *v);
-void __glColor3d(GLdouble red, GLdouble green, GLdouble blue);
-void __glColor3dv(const GLdouble *v);
-void __glColor3f(GLfloat red, GLfloat green, GLfloat blue);
-void __glColor3fv(const GLfloat *v);
-void __glColor3i(GLint red, GLint green, GLint blue);
-void __glColor3iv(const GLint *v);
-void __glColor3s(GLshort red, GLshort green, GLshort blue);
-void __glColor3sv(const GLshort *v);
-void __glColor3ub(GLubyte red, GLubyte green, GLubyte blue);
-void __glColor3ubv(const GLubyte *v);
-void __glColor3ui(GLuint red, GLuint green, GLuint blue);
-void __glColor3uiv(const GLuint *v);
-void __glColor3us(GLushort red, GLushort green, GLushort blue);
-void __glColor3usv(const GLushort *v);
-void __glColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
-void __glColor4bv(const GLbyte *v);
-void __glColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
-void __glColor4dv(const GLdouble *v);
-void __glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-void __glColor4fv(const GLfloat *v);
-void __glColor4i(GLint red, GLint green, GLint blue, GLint alpha);
-void __glColor4iv(const GLint *v);
-void __glColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha);
-void __glColor4sv(const GLshort *v);
-void __glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
-void __glColor4ubv(const GLubyte *v);
-void __glColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha);
-void __glColor4uiv(const GLuint *v);
-void __glColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha);
-void __glColor4usv(const GLushort *v);
-void __glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-void __glColorMaterial(GLenum face, GLenum mode);
-void __glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-void __glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
-void __glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-void __glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-void __glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-void __glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-void __glCullFace(GLenum mode);
-void __glDeleteLists(GLuint list, GLsizei range);
-void __glDeleteTextures(GLsizei n, const GLuint *textures);
-void __glDepthFunc(GLenum func);
-void __glDepthMask(GLboolean flag);
-void __glDepthRange(GLclampd zNear, GLclampd zFar);
-void __glDisable(GLenum cap);
-void __glDisableClientState(GLenum array);
-void __glDrawArrays(GLenum mode, GLint first, GLsizei count);
-void __glDrawBuffer(GLenum mode);
-void __glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
-void __glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-void __glEdgeFlag(GLboolean flag);
-void __glEdgeFlagPointer(GLsizei stride, const GLvoid *pointer);
-void __glEdgeFlagv(const GLboolean *flag);
-void __glEnable(GLenum cap);
-void __glEnableClientState(GLenum array);
-void __glEnd(void);
-void __glEndList(void);
-void __glEvalCoord1d(GLdouble u);
-void __glEvalCoord1dv(const GLdouble *u);
-void __glEvalCoord1f(GLfloat u);
-void __glEvalCoord1fv(const GLfloat *u);
-void __glEvalCoord2d(GLdouble u, GLdouble v);
-void __glEvalCoord2dv(const GLdouble *u);
-void __glEvalCoord2f(GLfloat u, GLfloat v);
-void __glEvalCoord2fv(const GLfloat *u);
-void __glEvalMesh1(GLenum mode, GLint i1, GLint i2);
-void __glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
-void __glEvalPoint1(GLint i);
-void __glEvalPoint2(GLint i, GLint j);
-void __glFeedbackBuffer(GLsizei size, GLenum type, GLfloat *buffer);
-void __glFinish(void);
-void __glFlush(void);
-void __glFogf(GLenum pname, GLfloat param);
-void __glFogfv(GLenum pname, const GLfloat *params);
-void __glFogi(GLenum pname, GLint param);
-void __glFogiv(GLenum pname, const GLint *params);
-void __glFrontFace(GLenum mode);
-void __glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-GLuint __glGenLists(GLsizei range);
-void __glGenTextures(GLsizei n, GLuint *textures);
-void __glGetBooleanv(GLenum val, GLboolean *b);
-void __glGetClipPlane(GLenum plane, GLdouble *equation);
-void __glGetDoublev(GLenum val, GLdouble *d);
-GLenum __glGetError(void);
-void __glGetFloatv(GLenum val, GLfloat *f);
-void __glGetIntegerv(GLenum val, GLint *i);
-void __glGetLightfv(GLenum light, GLenum pname, GLfloat *params);
-void __glGetLightiv(GLenum light, GLenum pname, GLint *params);
-void __glGetMapdv(GLenum target, GLenum query, GLdouble *v);
-void __glGetMapfv(GLenum target, GLenum query, GLfloat *v);
-void __glGetMapiv(GLenum target, GLenum query, GLint *v);
-void __glGetMaterialfv(GLenum face, GLenum pname, GLfloat *params);
-void __glGetMaterialiv(GLenum face, GLenum pname, GLint *params);
-void __glGetPixelMapfv(GLenum map, GLfloat *values);
-void __glGetPixelMapuiv(GLenum map, GLuint *values);
-void __glGetPixelMapusv(GLenum map, GLushort *values);
-void __glGetPointerv(GLenum pname, void **params);
-void __glGetPolygonStipple(GLubyte *mask);
-const GLubyte *__glGetString(GLenum name);
-void __glGetTexEnvfv(GLenum target, GLenum pname, GLfloat *params);
-void __glGetTexEnviv(GLenum target, GLenum pname, GLint *params);
-void __glGetTexGendv(GLenum coord, GLenum pname, GLdouble *params);
-void __glGetTexGenfv(GLenum coord, GLenum pname, GLfloat *params);
-void __glGetTexGeniv(GLenum coord, GLenum pname, GLint *params);
-void __glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *texels);
-void __glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params);
-void __glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params);
-void __glGetTexParameterfv(GLenum target, GLenum pname, GLfloat *params);
-void __glGetTexParameteriv(GLenum target, GLenum pname, GLint *params);
-void __glHint(GLenum target, GLenum mode);
-void __glIndexMask(GLuint mask);
-void __glIndexPointer(GLenum type, GLsizei stride, const GLvoid *pointer);
-void __glIndexd(GLdouble c);
-void __glIndexdv(const GLdouble *c);
-void __glIndexf(GLfloat c);
-void __glIndexfv(const GLfloat *c);
-void __glIndexi(GLint c);
-void __glIndexiv(const GLint *c);
-void __glIndexs(GLshort c);
-void __glIndexsv(const GLshort *c);
-void __glIndexub(GLubyte c);
-void __glIndexubv(const GLubyte *c);
-void __glInitNames(void);
-void __glInterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer);
-GLboolean __glIsEnabled(GLenum cap);
-GLboolean __glIsList(GLuint list);
-GLboolean __glIsTexture(GLuint texture);
-void __glLightModelf(GLenum pname, GLfloat param);
-void __glLightModelfv(GLenum pname, const GLfloat *params);
-void __glLightModeli(GLenum pname, GLint param);
-void __glLightModeliv(GLenum pname, const GLint *params);
-void __glLightf(GLenum light, GLenum pname, GLfloat param);
-void __glLightfv(GLenum light, GLenum pname, const GLfloat *params);
-void __glLighti(GLenum light, GLenum pname, GLint param);
-void __glLightiv(GLenum light, GLenum pname, const GLint *params);
-void __glLineStipple(GLint factor, GLushort pattern);
-void __glLineWidth(GLfloat width);
-void __glListBase(GLuint base);
-void __glLoadIdentity(void);
-void __glLoadMatrixd(const GLdouble *m);
-void __glLoadMatrixf(const GLfloat *m);
-void __glLoadName(GLuint name);
-void __glLogicOp(GLenum opcode);
-void __glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *pnts);
-void __glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *pnts);
-void __glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustr, GLint uord, GLdouble v1, GLdouble v2, GLint vstr, GLint vord, const GLdouble *pnts);
-void __glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustr, GLint uord, GLfloat v1, GLfloat v2, GLint vstr, GLint vord, const GLfloat *pnts);
-void __glMapGrid1d(GLint un, GLdouble u1, GLdouble u2);
-void __glMapGrid1f(GLint un, GLfloat u1, GLfloat u2);
-void __glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
-void __glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
-void __glMaterialf(GLenum face, GLenum pname, GLfloat param);
-void __glMaterialfv(GLenum face, GLenum pname, const GLfloat *params);
-void __glMateriali(GLenum face, GLenum pname, GLint param);
-void __glMaterialiv(GLenum face, GLenum pname, const GLint *params);
-void __glMatrixMode(GLenum mode);
-void __glMultMatrixd(const GLdouble *m);
-void __glMultMatrixf(const GLfloat *m);
-void __glNewList(GLuint list, GLenum mode);
-void __glNormal3b(GLbyte nx, GLbyte ny, GLbyte nz);
-void __glNormal3bv(const GLbyte *v);
-void __glNormal3d(GLdouble nx, GLdouble ny, GLdouble nz);
-void __glNormal3dv(const GLdouble *v);
-void __glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
-void __glNormal3fv(const GLfloat *v);
-void __glNormal3i(GLint nx, GLint ny, GLint nz);
-void __glNormal3iv(const GLint *v);
-void __glNormal3s(GLshort nx, GLshort ny, GLshort nz);
-void __glNormal3sv(const GLshort *v);
-void __glNormalPointer(GLenum type, GLsizei stride, const GLvoid *pointer);
-void __glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-void __glPassThrough(GLfloat token);
-void __glPixelMapfv(GLenum map, GLint mapsize, const GLfloat *values);
-void __glPixelMapuiv(GLenum map, GLint mapsize, const GLuint *values);
-void __glPixelMapusv(GLenum map, GLint mapsize, const GLushort *values);
-void __glPixelStoref(GLenum pname, GLfloat param);
-void __glPixelStorei(GLenum pname, GLint param);
-void __glPixelTransferf(GLenum pname, GLfloat param);
-void __glPixelTransferi(GLenum pname, GLint param);
-void __glPixelZoom(GLfloat xfactor, GLfloat yfactor);
-void __glPointSize(GLfloat size);
-void __glPolygonMode(GLenum face, GLenum mode);
-void __glPolygonOffset(GLfloat factor, GLfloat units);
-void __glPolygonStipple(const GLubyte *mask);
-void __glPopAttrib(void);
-void __glPopClientAttrib(void);
-void __glPopMatrix(void);
-void __glPopName(void);
-void __glPrioritizeTextures(GLsizei n, const GLuint *textures, const GLclampf *priorities);
-void __glPushAttrib(GLbitfield mask);
-void __glPushClientAttrib(GLuint mask);
-void __glPushMatrix(void);
-void __glPushName(GLuint name);
-void __glRasterPos2d(GLdouble x, GLdouble y);
-void __glRasterPos2dv(const GLdouble *v);
-void __glRasterPos2f(GLfloat x, GLfloat y);
-void __glRasterPos2fv(const GLfloat *v);
-void __glRasterPos2i(GLint x, GLint y);
-void __glRasterPos2iv(const GLint *v);
-void __glRasterPos2s(GLshort x, GLshort y);
-void __glRasterPos2sv(const GLshort *v);
-void __glRasterPos3d(GLdouble x, GLdouble y, GLdouble z);
-void __glRasterPos3dv(const GLdouble *v);
-void __glRasterPos3f(GLfloat x, GLfloat y, GLfloat z);
-void __glRasterPos3fv(const GLfloat *v);
-void __glRasterPos3i(GLint x, GLint y, GLint z);
-void __glRasterPos3iv(const GLint *v);
-void __glRasterPos3s(GLshort x, GLshort y, GLshort z);
-void __glRasterPos3sv(const GLshort *v);
-void __glRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-void __glRasterPos4dv(const GLdouble *v);
-void __glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-void __glRasterPos4fv(const GLfloat *v);
-void __glRasterPos4i(GLint x, GLint y, GLint z, GLint w);
-void __glRasterPos4iv(const GLint *v);
-void __glRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w);
-void __glRasterPos4sv(const GLshort *v);
-void __glReadBuffer(GLenum mode);
-void __glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
-void __glRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
-void __glRectdv(const GLdouble *v1, const GLdouble *v2);
-void __glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
-void __glRectfv(const GLfloat *v1, const GLfloat *v2);
-void __glRecti(GLint x1, GLint y1, GLint x2, GLint y2);
-void __glRectiv(const GLint *v1, const GLint *v2);
-void __glRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
-void __glRectsv(const GLshort *v1, const GLshort *v2);
-GLint __glRenderMode(GLenum mode);
-void __glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-void __glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-void __glScaled(GLdouble x, GLdouble y, GLdouble z);
-void __glScalef(GLfloat x, GLfloat y, GLfloat z);
-void __glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
-void __glSelectBuffer(GLsizei numnames, GLuint *buffer);
-void __glShadeModel(GLenum mode);
-void __glStencilFunc(GLenum func, GLint ref, GLuint mask);
-void __glStencilMask(GLuint mask);
-void __glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
-void __glTexCoord1d(GLdouble s);
-void __glTexCoord1dv(const GLdouble *v);
-void __glTexCoord1f(GLfloat s);
-void __glTexCoord1fv(const GLfloat *v);
-void __glTexCoord1i(GLint s);
-void __glTexCoord1iv(const GLint *v);
-void __glTexCoord1s(GLshort s);
-void __glTexCoord1sv(const GLshort *v);
-void __glTexCoord2d(GLdouble s, GLdouble t);
-void __glTexCoord2dv(const GLdouble *v);
-void __glTexCoord2f(GLfloat s, GLfloat t);
-void __glTexCoord2fv(const GLfloat *v);
-void __glTexCoord2i(GLint s, GLint t);
-void __glTexCoord2iv(const GLint *v);
-void __glTexCoord2s(GLshort s, GLshort t);
-void __glTexCoord2sv(const GLshort *v);
-void __glTexCoord3d(GLdouble s, GLdouble t, GLdouble r);
-void __glTexCoord3dv(const GLdouble *v);
-void __glTexCoord3f(GLfloat s, GLfloat t, GLfloat r);
-void __glTexCoord3fv(const GLfloat *v);
-void __glTexCoord3i(GLint s, GLint t, GLint r);
-void __glTexCoord3iv(const GLint *v);
-void __glTexCoord3s(GLshort s, GLshort t, GLshort r);
-void __glTexCoord3sv(const GLshort *v);
-void __glTexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-void __glTexCoord4dv(const GLdouble *v);
-void __glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-void __glTexCoord4fv(const GLfloat *v);
-void __glTexCoord4i(GLint s, GLint t, GLint r, GLint q);
-void __glTexCoord4iv(const GLint *v);
-void __glTexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q);
-void __glTexCoord4sv(const GLshort *v);
-void __glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-void __glTexEnvf(GLenum target, GLenum pname, GLfloat param);
-void __glTexEnvfv(GLenum target, GLenum pname, const GLfloat *params);
-void __glTexEnvi(GLenum target, GLenum pname, GLint param);
-void __glTexEnviv(GLenum target, GLenum pname, const GLint *params);
-void __glTexGend(GLenum coord, GLenum pname, GLdouble param);
-void __glTexGendv(GLenum coord, GLenum pname, const GLdouble *params);
-void __glTexGenf(GLenum coord, GLenum pname, GLfloat param);
-void __glTexGenfv(GLenum coord, GLenum pname, const GLfloat *params);
-void __glTexGeni(GLenum coord, GLenum pname, GLint param);
-void __glTexGeniv(GLenum coord, GLenum pname, const GLint *params);
-void __glTexImage1D(GLenum target, GLint level, GLint components, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *image);
-void __glTexImage2D(GLenum target, GLint level, GLint components, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *image);
-void __glTexParameterf(GLenum target, GLenum pname, GLfloat param);
-void __glTexParameterfv(GLenum target, GLenum pname, const GLfloat *params);
-void __glTexParameteri(GLenum target, GLenum pname, GLint param);
-void __glTexParameteriv(GLenum target, GLenum pname, const GLint *params);
-void __glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-void __glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-void __glTranslated(GLdouble x, GLdouble y, GLdouble z);
-void __glTranslatef(GLfloat x, GLfloat y, GLfloat z);
-void __glVertex2d(GLdouble x, GLdouble y);
-void __glVertex2dv(const GLdouble *v);
-void __glVertex2f(GLfloat x, GLfloat y);
-void __glVertex2fv(const GLfloat *v);
-void __glVertex2i(GLint x, GLint y);
-void __glVertex2iv(const GLint *v);
-void __glVertex2s(GLshort x, GLshort y);
-void __glVertex2sv(const GLshort *v);
-void __glVertex3d(GLdouble x, GLdouble y, GLdouble z);
-void __glVertex3dv(const GLdouble *v);
-void __glVertex3f(GLfloat x, GLfloat y, GLfloat z);
-void __glVertex3fv(const GLfloat *v);
-void __glVertex3i(GLint x, GLint y, GLint z);
-void __glVertex3iv(const GLint *v);
-void __glVertex3s(GLshort x, GLshort y, GLshort z);
-void __glVertex3sv(const GLshort *v);
-void __glVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-void __glVertex4dv(const GLdouble *v);
-void __glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-void __glVertex4fv(const GLfloat *v);
-void __glVertex4i(GLint x, GLint y, GLint z, GLint w);
-void __glVertex4iv(const GLint *v);
-void __glVertex4s(GLshort x, GLshort y, GLshort z, GLshort w);
-void __glVertex4sv(const GLshort *v);
-void __glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-void __glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-
-#endif /* _MESA_API_H_ */
diff --git a/xc/lib/GL/mesa/src/mesa_api_wrap.h b/xc/lib/GL/mesa/src/mesa_api_wrap.h
deleted file mode 100644
index 024b859b6..000000000
--- a/xc/lib/GL/mesa/src/mesa_api_wrap.h
+++ /dev/null
@@ -1,381 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/mesa_api_wrap.h,v 1.2 1999/06/27 14:07:26 dawes Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, 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 PRECISION INSIGHT 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.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <kevin@precisioninsight.com>
- *
- * $PI: xc/lib/GL/mesa/src/mesa_api_wrap.h,v 1.3 1999/06/14 21:10:40 faith Exp $
- */
-
-#ifndef _MESA_API_WRAP_H_
-#define _MESA_API_WRAP_H_
-
-#if defined(GLX_DIRECT_RENDERING) && defined(NEED_MESA_FUNCS_WRAPPED)
-
-/* NOTE: This file could be automatically generated */
-
-#define glAccum __glAccum
-#define glAlphaFunc __glAlphaFunc
-#define glAreTexturesResident __glAreTexturesResident
-#define glArrayElement __glArrayElement
-#define glBegin __glBegin
-#define glBindTexture __glBindTexture
-#define glBitmap __glBitmap
-#define glBlendFunc __glBlendFunc
-#define glCallList __glCallList
-#define glCallLists __glCallLists
-#define glClear __glClear
-#define glClearAccum __glClearAccum
-#define glClearColor __glClearColor
-#define glClearDepth __glClearDepth
-#define glClearIndex __glClearIndex
-#define glClearStencil __glClearStencil
-#define glClipPlane __glClipPlane
-#define glColor3b __glColor3b
-#define glColor3bv __glColor3bv
-#define glColor3d __glColor3d
-#define glColor3dv __glColor3dv
-#define glColor3f __glColor3f
-#define glColor3fv __glColor3fv
-#define glColor3i __glColor3i
-#define glColor3iv __glColor3iv
-#define glColor3s __glColor3s
-#define glColor3sv __glColor3sv
-#define glColor3ub __glColor3ub
-#define glColor3ubv __glColor3ubv
-#define glColor3ui __glColor3ui
-#define glColor3uiv __glColor3uiv
-#define glColor3us __glColor3us
-#define glColor3usv __glColor3usv
-#define glColor4b __glColor4b
-#define glColor4bv __glColor4bv
-#define glColor4d __glColor4d
-#define glColor4dv __glColor4dv
-#define glColor4f __glColor4f
-#define glColor4fv __glColor4fv
-#define glColor4i __glColor4i
-#define glColor4iv __glColor4iv
-#define glColor4s __glColor4s
-#define glColor4sv __glColor4sv
-#define glColor4ub __glColor4ub
-#define glColor4ubv __glColor4ubv
-#define glColor4ui __glColor4ui
-#define glColor4uiv __glColor4uiv
-#define glColor4us __glColor4us
-#define glColor4usv __glColor4usv
-#define glColorMask __glColorMask
-#define glColorMaterial __glColorMaterial
-#define glColorPointer __glColorPointer
-#define glCopyPixels __glCopyPixels
-#define glCopyTexImage1D __glCopyTexImage1D
-#define glCopyTexImage2D __glCopyTexImage2D
-#define glCopyTexSubImage1D __glCopyTexSubImage1D
-#define glCopyTexSubImage2D __glCopyTexSubImage2D
-#define glCullFace __glCullFace
-#define glDeleteLists __glDeleteLists
-#define glDeleteTextures __glDeleteTextures
-#define glDepthFunc __glDepthFunc
-#define glDepthMask __glDepthMask
-#define glDepthRange __glDepthRange
-#define glDisable __glDisable
-#define glDisableClientState __glDisableClientState
-#define glDrawArrays __glDrawArrays
-#define glDrawBuffer __glDrawBuffer
-#define glDrawElements __glDrawElements
-#define glDrawPixels __glDrawPixels
-#define glEdgeFlag __glEdgeFlag
-#define glEdgeFlagPointer __glEdgeFlagPointer
-#define glEdgeFlagv __glEdgeFlagv
-#define glEnable __glEnable
-#define glEnableClientState __glEnableClientState
-#define glEnd __glEnd
-#define glEndList __glEndList
-#define glEvalCoord1d __glEvalCoord1d
-#define glEvalCoord1dv __glEvalCoord1dv
-#define glEvalCoord1f __glEvalCoord1f
-#define glEvalCoord1fv __glEvalCoord1fv
-#define glEvalCoord2d __glEvalCoord2d
-#define glEvalCoord2dv __glEvalCoord2dv
-#define glEvalCoord2f __glEvalCoord2f
-#define glEvalCoord2fv __glEvalCoord2fv
-#define glEvalMesh1 __glEvalMesh1
-#define glEvalMesh2 __glEvalMesh2
-#define glEvalPoint1 __glEvalPoint1
-#define glEvalPoint2 __glEvalPoint2
-#define glFeedbackBuffer __glFeedbackBuffer
-#define glFinish __glFinish
-#define glFlush __glFlush
-#define glFogf __glFogf
-#define glFogfv __glFogfv
-#define glFogi __glFogi
-#define glFogiv __glFogiv
-#define glFrontFace __glFrontFace
-#define glFrustum __glFrustum
-#define glGenLists __glGenLists
-#define glGenTextures __glGenTextures
-#define glGetBooleanv __glGetBooleanv
-#define glGetClipPlane __glGetClipPlane
-#define glGetDoublev __glGetDoublev
-#define glGetError __glGetError
-#define glGetFloatv __glGetFloatv
-#define glGetIntegerv __glGetIntegerv
-#define glGetLightfv __glGetLightfv
-#define glGetLightiv __glGetLightiv
-#define glGetMapdv __glGetMapdv
-#define glGetMapfv __glGetMapfv
-#define glGetMapiv __glGetMapiv
-#define glGetMaterialfv __glGetMaterialfv
-#define glGetMaterialiv __glGetMaterialiv
-#define glGetPixelMapfv __glGetPixelMapfv
-#define glGetPixelMapuiv __glGetPixelMapuiv
-#define glGetPixelMapusv __glGetPixelMapusv
-#define glGetPointerv __glGetPointerv
-#define glGetPolygonStipple __glGetPolygonStipple
-#define glGetString __glGetString
-#define glGetTexEnvfv __glGetTexEnvfv
-#define glGetTexEnviv __glGetTexEnviv
-#define glGetTexGendv __glGetTexGendv
-#define glGetTexGenfv __glGetTexGenfv
-#define glGetTexGeniv __glGetTexGeniv
-#define glGetTexImage __glGetTexImage
-#define glGetTexLevelParameterfv __glGetTexLevelParameterfv
-#define glGetTexLevelParameteriv __glGetTexLevelParameteriv
-#define glGetTexParameterfv __glGetTexParameterfv
-#define glGetTexParameteriv __glGetTexParameteriv
-#define glHint __glHint
-#define glIndexMask __glIndexMask
-#define glIndexPointer __glIndexPointer
-#define glIndexd __glIndexd
-#define glIndexdv __glIndexdv
-#define glIndexf __glIndexf
-#define glIndexfv __glIndexfv
-#define glIndexi __glIndexi
-#define glIndexiv __glIndexiv
-#define glIndexs __glIndexs
-#define glIndexsv __glIndexsv
-#define glIndexub __glIndexub
-#define glIndexubv __glIndexubv
-#define glInitNames __glInitNames
-#define glInterleavedArrays __glInterleavedArrays
-#define glIsEnabled __glIsEnabled
-#define glIsList __glIsList
-#define glIsTexture __glIsTexture
-#define glLightModelf __glLightModelf
-#define glLightModelfv __glLightModelfv
-#define glLightModeli __glLightModeli
-#define glLightModeliv __glLightModeliv
-#define glLightf __glLightf
-#define glLightfv __glLightfv
-#define glLighti __glLighti
-#define glLightiv __glLightiv
-#define glLineStipple __glLineStipple
-#define glLineWidth __glLineWidth
-#define glListBase __glListBase
-#define glLoadIdentity __glLoadIdentity
-#define glLoadMatrixd __glLoadMatrixd
-#define glLoadMatrixf __glLoadMatrixf
-#define glLoadName __glLoadName
-#define glLogicOp __glLogicOp
-#define glMap1d __glMap1d
-#define glMap1f __glMap1f
-#define glMap2d __glMap2d
-#define glMap2f __glMap2f
-#define glMapGrid1d __glMapGrid1d
-#define glMapGrid1f __glMapGrid1f
-#define glMapGrid2d __glMapGrid2d
-#define glMapGrid2f __glMapGrid2f
-#define glMaterialf __glMaterialf
-#define glMaterialfv __glMaterialfv
-#define glMateriali __glMateriali
-#define glMaterialiv __glMaterialiv
-#define glMatrixMode __glMatrixMode
-#define glMultMatrixd __glMultMatrixd
-#define glMultMatrixf __glMultMatrixf
-#define glNewList __glNewList
-#define glNormal3b __glNormal3b
-#define glNormal3bv __glNormal3bv
-#define glNormal3d __glNormal3d
-#define glNormal3dv __glNormal3dv
-#define glNormal3f __glNormal3f
-#define glNormal3fv __glNormal3fv
-#define glNormal3i __glNormal3i
-#define glNormal3iv __glNormal3iv
-#define glNormal3s __glNormal3s
-#define glNormal3sv __glNormal3sv
-#define glNormalPointer __glNormalPointer
-#define glOrtho __glOrtho
-#define glPassThrough __glPassThrough
-#define glPixelMapfv __glPixelMapfv
-#define glPixelMapuiv __glPixelMapuiv
-#define glPixelMapusv __glPixelMapusv
-#define glPixelStoref __glPixelStoref
-#define glPixelStorei __glPixelStorei
-#define glPixelTransferf __glPixelTransferf
-#define glPixelTransferi __glPixelTransferi
-#define glPixelZoom __glPixelZoom
-#define glPointSize __glPointSize
-#define glPolygonMode __glPolygonMode
-#define glPolygonOffset __glPolygonOffset
-#define glPolygonStipple __glPolygonStipple
-#define glPopAttrib __glPopAttrib
-#define glPopClientAttrib __glPopClientAttrib
-#define glPopMatrix __glPopMatrix
-#define glPopName __glPopName
-#define glPrioritizeTextures __glPrioritizeTextures
-#define glPushAttrib __glPushAttrib
-#define glPushClientAttrib __glPushClientAttrib
-#define glPushMatrix __glPushMatrix
-#define glPushName __glPushName
-#define glRasterPos2d __glRasterPos2d
-#define glRasterPos2dv __glRasterPos2dv
-#define glRasterPos2f __glRasterPos2f
-#define glRasterPos2fv __glRasterPos2fv
-#define glRasterPos2i __glRasterPos2i
-#define glRasterPos2iv __glRasterPos2iv
-#define glRasterPos2s __glRasterPos2s
-#define glRasterPos2sv __glRasterPos2sv
-#define glRasterPos3d __glRasterPos3d
-#define glRasterPos3dv __glRasterPos3dv
-#define glRasterPos3f __glRasterPos3f
-#define glRasterPos3fv __glRasterPos3fv
-#define glRasterPos3i __glRasterPos3i
-#define glRasterPos3iv __glRasterPos3iv
-#define glRasterPos3s __glRasterPos3s
-#define glRasterPos3sv __glRasterPos3sv
-#define glRasterPos4d __glRasterPos4d
-#define glRasterPos4dv __glRasterPos4dv
-#define glRasterPos4f __glRasterPos4f
-#define glRasterPos4fv __glRasterPos4fv
-#define glRasterPos4i __glRasterPos4i
-#define glRasterPos4iv __glRasterPos4iv
-#define glRasterPos4s __glRasterPos4s
-#define glRasterPos4sv __glRasterPos4sv
-#define glReadBuffer __glReadBuffer
-#define glReadPixels __glReadPixels
-#define glRectd __glRectd
-#define glRectdv __glRectdv
-#define glRectf __glRectf
-#define glRectfv __glRectfv
-#define glRecti __glRecti
-#define glRectiv __glRectiv
-#define glRects __glRects
-#define glRectsv __glRectsv
-#define glRenderMode __glRenderMode
-#define glRotated __glRotated
-#define glRotatef __glRotatef
-#define glScaled __glScaled
-#define glScalef __glScalef
-#define glScissor __glScissor
-#define glSelectBuffer __glSelectBuffer
-#define glShadeModel __glShadeModel
-#define glStencilFunc __glStencilFunc
-#define glStencilMask __glStencilMask
-#define glStencilOp __glStencilOp
-#define glTexCoord1d __glTexCoord1d
-#define glTexCoord1dv __glTexCoord1dv
-#define glTexCoord1f __glTexCoord1f
-#define glTexCoord1fv __glTexCoord1fv
-#define glTexCoord1i __glTexCoord1i
-#define glTexCoord1iv __glTexCoord1iv
-#define glTexCoord1s __glTexCoord1s
-#define glTexCoord1sv __glTexCoord1sv
-#define glTexCoord2d __glTexCoord2d
-#define glTexCoord2dv __glTexCoord2dv
-#define glTexCoord2f __glTexCoord2f
-#define glTexCoord2fv __glTexCoord2fv
-#define glTexCoord2i __glTexCoord2i
-#define glTexCoord2iv __glTexCoord2iv
-#define glTexCoord2s __glTexCoord2s
-#define glTexCoord2sv __glTexCoord2sv
-#define glTexCoord3d __glTexCoord3d
-#define glTexCoord3dv __glTexCoord3dv
-#define glTexCoord3f __glTexCoord3f
-#define glTexCoord3fv __glTexCoord3fv
-#define glTexCoord3i __glTexCoord3i
-#define glTexCoord3iv __glTexCoord3iv
-#define glTexCoord3s __glTexCoord3s
-#define glTexCoord3sv __glTexCoord3sv
-#define glTexCoord4d __glTexCoord4d
-#define glTexCoord4dv __glTexCoord4dv
-#define glTexCoord4f __glTexCoord4f
-#define glTexCoord4fv __glTexCoord4fv
-#define glTexCoord4i __glTexCoord4i
-#define glTexCoord4iv __glTexCoord4iv
-#define glTexCoord4s __glTexCoord4s
-#define glTexCoord4sv __glTexCoord4sv
-#define glTexCoordPointer __glTexCoordPointer
-#define glTexEnvf __glTexEnvf
-#define glTexEnvfv __glTexEnvfv
-#define glTexEnvi __glTexEnvi
-#define glTexEnviv __glTexEnviv
-#define glTexGend __glTexGend
-#define glTexGendv __glTexGendv
-#define glTexGenf __glTexGenf
-#define glTexGenfv __glTexGenfv
-#define glTexGeni __glTexGeni
-#define glTexGeniv __glTexGeniv
-#define glTexImage1D __glTexImage1D
-#define glTexImage2D __glTexImage2D
-#define glTexParameterf __glTexParameterf
-#define glTexParameterfv __glTexParameterfv
-#define glTexParameteri __glTexParameteri
-#define glTexParameteriv __glTexParameteriv
-#define glTexSubImage1D __glTexSubImage1D
-#define glTexSubImage2D __glTexSubImage2D
-#define glTranslated __glTranslated
-#define glTranslatef __glTranslatef
-#define glVertex2d __glVertex2d
-#define glVertex2dv __glVertex2dv
-#define glVertex2f __glVertex2f
-#define glVertex2fv __glVertex2fv
-#define glVertex2i __glVertex2i
-#define glVertex2iv __glVertex2iv
-#define glVertex2s __glVertex2s
-#define glVertex2sv __glVertex2sv
-#define glVertex3d __glVertex3d
-#define glVertex3dv __glVertex3dv
-#define glVertex3f __glVertex3f
-#define glVertex3fv __glVertex3fv
-#define glVertex3i __glVertex3i
-#define glVertex3iv __glVertex3iv
-#define glVertex3s __glVertex3s
-#define glVertex3sv __glVertex3sv
-#define glVertex4d __glVertex4d
-#define glVertex4dv __glVertex4dv
-#define glVertex4f __glVertex4f
-#define glVertex4fv __glVertex4fv
-#define glVertex4i __glVertex4i
-#define glVertex4iv __glVertex4iv
-#define glVertex4s __glVertex4s
-#define glVertex4sv __glVertex4sv
-#define glVertexPointer __glVertexPointer
-#define glViewport __glViewport
-#endif
-
-#endif /* _MESA_API_WRAP_H_ */
diff --git a/xc/programs/Xserver/GL/mesa/src/Imakefile b/xc/programs/Xserver/GL/mesa/src/Imakefile
index e28b7c9b7..4d2ecf77e 100644
--- a/xc/programs/Xserver/GL/mesa/src/Imakefile
+++ b/xc/programs/Xserver/GL/mesa/src/Imakefile
@@ -15,10 +15,6 @@ LinkSourceFile(alpha.c,../../../../../extras/Mesa/src)
LinkSourceFile(alpha.h,../../../../../extras/Mesa/src)
LinkSourceFile(alphabuf.c,../../../../../extras/Mesa/src)
LinkSourceFile(alphabuf.h,../../../../../extras/Mesa/src)
-LinkSourceFile(api.h,../../../../../extras/Mesa/src)
-LinkSourceFile(api1.c,../../../../../extras/Mesa/src)
-LinkSourceFile(api2.c,../../../../../extras/Mesa/src)
-LinkSourceFile(apiext.c,../../../../../extras/Mesa/src)
LinkSourceFile(attrib.c,../../../../../extras/Mesa/src)
LinkSourceFile(attrib.h,../../../../../extras/Mesa/src)
LinkSourceFile(bbox.c,../../../../../extras/Mesa/src)
@@ -45,8 +41,12 @@ LinkSourceFile(cva.c,../../../../../extras/Mesa/src)
LinkSourceFile(cva.h,../../../../../extras/Mesa/src)
LinkSourceFile(dd.h,../../../../../extras/Mesa/src)
LinkSourceFile(ddsample.c,../../../../../extras/Mesa/src)
+LinkSourceFile(debug_xform.c,../../../../../extras/Mesa/src)
+LinkSourceFile(debug_xform.h,../../../../../extras/Mesa/src)
LinkSourceFile(depth.c,../../../../../extras/Mesa/src)
LinkSourceFile(depth.h,../../../../../extras/Mesa/src)
+LinkSourceFile(dispatch.c,../../../../../extras/Mesa/src)
+LinkSourceFile(dispatch.h,../../../../../extras/Mesa/src)
LinkSourceFile(dlist.c,../../../../../extras/Mesa/src)
LinkSourceFile(dlist.h,../../../../../extras/Mesa/src)
LinkSourceFile(dotprod_tmp.h,../../../../../extras/Mesa/src)
@@ -66,16 +66,30 @@ LinkSourceFile(fixed.h,../../../../../extras/Mesa/src)
LinkSourceFile(fog.c,../../../../../extras/Mesa/src)
LinkSourceFile(fog.h,../../../../../extras/Mesa/src)
LinkSourceFile(fog_tmp.h,../../../../../extras/Mesa/src)
+LinkSourceFile(glapi.h,../../../../../extras/Mesa/src)
+LinkSourceFile(glapi.c,../../../../../extras/Mesa/src)
+LinkSourceFile(glapioffsets.h,../../../../../extras/Mesa/src)
+LinkSourceFile(glapinoop.c,../../../../../extras/Mesa/src)
+LinkSourceFile(glapinoop.h,../../../../../extras/Mesa/src)
+LinkSourceFile(glapitable.h,../../../../../extras/Mesa/src)
+LinkSourceFile(glapitemp.h,../../../../../extras/Mesa/src)
+LinkSourceFile(glheader.h,../../../../../extras/Mesa/src)
+LinkSourceFile(glthread.c,../../../../../extras/Mesa/src)
+LinkSourceFile(glthread.h,../../../../../extras/Mesa/src)
LinkSourceFile(general_clip.h,../../../../../extras/Mesa/src)
LinkSourceFile(get.c,../../../../../extras/Mesa/src)
LinkSourceFile(get.h,../../../../../extras/Mesa/src)
LinkSourceFile(glmisc.c,../../../../../extras/Mesa/src)
LinkSourceFile(glmisc.h,../../../../../extras/Mesa/src)
+LinkSourceFile(glthread.c,../../../../../extras/Mesa/src)
+LinkSourceFile(glthread.h,../../../../../extras/Mesa/src)
LinkSourceFile(hash.c,../../../../../extras/Mesa/src)
LinkSourceFile(hash.h,../../../../../extras/Mesa/src)
LinkSourceFile(highpc.c,../../../../../extras/Mesa/src)
LinkSourceFile(image.c,../../../../../extras/Mesa/src)
LinkSourceFile(image.h,../../../../../extras/Mesa/src)
+LinkSourceFile(imaging.c,../../../../../extras/Mesa/src)
+LinkSourceFile(imaging.h,../../../../../extras/Mesa/src)
LinkSourceFile(indirect_tmp.h,../../../../../extras/Mesa/src)
LinkSourceFile(interp_tmp.h,../../../../../extras/Mesa/src)
LinkSourceFile(light.c,../../../../../extras/Mesa/src)
@@ -92,10 +106,10 @@ LinkSourceFile(masking.c,../../../../../extras/Mesa/src)
LinkSourceFile(masking.h,../../../../../extras/Mesa/src)
LinkSourceFile(matrix.c,../../../../../extras/Mesa/src)
LinkSourceFile(matrix.h,../../../../../extras/Mesa/src)
+LinkSourceFile(mem.c,../../../../../extras/Mesa/src)
+LinkSourceFile(mem.h,../../../../../extras/Mesa/src)
LinkSourceFile(mmath.c,../../../../../extras/Mesa/src)
LinkSourceFile(mmath.h,../../../../../extras/Mesa/src)
-LinkSourceFile(mthreads.c,../../../../../extras/Mesa/src)
-LinkSourceFile(mthreads.h,../../../../../extras/Mesa/src)
LinkSourceFile(norm_tmp.h,../../../../../extras/Mesa/src)
LinkSourceFile(pb.c,../../../../../extras/Mesa/src)
LinkSourceFile(pb.h,../../../../../extras/Mesa/src)
@@ -103,8 +117,6 @@ LinkSourceFile(pipeline.c,../../../../../extras/Mesa/src)
LinkSourceFile(pipeline.h,../../../../../extras/Mesa/src)
LinkSourceFile(pixel.c,../../../../../extras/Mesa/src)
LinkSourceFile(pixel.h,../../../../../extras/Mesa/src)
-LinkSourceFile(pointers.c,../../../../../extras/Mesa/src)
-LinkSourceFile(pointers.h,../../../../../extras/Mesa/src)
LinkSourceFile(points.c,../../../../../extras/Mesa/src)
LinkSourceFile(points.h,../../../../../extras/Mesa/src)
LinkSourceFile(polygon.c,../../../../../extras/Mesa/src)
@@ -172,34 +184,149 @@ LinkSourceFile(xform_tmp.h,../../../../../extras/Mesa/src)
LinkSourceFile(zoom.c,../../../../../extras/Mesa/src)
LinkSourceFile(zoom.h,../../../../../extras/Mesa/src)
-LinkSourceFile(mesa_api.h,../../../../../lib/GL/mesa/src)
-LinkSourceFile(mesa_api_wrap.h,../../../../../lib/GL/mesa/src)
-
- CORE_SRCS = accum.c alpha.c alphabuf.c api1.c api2.c apiext.c \
- attrib.c bitmap.c blend.c clip.c colortab.c context.c \
- copypix.c depth.c dlist.c drawpix.c enable.c eval.c \
- feedback.c fog.c get.c hash.c image.c light.c lines.c \
- logic.c masking.c matrix.c glmisc.c mmath.c mthreads.c \
- pb.c pixel.c points.c pointers.c polygon.c quads.c \
- rastpos.c readpix.c rect.c scissor.c shade.c span.c \
- stencil.c teximage.c texobj.c texstate.c texture.c \
- triangle.c varray.c winpos.c vb.c vbfill.c vbrender.c \
- vbxform.c vertices.c xform.c zoom.c stages.c \
- bbox.c config.c cva.c enums.c extensions.c \
- pipeline.c translate.c vbcull.c vbindirect.c vector.c
-
- CORE_OBJS = accum.o alpha.o alphabuf.o api1.o api2.o apiext.o \
- attrib.o bitmap.o blend.o clip.o colortab.o context.o \
- copypix.o depth.o dlist.o drawpix.o enable.o eval.o \
- feedback.o fog.o get.o hash.o image.o light.o lines.o \
- logic.o masking.o matrix.o glmisc.o mmath.o mthreads.o \
- pb.o pixel.o points.o pointers.o polygon.o quads.o \
- rastpos.o readpix.o rect.o scissor.o shade.o span.o \
- stencil.o teximage.o texobj.o texstate.o texture.o \
- triangle.o varray.o winpos.o vb.o vbfill.o vbrender.o \
- vbxform.o vertices.o xform.o zoom.o stages.o \
- bbox.o config.o cva.o enums.o extensions.o \
- pipeline.o translate.o vbcull.o vbindirect.o vector.o
+ CORE_SRCS = accum.c \
+ alpha.c \
+ alphabuf.c \
+ attrib.c \
+ bbox.c \
+ bitmap.c \
+ blend.c \
+ clip.c \
+ colortab.c \
+ config.c \
+ context.c \
+ copypix.c \
+ cva.c \
+ debug_xform.c \
+ depth.c \
+ dispatch.c \
+ dlist.c \
+ drawpix.c \
+ enable.c \
+ enums.c \
+ eval.c \
+ extensions.c \
+ feedback.c \
+ fog.c \
+ get.c \
+ glapi.c \
+ glapinoop.c \
+ glmisc.c \
+ glthread.c \
+ hash.c \
+ image.c \
+ imaging.o \
+ light.c \
+ lines.c \
+ logic.c \
+ masking.c \
+ matrix.c \
+ mem.c \
+ mmath.c \
+ pb.c \
+ pipeline.c \
+ pixel.c \
+ points.c \
+ polygon.c \
+ quads.c \
+ rastpos.c \
+ readpix.c \
+ rect.c \
+ scissor.c \
+ shade.c \
+ span.c \
+ stages.c \
+ stencil.c \
+ teximage.c \
+ texobj.c \
+ texstate.c \
+ texture.c \
+ translate.c \
+ triangle.c \
+ varray.c \
+ vb.c \
+ vbcull.c \
+ vbfill.c \
+ vbindirect.c \
+ vbrender.c \
+ vbxform.c \
+ vector.c \
+ vertices.c \
+ winpos.c \
+ xform.c \
+ zoom.c
+
+ CORE_OBJS = accum.o \
+ alpha.o \
+ alphabuf.o \
+ attrib.o \
+ bbox.o \
+ bitmap.o \
+ blend.o \
+ clip.o \
+ colortab.o \
+ config.o \
+ context.o \
+ copypix.o \
+ cva.o \
+ debug_xform.o \
+ depth.o \
+ dispatch.o \
+ dlist.o \
+ drawpix.o \
+ enable.o \
+ enums.o \
+ eval.o \
+ extensions.o \
+ feedback.o \
+ fog.o \
+ get.o \
+ glapi.o \
+ glapinoop.o \
+ glmisc.o \
+ glthread.o \
+ hash.o \
+ image.o \
+ imaging.o \
+ light.o \
+ lines.o \
+ logic.o \
+ masking.o \
+ matrix.o \
+ mem.o \
+ mmath.o \
+ pb.o \
+ pipeline.o \
+ pixel.o \
+ points.o \
+ polygon.o \
+ quads.o \
+ rastpos.o \
+ readpix.o \
+ rect.o \
+ scissor.o \
+ shade.o \
+ span.o \
+ stages.o \
+ stencil.o \
+ teximage.o \
+ texobj.o \
+ texstate.o \
+ texture.o \
+ translate.o \
+ triangle.o \
+ varray.o \
+ vb.o \
+ vbcull.o \
+ vbfill.o \
+ vbindirect.o \
+ vbrender.o \
+ vbxform.o \
+ vector.o \
+ vertices.o \
+ winpos.o \
+ xform.o \
+ zoom.o
ASM_SRCS = asm_386.S
ASM_OBJS = asm_386.o
diff --git a/xc/programs/Xserver/GL/mesa/src/X/Imakefile b/xc/programs/Xserver/GL/mesa/src/X/Imakefile
index b6ac8b5d9..9a112fafa 100644
--- a/xc/programs/Xserver/GL/mesa/src/X/Imakefile
+++ b/xc/programs/Xserver/GL/mesa/src/X/Imakefile
@@ -9,6 +9,7 @@ LinkSourceFile(xmesa2.c,../../../../../../extras/Mesa/src/X)
LinkSourceFile(xmesa3.c,../../../../../../extras/Mesa/src/X)
LinkSourceFile(xmesa4.c,../../../../../../extras/Mesa/src/X)
LinkSourceFile(xmesaP.h,../../../../../../extras/Mesa/src/X)
+LinkSourceFile(glxheader.h,../../../../../../extras/Mesa/src/X)
LinkSourceFile(compsize.c,../../../../../../lib/GL/glx)
LinkSourceFile(size.h,../../../../../../lib/GL/glx)
diff --git a/xc/programs/Xserver/GL/mesa/src/X/xf86glx.c b/xc/programs/Xserver/GL/mesa/src/X/xf86glx.c
index a5122725d..e4ee9aa4e 100644
--- a/xc/programs/Xserver/GL/mesa/src/X/xf86glx.c
+++ b/xc/programs/Xserver/GL/mesa/src/X/xf86glx.c
@@ -721,8 +721,9 @@ GLboolean __MESA_resizeBuffers(__GLdrawableBuffer *buffer,
__MESA_buffer buf = (__MESA_buffer)glPriv->private;
if (buf->xm_buf && buf->xm_buf->xm_context) {
+ GLcontext *ctx = buf->xm_buf->xm_context->gl_ctx;
XMesaForceCurrent(buf->xm_buf->xm_context);
- (*buf->xm_buf->xm_context->gl_ctx->API.ResizeBuffersMESA)(buf->xm_buf->xm_context->gl_ctx);
+ (*ctx->CurrentDispatch->ResizeBuffersMESA)();
XMesaForceCurrent(MESA_CC->xm_ctx);
}
diff --git a/xc/programs/Xserver/Imakefile b/xc/programs/Xserver/Imakefile
index 4b96fedd0..ab6d833e0 100644
--- a/xc/programs/Xserver/Imakefile
+++ b/xc/programs/Xserver/Imakefile
@@ -2,7 +2,7 @@ XCOMM $TOG: Imakefile /main/249 1997/12/11 11:18:14 kaleb $
/*
* Server Master Makefile
*/
-XCOMM $XFree86: xc/programs/Xserver/Imakefile,v 3.168 1999/08/14 10:49:21 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/Imakefile,v 3.172 1999/12/30 03:56:17 robin Exp $
#ifndef InstallXserverSetUID
#define InstallXserverSetUID NO
@@ -43,6 +43,8 @@ INSTPGMFLAGS =
#define NoMFBCFBLibs PreFbLibs $(CFB) NoMfbPostFbLibs
#define NoMFBCFB8Libs PreFbLibs $(CFB8) NoMfbPostFbLibs
+#define FbPostFbLibs $(FB) NoMfbPostFbLibs
+#define FBLibs PreFbLibs FbPostFbLibs
#if BuildPexExt
PEXLIBS = PEX5/dipex/dispatch/ModuleLibraryTargetName(didipex) \
@@ -82,8 +84,8 @@ INSTPGMFLAGS =
GL/mesa/src/ModuleLibraryTargetName(GLcore)
#else
GLXLIB = GL/glx/ModuleLibraryTargetName(glx) \
- GL/mesa/src/ModuleLibraryTargetName(GLcore) \
GL/mesa/src/X/ModuleLibraryTargetName(GLcoreX) \
+ GL/mesa/src/ModuleLibraryTargetName(GLcore) \
$(DRILIB)
#endif
#endif
@@ -202,6 +204,7 @@ XPFBLIBS = dix/LibraryTargetName(xpstubs)
BSDEMUL = $(DEPXBSDLIB)
#if DoLoadableServer
MFB = mfb/ModuleLibraryTargetName(mfb)
+ FB = fb/ModuleLibraryTargetName(fb)
CFB = cfb/ModuleLibraryTargetName(cfb) \
cfb16/ModuleLibraryTargetName(cfb16) \
cfb24/ModuleLibraryTargetName(cfb24) \
@@ -217,6 +220,7 @@ XPFBLIBS = dix/LibraryTargetName(xpstubs)
cfb32/ModuleLibraryTargetName(cfb32)
#else
MFB = mfb/LibraryTargetName(mfb)
+ FB = fb/LibraryTargetName(fb)
CFB = cfb/LibraryTargetName(cfb) cfb16/LibraryTargetName(cfb16) \
cfb24/LibraryTargetName(cfb24) cfb32/LibraryTargetName(cfb32)
CFB8 = cfb/LibraryTargetName(cfb)
@@ -519,8 +523,7 @@ XNEST = Xnest
#if XVirtualFramebufferServer && !MakeDllModules
XVFB = Xvfb
#endif
-#if defined(XF86Server) || (!MakeDllModules &&
- (defined(XnestServer) || defined(XVirtualFramebufferServer)))
+#if defined(XF86Server) || (!MakeDllModules && (defined(XnestServer) || defined(XVirtualFramebufferServer)))
MakeMutex($(XF86SERVER) $(XNEST) $(XVFB))
#endif
MakeMutex($(STDDIRS) mfb cfb cfb16 cfb32)
@@ -589,11 +592,16 @@ XF86DDCLIB = $(XF86SRC)/ddc/LibraryTargetName(ddc)
#if XF86RAC
XF86RACLIB = $(XF86SRC)/rac/LibraryTargetName(rac)
#endif
+#if XF86INT10
+XF86INT10LIB = $(XF86OSSRC)/LibraryTargetName(int10)
+#else
+XF86INT10LIB = $(XF86OSSRC)/int10/stub.o
+#endif
XF86IDRIVERLIB = $(XF86SRC)/input/LibraryTargetName(idriver)
#if !DoLoadableServer
XF86DRVOBJS = $(XF86SRC)/drivers/drvConf.o
XF86DRVLIBS = $(XF86DRIVERLIB) $(XF86RAMDACLIB) $(XF86DDCLIB) $(XF86I2CLIB) \
- $(XF86XAALIB) $(XF86VGAHWLIB) $(XF86FBDEVHWLIB) \
+ $(XF86INT10LIB) $(XF86XAALIB) $(XF86VGAHWLIB) $(XF86FBDEVHWLIB) \
$(XF8_32BPPLIB) $(XF8_16BPPLIB) $(XF24_32BPPLIB) \
$(XF4BPPLIB) $(XF1BPPLIB) $(XFSHADOWFBLIB) $(AFBLIB)
XF86IDRVOBJS = $(XF86SRC)/input/drvConf.o
@@ -633,6 +641,217 @@ ServerDriverSDKTarget(XFree86)
#endif
#endif /* XF86Server */
+XCOMM
+XCOMM Tiny X server section
+XCOMM
+
+ KDRIVE = hw/kdrive
+#ifdef LinuxArchitecture
+ KDOSDIR = $(KDRIVE)/linux
+ KDOS = $(KDOSDIR)/LibraryTargetName(linux)
+#endif
+
+#ifdef VXWORKS
+ KDOSDIR = $(KDRIVE)/vxworks
+ KDOS = $(KDOSDIR)/LibraryTargetName(vxworks)
+#endif
+
+#if BuildPseudo8
+ PSEUDO8 = $(KDRIVE)/pseudo8/LibraryTargetName(pseudo8)
+ PSEUDO8DIR = $(KDRIVE)/pseudo8
+#endif
+ KD = $(KDRIVE)/LibraryTargetName(kdrive)
+ KDFBDEV = $(KDRIVE)/fbdev/LibraryTargetName(fbdev)
+
+
+#define StdKdDirs $(KDRIVE) $(KDOSDIR) $(PSEUDO8DIR) fb $(DEPDIRS)
+#define StdKdSysLibs $(FONTLIBS) $(SYSLIBS)
+#define KdLibs $(KD) $(KDOS) $(PSEUDO8)
+
+#if XfbdevServer
+XCOMM
+XCOMM server with Keith's fbdev driver only
+XCOMM
+
+ FBDEVDIR = $(KDRIVE)/fbdev
+ FBDEV = $(FBDEVDIR)/LibraryTargetName(fbdev)
+
+ KDDIRS = StdKdDirs
+
+ FBDEVDIRS = $(STDDIRS) $(KDDIRS) $(FBDEVDIR)
+
+ FBDEVLIBS = PreFbLibs $(FBDEV) KdLibs FbPostFbLibs
+FBDEVSYSLIBS = StdKdSysLibs
+
+#if HasParallelMake
+MakeMutex($(FBDEVDIRS) $(FBDEVOBJS) $(FBDEVLIBS) $(FBDEVSYSLIBS))
+#endif
+#if HasGnuMake
+$(FBDEVOBJS) $(XFBDEV) $(FBDEVLIBS) $(FBDEVSYSLIBS):: $(FBDEVDIRS)
+ @if [ -f $@ ]; then touch $@; fi
+#endif
+ServerTarget(Xfbdev,$(FBDEVDIRS),$(FBDEVOBJS),$(FBDEVLIBS),$(FBDEVSYSLIBS))
+#endif /* XFBDEVServer */
+
+#if XSavageServer
+XCOMM
+XCOMM server with Keith's S3 Savage driver
+XCOMM
+
+ SAVAGEDIR = $(KDRIVE)/savage
+ SAVAGE = $(SAVAGEDIR)/LibraryTargetName(savage)
+
+ KDDIRS = StdKdDirs
+
+ SAVAGEDIRS = $(STDDIRS) $(KDDIRS) $(SAVAGEDIR)
+
+ SAVAGELIBS = PreFbLibs $(SAVAGE) KdLibs FbPostFbLibs
+SAVAGESYSLIBS = StdKdSysLibs
+
+#if HasParallelMake
+MakeMutex($(SAVAGEDIRS) $(SAVAGEOBJS) $(SAVAGELIBS) $(SAVAGESYSLIBS))
+#endif
+#if HasGnuMake
+$(SAVAGEOBJS) $(XSAVAGE) $(SAVAGELIBS) $(SAVAGESYSLIBS):: $(SAVAGEDIRS)
+ @if [ -f $@ ]; then touch $@; fi
+#endif
+ServerTarget(Xsavage,$(SAVAGEDIRS),$(SAVAGEOBJS),$(SAVAGELIBS),$(SAVAGESYSLIBS))
+#endif /* XSAVAGEServer */
+
+#if XTridentServer
+XCOMM
+XCOMM server with Keith's TRIDENT Cyber9525 driver
+XCOMM
+
+ FBDEVDIR = $(KDRIVE)/fbdev
+ FBDEV = $(FBDEVDIR)/LibraryTargetName(fbdev)
+ TRIDENTDIR = $(KDRIVE)/trident
+ TRIDENT = $(TRIDENTDIR)/LibraryTargetName(trident)
+
+ KDDIRS = StdKdDirs
+
+ TRIDENTDIRS = $(STDDIRS) $(KDDIRS) $(FBDEVDIR) $(TRIDENTDIR)
+
+ TRIDENTLIBS = PreFbLibs $(TRIDENT) $(FBDEV) KdLibs FbPostFbLibs
+TRIDENTSYSLIBS = StdKdSysLibs
+
+#if HasParallelMake
+MakeMutex($(TRIDENTDIRS) $(TRIDENTLIBS) $(TRIDENTSYSLIBS))
+#endif
+#if HasGnuMake
+$(TRIDENTOBJS) $(TRIDENTLIBS) $(TRIDENTSYSLIBS):: $(TRIDENTDIRS)
+ @if [ -f $@ ]; then touch $@; fi
+#endif
+ServerTarget(Xtrident,$(TRIDENTDIRS),$(TRIDENTOBJS),$(TRIDENTLIBS),$(TRIDENTSYSLIBS))
+#endif /* XTRIDENTServer */
+
+#if XSis530Server
+XCOMM
+XCOMM server with Keith's SiS 530 driver
+XCOMM
+
+ SIS530DIR = $(KDRIVE)/sis530
+ SIS530 = $(SIS530DIR)/LibraryTargetName(sis530)
+
+ KDDIRS = StdKdDirs
+
+ SIS530DIRS = $(STDDIRS) $(KDDIRS) $(SIS530DIR)
+
+ SIS530LIBS = PreFbLibs $(SIS530) KdLibs FbPostFbLibs
+SIS530SYSLIBS = StdKdSysLibs
+
+#if HasParallelMake
+MakeMutex($(SIS530DIRS) $(SIS530OBJS) $(SIS530LIBS) $(SIS530SYSLIBS))
+#endif
+#if HasGnuMake
+$(SIS530OBJS) $(SIS530LIBS) $(SIS530SYSLIBS):: $(SIS530DIRS)
+ @if [ -f $@ ]; then touch $@; fi
+#endif
+ServerTarget(Xsis530,$(SIS530DIRS),$(SIS530OBJS),$(SIS530LIBS),$(SIS530SYSLIBS))
+#endif /* XSIS530Server */
+
+#if XTrioServer
+XCOMM
+XCOMM server with Keith's S3 Trio driver
+XCOMM
+
+ TRIODIR = $(KDRIVE)/trio
+ TRIO = $(TRIODIR)/LibraryTargetName(trio)
+
+ KDDIRS = StdKdDirs
+
+ TRIODIRS = $(STDDIRS) $(KDDIRS) $(TRIODIR)
+
+ TRIOLIBS = PreFbLibs $(TRIO) KdLibs FbPostFbLibs
+TRIOSYSLIBS = StdKdSysLibs
+
+#if HasParallelMake
+MakeMutex($(TRIODIRS) $(TRIOOBJS) $(TRIOLIBS) $(TRIOSYSLIBS))
+#endif
+#if HasGnuMake
+$(TRIOOBJS) $(TRIOLIBS) $(TRIOSYSLIBS):: $(TRIODIRS)
+ @if [ -f $@ ]; then touch $@; fi
+#endif
+ServerTarget(Xtrio,$(TRIODIRS),$(TRIOOBJS),$(TRIOLIBS),$(TRIOSYSLIBS))
+#endif /* XTRIOServer */
+
+#if XTS300Server
+XCOMM
+XCOMM server with Keith's S3 Trio and SiS530 driver for the TS300/TS400
+XCOMM
+
+ TRIODIR = $(KDRIVE)/trio
+ TRIO = $(TRIODIR)/LibraryTargetName(trio)
+
+ SIS530DIR = $(KDRIVE)/sis530
+ SIS530 = $(SIS530DIR)/LibraryTargetName(sis530)
+
+ TS300DIR = $(KDRIVE)/ts300
+ TS300 = $(TS300DIR)/LibraryTargetName(ts300)
+
+ KDDIRS = StdKdDirs
+
+ TS300DIRS = $(STDDIRS) $(KDDIRS) $(TRIODIR) $(SIS530DIR) $(TS300DIR)
+
+ TS300LIBS = PreFbLibs $(TS300) $(TRIO) $(SIS530) KdLibs FbPostFbLibs
+ TS300SYSLIBS = StdKdSysLibs
+
+#if HasParallelMake
+MakeMutex($(TS300DIRS) $(TS300OBJS) $(TS300LIBS) $(TS300SYSLIBS))
+#endif
+#if HasGnuMake
+$(TS300OBJS) $(TS300LIBS) $(TS300SYSLIBS):: $(TS300DIRS)
+ @if [ -f $@ ]; then touch $@; fi
+#endif
+ServerTarget(Xts300,$(TS300DIRS),$(TS300OBJS),$(TS300LIBS),$(TS300SYSLIBS))
+#endif /* XTS300Server */
+
+#if XItsyServer
+XCOMM
+XCOMM server with Keith's FB driver only
+XCOMM
+ ITSYDIR = $(KDRIVE)/itsy
+ ITSY = $(ITSYDIR)/LibraryTargetName(itsy)
+
+ KDDIRS = StdKdDirs
+
+ ITSYDIRS = $(STDDIRS) $(KDDIRS) $(ITSYDIR)
+
+ ITSYLIBS = PreFbLibs $(ITSY) KdLibs FbPostFbLibs
+ITSYSYSLIBS = StdKdSysLibs
+
+#if HasParallelMake
+MakeMutex($(ITSYDIRS) $(ITSYOBJS) $(ITSYLIBS) $(ITSYSYSLIBS))
+#endif
+#if HasGnuMake
+$(ITSYOBJS) $(ITSYLIBS) $(ITSYSYSLIBS):: $(ITSYDIRS)
+ @if [ -f $@ ]; then touch $@; fi
+#endif
+ServerTarget(Xitsy,$(ITSYDIRS),$(ITSYOBJS),$(ITSYLIBS),$(ITSYSYSLIBS))
+#endif /* XItsyServer */
+
+KDRIVEDIRS=$(KDDIRS) $(FBDEVDIR) $(SAVAGEDIR) $(TRIDENTDIR) $(SIS530DIR) \
+ $(TRIODIR) $(TS300DIR) $(ITSYDIR)
#if XprtServer && !MakeDllModules
XCOMM
@@ -680,7 +899,7 @@ XNESTDDXDIR = hw/xnest
XNESTDDXDIR = hw
#endif
XNESTDIRS = $(STDDIRS) $(XNESTDDXDIR) $(DEPDIRS)
-#if !defined(LynxOSArchitecture) && !defined(Win32Architecture)
+#if !defined(LynxOSArchitecture) && !defined(Win32Architecture) && !defined(QNX4Architecture)
XNESTOBJS = hw/xnest/miinitext.o
#else
XNESTOBJS = hw/xnest/miinitext.o dix/main.o
@@ -768,9 +987,9 @@ CFBDIRS = $(CFB8DIR) $(CFB16DIR) $(CFB24DIR) $(CFB32DIR)
IPLANDIRS = $(IPLAN2P2DIR) $(IPLAN2P4DIR) $(IPLAN2P8DIR)
DDXDIRS = $(DDXDIR1) $(DDXDIR2) $(DDXDIR3) $(XVFBDDXDIR) $(XNESTDDXDIR)
SUBDIRS = $(STDDIRS) $(MFBDIR) $(CFBDIRS) $(IPLANDIRS) $(ILBMDIR) $(AFBDIR) \
- $(LMFCFBDIR) $(DDXDIRS)
+ $(LMFCFBDIR) $(DDXDIRS) $(FBDIR) $(KDRIVEDIRS)
-#if defined(ServerToInstall) && !defined(OS2Architecture)
+#if defined(ServerToInstall) && !defined(OS2Architecture) && !defined(QNX4Architecture)
install::
-(cd $(DESTDIR)$(BINDIR); $(RM) X; $(LN) ServerToInstall X)
#endif